diff --git a/.circleci/config.yml b/.circleci/config.yml index 7da9a33fd..5a5a24236 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,16 @@ executors: docker: - image: circleci/node:11.3.0 +aliases: + - &restore_cache + restore_cache: + key: dependencies-{{ checksum "package-lock.json" }} + - &save_cache + save_cache: + key: dependencies-{{ checksum "package-lock.json" }} + paths: + - node_modules + jobs: install: executor: @@ -12,38 +22,26 @@ jobs: steps: - checkout - run: ls -la - - restore_cache: - keys: - - test-dependencies-{{ checksum "package.json" }} - - - run: npm install --ignore-scripts - - run: npm run flow-typed install + - *restore_cache + - run: npm install - run: ls -la - - save_cache: - paths: - - node_modules - - flow-typed - key: test-dependencies-{{ checksum "package.json" }} + - *save_cache lint: executor: name: default steps: - checkout - - restore_cache: - keys: - - test-dependencies-{{ checksum "package.json" }} + - *restore_cache - run: npm run check - - run: npm run flow + - run: npm run tsc test: executor: name: default steps: - checkout - - restore_cache: - keys: - - test-dependencies-{{ checksum "package.json" }} + - *restore_cache - run: npm test - store_test_results: path: build/ diff --git a/.eslintrc.json b/.eslintrc.json index c32518ecf..1a9286f69 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,20 +1,47 @@ { - "extends": [ - "./node_modules/eslint-config-mattermost/.eslintrc.json", - "plugin:flowtype/recommended" - ], - "env": { - "jest": true - }, - "plugins": [ - "flowtype" - ], - "overrides": [ - { - "files": ["*.test.js"], - "env": { + "extends": [ + "./node_modules/eslint-config-mattermost/.eslintrc.json", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "env": { "jest": true - } - } - ] + }, + "rules": { + "@typescript-eslint/camelcase": 0, + "@typescript-eslint/no-undefined": 0, + "@typescript-eslint/no-non-null-assertion": 0, + "no-prototype-builtins": 0, + "no-mixed-operators": 0, + "no-undefined": 0, + "padding-line-between-statements": [ + "error", + { + "blankLine": "always", + "prev": "function", + "next": "function" + } + ], + "no-nested-ternary": 0, + "@typescript-eslint/no-unused-vars": 0, + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-use-before-define": 0, + "max-lines": 0, + "@typescript-eslint/no-var-requires": 0, + "@typescript-eslint/explicit-function-return-type": 0 + }, + "overrides": [ + { + "files": [ + "*.test.js" + ], + "env": { + "jest": true + } + } + ] } diff --git a/.flowconfig b/.flowconfig deleted file mode 100644 index 10c27c41a..000000000 --- a/.flowconfig +++ /dev/null @@ -1,33 +0,0 @@ -[ignore] -/node_modules/.* -/action_types/.* -/actions/.* -/client/.* -/constants/.* -/reducers/.* -/selectors/.* -/store/.* -/utils/.* -/types/.* - -[include] - -[libs] - -[lints] - -[options] -module.system.node.resolve_dirname=node_modules -suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe -module.name_mapper='^action_types\(.*\)$' -> '/src/action_types/\1' -module.name_mapper='^actions\(.*\)$' -> '/src/actions/\1' -module.name_mapper='^client\(.*\)$' -> '/src/client/\1' -module.name_mapper='^constants\(.*\)$' -> '/src/constants/\1' -module.name_mapper='^reducers\(.*\)$' -> '/src/reducers/\1' -module.name_mapper='^selectors\(.*\)$' -> '/src/selectors/\1' -module.name_mapper='^store\(.*\)$' -> '/src/store/\1' -module.name_mapper='^utils\(.*\)$' -> '/src/utils/\1' -module.name_mapper='^types\(.*\)$' -> '/src/types/\1' - -[version] -0.95.1 diff --git a/.gitignore b/.gitignore index 998140757..ccdc3d1bb 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,16 @@ mattermost-redux-*.tgz # test coverage coverage +/.rts2_cache_cjs/ +/.rts2_cache_esm/ +/dist/ +/build/ +/tsconfig.tsbuildinfo +junit.xml +index.d.ts +index.js +index.js.map +mattermost.client4.js +mattermost.client4.js.map +mattermost.websocket_client.js +mattermost.websocket_client.js.map diff --git a/.npmignore b/.npmignore index 852c5fe57..9b3e3c0c0 100644 --- a/.npmignore +++ b/.npmignore @@ -10,3 +10,13 @@ PULL_REQUEST_TEMPLATE.md .npmignore .npminstall .tmp +src +.circleci +jest.config.js +babel.config.js +rollup.config.js +tsconfig.json +.editorconfig +.eslintignore +mattermost-redux.iml +.eslintrc.json \ No newline at end of file diff --git a/Makefile b/Makefile index 6f83219ea..d2c51bcf0 100644 --- a/Makefile +++ b/Makefile @@ -23,33 +23,13 @@ clean: pre-run: @echo Make sure no previous build are in the folder - @rm -rf actions - @rm -rf action_types - @rm -rf client - @rm -rf constants - @rm -rf reducers - @rm -rf selectors - @rm -rf store - @rm -rf utils - @rm -rf lib - -test: check-style flow - npm test - -flow: .flowinstall - @echo Checking types - - npm run flow + @rm -rf build/* -.flowinstall: node_modules - @echo Getting flow-typed packages - - npm run flow-typed install +test: check-style + npm test - touch $@ install: node_modules bundle: npm run build - npm run webpack diff --git a/babel.config.js b/babel.config.js index e6b79926c..37c5361b0 100644 --- a/babel.config.js +++ b/babel.config.js @@ -15,10 +15,13 @@ const config = { useBuiltIns: 'usage', shippedProposals: true, }], + '@babel/typescript', ], plugins: [ - '@babel/transform-flow-comments', + '@babel/plugin-transform-runtime', + '@babel/plugin-syntax-dynamic-import', '@babel/proposal-class-properties', + '@babel/proposal-object-rest-spread', '@babel/plugin-proposal-optional-chaining', ['module-resolver', { root: ['./src', '.'], diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index f309ac177..000000000 --- a/build/.gitignore +++ /dev/null @@ -1 +0,0 @@ -test-results.xml diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 000000000..f87dfcfde --- /dev/null +++ b/jest.config.js @@ -0,0 +1,47 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +module.exports = { + globals: { + 'ts-jest': { + tsConfig: 'tsconfig.json', + diagnostics: true, + }, + NODE_ENV: 'test', + }, + preset: 'ts-jest/presets/js-with-babel', + rootDir: '.', + moduleDirectories: ['node_modules', 'src'], + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], + transformIgnorePatterns: ['/node_modules/'], + testMatch: [ + '/src/**/?(*.)(spec|test).(ts|js)?(x)', + ], + setupFilesAfterEnv: [ + '/test/setup.js', + ], + clearMocks: true, + collectCoverageFrom: [ + 'src/**/*.{js}', + 'src/**/*.{ts}', + ], + coverageReporters: [ + 'lcov', + 'text-summary', + ], + reporters: [ + 'default', + 'jest-junit', + ], + verbose: true, + moduleNameMapper: { + '^src/(.*)$': '/src/$1', + '^test/(.*)$': '/test/$1', + '^utils/(.*)$': '/src/utils/$1', + '^actions/(.*)$': '/src/actions/$1', + '^action_types$': '/src/action_types', + '^constants$': '/src/constants', + '^action_types/(.*)$': '/src/action_types/$1', + '^@/(.*)$': '/src/$1', + }, +}; diff --git a/package-lock.json b/package-lock.json index ba7ccb62e..47be7b58d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,46 +4,28 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@babel/cli": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.5.5.tgz", - "integrity": "sha512-UHI+7pHv/tk9g6WXQKYz+kmXTI77YtuY3vqC59KIqcoWEjsJJSG6rAxKaLsgj3LDyadsPrCB929gVOKM6Hui0w==", - "dev": true, - "requires": { - "chokidar": "^2.0.4", - "commander": "^2.8.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "lodash": "^4.17.13", - "mkdirp": "^0.5.1", - "output-file-sync": "^2.0.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - } - }, "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" } }, "@babel/core": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.5.5.tgz", - "integrity": "sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.0.tgz", + "integrity": "sha512-FuRhDRtsd6IptKpHXAa+4WPZYY2ZzgowkbLBecEDDSje1X/apG7jQM33or3NdOmjXBKWGOg4JmSiRfUfuTtHXw==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helpers": "^7.5.5", - "@babel/parser": "^7.5.5", - "@babel/template": "^7.4.4", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5", + "@babel/generator": "^7.6.0", + "@babel/helpers": "^7.6.0", + "@babel/parser": "^7.6.0", + "@babel/template": "^7.6.0", + "@babel/traverse": "^7.6.0", + "@babel/types": "^7.6.0", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -53,62 +35,6 @@ "source-map": "^0.5.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "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", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/traverse": { - "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", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -118,21 +44,6 @@ "ms": "^2.1.1" } }, - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -142,16 +53,15 @@ } }, "@babel/generator": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", - "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.2.tgz", + "integrity": "sha512-j8iHaIW4gGPnViaIHI7e9t/Hl8qLjERI6DcV9kEpAIDJsAOrcnXqRS7t+QbhL76pwbtqP+QCQLL0z1CyVmtjjQ==", "dev": true, "requires": { - "@babel/types": "^7.4.4", + "@babel/types": "^7.6.0", "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "lodash": "^4.17.13", + "source-map": "^0.5.0" } }, "@babel/helper-annotate-as-pure": { @@ -185,9 +95,9 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.5.tgz", - "integrity": "sha512-ZsxkyYiRA7Bg+ZTRpPvB6AbOFKTFFK4LrvTet8lInm0V468MWCaSYJE+I7v2z2r8KNLtYiV+K5kTCnR7dvyZjg==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz", + "integrity": "sha512-O1QWBko4fzGju6VoVvrZg0RROCVifcLxiApnGP3OWfWzvxRZFCoBD81K5ur5e3bVY2Vf/5rIJm8cqPKn8HUJng==", "dev": true, "requires": { "@babel/helper-function-name": "^7.1.0", @@ -207,19 +117,6 @@ "@babel/helper-function-name": "^7.1.0", "@babel/types": "^7.5.5", "lodash": "^4.17.13" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/helper-explode-assignable-expression": { @@ -268,19 +165,6 @@ "dev": true, "requires": { "@babel/types": "^7.5.5" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/helper-module-imports": { @@ -304,19 +188,6 @@ "@babel/template": "^7.4.4", "@babel/types": "^7.5.5", "lodash": "^4.17.13" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/helper-optimise-call-expression": { @@ -366,79 +237,6 @@ "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/traverse": "^7.5.5", "@babel/types": "^7.5.5" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "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", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/traverse": { - "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", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "@babel/helper-simple-access": { @@ -473,141 +271,31 @@ } }, "@babel/helpers": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.5.5.tgz", - "integrity": "sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.2.tgz", + "integrity": "sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA==", "dev": true, "requires": { - "@babel/template": "^7.4.4", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "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", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/traverse": { - "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", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } + "@babel/template": "^7.6.0", + "@babel/traverse": "^7.6.2", + "@babel/types": "^7.6.0" } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@babel/parser": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.0.tgz", - "integrity": "sha512-M74+GvK4hn1eejD9lZ7967qAwvqTZayQa3g10ag4s9uewgR7TKjeaT0YMyoq+gVfKYABiWZ4MQD701/t5e1Jhg==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.2.tgz", + "integrity": "sha512-mdFqWrSPCmikBoaBYMuBulzTIKuXVPtEISFbRRVNwMWpCms/hmE2kRq0bblUHaNRKrjRlmVbx1sDHmjmRgD2Xg==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -652,9 +340,9 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz", - "integrity": "sha512-F2DxJJSQ7f64FyTVl5cw/9MWn6naXGdk3Q3UhDbFEEHv+EilCPoeRD3Zh/Utx1CJz4uyKlQ4uH+bJPbEhMV7Zw==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz", + "integrity": "sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -682,14 +370,14 @@ } }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz", - "integrity": "sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA==", + "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==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" + "regexpu-core": "^4.6.0" } }, "@babel/plugin-syntax-async-generators": { @@ -710,15 +398,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-syntax-flow": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz", - "integrity": "sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-syntax-json-strings": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz", @@ -755,6 +434,15 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-syntax-typescript": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz", + "integrity": "sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag==", + "dev": true, + "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", @@ -785,9 +473,9 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.5.5.tgz", - "integrity": "sha512-82A3CLRRdYubkG85lKwhZB0WZoHxLGsJdux/cOVaJCJpvYFl1LVzAIFyRsa7CvXqW8rBM4Zf3Bfn8PHt5DP0Sg==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz", + "integrity": "sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -820,23 +508,23 @@ } }, "@babel/plugin-transform-destructuring": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.5.0.tgz", - "integrity": "sha512-YbYgbd3TryYYLGyC7ZR+Tq8H/+bCmwoaxHfJHupom5ECstzbRLTch6gOQbhEY9Z4hiCNHEURgq06ykFv9JZ/QQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz", + "integrity": "sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz", - "integrity": "sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg==", + "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==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" + "regexpu-core": "^4.6.0" } }, "@babel/plugin-transform-duplicate-keys": { @@ -858,43 +546,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-flow-comments": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-comments/-/plugin-transform-flow-comments-7.5.5.tgz", - "integrity": "sha512-tz3MWUB0MDIlFVWFeThSvY34J8JbLHJLMVkNJ3dce7M2Py1rMFHw+df3E4N5bW4C8rPTJIBl/6SE1vKfTndxJQ==", - "dev": true, - "requires": { - "@babel/generator": "^7.5.5", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.2.0" - }, - "dependencies": { - "@babel/generator": { - "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", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } - } - }, "@babel/plugin-transform-for-of": { "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz", @@ -944,9 +595,9 @@ } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz", - "integrity": "sha512-xmHq0B+ytyrWJvQTc5OWAC4ii6Dhr0s22STOoydokG51JjWhyYo5mRPXoi+ZmtHQhZZwuXNN+GG5jy5UZZJxIQ==", + "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==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.4.4", @@ -977,12 +628,12 @@ } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz", - "integrity": "sha512-z7+2IsWafTBbjNsOxU/Iv5CvTJlr5w4+HGu1HovKYTtgJ362f7kBcQglkfmlspKKZ3bgrbSGvLfNx++ZJgCWsg==", + "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==", "dev": true, "requires": { - "regexp-tree": "^0.1.6" + "regexpu-core": "^4.6.0" } }, "@babel/plugin-transform-new-target": { @@ -1042,6 +693,26 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-transform-runtime": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.0.tgz", + "integrity": "sha512-Da8tMf7uClzwUm/pnJ1S93m/aRXmoYNDD7TkHua8xBDdaAs54uZpTWvEt6NGwmoVMb9mZbntfTqmG2oSzN/7Vg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "resolve": "^1.8.1", + "semver": "^5.5.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "@babel/plugin-transform-shorthand-properties": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", @@ -1052,9 +723,9 @@ } }, "@babel/plugin-transform-spread": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz", - "integrity": "sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz", + "integrity": "sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0" @@ -1089,45 +760,32 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz", - "integrity": "sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA==", + "@babel/plugin-transform-typescript": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.6.0.tgz", + "integrity": "sha512-yzw7EopOOr6saONZ3KA3lpizKnWRTe+rfBqg4AmQbSow7ik7fqmzrfIqt053osLwLE2AaTqGinLM2tl6+M/uog==", "dev": true, "requires": { + "@babel/helper-create-class-features-plugin": "^7.6.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" + "@babel/plugin-syntax-typescript": "^7.2.0" } }, - "@babel/polyfill": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.4.4.tgz", - "integrity": "sha512-WlthFLfhQQhh+A2Gn5NSFl0Huxz36x86Jn+E9OW7ibK8edKPq+KLy4apM1yDpQ8kJOVi1OVjpP4vSDLdrI04dg==", + "@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==", "dev": true, "requires": { - "core-js": "^2.6.5", - "regenerator-runtime": "^0.13.2" - }, - "dependencies": { - "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", - "dev": true - } + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.6.0" } }, "@babel/preset-env": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.5.5.tgz", - "integrity": "sha512-GMZQka/+INwsMz1A5UEql8tG015h5j/qjptpKY2gJ7giy8ohzU710YciJB5rcKsWGWHiW3RUnHib0E5/m3Tp3A==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.0.tgz", + "integrity": "sha512-1efzxFv/TcPsNXlRhMzRnkBFMeIqBBgzwmZwlFDw5Ubj0AGLeufxugirwZmkkX/ayi3owsSqoQ4fw8LkfK9SYg==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.0.0", @@ -1146,10 +804,10 @@ "@babel/plugin-transform-arrow-functions": "^7.2.0", "@babel/plugin-transform-async-to-generator": "^7.5.0", "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.5.5", + "@babel/plugin-transform-block-scoping": "^7.6.0", "@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.5.0", + "@babel/plugin-transform-destructuring": "^7.6.0", "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", @@ -1158,10 +816,10 @@ "@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.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.4.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/plugin-transform-object-super": "^7.5.5", "@babel/plugin-transform-parameters": "^7.4.4", @@ -1174,91 +832,61 @@ "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", "@babel/plugin-transform-unicode-regex": "^7.4.4", - "@babel/types": "^7.5.5", + "@babel/types": "^7.6.0", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", "invariant": "^2.2.2", "js-levenshtein": "^1.1.3", "semver": "^5.5.0" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, - "@babel/register": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.5.5.tgz", - "integrity": "sha512-pdd5nNR+g2qDkXZlW1yRCWFlNrAn2PPdnZUB72zjX4l1Vv4fMRRLwyf+n/idFCLI1UgVGboUU8oVziwTBiyNKQ==", + "@babel/preset-typescript": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.6.0.tgz", + "integrity": "sha512-4xKw3tTcCm0qApyT6PqM9qniseCE79xGHiUnNdKGdxNsGUc2X7WwZybqIpnTmoukg3nhPceI5KPNzNqLNeIJww==", "dev": true, "requires": { - "core-js": "^3.0.0", - "find-cache-dir": "^2.0.0", - "lodash": "^4.17.13", - "mkdirp": "^0.5.1", - "pirates": "^4.0.0", - "source-map-support": "^0.5.9" - }, - "dependencies": { - "core-js": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.4.tgz", - "integrity": "sha512-YNZN8lt82XIMLnLirj9MhKDFZHalwzzrL9YLt6eb0T5D0EDl4IQ90IGkua8mHbnxNrkj1d8hbdizMc0Qmg1WnQ==", - "dev": true - } + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.6.0" } }, - "@babel/template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", - "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "@babel/runtime": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.0.tgz", + "integrity": "sha512-89eSBLJsxNxOERC0Op4vd+0Bqm6wRMqMbFtV3i0/fbaWw/mJ8Q3eBvgX0G4SyrOOLCtbu98HspF8o09MRT+KzQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" - }, - "dependencies": { - "@babel/parser": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", - "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", - "dev": true - } + "regenerator-runtime": "^0.13.2" } }, - "@babel/traverse": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz", - "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==", + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.4", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/traverse": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.2.tgz", + "integrity": "sha512-8fRE76xNwNttVEF2TwxJDGBLWthUkHWSldmfuBzVRmEDWOtu4XdINTgN7TDWzuLg4bbeIMLvfMFD9we5YcWkRQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.6.2", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4", + "@babel/parser": "^7.6.2", + "@babel/types": "^7.6.0", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.11" + "lodash": "^4.17.13" }, "dependencies": { - "@babel/parser": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", - "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", - "dev": true - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -1269,21 +897,21 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } }, "@babel/types": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", - "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz", + "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } }, @@ -1295,168 +923,75 @@ "requires": { "exec-sh": "^0.3.2", "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "@jest/console": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz", - "integrity": "sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz", + "integrity": "sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ==", "dev": true, "requires": { - "@jest/source-map": "^24.3.0", + "@jest/source-map": "^24.9.0", "chalk": "^2.0.1", "slash": "^2.0.0" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true } } }, "@jest/core": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.8.0.tgz", - "integrity": "sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.9.0.tgz", + "integrity": "sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A==", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/reporters": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", + "@jest/reporters": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", "exit": "^0.1.2", "graceful-fs": "^4.1.15", - "jest-changed-files": "^24.8.0", - "jest-config": "^24.8.0", - "jest-haste-map": "^24.8.0", - "jest-message-util": "^24.8.0", + "jest-changed-files": "^24.9.0", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", "jest-regex-util": "^24.3.0", - "jest-resolve-dependencies": "^24.8.0", - "jest-runner": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-snapshot": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", - "jest-watcher": "^24.8.0", + "jest-resolve": "^24.9.0", + "jest-resolve-dependencies": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "jest-watcher": "^24.9.0", "micromatch": "^3.1.10", "p-each-series": "^1.0.0", - "pirates": "^4.0.1", "realpath-native": "^1.1.0", "rimraf": "^2.5.4", + "slash": "^2.0.0", "strip-ansi": "^5.0.0" }, "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, - "jest-validate": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", - "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "camelcase": "^5.0.0", - "chalk": "^2.0.1", - "jest-get-type": "^24.8.0", - "leven": "^2.1.0", - "pretty-format": "^24.8.0" - } - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -1465,77 +1000,42 @@ "requires": { "ansi-regex": "^4.1.0" } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, "@jest/environment": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.8.0.tgz", - "integrity": "sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.9.0.tgz", + "integrity": "sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ==", "dev": true, "requires": { - "@jest/fake-timers": "^24.8.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", - "jest-mock": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } + "@jest/fake-timers": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0" } }, "@jest/fake-timers": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.8.0.tgz", - "integrity": "sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.9.0.tgz", + "integrity": "sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A==", "dev": true, "requires": { - "@jest/types": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-mock": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } + "@jest/types": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0" } }, "@jest/reporters": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.8.0.tgz", - "integrity": "sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.9.0.tgz", + "integrity": "sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw==", "dev": true, "requires": { - "@jest/environment": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", "chalk": "^2.0.1", "exit": "^0.1.2", "glob": "^7.1.2", @@ -1543,70 +1043,36 @@ "istanbul-lib-instrument": "^3.0.1", "istanbul-lib-report": "^2.0.4", "istanbul-lib-source-maps": "^3.0.1", - "istanbul-reports": "^2.1.1", - "jest-haste-map": "^24.8.0", - "jest-resolve": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-util": "^24.8.0", + "istanbul-reports": "^2.2.6", + "jest-haste-map": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", "jest-worker": "^24.6.0", - "node-notifier": "^5.2.1", + "node-notifier": "^5.4.2", "slash": "^2.0.0", "source-map": "^0.6.0", "string-length": "^2.0.0" }, "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, "@jest/source-map": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.3.0.tgz", - "integrity": "sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.9.0.tgz", + "integrity": "sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg==", "dev": true, "requires": { "callsites": "^3.0.0", @@ -1614,10 +1080,10 @@ "source-map": "^0.6.0" }, "dependencies": { - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "source-map": { @@ -1629,99 +1095,56 @@ } }, "@jest/test-result": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.8.0.tgz", - "integrity": "sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.9.0.tgz", + "integrity": "sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA==", "dev": true, "requires": { - "@jest/console": "^24.7.1", - "@jest/types": "^24.8.0", + "@jest/console": "^24.9.0", + "@jest/types": "^24.9.0", "@types/istanbul-lib-coverage": "^2.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } } }, "@jest/test-sequencer": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz", - "integrity": "sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz", + "integrity": "sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A==", "dev": true, "requires": { - "@jest/test-result": "^24.8.0", - "jest-haste-map": "^24.8.0", - "jest-runner": "^24.8.0", - "jest-runtime": "^24.8.0" + "@jest/test-result": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0" } }, "@jest/transform": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.8.0.tgz", - "integrity": "sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.9.0.tgz", + "integrity": "sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "babel-plugin-istanbul": "^5.1.0", "chalk": "^2.0.1", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.1.15", - "jest-haste-map": "^24.8.0", - "jest-regex-util": "^24.3.0", - "jest-util": "^24.8.0", + "jest-haste-map": "^24.9.0", + "jest-regex-util": "^24.9.0", + "jest-util": "^24.9.0", "micromatch": "^3.1.10", + "pirates": "^4.0.1", "realpath-native": "^1.1.0", "slash": "^2.0.0", "source-map": "^0.6.1", "write-file-atomic": "2.4.1" }, "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, "source-map": { @@ -1729,88 +1152,29 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "write-file-atomic": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz", - "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } } } }, "@jest/types": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.7.0.tgz", - "integrity": "sha512-ipJUa2rFWiKoBqMKP63Myb6h9+iT3FHRTF2M8OR6irxWzItisa8i4dcSg14IbvmXUnBlHBlUQPYUHWyX3UPpYA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", - "@types/yargs": "^12.0.9" - } - }, - "@octokit/rest": { - "version": "15.18.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-15.18.1.tgz", - "integrity": "sha512-g2tecjp2TEtYV8bKAFvfQtu+W29HM7ektmWmw8zrMy9/XCKDEYRErR2YvvhN9+IxkLC4O3lDqYP4b6WgsL6Utw==", - "dev": true, - "requires": { - "before-after-hook": "^1.1.0", - "btoa-lite": "^1.0.0", - "debug": "^3.1.0", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.0", - "lodash": "^4.17.4", - "node-fetch": "^2.1.1", - "universal-user-agent": "^2.0.0", - "url-template": "^2.0.8" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", - "dev": true - } + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" } }, "@react-native-community/netinfo": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-4.1.3.tgz", - "integrity": "sha512-c9ppXNFpKkXiKFJhik9Lzw62dosm+cAIvHl6OOGXp2D+1GlliIP+nMMtNapdppPoilRc33f4/GosqnL70viH9Q==" + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-4.4.0.tgz", + "integrity": "sha512-qqNWMOsrDjj/daqV21ID2T8mNUjZD4pdx3PuWyE65gzKh2w+oMnzKb+J0NbLyZPn3wwLwU1+Cpf58A0ff5szjQ==" }, "@types/babel__core": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz", - "integrity": "sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz", + "integrity": "sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -1821,9 +1185,9 @@ } }, "@types/babel__generator": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.0.2.tgz", - "integrity": "sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.0.tgz", + "integrity": "sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw==", "dev": true, "requires": { "@babel/types": "^7.0.0" @@ -1840,14 +1204,26 @@ } }, "@types/babel__traverse": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.6.tgz", - "integrity": "sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.7.tgz", + "integrity": "sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==", "dev": true, "requires": { "@babel/types": "^7.3.0" } }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, "@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -1873,222 +1249,219 @@ "@types/istanbul-lib-report": "*" } }, - "@types/stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", - "dev": true - }, - "@types/yargs": { - "version": "12.0.12", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz", - "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==", - "dev": true - }, - "@webassemblyjs/ast": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", - "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "@types/jest": { + "version": "24.0.18", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.18.tgz", + "integrity": "sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ==", "dev": true, "requires": { - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5" + "@types/jest-diff": "*" } }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", - "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", - "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", + "@types/jest-diff": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jest-diff/-/jest-diff-20.0.1.tgz", + "integrity": "sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==", "dev": true }, - "@webassemblyjs/helper-buffer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", - "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", + "@types/json-schema": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.3.tgz", + "integrity": "sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==", "dev": true }, - "@webassemblyjs/helper-code-frame": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", - "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", + "@types/moment-timezone": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@types/moment-timezone/-/moment-timezone-0.5.12.tgz", + "integrity": "sha512-hnHH2+Efg2vExr/dSz+IX860nSiyk9Sk4pJF2EmS11lRpMcNXeB4KBW5xcgw2QPsb9amTXdsVNEe5IoJXiT0uw==", "dev": true, "requires": { - "@webassemblyjs/wast-printer": "1.8.5" + "moment": ">=2.14.0" } }, - "@webassemblyjs/helper-fsm": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", - "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", + "@types/node": { + "version": "12.7.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.11.tgz", + "integrity": "sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw==", "dev": true }, - "@webassemblyjs/helper-module-context": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", - "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "mamacro": "^0.0.3" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", - "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", "dev": true }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", - "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "@types/resolve": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", + "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5" + "@types/node": "*" } }, - "@webassemblyjs/ieee754": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", - "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } + "@types/stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", + "dev": true }, - "@webassemblyjs/leb128": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", - "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "@types/yargs": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.3.tgz", + "integrity": "sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ==", "dev": true, "requires": { - "@xtuc/long": "4.2.2" + "@types/yargs-parser": "*" } }, - "@webassemblyjs/utf8": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", - "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", + "@types/yargs-parser": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-13.1.0.tgz", + "integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==", "dev": true }, - "@webassemblyjs/wasm-edit": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", - "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "@typescript-eslint/eslint-plugin": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.3.1.tgz", + "integrity": "sha512-VqVNEsvemviajlaWm03kVMabc6S3xCHGYuY0fReTrIIOZg+3WzB+wfw6fD3KYKerw5lYxmzogmHOZ0i7YKnuwA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/helper-wasm-section": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-opt": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "@webassemblyjs/wast-printer": "1.8.5" + "@typescript-eslint/experimental-utils": "2.3.1", + "eslint-utils": "^1.4.2", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^2.0.1", + "tsutils": "^3.17.1" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.3.1.tgz", + "integrity": "sha512-FaZEj73o4h6Wd0Lg+R4pZiJGdR0ZYbJr+O2+RbQ1aZjX8bZcfkVDtD+qm74Dv77rfSKkDKE64UTziLBo9UYHQA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.3.1", + "eslint-scope": "^5.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.3.1.tgz", + "integrity": "sha512-9SFhUgFuePJBB6jlLkOPPhMkZNiDCr+S8Ft7yAkkP2c5x5bxPhG3pe/exMiQaF8IGyVMDW6Ul0q4/cZ+uF3uog==", + "dev": true, + "requires": { + "glob": "^7.1.4", + "is-glob": "^4.0.1", + "lodash.unescape": "4.0.1", + "semver": "^6.3.0" + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, - "@webassemblyjs/wasm-gen": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", - "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "@typescript-eslint/parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.3.1.tgz", + "integrity": "sha512-ZlWdzhCJ2iZnSp/VBAJ/sowFbyHycIux8t0UEH0JsKgQvfSf7949hLYFMwTXdCMeEnpP1zRTHimrR+YHzs8LIw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.3.1", + "@typescript-eslint/typescript-estree": "2.3.1", + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.3.1.tgz", + "integrity": "sha512-FaZEj73o4h6Wd0Lg+R4pZiJGdR0ZYbJr+O2+RbQ1aZjX8bZcfkVDtD+qm74Dv77rfSKkDKE64UTziLBo9UYHQA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.3.1", + "eslint-scope": "^5.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.3.1.tgz", + "integrity": "sha512-9SFhUgFuePJBB6jlLkOPPhMkZNiDCr+S8Ft7yAkkP2c5x5bxPhG3pe/exMiQaF8IGyVMDW6Ul0q4/cZ+uF3uog==", + "dev": true, + "requires": { + "glob": "^7.1.4", + "is-glob": "^4.0.1", + "lodash.unescape": "4.0.1", + "semver": "^6.3.0" + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, - "@webassemblyjs/wasm-opt": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", - "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "@zerollup/ts-helpers": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.0.tgz", + "integrity": "sha512-Nr5taViAcvl4uo41/vlXcyDoLrEKiJUJkk4jN/WUzCyHZC5In6pGFK7WpYabwi67wxWn2Na6OV8oBtbFpqKUXw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5" + "resolve": "^1.8.1" } }, - "@webassemblyjs/wasm-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", - "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "@zerollup/ts-transform-paths": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.3.tgz", + "integrity": "sha512-HxwlDpxB7awHypfO7vr+E9WXYXw0ymZJckXLMdtp51Hm8bP4M4VX0c1vOrfmcji85h7BkcxNKt1aONc98r3ANw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" + "@zerollup/ts-helpers": "^1.7.0" } }, - "@webassemblyjs/wast-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", - "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/floating-point-hex-parser": "1.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-code-frame": "1.8.5", - "@webassemblyjs/helper-fsm": "1.8.5", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", - "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5", - "@xtuc/long": "4.2.2" - } - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "abab": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", - "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", - "dev": true + "abab": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.2.tgz", + "integrity": "sha512-2scffjvioEmNz0OyDSLGWDfKCVwaKc6l9Pm9kOIREU13ClXZvHpg/nRL5xyjSSSLhOnXqft2HpsAzNEEA8cFFg==", + "dev": true }, "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", "dev": true }, "acorn-globals": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz", - "integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", + "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", "dev": true, "requires": { "acorn": "^6.0.1", @@ -2096,38 +1469,29 @@ }, "dependencies": { "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", + "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", "dev": true } } }, "acorn-jsx": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", - "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", + "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", "dev": true }, "acorn-walk": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", - "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", "dev": true }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -2136,18 +1500,6 @@ "uri-js": "^4.2.2" } }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true - }, - "ajv-keywords": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz", - "integrity": "sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw==", - "dev": true - }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -2155,9 +1507,9 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { @@ -2179,12 +1531,6 @@ "normalize-path": "^2.1.1" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -2214,10 +1560,20 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -2233,44 +1589,6 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -2295,22 +1613,16 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "atob": { "version": "2.1.2", @@ -2331,92 +1643,38 @@ "dev": true }, "babel-eslint": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.2.tgz", - "integrity": "sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.3.tgz", + "integrity": "sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.0.0", "@babel/traverse": "^7.0.0", "@babel/types": "^7.0.0", - "eslint-scope": "3.7.1", - "eslint-visitor-keys": "^1.0.0" + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" } }, "babel-jest": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.8.0.tgz", - "integrity": "sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.9.0.tgz", + "integrity": "sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw==", "dev": true, "requires": { - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", "@types/babel__core": "^7.1.0", "babel-plugin-istanbul": "^5.1.0", - "babel-preset-jest": "^24.6.0", + "babel-preset-jest": "^24.9.0", "chalk": "^2.4.2", "slash": "^2.0.0" }, "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "babel-loader": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz", - "integrity": "sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw==", - "dev": true, - "requires": { - "find-cache-dir": "^2.0.0", - "loader-utils": "^1.0.2", - "mkdirp": "^0.5.1", - "pify": "^4.0.1" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true } } @@ -2431,11 +1689,12 @@ } }, "babel-plugin-istanbul": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz", - "integrity": "sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz", + "integrity": "sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw==", "dev": true, "requires": { + "@babel/helper-plugin-utils": "^7.0.0", "find-up": "^3.0.0", "istanbul-lib-instrument": "^3.3.0", "test-exclude": "^5.2.3" @@ -2461,9 +1720,9 @@ } }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -2487,9 +1746,9 @@ } }, "babel-plugin-jest-hoist": { - "version": "24.6.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz", - "integrity": "sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz", + "integrity": "sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw==", "dev": true, "requires": { "@types/babel__traverse": "^7.0.6" @@ -2516,39 +1775,14 @@ } } }, - "babel-polyfill": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", - "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "regenerator-runtime": "^0.10.5" - }, - "dependencies": { - "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", - "dev": true - } - } - }, "babel-preset-jest": { - "version": "24.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz", - "integrity": "sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz", + "integrity": "sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg==", "dev": true, "requires": { "@babel/plugin-syntax-object-rest-spread": "^7.0.0", - "babel-plugin-jest-hoist": "^24.6.0" + "babel-plugin-jest-hoist": "^24.9.0" } }, "babel-runtime": { @@ -2564,6 +1798,11 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" } } }, @@ -2629,10 +1868,9 @@ } }, "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, "bcrypt-pbkdf": { "version": "1.0.2", @@ -2643,52 +1881,6 @@ "tweetnacl": "^0.14.3" } }, - "before-after-hook": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-1.4.0.tgz", - "integrity": "sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg==", - "dev": true - }, - "big-integer": { - "version": "1.6.44", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.44.tgz", - "integrity": "sha512-7MzElZPTyJ2fNvBkPxtFQ2fWIkVmuzw41+BZHSzpEq3ymB2MfeKp1+yXl/tS75xCx+WnyV+yb0kp+K1C3UNwmQ==", - "dev": true - }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "binary": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", - "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", - "dev": true, - "requires": { - "buffers": "~0.1.1", - "chainsaw": "~0.1.0" - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "bluebird": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", - "integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2728,12 +1920,6 @@ } } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, "browser-process-hrtime": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", @@ -2757,208 +1943,47 @@ } } }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - } - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "browserslist": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.0.tgz", + "integrity": "sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA==", "dev": true, "requires": { - "pako": "~1.0.5" + "caniuse-lite": "^1.0.30000989", + "electron-to-chromium": "^1.3.247", + "node-releases": "^1.1.29" } }, - "browserslist": { - "version": "4.6.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.6.tgz", - "integrity": "sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA==", + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30000984", - "electron-to-chromium": "^1.3.191", - "node-releases": "^1.1.25" + "fast-json-stable-stringify": "2.x" } }, "bser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", - "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.0.tgz", + "integrity": "sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg==", "dev": true, "requires": { "node-int64": "^0.4.0" } }, - "btoa-lite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", - "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", - "dev": true - }, - "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, "buffer-from": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", - "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", - "dev": true - }, - "buffer-indexof-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz", - "integrity": "sha1-qfuAbOgUXVQoUQznLyeLs2OmOL8=", - "dev": true - }, - "buffer-shims": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "buffers": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", - "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "builtin-modules": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", "dev": true }, - "cacache": { - "version": "11.3.2", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz", - "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==", - "dev": true, - "requires": { - "bluebird": "^3.5.3", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.3", - "graceful-fs": "^4.1.15", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - }, - "dependencies": { - "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", - "dev": true - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - } - } - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -2976,10 +2001,28 @@ "unset-value": "^1.0.0" } }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", "dev": true }, "camelcase": { @@ -2989,9 +2032,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30000984", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000984.tgz", - "integrity": "sha512-n5tKOjMaZ1fksIpQbjERuqCyfgec/m9pferkFQbLmWtqLUdmt12hNhjSwsmPdqeiG2NkITOQhr1VYIwWSAceiA==", + "version": "1.0.30000999", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000999.tgz", + "integrity": "sha512-1CUyKyecPeksKwXZvYw0tEoaMCo/RwBlXmEtN5vVnabvO0KPd9RQLcaAuR9/1F+KDMv6esmOFWlsXuzDk+8rxg==", "dev": true }, "capture-exit": { @@ -3023,15 +2066,6 @@ "type-detect": "^4.0.5" } }, - "chainsaw": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", - "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", - "dev": true, - "requires": { - "traverse": ">=0.3.0 <0.4" - } - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3049,638 +2083,18 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", - "dev": true - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "chokidar": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", - "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - }, - "dependencies": { - "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "resolved": false, - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": false, - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": false, - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": false, - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "resolved": false, - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": false, - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "resolved": false, - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "resolved": false, - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": false, - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": false, - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": false, - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": false, - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "resolved": false, - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": false, - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": false, - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "resolved": false, - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": false, - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": false, - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.3.5", - "resolved": false, - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "resolved": false, - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": false, - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "resolved": false, - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.4", - "resolved": false, - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "resolved": false, - "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "resolved": false, - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.5", - "resolved": false, - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.2.0", - "resolved": false, - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": false, - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "object-assign": { - "version": "4.1.1", - "resolved": false, - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": false, - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "resolved": false, - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": false, - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": false, - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "resolved": false, - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": false, - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": false, - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": false, - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": false, - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "resolved": false, - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true, - "optional": true - }, - "semver": { - "version": "5.6.0", - "resolved": false, - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": false, - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": false, - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": false, - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "resolved": false, - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": false, - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.0.3", - "resolved": false, - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true, - "optional": true - } - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - } - } - }, - "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -3720,67 +2134,50 @@ "dev": true }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" } } } }, - "clone": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", - "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", - "dev": true - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -3792,12 +2189,12 @@ } }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { - "color-name": "^1.1.1" + "color-name": "1.1.3" } }, "color-name": { @@ -3806,16 +2203,11 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", - "dev": true - }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -3833,9 +2225,9 @@ "dev": true }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -3844,31 +2236,10 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "^0.1.4" - } - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, "convert-source-map": { @@ -3880,20 +2251,6 @@ "safe-buffer": "~5.1.1" } }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -3907,71 +2264,79 @@ "dev": true }, "core-js-compat": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.1.4.tgz", - "integrity": "sha512-Z5zbO9f1d0YrJdoaQhphVAnKPimX92D6z8lCGphH89MNRxlL1prI9ExJPqVwP0/kgkQCv8c4GJGT8X16yUncOg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.2.1.tgz", + "integrity": "sha512-MwPZle5CF9dEaMYdDeWm73ao/IflDH+FjeJCWEADcEgFSE9TLimFKwJsfmkwzI8eC0Aj0mgvMDjeQjrElkz4/A==", "dev": true, "requires": { - "browserslist": "^4.6.2", - "core-js-pure": "3.1.4", - "semver": "^6.1.1" + "browserslist": "^4.6.6", + "semver": "^6.3.0" }, "dependencies": { "semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } }, - "core-js-pure": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.1.4.tgz", - "integrity": "sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA==", - "dev": true - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", "dev": true, "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + } } }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "cross-env": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz", + "integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==", "dev": true, "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "cross-spawn": "^7.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.0.tgz", + "integrity": "sha512-6U/8SMK2FBNnB21oQ4+6Nsodxanw1gTkntYA2zBdkFYFu3ZDx65P2ONEXGSvob/QS6REjVHQ9zxzdOafwFdstw==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "path-key": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.0.tgz", + "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==", + "dev": true + } } }, "cross-spawn": { @@ -3987,52 +2352,21 @@ "which": "^1.2.9" } }, - "crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", - "dev": true - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "cssom": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", - "integrity": "sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", "dev": true }, "cssstyle": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz", - "integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", + "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", "dev": true, "requires": { "cssom": "0.3.x" } }, - "cyclist": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", - "dev": true - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -4066,12 +2400,6 @@ } } }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -4093,15 +2421,6 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -4111,17 +2430,6 @@ "type-detect": "^4.0.0" } }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" - }, - "deep-freeze": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz", - "integrity": "sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ=", - "dev": true - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -4181,17 +2489,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "detect-newline": { "version": "2.1.0", @@ -4200,37 +2499,21 @@ "dev": true }, "diff-sequences": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", - "integrity": "sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz", + "integrity": "sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { - "esutils": "^2.0.2" + "esutils": "^2.0.2", + "isarray": "^1.0.0" } }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", @@ -4240,33 +2523,6 @@ "webidl-conversions": "^4.0.2" } }, - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -4278,38 +2534,17 @@ } }, "electron-to-chromium": { - "version": "1.3.194", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.194.tgz", - "integrity": "sha512-w0LHR2YD9Ex1o+Sz4IN2hYzCB8vaFtMNW+yJcBf6SZlVqgFahkne/4rGVJdk4fPF98Gch9snY7PiabOh+vqHNg==", + "version": "1.3.280", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.280.tgz", + "integrity": "sha512-qYWNMjKLEfQAWZF2Sarvo+ahigu0EArnpCFSoUuZJS3W5wIeVfeEvsgmT2mgIrieQkeQ0+xFmykK3nx2ezekPQ==", "dev": true }, - "elliptic": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", - "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, "encoding": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", @@ -4319,34 +2554,14 @@ } }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" } }, - "enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "tapable": "^1.0.0" - } - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4357,17 +2572,21 @@ } }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.2.tgz", + "integrity": "sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg==", "dev": true, "requires": { "es-to-primitive": "^1.2.0", "function-bind": "^1.1.1", "has": "^1.0.3", + "has-symbols": "^1.0.0", "is-callable": "^1.1.4", "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "object-inspect": "^1.6.0", + "object-keys": "^1.1.1", + "string.prototype.trimleft": "^2.0.0", + "string.prototype.trimright": "^2.0.0" } }, "es-to-primitive": { @@ -4381,21 +2600,6 @@ "is-symbol": "^1.0.2" } }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "requires": { - "es6-promise": "^4.0.3" - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -4403,9 +2607,9 @@ "dev": true }, "escodegen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", - "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz", + "integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==", "dev": true, "requires": { "esprima": "^3.1.3", @@ -4474,12 +2678,6 @@ "text-table": "^0.2.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -4489,14 +2687,23 @@ "ms": "^2.1.1" } }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "esutils": "^2.0.2" + } + }, + "import-fresh": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", + "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" } }, "ms": { @@ -4505,20 +2712,17 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -4527,30 +2731,64 @@ "from": "github:mattermost/eslint-config-mattermost#6fe27a2bd1f9df4d4eb96fac6fcdcc0fee0ecbd7", "dev": true }, - "eslint-plugin-flowtype": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.12.1.tgz", - "integrity": "sha512-NZqf5iRgsfHOC31HQdtX2pvzCi0n/j9pB+L7Cf9QtuYxpx0i2wObT+R3rPKhQK4KtEDzGuzPYVf75j4eg+s9ZQ==", + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", "dev": true, "requires": { - "lodash": "^4.17.11" + "debug": "^2.6.9", + "resolve": "^1.5.0" + } + }, + "eslint-module-utils": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz", + "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==", + "dev": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^2.0.0" + } + }, + "eslint-plugin-cypress": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.7.0.tgz", + "integrity": "sha512-52Lq5ePCD/8jc536e1RqtLfj33BAy1s7BlYgCjbG39J5kqUitcTlRY5i3NRoeAyPHueDwETsq0eASF44ugLosQ==", + "dev": true, + "requires": { + "globals": "^11.12.0" } }, "eslint-plugin-header": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.0.0.tgz", - "integrity": "sha512-OIu2ciVW8jK4Ove4JHm1I7X0C98PZuLCyCsoUhAm2HpyGS+zr34qLM6iV06unnDvssvvEh5BkOfaLRF+N7cGoQ==" - }, - "eslint-plugin-jest": { - "version": "22.11.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.11.1.tgz", - "integrity": "sha512-kPF1Nmr5xMLz6DT7qEttz0TTeyx1x6SozIkNO9y4F2yxuWjHMp/e70fo742pR3y0MewgXQQMIIXeSKLB66iO7Q==", + "integrity": "sha512-OIu2ciVW8jK4Ove4JHm1I7X0C98PZuLCyCsoUhAm2HpyGS+zr34qLM6iV06unnDvssvvEh5BkOfaLRF+N7cGoQ==", "dev": true }, + "eslint-plugin-import": { + "version": "2.18.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", + "integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==", + "dev": true, + "requires": { + "array-includes": "^3.0.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", + "read-pkg-up": "^2.0.0", + "resolve": "^1.11.0" + } + }, "eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -4567,28 +2805,20 @@ } }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, "espree": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.0.0.tgz", - "integrity": "sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.1.tgz", + "integrity": "sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==", "dev": true, "requires": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - }, - "dependencies": { - "acorn": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz", - "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==", - "dev": true - } + "acorn": "^7.0.0", + "acorn-jsx": "^5.0.2", + "eslint-visitor-keys": "^1.1.0" } }, "esprima": { @@ -4616,33 +2846,23 @@ } }, "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, - "events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", - "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "exec-sh": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz", @@ -4706,45 +2926,17 @@ } }, "expect": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-24.8.0.tgz", - "integrity": "sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-24.9.0.tgz", + "integrity": "sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q==", "dev": true, "requires": { - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "ansi-styles": "^3.2.0", - "jest-get-type": "^24.8.0", - "jest-matcher-utils": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-regex-util": "^24.3.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", - "dev": true - } + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.9.0" } }, "extend": { @@ -4783,17 +2975,6 @@ "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } } }, "extglob": { @@ -4894,33 +3075,6 @@ "bser": "^2.0.0" } }, - "fetch-mock": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/fetch-mock/-/fetch-mock-7.3.7.tgz", - "integrity": "sha512-Tl2OEdsLXaXwv+V61s6Ar38FiGrhKGzokLtToiW1Otu6ei0e+g8Apoug5Zc/AFBipAfuiO/4vXV5IP6/lVApBA==", - "dev": true, - "requires": { - "babel-polyfill": "^6.26.0", - "core-js": "^2.6.9", - "glob-to-regexp": "^0.4.0", - "path-to-regexp": "^2.2.1", - "whatwg-url": "^6.5.0" - }, - "dependencies": { - "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", - "dev": true - } - } - }, - "figgy-pudding": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", - "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", - "dev": true - }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -4970,17 +3124,14 @@ "requires": { "json5": "^0.5.1", "path-exists": "^3.0.0" - } - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + } } }, "find-up": { @@ -5009,446 +3160,71 @@ "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", "dev": true }, - "flow-bin": { - "version": "0.95.1", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.95.1.tgz", - "integrity": "sha512-06IOC/pqPMNRYtC6AMZEWYR9Fi6UdBC7gImGinPuNUpPZFnP5E9/0cBCl3DWrH4zz/gSM2HdDilU7vPGpYIr2w==", + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", "dev": true }, - "flow-typed": { + "form-data": { "version": "2.5.1", - "resolved": "https://registry.npmjs.org/flow-typed/-/flow-typed-2.5.1.tgz", - "integrity": "sha1-D/VlzJTSr4xVd0S6NktvFHJqa58=", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", "dev": true, "requires": { - "@octokit/rest": "^15.2.6", - "babel-polyfill": "^6.26.0", - "colors": "^1.1.2", - "fs-extra": "^5.0.0", - "glob": "^7.1.2", - "got": "^7.1.0", - "md5": "^2.1.0", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.2", - "semver": "^5.5.0", - "table": "^4.0.2", - "through": "^2.3.8", - "unzipper": "^0.8.11", - "which": "^1.3.0", - "yargs": "^4.2.0" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", - "dev": true, - "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", - "dev": true, - "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - } - } - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.0.tgz", - "integrity": "sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", - "dev": true - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true }, "ansi-regex": { "version": "2.1.1", @@ -5981,18 +3757,6 @@ } } }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -6006,9 +3770,9 @@ "dev": true }, "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-func-name": { @@ -6020,7 +3784,12 @@ "get-params": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/get-params/-/get-params-0.1.2.tgz", - "integrity": "sha1-uuDfq6WIoMYNeDTA2Nwv9g7u8v4=", + "integrity": "sha1-uuDfq6WIoMYNeDTA2Nwv9g7u8v4=" + }, + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", "dev": true }, "get-stream": { @@ -6056,9 +3825,9 @@ } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -6090,53 +3859,16 @@ } } }, - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, "globals": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", - "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, - "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", - "dev": true, - "requires": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" - }, - "dependencies": { - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - } - } - }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" }, "growly": { "version": "1.3.0", @@ -6145,9 +3877,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.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.3.tgz", + "integrity": "sha512-B0W4A2U1ww3q7VVthTKfh+epHx+q4mCt6iK+zEAzbMBpWQAwxCeKxEGpj/1oQTpzPXDNSOG7hmG14TsISH50yw==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -6180,11 +3912,6 @@ "har-schema": "^2.0.0" } }, - "harmony-reflect": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.1.tgz", - "integrity": "sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA==" - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -6200,27 +3927,12 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", - "dev": true - }, "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "dev": true, - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -6253,41 +3965,10 @@ } } }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz", + "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==", "dev": true }, "html-encoding-sniffer": { @@ -6299,27 +3980,6 @@ "whatwg-encoding": "^1.0.1" } }, - "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", - "dev": true, - "requires": { - "agent-base": "4", - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -6331,58 +3991,121 @@ "sshpk": "^1.7.0" } }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "https-proxy-agent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", - "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", + "husky": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-3.0.5.tgz", + "integrity": "sha512-cKd09Jy9cDyNIvAdN2QQAP/oA21sle4FWXjIMDttailpLAYZuBE7WaPmhrkj+afS8Sj9isghAtFvWSQ0JiwOHg==", "dev": true, "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "chalk": "^2.4.2", + "cosmiconfig": "^5.2.1", + "execa": "^1.0.0", + "get-stdin": "^7.0.0", + "is-ci": "^2.0.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "read-pkg": "^5.1.1", + "run-node": "^1.0.0", + "slash": "^3.0.0" }, "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "ms": "^2.1.1" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + } } } }, "iconv-lite": { - "version": "0.4.21", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", - "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { - "safer-buffer": "^2.1.0" + "safer-buffer": ">= 2.1.2 < 3" } }, "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "ignore": { "version": "4.0.6", @@ -6391,13 +4114,13 @@ "dev": true }, "import-fresh": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", - "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", "dev": true, "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" } }, "import-local": { @@ -6408,13 +4131,66 @@ "requires": { "pkg-dir": "^3.0.0", "resolve-cwd": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } } }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "inflight": { "version": "1.0.6", @@ -6427,15 +4203,15 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", "dev": true }, "inquirer": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz", - "integrity": "sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", "dev": true, "requires": { "ansi-escapes": "^3.2.0", @@ -6454,38 +4230,11 @@ }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -6493,14 +4242,6 @@ "dev": true, "requires": { "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } } } } @@ -6514,12 +4255,6 @@ "loose-envify": "^1.0.0" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -6546,15 +4281,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -6621,6 +4347,12 @@ } } }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -6634,13 +4366,10 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "is-generator-fn": { "version": "2.1.0", @@ -6657,6 +4386,12 @@ "is-extglob": "^2.1.1" } }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -6677,18 +4412,6 @@ } } }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", - "dev": true - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -6704,6 +4427,15 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, + "is-reference": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", + "integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==", + "dev": true, + "requires": { + "@types/estree": "0.0.39" + } + }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -6713,12 +4445,6 @@ "has": "^1.0.1" } }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", - "dev": true - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -6739,12 +4465,6 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -6811,16 +4531,10 @@ "semver": "^6.0.0" }, "dependencies": { - "@babel/parser": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", - "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", - "dev": true - }, "semver": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", - "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -6870,9 +4584,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "source-map": { @@ -6892,16 +4606,6 @@ "handlebars": "^4.1.2" } }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "dev": true, - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, "jest": { "version": "24.8.0", "resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz", @@ -6910,584 +4614,176 @@ "requires": { "import-local": "^2.0.0", "jest-cli": "^24.8.0" + }, + "dependencies": { + "jest-cli": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.9.0.tgz", + "integrity": "sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg==", + "dev": true, + "requires": { + "@jest/core": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "import-local": "^2.0.0", + "is-ci": "^2.0.0", + "jest-config": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "prompts": "^2.0.1", + "realpath-native": "^1.1.0", + "yargs": "^13.3.0" + } + } } }, "jest-changed-files": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.8.0.tgz", - "integrity": "sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.9.0.tgz", + "integrity": "sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg==", "dev": true, "requires": { - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "execa": "^1.0.0", "throat": "^4.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } } }, - "jest-cli": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.8.0.tgz", - "integrity": "sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA==", + "jest-config": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.9.0.tgz", + "integrity": "sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ==", "dev": true, "requires": { - "@jest/core": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "import-local": "^2.0.0", - "is-ci": "^2.0.0", - "jest-config": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", - "prompts": "^2.0.1", - "realpath-native": "^1.1.0", - "yargs": "^12.0.2" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", - "dev": true - }, - "jest-validate": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", - "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "camelcase": "^5.0.0", - "chalk": "^2.0.1", - "jest-get-type": "^24.8.0", - "leven": "^2.1.0", - "pretty-format": "^24.8.0" - } - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "jest-config": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.8.0.tgz", - "integrity": "sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==", - "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^24.8.0", - "@jest/types": "^24.8.0", - "babel-jest": "^24.8.0", + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^24.9.0", + "@jest/types": "^24.9.0", + "babel-jest": "^24.9.0", "chalk": "^2.0.1", "glob": "^7.1.1", - "jest-environment-jsdom": "^24.8.0", - "jest-environment-node": "^24.8.0", - "jest-get-type": "^24.8.0", - "jest-jasmine2": "^24.8.0", + "jest-environment-jsdom": "^24.9.0", + "jest-environment-node": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-jasmine2": "^24.9.0", "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", + "jest-resolve": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", "micromatch": "^3.1.10", - "pretty-format": "^24.8.0", + "pretty-format": "^24.9.0", "realpath-native": "^1.1.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", - "dev": true - }, - "jest-validate": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", - "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "camelcase": "^5.0.0", - "chalk": "^2.0.1", - "jest-get-type": "^24.8.0", - "leven": "^2.1.0", - "pretty-format": "^24.8.0" - } - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-diff": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.8.0.tgz", - "integrity": "sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz", + "integrity": "sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==", "dev": true, "requires": { "chalk": "^2.0.1", - "diff-sequences": "^24.3.0", - "jest-get-type": "^24.8.0", - "pretty-format": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", - "dev": true - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "diff-sequences": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" } }, "jest-docblock": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.3.0.tgz", - "integrity": "sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.9.0.tgz", + "integrity": "sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA==", "dev": true, "requires": { "detect-newline": "^2.1.0" } }, "jest-each": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.8.0.tgz", - "integrity": "sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.9.0.tgz", + "integrity": "sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog==", "dev": true, "requires": { - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "chalk": "^2.0.1", - "jest-get-type": "^24.8.0", - "jest-util": "^24.8.0", - "pretty-format": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", - "dev": true - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "jest-get-type": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0" } }, "jest-environment-jsdom": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz", - "integrity": "sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz", + "integrity": "sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA==", "dev": true, "requires": { - "@jest/environment": "^24.8.0", - "@jest/fake-timers": "^24.8.0", - "@jest/types": "^24.8.0", - "jest-mock": "^24.8.0", - "jest-util": "^24.8.0", + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0", "jsdom": "^11.5.1" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } } }, "jest-environment-node": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.8.0.tgz", - "integrity": "sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.9.0.tgz", + "integrity": "sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA==", "dev": true, "requires": { - "@jest/environment": "^24.8.0", - "@jest/fake-timers": "^24.8.0", - "@jest/types": "^24.8.0", - "jest-mock": "^24.8.0", - "jest-util": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0" } }, "jest-get-type": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.3.0.tgz", - "integrity": "sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==", "dev": true }, "jest-haste-map": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.8.0.tgz", - "integrity": "sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.9.0.tgz", + "integrity": "sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ==", "dev": true, "requires": { - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", - "jest-serializer": "^24.4.0", - "jest-util": "^24.8.0", - "jest-worker": "^24.6.0", + "jest-serializer": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.9.0", "micromatch": "^3.1.10", "sane": "^4.0.3", "walker": "^1.0.7" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - } } }, "jest-jasmine2": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz", - "integrity": "sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz", + "integrity": "sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", "chalk": "^2.0.1", "co": "^4.6.0", - "expect": "^24.8.0", + "expect": "^24.9.0", "is-generator-fn": "^2.0.0", - "jest-each": "^24.8.0", - "jest-matcher-utils": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-snapshot": "^24.8.0", - "jest-util": "^24.8.0", - "pretty-format": "^24.8.0", + "jest-each": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0", "throat": "^4.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-junit": { @@ -7500,161 +4796,39 @@ "mkdirp": "^0.5.1", "strip-ansi": "^4.0.0", "xml": "^1.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } } }, "jest-leak-detector": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz", - "integrity": "sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz", + "integrity": "sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA==", "dev": true, "requires": { - "pretty-format": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - } + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" } }, "jest-matcher-utils": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz", - "integrity": "sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz", + "integrity": "sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA==", "dev": true, "requires": { "chalk": "^2.0.1", - "jest-diff": "^24.8.0", - "jest-get-type": "^24.8.0", - "pretty-format": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", - "dev": true - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" } }, "jest-message-util": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.8.0.tgz", - "integrity": "sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.9.0.tgz", + "integrity": "sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", "@types/stack-utils": "^1.0.1", "chalk": "^2.0.1", "micromatch": "^3.1.10", @@ -7662,68 +4836,21 @@ "stack-utils": "^1.0.1" }, "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true } } }, "jest-mock": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.8.0.tgz", - "integrity": "sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.9.0.tgz", + "integrity": "sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w==", "dev": true, "requires": { - "@jest/types": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } + "@jest/types": "^24.9.0" } }, "jest-pnp-resolver": { @@ -7733,393 +4860,147 @@ "dev": true }, "jest-regex-util": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.3.0.tgz", - "integrity": "sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.9.0.tgz", + "integrity": "sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA==", "dev": true }, "jest-resolve": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.8.0.tgz", - "integrity": "sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.9.0.tgz", + "integrity": "sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ==", "dev": true, "requires": { - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "browser-resolve": "^1.11.3", "chalk": "^2.0.1", "jest-pnp-resolver": "^1.2.1", "realpath-native": "^1.1.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-resolve-dependencies": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz", - "integrity": "sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz", + "integrity": "sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g==", "dev": true, "requires": { - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "jest-regex-util": "^24.3.0", - "jest-snapshot": "^24.8.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - } + "jest-snapshot": "^24.9.0" } }, "jest-runner": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.8.0.tgz", - "integrity": "sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.9.0.tgz", + "integrity": "sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg==", "dev": true, "requires": { "@jest/console": "^24.7.1", - "@jest/environment": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", "chalk": "^2.4.2", "exit": "^0.1.2", "graceful-fs": "^4.1.15", - "jest-config": "^24.8.0", + "jest-config": "^24.9.0", "jest-docblock": "^24.3.0", - "jest-haste-map": "^24.8.0", - "jest-jasmine2": "^24.8.0", - "jest-leak-detector": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-resolve": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-util": "^24.8.0", + "jest-haste-map": "^24.9.0", + "jest-jasmine2": "^24.9.0", + "jest-leak-detector": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", "jest-worker": "^24.6.0", - "source-map-support": "^0.5.6", - "throat": "^4.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "jest-runtime": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.8.0.tgz", - "integrity": "sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA==", - "dev": true, - "requires": { - "@jest/console": "^24.7.1", - "@jest/environment": "^24.8.0", - "@jest/source-map": "^24.3.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", - "@types/yargs": "^12.0.2", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.1.15", - "jest-config": "^24.8.0", - "jest-haste-map": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-mock": "^24.8.0", - "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.8.0", - "jest-snapshot": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", - "realpath-native": "^1.1.0", - "slash": "^2.0.0", - "strip-bom": "^3.0.0", - "yargs": "^12.0.2" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" + } + }, + "jest-runtime": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.9.0.tgz", + "integrity": "sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.9.0", + "@jest/source-map": "^24.3.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "strip-bom": "^3.0.0", + "yargs": "^13.3.0" + }, + "dependencies": { + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true - }, - "jest-validate": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", - "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "camelcase": "^5.0.0", - "chalk": "^2.0.1", - "jest-get-type": "^24.8.0", - "leven": "^2.1.0", - "pretty-format": "^24.8.0" - } - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, "jest-serializer": { - "version": "24.4.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.4.0.tgz", - "integrity": "sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.9.0.tgz", + "integrity": "sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ==", "dev": true }, "jest-snapshot": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.8.0.tgz", - "integrity": "sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.9.0.tgz", + "integrity": "sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^24.8.0", + "@jest/types": "^24.9.0", "chalk": "^2.0.1", - "expect": "^24.8.0", - "jest-diff": "^24.8.0", - "jest-matcher-utils": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-resolve": "^24.8.0", + "expect": "^24.9.0", + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "pretty-format": "^24.8.0", - "semver": "^5.5.0" + "pretty-format": "^24.9.0", + "semver": "^6.2.0" }, "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, "jest-util": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.8.0.tgz", - "integrity": "sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.9.0.tgz", + "integrity": "sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg==", "dev": true, "requires": { - "@jest/console": "^24.7.1", - "@jest/fake-timers": "^24.8.0", - "@jest/source-map": "^24.3.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", + "@jest/console": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/source-map": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", "callsites": "^3.0.0", "chalk": "^2.0.1", "graceful-fs": "^4.1.15", @@ -8129,41 +5010,16 @@ "source-map": "^0.6.0" }, "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, "source-map": { @@ -8171,127 +5027,45 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, "jest-validate": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.7.0.tgz", - "integrity": "sha512-cgai/gts9B2chz1rqVdmLhzYxQbgQurh1PEQSvSgPZ8KGa1AqXsqC45W5wKEwzxKrWqypuQrQxnF4+G9VejJJA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.9.0.tgz", + "integrity": "sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ==", "dev": true, "requires": { - "@jest/types": "^24.7.0", - "camelcase": "^5.0.0", + "@jest/types": "^24.9.0", + "camelcase": "^5.3.1", "chalk": "^2.0.1", - "jest-get-type": "^24.3.0", - "leven": "^2.1.0", - "pretty-format": "^24.7.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "jest-get-type": "^24.9.0", + "leven": "^3.1.0", + "pretty-format": "^24.9.0" } }, "jest-watcher": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.8.0.tgz", - "integrity": "sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.9.0.tgz", + "integrity": "sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw==", "dev": true, "requires": { - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "@types/yargs": "^12.0.9", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", - "jest-util": "^24.8.0", + "jest-util": "^24.9.0", "string-length": "^2.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "jest-worker": { - "version": "24.6.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz", - "integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", + "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", "dev": true, "requires": { - "merge-stream": "^1.0.1", + "merge-stream": "^2.0.0", "supports-color": "^6.1.0" }, "dependencies": { @@ -8313,9 +5087,9 @@ "dev": true }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "3.13.1", @@ -8330,8 +5104,7 @@ "jsan": { "version": "3.1.13", "resolved": "https://registry.npmjs.org/jsan/-/jsan-3.1.13.tgz", - "integrity": "sha512-9kGpCsGHifmw6oJet+y8HaCl14y7qgAsxVdV3pCHDySNR3BfDC30zgkssd7x5LRVAT22dnpbe9JdzzmXZnq9/g==", - "dev": true + "integrity": "sha512-9kGpCsGHifmw6oJet+y8HaCl14y7qgAsxVdV3pCHDySNR3BfDC30zgkssd7x5LRVAT22dnpbe9JdzzmXZnq9/g==" }, "jsbn": { "version": "0.1.1", @@ -8373,14 +5146,11 @@ "xml-name-validator": "^3.0.0" }, "dependencies": { - "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true } } }, @@ -8420,10 +5190,13 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } }, "jsonfile": { "version": "4.0.0", @@ -8458,15 +5231,6 @@ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, "left-pad": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", @@ -8474,9 +5238,9 @@ "dev": true }, "leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true }, "levn": { @@ -8489,64 +5253,29 @@ "type-check": "~0.3.2" } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, "linked-list": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/linked-list/-/linked-list-0.1.0.tgz", - "integrity": "sha1-eYsP+X0bkqT9CEgPVa6k6dSdN78=", - "dev": true - }, - "listenercount": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", - "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=", - "dev": true + "integrity": "sha1-eYsP+X0bkqT9CEgPVa6k6dSdN78=" }, "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", + "parse-json": "^2.2.0", + "pify": "^2.0.0", "strip-bom": "^3.0.0" } }, - "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", - "dev": true - }, - "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^2.0.0", - "json5": "^1.0.1" - }, - "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -8558,33 +5287,39 @@ } }, "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "lodash-es": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz", "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==" }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", "dev": true }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", + "dev": true + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8593,27 +5328,15 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "magic-string": { + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.3.tgz", + "integrity": "sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA==", "dev": true, "requires": { - "yallist": "^3.0.2" + "sourcemap-codec": "^1.4.4" } }, - "macos-release": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", - "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", - "dev": true - }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -8631,126 +5354,49 @@ "dev": true }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } }, - "makeerror": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", - "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", - "dev": true, - "requires": { - "tmpl": "1.0.x" - } - }, - "mamacro": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", - "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", - "dev": true - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", - "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", - "dev": true, - "requires": { - "charenc": "~0.0.1", - "crypt": "~0.0.1", - "is-buffer": "~1.1.1" - } - }, - "md5.js": { + "make-error": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - } - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "dev": true - } - } + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "dev": true }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", "dev": true, "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" + "tmpl": "1.0.x" } }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { - "readable-stream": "^2.0.1" + "object-visit": "^1.0.0" } }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -8772,25 +5418,17 @@ "to-regex": "^3.0.2" } }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, "mime-db": { "version": "1.40.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true }, "mime-types": { "version": "2.1.24", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dev": true, "requires": { "mime-db": "1.40.0" } @@ -8801,24 +5439,6 @@ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -8829,29 +5449,11 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -8880,6 +5482,14 @@ "dev": true, "requires": { "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } } }, "mock-socket": { @@ -8904,20 +5514,6 @@ "moment": ">= 2.9.0" } }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -8938,10 +5534,9 @@ "optional": true }, "nanoid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.0.1.tgz", - "integrity": "sha512-k1u2uemjIGsn25zmujKnotgniC/gxQ9sdegdezeDiKdkDW56THUMqlz3urndKCXJxA6yPzSZbXx/QCMe/pxqsA==", - "dev": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.1.1.tgz", + "integrity": "sha512-0YbJdaL4JFoejIOoawgLcYValFGJ2iyUuVDIWL3g8Es87SSOWFbWdRUMV3VMSiyPs3SQ3QxCIxFX00q5DLkMCw==" }, "nanomatch": { "version": "1.2.13", @@ -8981,20 +5576,17 @@ "dev": true }, "nock": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/nock/-/nock-10.0.6.tgz", - "integrity": "sha512-b47OWj1qf/LqSQYnmokNWM8D88KvUl2y7jT0567NB3ZBAZFz2bWp2PC81Xn7u8F2/vJxzkzNZybnemeFa7AZ2w==", + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/nock/-/nock-11.3.5.tgz", + "integrity": "sha512-6WGeZcWc3RExkBcMSYSrUm/5YukDo52m/jhwniQyrnuiCnKRljBwwje9vTwJyEi4J6m2bq0Aj6C1vzuM6iuaeg==", "dev": true, "requires": { "chai": "^4.1.2", "debug": "^4.1.0", - "deep-equal": "^1.0.0", "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.5", + "lodash": "^4.17.13", "mkdirp": "^0.5.0", - "propagate": "^1.0.0", - "qs": "^6.5.1", - "semver": "^5.5.0" + "propagate": "^2.0.0" }, "dependencies": { "debug": { @@ -9007,9 +5599,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } @@ -9029,52 +5621,24 @@ "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", "dev": true }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, "node-localstorage": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-1.3.1.tgz", "integrity": "sha512-NMWCSWWc6JbHT5PyWlNT2i8r7PgGYXVntmKawY83k/M0UJScZ5jirb61TLnqKwd815DfBQu+lR3sRw08SPzIaQ==", - "dev": true, "requires": { "write-file-atomic": "^1.1.4" + }, + "dependencies": { + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + } } }, "node-modules-regexp": { @@ -9084,9 +5648,9 @@ "dev": true }, "node-notifier": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.0.tgz", - "integrity": "sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.3.tgz", + "integrity": "sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q==", "dev": true, "requires": { "growly": "^1.3.0", @@ -9097,12 +5661,20 @@ } }, "node-releases": { - "version": "1.1.25", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.25.tgz", - "integrity": "sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ==", + "version": "1.1.35", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.35.tgz", + "integrity": "sha512-JGcM/wndCN/2elJlU0IGdVEJQQnJwsLbgPCFd2pY7V0mxf17bZ0Gb/lgOtL29ZQhvEX5shnVhxQyZz3ex94N8w==", "dev": true, "requires": { - "semver": "^5.3.0" + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "normalize-package-data": { @@ -9135,12 +5707,6 @@ "path-key": "^2.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, "nwsapi": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", @@ -9153,12 +5719,6 @@ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -9190,6 +5750,12 @@ } } }, + "object-inspect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -9236,6 +5802,18 @@ "isobject": "^3.0.1" } }, + "object.values": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", + "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.12.0", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -9254,6 +5832,12 @@ "mimic-fn": "^1.0.0" } }, + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -9264,6 +5848,12 @@ "wordwrap": "~0.0.2" }, "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -9286,62 +5876,12 @@ "wordwrap": "~1.0.0" } }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "dev": true, - "requires": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "output-file-sync": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz", - "integrity": "sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "is-plain-obj": "^1.1.0", - "mkdirp": "^0.5.1" - } - }, - "p-cancelable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", - "dev": true - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, "p-each-series": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", @@ -9381,38 +5921,12 @@ "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", "dev": true }, - "p-timeout": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", - "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", - "dev": true, - "requires": { - "p-finally": "^1.0.0" - } - }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, - "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", - "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", - "dev": true - }, - "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", - "dev": true, - "requires": { - "cyclist": "~0.2.2", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -9420,30 +5934,23 @@ "dev": true, "requires": { "callsites": "^3.0.0" - } - }, - "parse-asn1": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", - "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } } }, "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "error-ex": "^1.2.0" } }, "parse5": { @@ -9458,12 +5965,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -9494,128 +5995,49 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-to-regexp": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.4.0.tgz", - "integrity": "sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w==", - "dev": true - }, "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "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": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { - "node-modules-regexp": "^1.0.0" + "pify": "^2.0.0" } - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - } + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "dev": true, + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" } }, "pkg-up": { @@ -9627,6 +6049,15 @@ "find-up": "^2.1.0" } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -9645,19 +6076,13 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, "pretty-format": { - "version": "24.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.7.0.tgz", - "integrity": "sha512-apen5cjf/U4dj7tHetpC7UEFCvtAgnNZnBDkfPv3fokzIqyOJckAG9OlAPC1BlFALnqT/lGB2tl9EJjlK6eCsA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", "dev": true, "requires": { - "@jest/types": "^24.7.0", + "@jest/types": "^24.9.0", "ansi-regex": "^4.0.0", "ansi-styles": "^3.2.0", "react-is": "^16.8.4" @@ -9668,15 +6093,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } } } }, @@ -9686,91 +6102,34 @@ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, "prompts": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.1.0.tgz", - "integrity": "sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==", - "dev": true, - "requires": { - "kleur": "^3.0.2", - "sisteransi": "^1.0.0" - } - }, - "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.2.1.tgz", + "integrity": "sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw==", "dev": true, "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" + "kleur": "^3.0.3", + "sisteransi": "^1.0.3" } }, "propagate": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/propagate/-/propagate-1.0.0.tgz", - "integrity": "sha1-AMLa7t2iDofjeCs0Stuhzd1q1wk=", - "dev": true - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", "dev": true }, "psl": { - "version": "1.1.32", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz", - "integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==", "dev": true }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - } - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -9781,29 +6140,6 @@ "once": "^1.3.1" } }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -9819,148 +6155,39 @@ "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", "dev": true }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "react": { - "version": "16.8.6", - "resolved": "https://registry.npmjs.org/react/-/react-16.8.6.tgz", - "integrity": "sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==", - "dev": true, - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.13.6" - } - }, "react-is": { - "version": "16.8.6", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", - "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "version": "16.10.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.10.2.tgz", + "integrity": "sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA==", "dev": true }, "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { - "load-json-file": "^4.0.0", + "load-json-file": "^2.0.0", "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" + "path-type": "^2.0.0" } }, "read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" } }, "realpath-native": { @@ -9986,16 +6213,10 @@ "resolved": "https://registry.npmjs.org/redux-action-buffer/-/redux-action-buffer-1.2.0.tgz", "integrity": "sha1-LsCh2JnMn29EzN60Me5SrUHdl1U=" }, - "redux-batched-actions": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/redux-batched-actions/-/redux-batched-actions-0.4.1.tgz", - "integrity": "sha512-r6tLDyBP3U9cXNLEHs0n1mX5TQfmk6xE0Y9uinYZ5HOyAWDgIJxYqRRkU/bC6XrJ4nS7tasNbxaHJHVmf9UdkA==" - }, "redux-devtools-core": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/redux-devtools-core/-/redux-devtools-core-0.2.1.tgz", "integrity": "sha512-RAGOxtUFdr/1USAvxrWd+Gq/Euzgw7quCZlO5TgFpDfG7rB5tMhZUrNyBjpzgzL2yMk0eHnPYIGm7NkIfRzHxQ==", - "dev": true, "requires": { "get-params": "^0.1.2", "jsan": "^3.1.13", @@ -10008,7 +6229,6 @@ "version": "1.9.6", "resolved": "https://registry.npmjs.org/redux-devtools-instrument/-/redux-devtools-instrument-1.9.6.tgz", "integrity": "sha512-MwvY4cLEB2tIfWWBzrUR02UM9qRG2i7daNzywRvabOSVdvAY7s9BxSwMmVRH1Y/7QWjplNtOwgT0apKhHg2Qew==", - "dev": true, "requires": { "lodash": "^4.2.0", "symbol-observable": "^1.0.2" @@ -10045,7 +6265,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/redux-persist-node-storage/-/redux-persist-node-storage-2.0.0.tgz", "integrity": "sha1-QAHjK4tDxzgH7y2pujAfSxxmr3k=", - "dev": true, "requires": { "node-localstorage": "^1.3.0" } @@ -10071,9 +6290,10 @@ } }, "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", + "dev": true }, "regenerator-transform": { "version": "0.14.1", @@ -10094,12 +6314,6 @@ "safe-regex": "^1.1.0" } }, - "regexp-tree": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.11.tgz", - "integrity": "sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg==", - "dev": true - }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -10107,13 +6321,13 @@ "dev": true }, "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", + "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==", "dev": true, "requires": { "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", + "regenerate-unicode-properties": "^8.1.0", "regjsgen": "^0.5.0", "regjsparser": "^0.6.0", "unicode-match-property-ecmascript": "^1.0.4", @@ -10147,7 +6361,6 @@ "version": "0.5.16", "resolved": "https://registry.npmjs.org/remote-redux-devtools/-/remote-redux-devtools-0.5.16.tgz", "integrity": "sha512-xZ2D1VRIWzat5nsvcraT6fKEX9Cfi+HbQBCwzNnUAM8Uicm/anOc60XGalcaDPrVmLug7nhDl2nimEa3bL3K9w==", - "dev": true, "requires": { "jsan": "^3.1.13", "querystring": "^0.2.0", @@ -10161,7 +6374,6 @@ "version": "0.1.8", "resolved": "https://registry.npmjs.org/remotedev-serialize/-/remotedev-serialize-0.1.8.tgz", "integrity": "sha512-3YG/FDcOmiK22bl5oMRM8RRnbGrFEuPGjbcDG+z2xi5aQaNQNZ8lqoRnZTwXVfaZtutXuiAQOgPRrogzQk8edg==", - "dev": true, "requires": { "jsan": "^3.1.13" } @@ -10223,27 +6435,12 @@ "mime-types": "^2.1.12" } }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dev": true, - "requires": { - "mime-db": "1.40.0" - } - }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", @@ -10300,9 +6497,9 @@ "integrity": "sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA==" }, "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", + "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -10315,20 +6512,12 @@ "dev": true, "requires": { "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } } }, "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", "dev": true }, "resolve-url": { @@ -10360,44 +6549,194 @@ "dev": true, "requires": { "glob": "^7.1.3" + } + }, + "rn-host-detect": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/rn-host-detect/-/rn-host-detect-1.1.5.tgz", + "integrity": "sha512-ufk2dFT3QeP9HyZ/xTuMtW27KnFy815CYitJMqQm+pgG3ZAtHBsrU8nXizNKkqXGy3bQmhEoloVbrfbvMJMqkg==" + }, + "rollup": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.22.0.tgz", + "integrity": "sha512-x4l4ZrV/Mr/x/jvFTmwROdEAhbZjx16yDRTVSKWh/i4oJDuW2dVEbECT853mybYCz7BAitU8ElGlhx7dNjw3qQ==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" + } + }, + "rollup-plugin-babel": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.3.3.tgz", + "integrity": "sha512-tKzWOCmIJD/6aKNz0H1GMM+lW1q9KyFubbWzGiOG540zxPPifnEAHTZwjo0g991Y+DyOZcLqBgqOdqazYE5fkw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "rollup-pluginutils": "^2.8.1" + } + }, + "rollup-plugin-commonjs": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.1.0.tgz", + "integrity": "sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1", + "is-reference": "^1.1.2", + "magic-string": "^0.25.2", + "resolve": "^1.11.0", + "rollup-pluginutils": "^2.8.1" + } + }, + "rollup-plugin-node-resolve": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz", + "integrity": "sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw==", + "dev": true, + "requires": { + "@types/resolve": "0.0.8", + "builtin-modules": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.11.1", + "rollup-pluginutils": "^2.8.1" + } + }, + "rollup-plugin-terser": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.2.tgz", + "integrity": "sha512-sWKBCOS+vUkRtHtEiJPAf+WnBqk/C402fBD9AVHxSIXMqjsY7MnYWKYEUqGixtr0c8+1DjzUEPlNgOYQPVrS1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "jest-worker": "^24.6.0", + "rollup-pluginutils": "^2.8.1", + "serialize-javascript": "^1.7.0", + "terser": "^4.1.0" + } + }, + "rollup-plugin-typescript2": { + "version": "0.24.3", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.24.3.tgz", + "integrity": "sha512-D7yovQlhnRoz7pG/RF0ni+koxgzEShwfAGuOq6OVqKzcATHOvmUt2ePeYVdc9N0adcW1PcTzklUEM0oNWE/POw==", + "dev": true, + "requires": { + "find-cache-dir": "^3.0.0", + "fs-extra": "8.1.0", + "resolve": "1.12.0", + "rollup-pluginutils": "2.8.1", + "tslib": "1.10.0" }, "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "find-cache-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.0.0.tgz", + "integrity": "sha512-t7ulV1fmbxh5G9l/492O1p5+EBbr3uwpt6odhFTMc+nWyhmbloe+ja9BZ8pIBtqFWhOmCWVjx+pTW4zDkFoclw==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.0", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "find-up": "^4.0.0" + } + }, + "rollup-pluginutils": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz", + "integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "estree-walker": "^0.6.1" } }, - "rn-host-detect": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/rn-host-detect/-/rn-host-detect-1.1.5.tgz", - "integrity": "sha512-ufk2dFT3QeP9HyZ/xTuMtW27KnFy815CYitJMqQm+pgG3ZAtHBsrU8nXizNKkqXGy3bQmhEoloVbrfbvMJMqkg==", - "dev": true - }, "rsvp": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.4.tgz", - "integrity": "sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA==", + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", + "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", "dev": true }, "run-async": { @@ -10409,28 +6748,25 @@ "is-promise": "^2.1.0" } }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } + "run-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz", + "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==", + "dev": true }, "rxjs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", - "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", + "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", "dev": true, "requires": { "tslib": "^1.9.0" } }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safe-regex": { @@ -10462,14 +6798,6 @@ "micromatch": "^3.1.4", "minimist": "^1.1.1", "walker": "~1.0.5" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "sax": { @@ -10482,37 +6810,26 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/sc-channel/-/sc-channel-1.2.0.tgz", "integrity": "sha512-M3gdq8PlKg0zWJSisWqAsMmTVxYRTpVRqw4CWAdKBgAfVKumFcTjoCV0hYu7lgUXccCtCD8Wk9VkkE+IXCxmZA==", - "dev": true, "requires": { "component-emitter": "1.2.1" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + } } }, + "sc-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/sc-errors/-/sc-errors-2.0.1.tgz", + "integrity": "sha512-JoVhq3Ud+3Ujv2SIG7W0XtjRHsrNgl6iXuHHsh0s+Kdt5NwI6N2EGAZD4iteitdDv68ENBkpjtSvN597/wxPSQ==" + }, "sc-formatter": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/sc-formatter/-/sc-formatter-3.0.2.tgz", - "integrity": "sha512-9PbqYBpCq+OoEeRQ3QfFIGE6qwjjBcd2j7UjgDlhnZbtSnuGgHdcRklPKYGuYFH82V/dwd+AIpu8XvA1zqTd+A==", - "dev": true - }, - "scheduler": { - "version": "0.13.6", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.6.tgz", - "integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==", - "dev": true, - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } + "integrity": "sha512-9PbqYBpCq+OoEeRQ3QfFIGE6qwjjBcd2j7UjgDlhnZbtSnuGgHdcRklPKYGuYFH82V/dwd+AIpu8XvA1zqTd+A==" }, "semver": { "version": "5.5.0", @@ -10520,15 +6837,21 @@ "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, "serialize-error": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=" }, "serialize-javascript": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", - "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", + "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", "dev": true }, "set-blocking": { @@ -10560,22 +6883,6 @@ } } }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "shallow-equals": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shallow-equals/-/shallow-equals-1.0.0.tgz", @@ -10609,15 +6916,15 @@ "dev": true }, "sisteransi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.0.tgz", - "integrity": "sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.3.tgz", + "integrity": "sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg==", "dev": true }, "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, "slice-ansi": { @@ -10629,21 +6936,12 @@ "ansi-styles": "^3.2.0", "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - } } }, "slide": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "dev": true + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" }, "snapdragon": { "version": "0.8.2", @@ -10753,10 +7051,9 @@ } }, "socketcluster-client": { - "version": "14.2.2", - "resolved": "https://registry.npmjs.org/socketcluster-client/-/socketcluster-client-14.2.2.tgz", - "integrity": "sha512-vofmFcTaHaIf+MqAR0OZS7e30X4jxbDPJl+taCe8kLGJ5rVOrKeuU0sGyHyHyqW87AIR6jqc4KODl4WQJ4SsAA==", - "dev": true, + "version": "14.3.1", + "resolved": "https://registry.npmjs.org/socketcluster-client/-/socketcluster-client-14.3.1.tgz", + "integrity": "sha512-Sd/T0K/9UlqTfz+HUuFq90dshA5OBJPQbdkRzGtcKIOm52fkdsBTt0FYpiuzzxv5VrU7PWpRm6KIfNXyPwlLpw==", "requires": { "buffer": "^5.2.1", "clone": "2.1.1", @@ -10764,51 +7061,46 @@ "linked-list": "0.1.0", "querystring": "0.2.0", "sc-channel": "^1.2.0", - "sc-errors": "^1.4.1", + "sc-errors": "^2.0.1", "sc-formatter": "^3.0.1", "uuid": "3.2.1", - "ws": "5.1.1" + "ws": "7.1.0" }, "dependencies": { "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dev": true, + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", + "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==", "requires": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" } }, - "sc-errors": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sc-errors/-/sc-errors-1.4.1.tgz", - "integrity": "sha512-dBn92iIonpChTxYLgKkIT/PCApvmYT6EPIbRvbQKTgY6tbEbIy8XVUv4pGyKwEK4nCmvX4TKXcN0iXC6tNW6rQ==", - "dev": true + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" }, "uuid": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", - "dev": true + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" }, "ws": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.1.1.tgz", - "integrity": "sha512-bOusvpCb09TOBLbpMKszd45WKC2KPtxiyiHanv+H2DE3Az+1db5a/L7sVJZVDPUC1Br8f0SKRr1KjLpD1U/IAw==", - "dev": true, + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.1.0.tgz", + "integrity": "sha512-Swie2C4fs7CkwlHu1glMePLYJJsWjzhl1vm3ZaLplD0h7OMkZyZ6kLTB/OagiU923bZrPFXuDTeEqaEN4NWG4g==", "requires": { - "async-limiter": "~1.0.0" + "async-limiter": "^1.0.0" } } } }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -10829,9 +7121,9 @@ } }, "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -10852,6 +7144,12 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, + "sourcemap-codec": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz", + "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", + "dev": true + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -10879,9 +7177,9 @@ } }, "spdx-license-ids": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "split-string": { @@ -10916,15 +7214,6 @@ "tweetnacl": "~0.14.0" } }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, "stack-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", @@ -10958,45 +7247,6 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, "string-length": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", @@ -11005,52 +7255,45 @@ "requires": { "astral-regex": "^1.0.0", "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } } }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^3.0.0" } }, "strip-bom": { @@ -11086,15 +7329,15 @@ "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, "table": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.4.tgz", - "integrity": "sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { "ajv": "^6.10.2", @@ -11103,30 +7346,12 @@ "string-width": "^3.0.0" }, "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -11149,58 +7374,16 @@ } } }, - "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true - }, "terser": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.1.2.tgz", - "integrity": "sha512-jvNoEQSPXJdssFwqPSgWjsOrb+ELoE+ILpHPKXC83tIxOlh2U75F1KuB2luLD/3a6/7K3Vw5pDn+hvu0C4AzSw==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.3.4.tgz", + "integrity": "sha512-Kcrn3RiW8NtHBP0ssOAzwa2MsIRQ8lJWiBG/K7JgqPlomA3mtb2DEmp4/hrUA+Jujx+WZ02zqd7GYD+QRBB/2Q==", "dev": true, "requires": { "commander": "^2.20.0", "source-map": "~0.6.1", "source-map-support": "~0.5.12" }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - } - } - }, - "terser-webpack-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz", - "integrity": "sha512-W2YWmxPjjkUcOWa4pBEv4OP4er1aeQJlSo2UhtCFQCuRXEHjOFscO8VyWHj9JLlA0RzQb8Y2/Ta78XZvT54uGg==", - "dev": true, - "requires": { - "cacache": "^11.3.2", - "find-cache-dir": "^2.0.0", - "is-wsl": "^1.1.0", - "loader-utils": "^1.2.3", - "schema-utils": "^1.0.0", - "serialize-javascript": "^1.7.0", - "source-map": "^0.6.1", - "terser": "^4.0.0", - "webpack-sources": "^1.3.0", - "worker-farm": "^1.7.0" - }, "dependencies": { "source-map": { "version": "0.6.1", @@ -11222,18 +7405,105 @@ "require-main-filename": "^2.0.0" }, "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "locate-path": "^3.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" } } } @@ -11256,31 +7526,6 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "dev": true - }, - "timers-browserify": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", - "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -11296,12 +7541,6 @@ "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", "dev": true }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -11369,17 +7608,40 @@ "punycode": "^2.1.0" } }, - "traverse": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", - "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=", - "dev": true - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true + "ts-jest": { + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.1.0.tgz", + "integrity": "sha512-HEGfrIEAZKfu1pkaxB9au17b1d9b56YZSqz5eCVE8mX68+5reOvlM93xGOzzCREIov9mdH7JBG+s0UyNAqr0tQ==", + "dev": true, + "requires": { + "bs-logger": "0.x", + "buffer-from": "1.x", + "fast-json-stable-stringify": "2.x", + "json5": "2.x", + "lodash.memoize": "4.x", + "make-error": "1.x", + "mkdirp": "0.x", + "resolve": "1.x", + "semver": "^5.5", + "yargs-parser": "10.x" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } }, "tslib": { "version": "1.10.0", @@ -11387,11 +7649,23 @@ "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "ttypescript": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.7.tgz", + "integrity": "sha512-qloW8S60+xWVC2bQWldYQfESNFkIgDL5/M+vAOOsuLJ1pQu0SG2vQx5DNJO2nlwSrHxD8cDuF2sVDXg6v3GG3Q==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } }, "tunnel-agent": { "version": "0.6.0", @@ -11423,19 +7697,26 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + }, + "typescript": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz", + "integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==", "dev": true }, "uglify-js": { - "version": "3.5.15", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz", - "integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.1.tgz", + "integrity": "sha512-+dSJLJpXBb6oMHP+Yvw8hUgElz4gLTh82XuX68QiJVTXaE5ibl6buzhNkQdYhBlIhozWOC9ge16wyRmjG4TwVQ==", "dev": true, + "optional": true, "requires": { - "commander": "~2.20.0", + "commander": "2.20.0", "source-map": "~0.6.1" }, "dependencies": { @@ -11443,32 +7724,8 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "uglifyjs-webpack-plugin": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.1.3.tgz", - "integrity": "sha512-/lRkCaFbI6pT3CxsQHDhBcqB6tocOnqba0vJqJ2DzSWFLRgOIiip8q0nVFydyXk+n8UtF7ZuS6hvWopcYH5FuA==", - "dev": true, - "requires": { - "cacache": "^11.3.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^1.7.0", - "source-map": "^0.6.1", - "uglify-js": "^3.5.12", - "webpack-sources": "^1.3.0", - "worker-farm": "^1.7.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "dev": true, + "optional": true } } }, @@ -11512,33 +7769,6 @@ "set-value": "^2.0.1" } }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz", - "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "universal-user-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.1.0.tgz", - "integrity": "sha512-8itiX7G05Tu3mGDTdNY2fB4KJ8MgZLS54RdG6PkkfwMAavrXu1mV/lls/GABx9O3Rw4PnTtasxrvbMQoBYY92Q==", - "dev": true, - "requires": { - "os-name": "^3.0.0" - } - }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -11585,58 +7815,6 @@ } } }, - "unzipper": { - "version": "0.8.14", - "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.8.14.tgz", - "integrity": "sha512-8rFtE7EP5ssOwGpN2dt1Q4njl0N1hUXJ7sSPz0leU2hRdq6+pra57z4YPBlVqm40vcgv6ooKZEAx48fMTv9x4w==", - "dev": true, - "requires": { - "big-integer": "^1.6.17", - "binary": "~0.3.0", - "bluebird": "~3.4.1", - "buffer-indexof-polyfill": "~1.0.0", - "duplexer2": "~0.1.4", - "fstream": "~1.0.10", - "listenercount": "~1.0.1", - "readable-stream": "~2.1.5", - "setimmediate": "~1.0.4" - }, - "dependencies": { - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "readable-stream": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", - "integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=", - "dev": true, - "requires": { - "buffer-shims": "^1.0.0", - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", - "dev": true - }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -11652,76 +7830,22 @@ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, "url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", "dev": true, "requires": { - "querystringify": "^2.0.0", + "querystringify": "^2.1.1", "requires-port": "^1.0.0" } }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "dev": true, - "requires": { - "prepend-http": "^1.0.1" - } - }, - "url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=", - "dev": true - }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", - "dev": true - }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, "util.promisify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", @@ -11733,9 +7857,9 @@ } }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "dev": true }, "validate-npm-package-license": { @@ -11759,12 +7883,6 @@ "extsprintf": "^1.2.0" } }, - "vm-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", - "dev": true - }, "w3c-hr-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", @@ -11783,90 +7901,12 @@ "makeerror": "1.0.x" } }, - "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", - "dev": true, - "requires": { - "chokidar": "^2.0.2", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" - } - }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, - "webpack": { - "version": "4.36.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.36.1.tgz", - "integrity": "sha512-Ej01/N9W8DVyhEpeQnbUdGvOECw0L46FxS12cCOs8gSK7bhUlrbHRnWkjiXckGlHjUrmL89kDpTRIkUk6Y+fKg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/wasm-edit": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "acorn": "^6.2.0", - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0", - "chrome-trace-event": "^1.0.0", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.0", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.3.0", - "loader-utils": "^1.1.0", - "memory-fs": "~0.4.1", - "micromatch": "^3.1.8", - "mkdirp": "~0.5.0", - "neo-async": "^2.5.0", - "node-libs-browser": "^2.0.0", - "schema-utils": "^1.0.0", - "tapable": "^1.1.0", - "terser-webpack-plugin": "^1.1.0", - "watchpack": "^1.5.0", - "webpack-sources": "^1.3.0" - }, - "dependencies": { - "acorn": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz", - "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==", - "dev": true - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - } - } - }, - "webpack-sources": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", - "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -11874,23 +7914,12 @@ "dev": true, "requires": { "iconv-lite": "0.4.24" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } } }, "whatwg-fetch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" }, "whatwg-mimetype": { "version": "2.3.0", @@ -11924,44 +7953,49 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", - "dev": true - }, - "windows-release": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", - "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", - "dev": true, - "requires": { - "execa": "^1.0.0" - } - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "requires": { - "errno": "~0.1.7" - } - }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "wrappy": { @@ -11980,23 +8014,23 @@ } }, "write-file-atomic": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz", + "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==", "dev": true, "requires": { "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "slide": "^1.1.5" + "signal-exit": "^3.0.2" } }, "ws": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.1.1.tgz", - "integrity": "sha512-o41D/WmDeca0BqYhsr3nJzQyg9NF5X8l/UdnFNux9cS3lwB+swm8qGWX5rn+aD6xfBU3rGmtHij7g7x6LxFU3A==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", "dev": true, "requires": { - "async-limiter": "^1.0.0" + "async-limiter": "~1.0.0" } }, "xml": { @@ -12011,48 +8045,34 @@ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "find-up": { @@ -12064,12 +8084,6 @@ "locate-path": "^3.0.0" } }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -12081,9 +8095,9 @@ } }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -12104,37 +8118,32 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" } } } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", diff --git a/package.json b/package.json index a75239ed5..3a73fe628 100644 --- a/package.json +++ b/package.json @@ -8,99 +8,86 @@ "bugs": { "url": "https://github.com/mattermost/mattermost-redux/issues" }, + "scripts": { + "start": "ttsc --watch", + "build": "cross-env NODE_ENV=production ttsc && cross-env NODE_ENV=production rollup -c", + "check": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet 'src/**/*.ts'", + "fix": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet 'src/**/*.ts' --fix", + "tsc": "ttsc --noEmit", + "tsc:watch": "ttsc --noEmit --watch", + "test": "jest --forceExit --detectOpenHandles --maxWorkers=2", + "test:watch": "jest --watch", + "test:coverage": "jest --coverage", + "prepare": "npm run build", + "dev": "ttsc --outDir ${WEBAPP_DIR:-../mattermost-webapp}/node_modules/mattermost-redux", + "dev-mobile": "ttsc --outDir ${MOBILE_DIR:-../mattermost-mobile}/node_modules/mattermost-redux", + "dev:watch": "ttsc --watch --outDir ${WEBAPP_DIR:-../mattermost-webapp}/node_modules/mattermost-redux", + "dev-mobile:watch": "ttsc --watch --outDir ${MOBILE_DIR:-../mattermost-mobile}/node_modules/mattermost-redux" + }, "dependencies": { - "deep-equal": "1.0.1", - "eslint-plugin-header": "3.0.0", - "form-data": "2.5.0", "gfycat-sdk": "1.4.18", - "harmony-reflect": "1.6.1", - "isomorphic-fetch": "2.2.1", - "mime-db": "1.40.0", "moment-timezone": "0.5.26", + "isomorphic-fetch": "2.2.1", "redux": "4.0.4", "redux-action-buffer": "1.2.0", - "redux-batched-actions": "0.4.1", "redux-offline": "git+https://github.com/enahum/redux-offline.git#885024de96b6ec73650c340c8928066585c413df", "redux-persist": "4.9.1", + "redux-persist-node-storage": "2.0.0", "redux-thunk": "2.3.0", + "remote-redux-devtools": "0.5.16", "reselect": "4.0.0", "serialize-error": "2.1.0", "shallow-equals": "1.0.0" }, + "husky": { + "hooks": { + "pre-commit": "npm run check && npm run tsc" + } + }, + "jest-junit": { + "output": "build/test-results.xml" + }, "devDependencies": { - "@babel/cli": "7.5.5", - "@babel/core": "7.5.5", + "@babel/core": "7.6.0", "@babel/plugin-proposal-class-properties": "7.5.5", + "@babel/plugin-proposal-object-rest-spread": "7.6.2", "@babel/plugin-proposal-optional-chaining": "7.2.0", - "@babel/plugin-transform-flow-comments": "7.5.5", - "@babel/polyfill": "7.4.4", - "@babel/preset-env": "7.5.5", - "@babel/register": "7.5.5", - "babel-eslint": "10.0.2", - "babel-jest": "24.8.0", - "babel-loader": "8.0.6", + "@babel/plugin-transform-runtime": "7.6.0", + "@babel/preset-env": "7.6.0", + "@babel/preset-typescript": "7.6.0", + "@babel/runtime": "7.6.0", + "@typescript-eslint/eslint-plugin": "2.3.1", + "@typescript-eslint/parser": "2.3.1", + "@types/jest": "24.0.18", + "@types/moment-timezone": "0.5.12", + "@types/node": "12.7.11", + "@zerollup/ts-transform-paths": "1.7.3", + "babel-eslint": "10.0.3", "babel-plugin-module-resolver": "3.2.0", "core-js": "3.1.4", - "chai": "4.2.0", - "deep-freeze": "0.0.1", + "cross-env": "6.0.3", "eslint": "6.0.1", "eslint-config-mattermost": "github:mattermost/eslint-config-mattermost#6fe27a2bd1f9df4d4eb96fac6fcdcc0fee0ecbd7", - "eslint-plugin-flowtype": "3.12.1", - "eslint-plugin-jest": "22.11.1", - "expect": "24.8.0", - "fetch-mock": "7.3.7", - "flow-bin": "0.95.1", - "flow-typed": "2.5.1", + "eslint-plugin-cypress": "2.7.0", + "eslint-plugin-header": "3.0.0", + "eslint-plugin-import": "2.18.2", + "form-data": "2.5.1", + "husky": "3.0.5", "jest": "24.8.0", - "jest-cli": "24.8.0", "jest-junit": "6.4.0", "mock-socket": "8.0.5", - "nock": "10.0.6", - "react": "16.8.6", + "nock": "^11.3.5", "redux-mock-store": "1.5.3", - "redux-persist-node-storage": "2.0.0", - "remote-redux-devtools": "0.5.16", - "uglifyjs-webpack-plugin": "2.1.3", - "webpack": "4.36.1", - "ws": "7.1.1" - }, - "scripts": { - "build": "babel src --out-dir . --ignore '**/*.test.js'", - "webpack": "webpack", - "dev": "babel src --out-dir ${WEBAPP_DIR:-../mattermost-webapp}/node_modules/mattermost-redux --source-maps", - "dev-mobile": "babel src --out-dir ${MOBILE_DIR:-../mattermost-mobile}/node_modules/mattermost-redux --source-maps", - "dev:watch": "babel --watch src --out-dir ${WEBAPP_DIR:-../mattermost-webapp}/node_modules/mattermost-redux --source-maps", - "dev-mobile:watch": "babel --watch src --out-dir ${MOBILE_DIR:-../mattermost-mobile}/node_modules/mattermost-redux --source-maps", - "check": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet .", - "fix": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet . --fix", - "flow": "flow", - "flow-typed": "flow-typed", - "test": "jest --forceExit --detectOpenHandles --maxWorkers=2", - "test:watch": "jest --watch", - "test:coverage": "jest --coverage", - "prepare": "npm run build" - }, - "jest": { - "clearMocks": true, - "collectCoverageFrom": [ - "src/**/*.{js}" - ], - "coverageReporters": [ - "lcov", - "text-summary" - ], - "reporters": [ - "default", - "jest-junit" - ], - "setupFilesAfterEnv": [ - "/test/setup.js" - ], - "testPathIgnorePatterns": [ - "/node_modules/" - ] - }, - "jest-junit": { - "output": "build/test-results.xml" + "rollup": "1.22.0", + "rollup-plugin-babel": "4.3.3", + "rollup-plugin-commonjs": "10.1.0", + "rollup-plugin-node-resolve": "5.2.0", + "rollup-plugin-terser": "5.1.2", + "rollup-plugin-typescript2": "0.24.3", + "ts-jest": "24.1.0", + "tslib": "1.10.0", + "ttypescript": "1.5.7", + "source-map-support": "0.5.12", + "typescript": "3.6.3" } -} +} \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 000000000..80095038a --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,47 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import resolve from 'rollup-plugin-node-resolve'; + +import {terser} from 'rollup-plugin-terser'; +import commonjs from 'rollup-plugin-commonjs'; +import typescript from 'rollup-plugin-typescript2'; + +// eslint-disable-next-line no-process-env +const production = process.env.NODE_ENV === 'production'; + +const inputs = ['client4', 'websocket_client']; +// eslint-disable-next-line no-process-env +const buildFolder = process.env.OUTPUT_FOLDER || '.'; + +module.exports = inputs.map((input) => ({ + input: `./src/client/${input}.ts`, + treeshake: Boolean(production), + output: [ + { + format: 'cjs', + file: `${buildFolder}/mattermost.${input}.js`, + sourcemap: true, + exports: 'named', + }], + plugins: [ + resolve(), + commonjs({ + include: ['node_modules/**'], + + }), + typescript({ + tsconfigOverride: { + compilerOptions: {module: 'esnext'}, + }, + // eslint-disable-next-line global-require + typescript: require('ttypescript'), + rollupCommonJSResolveHack: true, + exclude: '**/__tests__/**', + clean: true, + }), + + // only minify if in production + production && terser(), + ], +})); diff --git a/src/action_types/admin.js b/src/action_types/admin.ts similarity index 99% rename from src/action_types/admin.js rename to src/action_types/admin.ts index b93a88b0f..0d95b9d1d 100644 --- a/src/action_types/admin.js +++ b/src/action_types/admin.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/alerts.js b/src/action_types/alerts.ts similarity index 96% rename from src/action_types/alerts.js rename to src/action_types/alerts.ts index 408720835..18bedbe63 100644 --- a/src/action_types/alerts.js +++ b/src/action_types/alerts.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import keyMirror from 'utils/key_mirror'; diff --git a/src/action_types/bots.js b/src/action_types/bots.ts similarity index 100% rename from src/action_types/bots.js rename to src/action_types/bots.ts diff --git a/src/action_types/channels.js b/src/action_types/channels.ts similarity index 99% rename from src/action_types/channels.js rename to src/action_types/channels.ts index 4397869b9..9840f84f9 100644 --- a/src/action_types/channels.js +++ b/src/action_types/channels.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/emojis.js b/src/action_types/emojis.ts similarity index 97% rename from src/action_types/emojis.js rename to src/action_types/emojis.ts index 29ef25265..a68a366c7 100644 --- a/src/action_types/emojis.js +++ b/src/action_types/emojis.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/errors.js b/src/action_types/errors.ts similarity index 96% rename from src/action_types/errors.js rename to src/action_types/errors.ts index 3e6e182da..0f197e10e 100644 --- a/src/action_types/errors.js +++ b/src/action_types/errors.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/files.js b/src/action_types/files.ts similarity index 97% rename from src/action_types/files.js rename to src/action_types/files.ts index a678e2696..01b11efb6 100644 --- a/src/action_types/files.js +++ b/src/action_types/files.ts @@ -1,9 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; - export default keyMirror({ UPLOAD_FILES_REQUEST: null, diff --git a/src/action_types/general.js b/src/action_types/general.ts similarity index 99% rename from src/action_types/general.js rename to src/action_types/general.ts index fb1c947bd..7f10ee0aa 100644 --- a/src/action_types/general.js +++ b/src/action_types/general.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import keyMirror from 'utils/key_mirror'; diff --git a/src/action_types/gifs.js b/src/action_types/gifs.ts similarity index 100% rename from src/action_types/gifs.js rename to src/action_types/gifs.ts diff --git a/src/action_types/groups.js b/src/action_types/groups.ts similarity index 99% rename from src/action_types/groups.js rename to src/action_types/groups.ts index 0ad89c587..36654a237 100644 --- a/src/action_types/groups.js +++ b/src/action_types/groups.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/index.js b/src/action_types/index.ts similarity index 99% rename from src/action_types/index.js rename to src/action_types/index.ts index 38ed4586f..696e284c7 100644 --- a/src/action_types/index.js +++ b/src/action_types/index.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import ChannelTypes from './channels'; import ErrorTypes from './errors'; import GeneralTypes from './general'; diff --git a/src/action_types/integrations.js b/src/action_types/integrations.ts similarity index 99% rename from src/action_types/integrations.js rename to src/action_types/integrations.ts index 41132cf16..0789e590e 100644 --- a/src/action_types/integrations.js +++ b/src/action_types/integrations.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/jobs.js b/src/action_types/jobs.ts similarity index 98% rename from src/action_types/jobs.js rename to src/action_types/jobs.ts index 568485216..ea3109634 100644 --- a/src/action_types/jobs.js +++ b/src/action_types/jobs.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/plugins.js b/src/action_types/plugins.ts similarity index 84% rename from src/action_types/plugins.js rename to src/action_types/plugins.ts index 16919f559..dcea7e7e8 100644 --- a/src/action_types/plugins.js +++ b/src/action_types/plugins.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import keyMirror from 'utils/key_mirror'; export default keyMirror({ RECEIVED_MARKETPLACE_PLUGINS: null, + GET_MARKETPLACE_PLUGINS_FAILURE: null, }); diff --git a/src/action_types/posts.js b/src/action_types/posts.ts similarity index 98% rename from src/action_types/posts.js rename to src/action_types/posts.ts index e049556ca..81d98edcd 100644 --- a/src/action_types/posts.js +++ b/src/action_types/posts.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import keyMirror from 'utils/key_mirror'; @@ -19,6 +18,7 @@ export default keyMirror({ GET_POST_THREAD_FAILURE: null, GET_POSTS_SUCCESS: null, + GET_POSTS_FAILURE: null, GET_POSTS_SINCE_SUCCESS: null, GET_POST_THREAD_WITH_RETRY_ATTEMPT: null, diff --git a/src/action_types/preferences.js b/src/action_types/preferences.ts similarity index 98% rename from src/action_types/preferences.js rename to src/action_types/preferences.ts index ddf70fc9a..b80e760c7 100644 --- a/src/action_types/preferences.js +++ b/src/action_types/preferences.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/roles.js b/src/action_types/roles.ts similarity index 98% rename from src/action_types/roles.js rename to src/action_types/roles.ts index 3163b495f..d5fa563a0 100644 --- a/src/action_types/roles.js +++ b/src/action_types/roles.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/schemes.js b/src/action_types/schemes.ts similarity index 99% rename from src/action_types/schemes.js rename to src/action_types/schemes.ts index 9568cdbc3..d1cb5b8fc 100644 --- a/src/action_types/schemes.js +++ b/src/action_types/schemes.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/search.js b/src/action_types/search.ts similarity index 98% rename from src/action_types/search.js rename to src/action_types/search.ts index 8e7f24cbb..2963a40bd 100644 --- a/src/action_types/search.js +++ b/src/action_types/search.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import keyMirror from 'utils/key_mirror'; export default keyMirror({ diff --git a/src/action_types/teams.js b/src/action_types/teams.ts similarity index 99% rename from src/action_types/teams.js rename to src/action_types/teams.ts index b7ab38823..59ac902d5 100644 --- a/src/action_types/teams.js +++ b/src/action_types/teams.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import keyMirror from 'utils/key_mirror'; diff --git a/src/action_types/users.js b/src/action_types/users.ts similarity index 99% rename from src/action_types/users.js rename to src/action_types/users.ts index 7666237a9..7314ab82a 100644 --- a/src/action_types/users.js +++ b/src/action_types/users.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import keyMirror from 'utils/key_mirror'; diff --git a/src/actions/admin.test.js b/src/actions/admin.test.js index dcba9e944..84b50d50a 100644 --- a/src/actions/admin.test.js +++ b/src/actions/admin.test.js @@ -8,7 +8,7 @@ import nock from 'nock'; import * as Actions from 'actions/admin'; import {Client4} from 'client'; -import {RequestStatus, Stats} from 'constants'; +import {RequestStatus, Stats} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/admin.js b/src/actions/admin.ts similarity index 89% rename from src/actions/admin.js rename to src/actions/admin.ts index 51c34f042..1ed44731c 100644 --- a/src/actions/admin.js +++ b/src/actions/admin.ts @@ -1,21 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {AdminTypes} from 'action_types'; -import {General} from 'constants'; - +import {General} from '../constants'; import {Client4} from 'client'; -import {logError} from './errors'; -import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; -import {batchActions} from 'redux-batched-actions'; - -import type {ActionFunc} from 'types/actions'; -import type {Job} from 'types/jobs'; -import type {GroupSearchOpts} from 'types/groups'; +import {Action, ActionFunc, batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; +import {Job} from 'types/jobs'; +import {GroupSearchOpts} from 'types/groups'; -export function getLogs(page: number = 0, perPage: number = General.LOGS_PAGE_SIZE_DEFAULT): ActionFunc { +import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; +import {logError} from './errors'; +export function getLogs(page = 0, perPage: number = General.LOGS_PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getLogs, onRequest: AdminTypes.GET_LOGS_REQUEST, @@ -28,7 +23,7 @@ export function getLogs(page: number = 0, perPage: number = General.LOGS_PAGE_SI }); } -export function getAudits(page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getAudits(page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getAudits, onRequest: AdminTypes.GET_AUDITS_REQUEST, @@ -50,7 +45,7 @@ export function getConfig(): ActionFunc { }); } -export function updateConfig(config: Object): ActionFunc { +export function updateConfig(config: Record): ActionFunc { return bindClientFunc({ clientFunc: Client4.updateConfig, onRequest: AdminTypes.UPDATE_CONFIG_REQUEST, @@ -80,7 +75,7 @@ export function getEnvironmentConfig(): ActionFunc { }); } -export function testEmail(config: Object): ActionFunc { +export function testEmail(config: any): ActionFunc { return bindClientFunc({ clientFunc: Client4.testEmail, onRequest: AdminTypes.TEST_EMAIL_REQUEST, @@ -92,7 +87,7 @@ export function testEmail(config: Object): ActionFunc { }); } -export function testSiteURL(siteURL: String): ActionFunc { +export function testSiteURL(siteURL: string): ActionFunc { return bindClientFunc({ clientFunc: Client4.testSiteURL, onRequest: AdminTypes.TEST_SITE_URL_REQUEST, @@ -104,7 +99,7 @@ export function testSiteURL(siteURL: String): ActionFunc { }); } -export function testS3Connection(config: Object): ActionFunc { +export function testS3Connection(config: any): ActionFunc { return bindClientFunc({ clientFunc: Client4.testS3Connection, onRequest: AdminTypes.TEST_S3_REQUEST, @@ -158,7 +153,7 @@ export function getComplianceReport(reportId: string): ActionFunc { }); } -export function getComplianceReports(page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getComplianceReports(page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getComplianceReports, onRequest: AdminTypes.GET_COMPLIANCE_REQUEST, @@ -219,7 +214,7 @@ export function syncLdap(): ActionFunc { }); } -export function getLdapGroups(page: number = 0, perPage: number = General.PAGE_SIZE_MAXIMUM, opts: GroupSearchOpts = {q: ''}): ActionFunc { +export function getLdapGroups(page = 0, perPage: number = General.PAGE_SIZE_MAXIMUM, opts: GroupSearchOpts = {q: ''}): ActionFunc { return bindClientFunc({ clientFunc: Client4.getLdapGroups, onRequest: AdminTypes.GET_LDAP_GROUPS_REQUEST, @@ -234,7 +229,7 @@ export function getLdapGroups(page: number = 0, perPage: number = General.PAGE_S } export function linkLdapGroup(key: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AdminTypes.LINK_LDAP_GROUP_REQUEST, data: key}); let data; @@ -267,7 +262,7 @@ export function linkLdapGroup(key: string): ActionFunc { } export function unlinkLdapGroup(key: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AdminTypes.UNLINK_LDAP_GROUP_REQUEST, data: key}); try { @@ -362,7 +357,7 @@ export function removeIdpSamlCertificate(): ActionFunc { }); } -export function testElasticsearch(config: Object): ActionFunc { +export function testElasticsearch(config: any): ActionFunc { return bindClientFunc({ clientFunc: Client4.testElasticsearch, onRequest: AdminTypes.TEST_ELASTICSEARCH_REQUEST, @@ -404,8 +399,8 @@ export function removeLicense(): ActionFunc { }); } -export function getAnalytics(name: string, teamId: string = ''): ActionFunc { - return async (dispatch, getState) => { +export function getAnalytics(name: string, teamId = ''): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AdminTypes.GET_ANALYTICS_REQUEST, data: null}, getState); let data; @@ -420,7 +415,7 @@ export function getAnalytics(name: string, teamId: string = ''): ActionFunc { return {error}; } - const actions = [{type: AdminTypes.GET_ANALYTICS_SUCCESS, data: null}]; + const actions: Action[] = [{type: AdminTypes.GET_ANALYTICS_SUCCESS, data: null}]; if (teamId === '') { actions.push({type: AdminTypes.RECEIVED_SYSTEM_ANALYTICS, data, name}); } else { @@ -433,28 +428,28 @@ export function getAnalytics(name: string, teamId: string = ''): ActionFunc { }; } -export function getStandardAnalytics(teamId: string = ''): ActionFunc { +export function getStandardAnalytics(teamId = ''): ActionFunc { return getAnalytics('standard', teamId); } -export function getAdvancedAnalytics(teamId: string = ''): ActionFunc { +export function getAdvancedAnalytics(teamId = ''): ActionFunc { return getAnalytics('extra_counts', teamId); } -export function getPostsPerDayAnalytics(teamId: string = ''): ActionFunc { +export function getPostsPerDayAnalytics(teamId = ''): ActionFunc { return getAnalytics('post_counts_day', teamId); } -export function getBotPostsPerDayAnalytics(teamId: string = ''): ActionFunc { +export function getBotPostsPerDayAnalytics(teamId = ''): ActionFunc { return getAnalytics('bot_post_counts_day', teamId); } -export function getUsersPerDayAnalytics(teamId: string = ''): ActionFunc { +export function getUsersPerDayAnalytics(teamId = ''): ActionFunc { return getAnalytics('user_counts_with_posts_day', teamId); } -export function uploadPlugin(fileData: File, force: boolean = false): ActionFunc { - return async (dispatch, getState) => { +export function uploadPlugin(fileData: File, force = false): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AdminTypes.UPLOAD_PLUGIN_REQUEST, data: null}); let data; @@ -477,7 +472,7 @@ export function uploadPlugin(fileData: File, force: boolean = false): ActionFunc }; } -export function installPluginFromUrl(url: string, force: boolean = false): ActionFunc { +export function installPluginFromUrl(url: string, force = false): ActionFunc { return async (dispatch, getState) => { dispatch({type: AdminTypes.INSTALL_PLUGIN_FROM_URL_REQUEST, data: null}); @@ -518,7 +513,7 @@ export function getPluginStatuses(): ActionFunc { } export function removePlugin(pluginId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AdminTypes.REMOVE_PLUGIN_REQUEST, data: pluginId}); try { @@ -540,8 +535,9 @@ export function removePlugin(pluginId: string): ActionFunc { return {data: true}; }; } + export function enablePlugin(pluginId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AdminTypes.ENABLE_PLUGIN_REQUEST, data: pluginId}); try { @@ -565,7 +561,7 @@ export function enablePlugin(pluginId: string): ActionFunc { } export function disablePlugin(pluginId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AdminTypes.DISABLE_PLUGIN_REQUEST, data: pluginId}); try { diff --git a/src/actions/alerts.test.js b/src/actions/alerts.test.js index cc7df6af4..b0496c66d 100644 --- a/src/actions/alerts.test.js +++ b/src/actions/alerts.test.js @@ -4,7 +4,7 @@ import assert from 'assert'; import * as Actions from 'actions/alerts'; -import {Alerts} from 'constants'; +import {Alerts} from '../constants'; import configureStore from 'test/test_store'; describe('Actions.Alerts', () => { diff --git a/src/actions/alerts.js b/src/actions/alerts.ts similarity index 74% rename from src/actions/alerts.js rename to src/actions/alerts.ts index d51d4f449..12fd8ea96 100644 --- a/src/actions/alerts.js +++ b/src/actions/alerts.ts @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import {AlertTypes} from 'action_types'; -import {Alerts} from 'constants'; +import {Alerts} from '../constants'; -import type {ActionFunc} from 'types/actions'; -import type {AlertType} from 'types/alerts'; +import {ActionFunc, DispatchFunc, GetStateFunc} from 'types/actions'; +import {AlertType} from 'types/alerts'; export function pushNotificationAlert(message: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const notificationAlert: AlertType = { type: Alerts.ALERT_NOTIFICATION, message, @@ -22,7 +21,7 @@ export function pushNotificationAlert(message: string): ActionFunc { } export function pushDeveloperAlert(message: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const developerAlert: AlertType = { type: Alerts.ALERT_DEVELOPER, message, @@ -35,7 +34,7 @@ export function pushDeveloperAlert(message: string): ActionFunc { } export function pushErrorAlert(message: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const errorAlert: AlertType = { type: Alerts.ALERT_ERROR, message, @@ -48,7 +47,7 @@ export function pushErrorAlert(message: string): ActionFunc { } export function clearLatestAlert(): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: AlertTypes.CLEAR_ALERT, data: null}, getState); return {data: true}; diff --git a/src/actions/bots.js b/src/actions/bots.ts similarity index 100% rename from src/actions/bots.js rename to src/actions/bots.ts diff --git a/src/actions/channels.test.js b/src/actions/channels.test.js index 6372b9c0c..506d687f7 100644 --- a/src/actions/channels.test.js +++ b/src/actions/channels.test.js @@ -9,7 +9,7 @@ import {addUserToTeam} from 'actions/teams'; import {getProfilesByIds, login} from 'actions/users'; import {createIncomingHook, createOutgoingHook} from 'actions/integrations'; import {Client4} from 'client'; -import {General, RequestStatus, Preferences} from 'constants'; +import {General, RequestStatus, Preferences} from '../constants'; import {getPreferenceKey} from 'utils/preference_utils'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/channels.js b/src/actions/channels.ts similarity index 90% rename from src/actions/channels.js rename to src/actions/channels.ts index 03ffa2828..f956a2537 100644 --- a/src/actions/channels.js +++ b/src/actions/channels.ts @@ -1,26 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {batchActions} from 'redux-batched-actions'; - import {Client4} from 'client'; -import {General, Preferences} from 'constants'; +import {General, Preferences} from '../constants'; import {ChannelTypes, PreferenceTypes, UserTypes} from 'action_types'; -import {savePreferences, deletePreferences} from 'actions/preferences'; +import {savePreferences, deletePreferences} from './preferences'; import {getChannelsIdForTeam, getChannelByName} from 'utils/channel_utils'; import {getChannelsNameMapInTeam, getMyChannelMember as getMyChannelMemberSelector, getRedirectChannelNameForTeam} from 'selectors/entities/channels'; import {getCurrentTeamId} from 'selectors/entities/teams'; +import {Action, ActionFunc, batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; + +import {Channel, ChannelNotifyProps, ChannelMembership} from 'types/channels'; + +import {PreferenceType} from 'types/preferences'; + import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; import {getMissingProfilesByIds} from './users'; import {loadRolesIfNeeded} from './roles'; - -import type {ActionFunc, DispatchFunc, GetStateFunc} from 'types/actions'; -import type {Channel, ChannelNotifyProps, ChannelMembership} from 'types/channels'; -import type {PreferenceType} from 'types/preferences'; - +import {UserProfile} from 'types/users'; export function selectChannel(channelId: string) { return { type: ChannelTypes.SELECT_CHANNEL, @@ -29,7 +27,7 @@ export function selectChannel(channelId: string) { } export function createChannel(channel: Channel, userId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let created; try { created = await Client4.createChannel(channel); @@ -56,7 +54,7 @@ export function createChannel(channel: Channel, userId: string): ActionFunc { last_update_at: created.create_at, }; - const actions = []; + const actions: Action[] = []; const {channels, myMembers} = getState().entities.channels; if (!channels[created.id]) { @@ -80,7 +78,7 @@ export function createChannel(channel: Channel, userId: string): ActionFunc { } export function createDirectChannel(userId: string, otherUserId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.CREATE_CHANNEL_REQUEST, data: null}, getState); let created; @@ -155,7 +153,7 @@ export function markGroupChannelOpen(channelId: string): ActionFunc { } export function createGroupChannel(userIds: Array): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.CREATE_CHANNEL_REQUEST, data: null}, getState); const {currentUserId} = getState().entities.users; @@ -172,7 +170,7 @@ export function createGroupChannel(userIds: Array): ActionFunc { return {error}; } - let member = { + let member: Partial = { channel_id: created.id, user_id: currentUserId, roles: `${General.CHANNEL_USER_ROLE}`, @@ -201,9 +199,7 @@ export function createGroupChannel(userIds: Array): ActionFunc { dispatch(markGroupChannelOpen(created.id)); - const profilesInChannel = userIds.map((id) => { - return {id}; - }); + const profilesInChannel = userIds.map((id) => ({id})); profilesInChannel.push({id: currentUserId}); // currentUserId is optionally in userIds, but the reducer will get rid of a duplicate dispatch(batchActions([ @@ -224,14 +220,14 @@ export function createGroupChannel(userIds: Array): ActionFunc { data: profilesInChannel, }, ]), getState); - dispatch(loadRolesIfNeeded((member && member.roles.split(' ')) || [])); + dispatch(loadRolesIfNeeded((member && member.roles && member.roles.split(' ')) || [])); return {data: created}; }; } export function patchChannel(channelId: string, patch: Channel): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.UPDATE_CHANNEL_REQUEST, data: null}, getState); let updated; @@ -262,7 +258,7 @@ export function patchChannel(channelId: string, patch: Channel): ActionFunc { } export function updateChannel(channel: Channel): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.UPDATE_CHANNEL_REQUEST, data: null}, getState); let updated; @@ -293,7 +289,7 @@ export function updateChannel(channel: Channel): ActionFunc { } export function updateChannelPrivacy(channelId: string, privacy: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.UPDATE_CHANNEL_REQUEST, data: null}, getState); let updatedChannel; @@ -324,7 +320,7 @@ export function updateChannelPrivacy(channelId: string, privacy: string): Action } export function convertChannelToPrivate(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.UPDATE_CHANNEL_REQUEST, data: null}, getState); let convertedChannel; @@ -355,7 +351,7 @@ export function convertChannelToPrivate(channelId: string): ActionFunc { } export function updateChannelNotifyProps(userId: string, channelId: string, props: ChannelNotifyProps): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const notifyProps = { user_id: userId, channel_id: channelId, @@ -386,8 +382,8 @@ export function updateChannelNotifyProps(userId: string, channelId: string, prop }; } -export function getChannelByNameAndTeamName(teamName: string, channelName: string, includeDeleted: boolean = false): ActionFunc { - return async (dispatch, getState) => { +export function getChannelByNameAndTeamName(teamName: string, channelName: string, includeDeleted = false): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; try { data = await Client4.getChannelByNameAndTeamName(teamName, channelName, includeDeleted); @@ -410,7 +406,7 @@ export function getChannelByNameAndTeamName(teamName: string, channelName: strin } export function getChannel(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; try { data = await Client4.getChannel(channelId); @@ -433,7 +429,7 @@ export function getChannel(channelId: string): ActionFunc { } export function getChannelAndMyMember(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let channel; let member; try { @@ -468,7 +464,7 @@ export function getChannelAndMyMember(channelId: string): ActionFunc { } export function getChannelTimezones(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let channelTimezones; try { const channelTimezonesRequest = Client4.getChannelTimezones(channelId); @@ -485,7 +481,7 @@ export function getChannelTimezones(channelId: string): ActionFunc { } export function fetchMyChannelsAndMembers(teamId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({ type: ChannelTypes.CHANNELS_REQUEST, data: null, @@ -525,7 +521,7 @@ export function fetchMyChannelsAndMembers(teamId: string): ActionFunc { currentUserId, }, ]), getState); - const roles = new Set(); + const roles = new Set(); for (const member of channelMembers) { for (const role of member.roles.split(' ')) { roles.add(role); @@ -540,7 +536,7 @@ export function fetchMyChannelsAndMembers(teamId: string): ActionFunc { } export function getMyChannelMembers(teamId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let channelMembers; try { const channelMembersRequest = Client4.getMyChannelMembers(teamId); @@ -560,8 +556,8 @@ export function getMyChannelMembers(teamId: string): ActionFunc { remove: getChannelsIdForTeam(getState(), teamId), currentUserId, }); + const roles = new Set(); - const roles = new Set(); for (const member of channelMembers) { for (const role of member.roles.split(' ')) { roles.add(role); @@ -575,9 +571,10 @@ export function getMyChannelMembers(teamId: string): ActionFunc { }; } -export function getChannelMembers(channelId: string, page: number = 0, perPage: number = General.CHANNELS_CHUNK_SIZE): ActionFunc { - return async (dispatch, getState) => { +export function getChannelMembers(channelId: string, page = 0, perPage: number = General.CHANNELS_CHUNK_SIZE): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let channelMembers; + try { const channelMembersRequest = Client4.getChannelMembers(channelId, page, perPage); @@ -601,7 +598,7 @@ export function getChannelMembers(channelId: string, page: number = 0, perPage: } export function leaveChannel(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const {currentUserId} = state.entities.users; const {channels, myMembers} = state.entities.channels; @@ -643,8 +640,8 @@ export function leaveChannel(channelId: string): ActionFunc { } export function joinChannel(userId: string, teamId: string, channelId: string, channelName: string): ActionFunc { - return async (dispatch, getState) => { - let member: ?ChannelMembership; + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { + let member: ChannelMembership | undefined | null; let channel; try { if (channelId) { @@ -685,7 +682,7 @@ export function joinChannel(userId: string, teamId: string, channelId: string, c } export function deleteChannel(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let state = getState(); const viewArchivedChannels = state.entities.general.config.ExperimentalViewArchivedChannels === 'true'; @@ -714,13 +711,13 @@ export function deleteChannel(channelId: string): ActionFunc { }; } -export function viewChannel(channelId: string, prevChannelId: string = ''): ActionFunc { - return async (dispatch, getState) => { +export function viewChannel(channelId: string, prevChannelId = ''): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; const {myPreferences} = getState().entities.preferences; const viewTimePref = myPreferences[`${Preferences.CATEGORY_CHANNEL_APPROXIMATE_VIEW_TIME}--${channelId}`]; - const viewTime = viewTimePref ? parseInt(viewTimePref.value, 10) : 0; + const viewTime = viewTimePref ? parseInt(viewTimePref.value!, 10) : 0; if (viewTime < new Date().getTime() - (3 * 60 * 60 * 1000)) { const preferences = [ {user_id: currentUserId, category: Preferences.CATEGORY_CHANNEL_APPROXIMATE_VIEW_TIME, name: channelId, value: new Date().getTime().toString()}, @@ -737,7 +734,7 @@ export function viewChannel(channelId: string, prevChannelId: string = ''): Acti return {error}; } - const actions = []; + const actions: Action[] = []; const {myMembers} = getState().entities.channels; const member = myMembers[channelId]; @@ -764,9 +761,9 @@ export function viewChannel(channelId: string, prevChannelId: string = ''): Acti }; } -export function markChannelAsViewed(channelId: string, prevChannelId: string = ''): ActionFunc { - return async (dispatch, getState) => { - const actions = []; +export function markChannelAsViewed(channelId: string, prevChannelId = ''): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { + const actions: Action[] = []; const {myMembers} = getState().entities.channels; const member = myMembers[channelId]; @@ -795,8 +792,8 @@ export function markChannelAsViewed(channelId: string, prevChannelId: string = ' }; } -export function getChannels(teamId: string, page: number = 0, perPage: number = General.CHANNELS_CHUNK_SIZE): ActionFunc { - return async (dispatch, getState) => { +export function getChannels(teamId: string, page = 0, perPage: number = General.CHANNELS_CHUNK_SIZE): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.GET_CHANNELS_REQUEST, data: null}, getState); let channels; @@ -826,8 +823,8 @@ export function getChannels(teamId: string, page: number = 0, perPage: number = }; } -export function getAllChannelsWithCount(page: number = 0, perPage: number = General.CHANNELS_CHUNK_SIZE, notAssociatedToGroup: string = '', excludeDefaultChannels: boolean = false): ActionFunc { - return async (dispatch, getState) => { +export function getAllChannelsWithCount(page = 0, perPage: number = General.CHANNELS_CHUNK_SIZE, notAssociatedToGroup = '', excludeDefaultChannels = false): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.GET_ALL_CHANNELS_REQUEST, data: null}, getState); let payload; @@ -860,8 +857,8 @@ export function getAllChannelsWithCount(page: number = 0, perPage: number = Gene }; } -export function getAllChannels(page: number = 0, perPage: number = General.CHANNELS_CHUNK_SIZE, notAssociatedToGroup: string = '', excludeDefaultChannels: boolean = false): ActionFunc { - return async (dispatch, getState) => { +export function getAllChannels(page = 0, perPage: number = General.CHANNELS_CHUNK_SIZE, notAssociatedToGroup = '', excludeDefaultChannels = false): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.GET_ALL_CHANNELS_REQUEST, data: null}, getState); let channels; @@ -891,7 +888,7 @@ export function getAllChannels(page: number = 0, perPage: number = General.CHANN } export function autocompleteChannels(teamId: string, term: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.GET_CHANNELS_REQUEST, data: null}, getState); let channels; @@ -922,7 +919,7 @@ export function autocompleteChannels(teamId: string, term: string): ActionFunc { } export function autocompleteChannelsForSearch(teamId: string, term: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.GET_CHANNELS_REQUEST, data: null}, getState); let channels; @@ -953,7 +950,7 @@ export function autocompleteChannelsForSearch(teamId: string, term: string): Act } export function searchChannels(teamId: string, term: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.GET_CHANNELS_REQUEST, data: null}, getState); let channels; @@ -983,8 +980,8 @@ export function searchChannels(teamId: string, term: string): ActionFunc { }; } -export function searchAllChannels(term: string, notAssociatedToGroup: string = '', excludeDefaultChannels: boolean = false): ActionFunc { - return async (dispatch, getState) => { +export function searchAllChannels(term: string, notAssociatedToGroup = '', excludeDefaultChannels = false): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: ChannelTypes.GET_ALL_CHANNELS_REQUEST, data: null}, getState); let channels; @@ -1021,7 +1018,7 @@ export function searchGroupChannels(term: string): ActionFunc { } export function getChannelStats(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let stat; try { stat = await Client4.getChannelStats(channelId); @@ -1040,8 +1037,8 @@ export function getChannelStats(channelId: string): ActionFunc { }; } -export function addChannelMember(channelId: string, userId: string, postRootId: string = ''): ActionFunc { - return async (dispatch, getState) => { +export function addChannelMember(channelId: string, userId: string, postRootId = ''): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let member; try { member = await Client4.addToChannel(userId, channelId, postRootId); @@ -1073,7 +1070,7 @@ export function addChannelMember(channelId: string, userId: string, postRootId: } export function removeChannelMember(channelId: string, userId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { try { await Client4.removeFromChannel(userId, channelId); } catch (error) { @@ -1100,7 +1097,7 @@ export function removeChannelMember(channelId: string, userId: string): ActionFu } export function updateChannelMemberRoles(channelId: string, userId: string, roles: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { try { await Client4.updateChannelMemberRoles(channelId, userId, roles); } catch (error) { @@ -1122,7 +1119,7 @@ export function updateChannelMemberRoles(channelId: string, userId: string, role } export function updateChannelHeader(channelId: string, header: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { Client4.trackEvent('action', 'action_channels_update_header', {channel_id: channelId}); dispatch({ @@ -1138,7 +1135,7 @@ export function updateChannelHeader(channelId: string, header: string): ActionFu } export function updateChannelPurpose(channelId: string, purpose: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { Client4.trackEvent('action', 'action_channels_update_purpose', {channel_id: channelId}); dispatch({ @@ -1153,8 +1150,8 @@ export function updateChannelPurpose(channelId: string, purpose: string): Action }; } -export function markChannelAsRead(channelId: string, prevChannelId: ?string, updateLastViewedAt: boolean = true): ActionFunc { - return async (dispatch, getState) => { +export function markChannelAsRead(channelId: string, prevChannelId?: string, updateLastViewedAt = true): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { // Send channel last viewed at to the server if (updateLastViewedAt) { Client4.viewMyChannel(channelId, prevChannelId).then().catch((error) => { @@ -1175,7 +1172,7 @@ export function markChannelAsRead(channelId: string, prevChannelId: ?string, upd const channelMember = myMembers[channelId]; const prevChannelMember = prevChannelId ? myMembers[prevChannelId] : null; // May also be null - const actions = []; + const actions: Action[] = []; if (channel && channelMember) { actions.push({ @@ -1226,13 +1223,14 @@ export function markChannelAsRead(channelId: string, prevChannelId: ?string, upd } // Increments the number of posts in the channel by 1 and marks it as unread if necessary + export function markChannelAsUnread(teamId: string, channelId: string, mentions: Array): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const {myMembers} = state.entities.channels; const {currentUserId} = state.entities.users; - const actions = [{ + const actions: Action[] = [{ type: ChannelTypes.INCREMENT_TOTAL_MSG_COUNT, data: { channelId, @@ -1299,7 +1297,7 @@ export function getMyChannelMember(channelId: string) { } export function favoriteChannel(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; const preference: PreferenceType = { user_id: currentUserId, @@ -1315,7 +1313,7 @@ export function favoriteChannel(channelId: string): ActionFunc { } export function unfavoriteChannel(channelId: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; const preference: PreferenceType = { user_id: currentUserId, @@ -1350,7 +1348,7 @@ export function updateChannelMemberSchemeRoles(channelId: string, userId: string }); } -export function membersMinusGroupMembers(channelID: string, groupIDs: Array, page: number = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { +export function membersMinusGroupMembers(channelID: string, groupIDs: Array, page = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { return bindClientFunc({ clientFunc: Client4.channelMembersMinusGroupMembers, onSuccess: ChannelTypes.RECEIVED_CHANNEL_MEMBERS_MINUS_GROUP_MEMBERS, diff --git a/src/actions/emojis.js b/src/actions/emojis.ts similarity index 83% rename from src/actions/emojis.js rename to src/actions/emojis.ts index 6309a8128..119800c36 100644 --- a/src/actions/emojis.js +++ b/src/actions/emojis.ts @@ -1,28 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {Client4} from 'client'; import {EmojiTypes} from 'action_types'; -import {General, Emoji} from 'constants'; - -import {getProfilesByIds} from 'actions/users'; +import {General, Emoji} from '../constants'; +import {getProfilesByIds} from './users'; import {getCustomEmojisByName as selectCustomEmojisByName} from 'selectors/entities/emojis'; - import {parseNeededCustomEmojisFromText} from 'utils/emoji_utils'; +import {GetStateFunc, DispatchFunc, ActionFunc, ActionResult} from 'types/actions'; + import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; - -import type {GetStateFunc, DispatchFunc, ActionFunc} from 'types/actions'; - -export let systemEmojis: Map = new Map(); - -export function setSystemEmojis(emojis: Map) { +import {SystemEmoji, CustomEmoji} from 'types/emojis'; +import {Dictionary} from 'types/utilities'; +export let systemEmojis: Map = new Map(); +export function setSystemEmojis(emojis: Map) { systemEmojis = emojis; } -export function createCustomEmoji(emoji: Object, image: Object): ActionFunc { +export function createCustomEmoji(emoji: any, image: any): ActionFunc { return bindClientFunc({ clientFunc: Client4.createCustomEmoji, onSuccess: EmojiTypes.RECEIVED_CUSTOM_EMOJI, @@ -44,8 +40,9 @@ export function getCustomEmoji(emojiId: string): ActionFunc { } export function getCustomEmojiByName(name: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; + try { data = await Client4.getCustomEmojiByName(name); } catch (error) { @@ -70,12 +67,12 @@ export function getCustomEmojiByName(name: string): ActionFunc { } export function getCustomEmojisByName(names: Array): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { if (!names || names.length === 0) { return {data: true}; } - const promises = []; + const promises: Promise[] = []; names.forEach((name) => promises.push(getCustomEmojiByName(name)(dispatch, getState))); await Promise.all(promises); @@ -84,7 +81,7 @@ export function getCustomEmojisByName(names: Array): ActionFunc { } export function getCustomEmojisInText(text: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { if (!text) { return {data: true}; } @@ -100,10 +97,10 @@ export function getCustomEmojisInText(text: string): ActionFunc { } export function getCustomEmojis( - page: number = 0, + page = 0, perPage: number = General.PAGE_SIZE_DEFAULT, sort: string = Emoji.SORT_BY_NAME, - loadUsers: boolean = false + loadUsers = false ): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; @@ -129,10 +126,10 @@ export function getCustomEmojis( }; } -export function loadProfilesForCustomEmojis(emojis: Array): ActionFunc { +export function loadProfilesForCustomEmojis(emojis: Array): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { - const usersToLoad = {}; - emojis.forEach((emoji: Object) => { + const usersToLoad: Dictionary = {}; + emojis.forEach((emoji: CustomEmoji) => { if (!getState().entities.users.profiles[emoji.creator_id]) { usersToLoad[emoji.creator_id] = true; } @@ -206,8 +203,8 @@ export function deleteCustomEmoji(emojiId: string): ActionFunc { }; } -export function searchCustomEmojis(term: string, options: Object = {}, loadUsers: boolean = false): ActionFunc { - return async (dispatch, getState) => { +export function searchCustomEmojis(term: string, options: any = {}, loadUsers = false): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; try { data = await Client4.searchCustomEmoji(term, options); @@ -232,7 +229,7 @@ export function searchCustomEmojis(term: string, options: Object = {}, loadUsers } export function autocompleteCustomEmojis(name: string): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; try { data = await Client4.autocompleteCustomEmoji(name); diff --git a/src/actions/errors.js b/src/actions/errors.ts similarity index 87% rename from src/actions/errors.js rename to src/actions/errors.ts index 8bc4d9e22..16b46b6c5 100644 --- a/src/actions/errors.js +++ b/src/actions/errors.ts @@ -1,15 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {ErrorTypes} from 'action_types'; import serializeError from 'serialize-error'; import {Client4} from 'client'; import EventEmitter from 'utils/event_emitter'; - -import type {DispatchFunc, ActionFunc} from 'types/actions'; -import type {Error} from 'types/errors'; - +import {DispatchFunc, ActionFunc} from 'types/actions'; +import {Error} from 'types/errors'; export function dismissErrorObject(index: number) { return { type: ErrorTypes.DISMISS_ERROR, @@ -26,7 +22,7 @@ export function dismissError(index: number): ActionFunc { }; } -export function getLogErrorAction(error: Error, displayable: boolean = false) { +export function getLogErrorAction(error: serializeError.ErrorObject, displayable = false) { return { type: ErrorTypes.LOG_ERROR, displayable, @@ -35,7 +31,7 @@ export function getLogErrorAction(error: Error, displayable: boolean = false) { }; } -export function logError(error: Error, displayable: boolean = false): ActionFunc { +export function logError(error: Error, displayable = false): ActionFunc { return async (dispatch: DispatchFunc) => { if (error.server_error_id === 'api.context.session_expired.app_error') { return {data: true}; diff --git a/src/actions/files.test.js b/src/actions/files.test.js index d7c2c5219..680218ba5 100644 --- a/src/actions/files.test.js +++ b/src/actions/files.test.js @@ -7,7 +7,7 @@ import nock from 'nock'; import * as Actions from 'actions/files'; import {Client4} from 'client'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; @@ -102,55 +102,6 @@ describe('Actions.Files', () => { assert.equal(fileIdsByPostId[postForFile.id][0], fileId); }); - it('getMissingFilesForPost', async () => { - const {basicClient4, basicChannel} = TestHelper; - const testFileName = 'test.png'; - const testImageData = fs.createReadStream(`test/assets/images/${testFileName}`); - const clientId = TestHelper.generateId(); - - const imageFormData = new FormData(); - imageFormData.append('files', testImageData); - imageFormData.append('channel_id', basicChannel.id); - imageFormData.append('client_ids', clientId); - const formBoundary = imageFormData.getBoundary(); - - nock(Client4.getFilesRoute()). - post(''). - reply(201, {file_infos: [{id: TestHelper.generateId(), user_id: TestHelper.basicUser.id, create_at: 1507921547541, update_at: 1507921547541, delete_at: 0, name: 'test.png', extension: 'png', size: 258428, mime_type: 'image/png', width: 600, height: 600, has_preview_image: true}], client_ids: [TestHelper.generateId()]}); - - const fileUploadResp = await basicClient4. - uploadFile(imageFormData, formBoundary); - const fileId = fileUploadResp.file_infos[0].id; - - const fakePostForFile = TestHelper.fakePost(basicChannel.id); - fakePostForFile.file_ids = [fileId]; - - nock(Client4.getPostsRoute()). - post(''). - reply(201, {...TestHelper.fakePostWithId(), ...fakePostForFile}); - const postForFile = await basicClient4.createPost(fakePostForFile); - - nock(Client4.getPostsRoute()). - get(`/${postForFile.id}/files/info`). - reply(200, [{id: fileId, user_id: TestHelper.basicUser.id, create_at: 1507921547541, update_at: 1507921547541, delete_at: 0, name: 'test.png', extension: 'png', size: 258428, mime_type: 'image/png', width: 600, height: 600, has_preview_image: true}]); - - await Actions.getMissingFilesForPost(postForFile.id)(store.dispatch, store.getState); - - const {files: allFiles, fileIdsByPostId} = store.getState().entities.files; - - assert.ok(allFiles); - assert.ok(allFiles[fileId]); - assert.equal(allFiles[fileId].id, fileId); - assert.equal(allFiles[fileId].name, testFileName); - - assert.ok(fileIdsByPostId); - assert.ok(fileIdsByPostId[postForFile.id]); - assert.equal(fileIdsByPostId[postForFile.id][0], fileId); - - const {data: files} = await Actions.getMissingFilesForPost(postForFile.id)(store.dispatch, store.getState); - assert.ok(files.length === 0); - }); - it('getFilePublicLink', async () => { const fileId = 't1izsr9uspgi3ynggqu6xxjn9y'; nock(Client4.getBaseRoute()). diff --git a/src/actions/files.js b/src/actions/files.ts similarity index 80% rename from src/actions/files.js rename to src/actions/files.ts index 877df7ac9..55052248f 100644 --- a/src/actions/files.js +++ b/src/actions/files.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {batchActions} from 'redux-batched-actions'; - import {Client4} from 'client'; import {FileTypes} from 'action_types'; + +import {Action, batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; + import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; -import type {DispatchFunc, GetStateFunc} from 'types/actions'; export function getFilesForPost(postId: string) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { @@ -32,21 +30,7 @@ export function getFilesForPost(postId: string) { }; } -export function getMissingFilesForPost(postId: string) { - return async (dispatch: DispatchFunc, getState: GetStateFunc) => { - const {fileIdsByPostId} = getState().entities.files; - - let posts = []; - if (!fileIdsByPostId[postId]) { - posts = await getFilesForPost(postId)(dispatch, getState); - } - - return {data: posts}; - }; -} - -export function uploadFile(channelId: string, rootId: string, clientIds: Array, - fileFormData: File, formBoundary: string) { +export function uploadFile(channelId: string, rootId: string, clientIds: Array, fileFormData: File, formBoundary: string) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: FileTypes.UPLOAD_FILES_REQUEST, data: {}}, getState); diff --git a/src/actions/general.test.js b/src/actions/general.test.js index d8c83ad8d..668f13175 100644 --- a/src/actions/general.test.js +++ b/src/actions/general.test.js @@ -7,7 +7,7 @@ import nock from 'nock'; import {GeneralTypes} from 'action_types'; import * as Actions from 'actions/general'; import {Client4} from 'client'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/general.js b/src/actions/general.ts similarity index 91% rename from src/actions/general.js rename to src/actions/general.ts index 028f20735..d7003cac3 100644 --- a/src/actions/general.js +++ b/src/actions/general.ts @@ -1,26 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {Client4} from 'client'; -import {bindClientFunc, forceLogoutIfNecessary, FormattedError} from './helpers.js'; + import {GeneralTypes} from 'action_types'; -import {loadMe} from './users'; -import {loadRolesIfNeeded} from './roles'; -import {logError} from './errors'; -import {batchActions} from 'redux-batched-actions'; + import {getServerVersion} from 'selectors/entities/general'; import {isMinimumServerVersion} from 'utils/helpers'; +import {GeneralState} from 'types/general'; +import {GenericClientResponse, logLevel} from 'types/client4'; +import {GetStateFunc, DispatchFunc, ActionFunc, batchActions} from 'types/actions'; -import type {GeneralState} from 'types/general'; -import type {GenericClientResponse, logLevel} from 'types/client4'; -import type {GetStateFunc, DispatchFunc, ActionFunc} from 'types/actions'; +import {logError} from './errors'; +import {loadRolesIfNeeded} from './roles'; +import {loadMe} from './users'; +import {bindClientFunc, forceLogoutIfNecessary, FormattedError} from './helpers'; export function getPing(): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GeneralTypes.PING_REQUEST, data: {}}, getState); - let data: GenericClientResponse; + let data; let pingError = new FormattedError( 'mobile.server_ping_failed', 'Cannot connect to the server. Please check your server URL and internet connection.' @@ -135,7 +134,7 @@ export function logClientError(message: string, level: logLevel = 'ERROR') { }); } -export function setAppState(state: $PropertyType): ActionFunc { +export function setAppState(state: GeneralState['appState']): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GeneralTypes.RECEIVED_APP_STATE, data: state}, getState); @@ -143,7 +142,7 @@ export function setAppState(state: $PropertyType): Act }; } -export function setDeviceToken(token: $PropertyType): ActionFunc { +export function setDeviceToken(token: GeneralState['deviceToken']): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GeneralTypes.RECEIVED_APP_DEVICE_TOKEN, data: token}, getState); @@ -160,7 +159,7 @@ export function setServerVersion(serverVersion: string): ActionFunc { }; } -export function setStoreFromLocalData(data: { token: string, url: string }): ActionFunc { +export function setStoreFromLocalData(data: { token: string; url: string }): ActionFunc { return async (dispatch: DispatchFunc, getState) => { Client4.setToken(data.token); Client4.setUrl(data.url); @@ -187,7 +186,7 @@ export function getRedirectLocation(url: string): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GeneralTypes.REDIRECT_LOCATION_REQUEST, data: {}}, getState); - let pendingData: Promise; + let pendingData: Promise; if (isMinimumServerVersion(getServerVersion(getState()), 5, 3)) { pendingData = Client4.getRedirectLocation(url); } else { diff --git a/src/actions/gifs.js b/src/actions/gifs.ts similarity index 88% rename from src/actions/gifs.js rename to src/actions/gifs.ts index 300ef0517..5b9fcc246 100644 --- a/src/actions/gifs.js +++ b/src/actions/gifs.ts @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {GifTypes} from 'action_types'; import {Client4} from 'client'; import gfycatSdk from 'utils/gfycat_sdk'; +import {ActionResult, DispatchFunc, GetStateFunc} from 'types/actions'; // APP PROPS @@ -15,7 +15,7 @@ export function saveAppPropsRequest(props) { } export function saveAppProps(appProps) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const {GfycatApiKey, GfycatApiSecret} = getState().entities.general.config; gfycatSdk(GfycatApiKey, GfycatApiSecret).authenticate(); dispatch(saveAppPropsRequest(appProps)); @@ -143,14 +143,14 @@ export function searchPriorLocation(priorLocation) { } export function searchGfycat({searchText, count = 30, startIndex = 0}) { - var start = startIndex; - return (dispatch, getState) => { + let start = startIndex; + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const {GfycatApiKey, GfycatApiSecret} = getState().entities.general.config; const {resultsByTerm} = getState().entities.gifs.search; if (resultsByTerm[searchText]) { start = resultsByTerm[searchText].start + count; } - dispatch(requestSearch(searchText, count, start)); + dispatch(requestSearch(searchText)); gfycatSdk(GfycatApiKey, GfycatApiSecret).authenticate(); return gfycatSdk(GfycatApiKey, GfycatApiSecret).search({search_text: searchText, count, start}).then((json) => { if (json.errorMessage) { @@ -180,9 +180,9 @@ export function searchGfycat({searchText, count = 30, startIndex = 0}) { }; } -export function searchCategory({tagName = '', gfyCount = 30, cursorPos}) { - var cursor = cursorPos; - return (dispatch, getState) => { +export function searchCategory({tagName = '', gfyCount = 30, cursorPos = undefined}) { + let cursor = cursorPos; + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {GfycatApiKey, GfycatApiSecret} = getState().entities.general.config; const {resultsByTerm} = getState().entities.gifs.search; if (resultsByTerm[tagName]) { @@ -210,7 +210,7 @@ export function searchCategory({tagName = '', gfyCount = 30, cursorPos}) { // preload categories list if (tagName === 'trending') { - dispatch(requestCategoriesListIfNeeded()); + dispatch(requestCategoriesListIfNeeded() as any); } } } @@ -231,7 +231,7 @@ export function shouldSearch(state, searchText) { } export function searchIfNeeded(searchText) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { if (shouldSearch(getState(), searchText)) { if (searchText.toLowerCase() === 'trending') { return dispatch(searchCategory({tagName: searchText})); @@ -243,7 +243,7 @@ export function searchIfNeeded(searchText) { } export function searchIfNeededInitial(searchText) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch(updateSearchText(searchText)); if (shouldSearchInitial(getState(), searchText)) { if (searchText.toLowerCase() === 'trending') { @@ -262,11 +262,12 @@ export function shouldSearchInitial(state, searchText) { } else if (resultsByTerm.isFetching) { return false; } + return false; } export function searchById(gfyId) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const {GfycatApiKey, GfycatApiSecret} = getState().entities.general.config; dispatch(requestSearchById(gfyId)); return gfycatSdk(GfycatApiKey, GfycatApiSecret).searchById({id: gfyId}).then( @@ -279,38 +280,39 @@ export function searchById(gfyId) { } export function shouldSearchById(state, gfyId) { - return !state.cache.gifs[gfyId]; + return !state.entities.gifs.cache.gifs[gfyId]; //TODO investigate, used to be !state.cache.gifs[gfyId]; } export function searchByIdIfNeeded(gfyId) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { if (shouldSearchById(getState(), gfyId)) { return dispatch(searchById(gfyId)); } - return Promise.resolve(getState().cache.gifs[gfyId]); + + return Promise.resolve(getState().entities.gifs.cache.gifs[gfyId]); //TODO: investigate, used to be getState().cache.gifs[gfyId] }; } export function saveSearchScrollPosition(scrollPosition) { - return (dispatch) => { + return (dispatch: DispatchFunc) => { dispatch(searchScrollPosition(scrollPosition)); }; } export function saveSearchPriorLocation(priorLocation) { - return (dispatch) => { + return (dispatch: DispatchFunc) => { dispatch(searchPriorLocation(priorLocation)); }; } export function searchTextUpdate(searchText) { - return (dispatch) => { + return (dispatch: DispatchFunc) => { dispatch(updateSearchText(searchText)); }; } export function saveSearchBarText(searchBarText) { - return (dispatch) => { + return (dispatch: DispatchFunc) => { dispatch(searchBarTextSave(searchBarText)); }; } @@ -338,7 +340,7 @@ export function categoriesListFailure(err) { } export function requestCategoriesList({count = 60} = {}) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const {GfycatApiKey, GfycatApiSecret} = getState().entities.general.config; const state = getState().entities.gifs.categories; if (!shouldRequestCategoriesList(state)) { @@ -367,8 +369,10 @@ export function requestCategoriesList({count = 60} = {}) { }; } -export function requestCategoriesListIfNeeded({count} = {}) { - return (dispatch, getState) => { +export function requestCategoriesListIfNeeded({ + count, +} = {count: undefined}) { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState().entities.gifs.categories; if (state.tagsList && state.tagsList.length) { return Promise.resolve(); @@ -408,8 +412,9 @@ export function cacheGifs(gifs) { } export function cacheGifsRequest(gifs) { - return (dispatch) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch(cacheRequest()); dispatch(cacheGifs(gifs)); + return {data: true}; }; } diff --git a/src/actions/groups.test.js b/src/actions/groups.test.js index a110bd142..5b66ed7f5 100644 --- a/src/actions/groups.test.js +++ b/src/actions/groups.test.js @@ -7,7 +7,7 @@ import nock from 'nock'; import * as Actions from 'actions/groups'; import {Client4} from 'client'; -import {RequestStatus, Groups} from 'constants'; +import {RequestStatus, Groups} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; @@ -430,7 +430,7 @@ describe('Actions.Groups', () => { } const groupIDs = state.entities.teams.groupsAssociatedToTeam[teamID].ids; - var expectedIDs = ['tnd8zod9f3fdtqosxjmhwucbth', 'qhdp6g7aubbpiyja7c4sgpe7tc']; + const expectedIDs = ['tnd8zod9f3fdtqosxjmhwucbth', 'qhdp6g7aubbpiyja7c4sgpe7tc']; assert.strictEqual(groupIDs.length, expectedIDs.length); groupIDs.forEach((id) => { assert.ok(expectedIDs.includes(id)); @@ -483,7 +483,7 @@ describe('Actions.Groups', () => { } const groupIDs = state.entities.teams.groupsAssociatedToTeam[teamID].ids; - var expectedIDs = ['existing2'].concat(response.map((group) => group.id)); + const expectedIDs = ['existing2'].concat(response.map((group) => group.id)); assert.strictEqual(groupIDs.length, expectedIDs.length); groupIDs.forEach((id) => { assert.ok(expectedIDs.includes(id)); @@ -615,7 +615,7 @@ describe('Actions.Groups', () => { } const groupIDs = state.entities.channels.groupsAssociatedToChannel[channelID].ids; - var expectedIDs = ['tnd8zod9f3fdtqosxjmhwucbth', 'qhdp6g7aubbpiyja7c4sgpe7tc']; + const expectedIDs = ['tnd8zod9f3fdtqosxjmhwucbth', 'qhdp6g7aubbpiyja7c4sgpe7tc']; assert.strictEqual(groupIDs.length, expectedIDs.length); groupIDs.forEach((id) => { assert.ok(expectedIDs.includes(id)); @@ -668,7 +668,7 @@ describe('Actions.Groups', () => { } const groupIDs = state.entities.channels.groupsAssociatedToChannel[channelID].ids; - var expectedIDs = ['existing2'].concat(response.map((group) => group.id)); + const expectedIDs = ['existing2'].concat(response.map((group) => group.id)); assert.strictEqual(groupIDs.length, expectedIDs.length); groupIDs.forEach((id) => { assert.ok(expectedIDs.includes(id)); diff --git a/src/actions/groups.js b/src/actions/groups.ts similarity index 89% rename from src/actions/groups.js rename to src/actions/groups.ts index 4266e51fb..8e9e3a6ca 100644 --- a/src/actions/groups.js +++ b/src/actions/groups.ts @@ -1,21 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {GroupTypes} from 'action_types'; -import {General, Groups} from 'constants'; - +import {General, Groups} from '../constants'; import {Client4} from 'client'; -import {logError} from './errors'; -import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; -import {batchActions} from 'redux-batched-actions'; - -import type {ActionFunc} from '../types/actions'; -import type {SyncableType, SyncablePatch} from '../types/groups'; +import {Action, ActionFunc, batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; +import {SyncableType, SyncablePatch} from 'types/groups'; +import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; +import {logError} from './errors'; export function linkGroupSyncable(groupID: string, syncableID: string, syncableType: SyncableType, patch: SyncablePatch): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GroupTypes.LINK_GROUP_SYNCABLE_REQUEST, data: {groupID, syncableID}}); let data; @@ -30,7 +25,7 @@ export function linkGroupSyncable(groupID: string, syncableID: string, syncableT return {error}; } - const dispatches = []; + const dispatches: Action[] = []; let type; switch (syncableType) { @@ -54,7 +49,7 @@ export function linkGroupSyncable(groupID: string, syncableID: string, syncableT } export function unlinkGroupSyncable(groupID: string, syncableID: string, syncableType: SyncableType): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GroupTypes.UNLINK_GROUP_SYNCABLE_REQUEST, data: {groupID, syncableID}}); try { @@ -68,7 +63,7 @@ export function unlinkGroupSyncable(groupID: string, syncableID: string, syncabl return {error}; } - const dispatches = []; + const dispatches: Action[] = []; let type; const data = {group_id: groupID, syncable_id: syncableID}; @@ -95,7 +90,7 @@ export function unlinkGroupSyncable(groupID: string, syncableID: string, syncabl } export function getGroupSyncables(groupID: string, syncableType: SyncableType): ActionFunc { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GroupTypes.GET_GROUP_SYNCABLES_REQUEST, data: {groupID}}); let data; @@ -131,8 +126,8 @@ export function getGroupSyncables(groupID: string, syncableType: SyncableType): }; } -export function getGroupMembers(groupID: string, page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { - return async (dispatch, getState) => { +export function getGroupMembers(groupID: string, page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: GroupTypes.GET_GROUP_MEMBERS_REQUEST, data: {groupID, page, perPage}}); let data; @@ -168,7 +163,7 @@ export function getGroup(id: string): ActionFunc { }); } -export function getGroupsNotAssociatedToTeam(teamID: string, q: string = '', page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getGroupsNotAssociatedToTeam(teamID: string, q = '', page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getGroupsNotAssociatedToTeam, onRequest: GroupTypes.GET_GROUPS_NOT_ASSOCIATED_TO_TEAM_REQUEST, @@ -183,7 +178,7 @@ export function getGroupsNotAssociatedToTeam(teamID: string, q: string = '', pag }); } -export function getGroupsNotAssociatedToChannel(channelID: string, q: string = '', page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getGroupsNotAssociatedToChannel(channelID: string, q = '', page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getGroupsNotAssociatedToChannel, onRequest: GroupTypes.GET_GROUPS_NOT_ASSOCIATED_TO_CHANNEL_REQUEST, @@ -230,7 +225,7 @@ export function getAllGroupsAssociatedToChannel(channelID: string): ActionFunc { }); } -export function getGroupsAssociatedToTeam(teamID: string, q: string = '', page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getGroupsAssociatedToTeam(teamID: string, q = '', page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: async (param1, param2, param3, param4) => { const result = await Client4.getGroupsAssociatedToTeam(param1, param2, param3, param4); @@ -248,7 +243,7 @@ export function getGroupsAssociatedToTeam(teamID: string, q: string = '', page: }); } -export function getGroupsAssociatedToChannel(channelID: string, q: string = '', page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getGroupsAssociatedToChannel(channelID: string, q = '', page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: async (param1, param2, param3, param4) => { const result = await Client4.getGroupsAssociatedToChannel(param1, param2, param3, param4); diff --git a/src/actions/helpers.js b/src/actions/helpers.ts similarity index 80% rename from src/actions/helpers.js rename to src/actions/helpers.ts index 9e68f720d..9c598829e 100644 --- a/src/actions/helpers.js +++ b/src/actions/helpers.ts @@ -1,21 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {batchActions} from 'redux-batched-actions'; import {Client4} from 'client'; import {UserTypes} from 'action_types'; -import {logError} from './errors'; -import type {Client4Error} from 'types/client4'; -import type {ActionFunc, GenericAction, DispatchFunc, GetStateFunc} from 'types/actions'; -type ActionType = string; +import {Client4Error} from 'types/client4'; +import {batchActions, Action, ActionFunc, GenericAction, DispatchFunc, GetStateFunc} from 'types/actions'; +import {logError} from './errors'; +type ActionType = string; const HTTP_UNAUTHORIZED = 401; - export function forceLogoutIfNecessary(err: Client4Error, dispatch: DispatchFunc, getState: GetStateFunc) { const {currentUserId} = getState().entities.users; - if (err.status_code === HTTP_UNAUTHORIZED && err.url && err.url.indexOf('/login') === -1 && currentUserId) { + + if ('status_code' in err && err.status_code === HTTP_UNAUTHORIZED && err.url && err.url.indexOf('/login') === -1 && currentUserId) { Client4.setToken(''); dispatch({type: UserTypes.LOGOUT_SUCCESS, data: {}}); } @@ -43,7 +40,7 @@ export function requestSuccess(type: ActionType, data: any) { }; } -export function requestFailure(type: ActionType, error: Client4Error) { +export function requestFailure(type: ActionType, error: Client4Error): any { return { type, error, @@ -63,20 +60,21 @@ export function requestFailure(type: ActionType, error: Client4Error) { * @param {...Array} obj.params * @returns {ActionFunc} ActionFunc */ + export function bindClientFunc({ clientFunc, onRequest, onSuccess, onFailure, params = [], -}: {| - clientFunc: () => Promise, - onRequest?: ActionType, - onSuccess?: ActionType | Array, - onFailure?: ActionType, - params?: Array, -|}): ActionFunc { - return async (dispatch, getState) => { +}: { + clientFunc: (...args) => Promise; + onRequest?: ActionType; + onSuccess?: ActionType | Array; + onFailure?: ActionType; + params?: Array; +}): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { if (onRequest) { dispatch(requestData(onRequest), getState); } @@ -86,7 +84,7 @@ export function bindClientFunc({ data = await clientFunc(...params); } catch (error) { forceLogoutIfNecessary(error, dispatch, getState); - const actions = [logError(error)]; + const actions: Action[] = [logError(error)]; if (onFailure) { actions.push(requestFailure(onFailure, error)); } @@ -107,7 +105,8 @@ export function bindClientFunc({ } // Debounce function based on underscores modified to use es6 and a cb -export function debounce(func: (...args: any) => mixed, wait: number, immediate: boolean, cb: () => mixed) { + +export function debounce(func: (...args: any) => unknown, wait: number, immediate: boolean, cb: () => unknown) { let timeout; return function fx(...args: Array) { const runLater = () => { @@ -135,12 +134,12 @@ export function debounce(func: (...args: any) => mixed, wait: number, immediate: export class FormattedError extends Error { intl: { - id: string, - defaultMessage: string, - values: Object - } + id: string; + defaultMessage: string; + values: any; + }; - constructor(id: string, defaultMessage: string, values: Object = {}) { + constructor(id: string, defaultMessage: string, values: any = {}) { super(defaultMessage); this.intl = { id, diff --git a/src/actions/index.ts b/src/actions/index.ts new file mode 100644 index 000000000..875276ca7 --- /dev/null +++ b/src/actions/index.ts @@ -0,0 +1,53 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import * as admin from './admin'; +import * as alerts from './alerts'; +import * as bots from './bots'; +import * as channels from './channels'; +import * as errors from './errors'; +import * as emojis from './emojis'; +import * as files from './files'; +import * as general from './general'; +import * as groups from './groups'; +import * as gifs from './gifs'; +import * as helpers from './helpers'; +import * as integrations from './integrations'; +import * as jobs from './jobs'; +import * as plugins from './plugins'; +import * as posts from './posts'; +import * as preferences from './preferences'; +import * as roles from './roles'; +import * as schemes from './schemes'; +import * as search from './search'; +import * as teams from './teams'; +import * as timezone from './timezone'; +import * as websocket from './websocket'; +import * as users from './users'; + +export { + admin, + alerts, + bots, + channels, + errors, + emojis, + files, + general, + groups, + gifs, + integrations, + helpers, + jobs, + plugins, + posts, + preferences, + roles, + schemes, + search, + teams, + timezone, + websocket, + users, +}; + diff --git a/src/actions/integrations.test.js b/src/actions/integrations.test.js index 9e2ae16b9..f4a58bce4 100644 --- a/src/actions/integrations.test.js +++ b/src/actions/integrations.test.js @@ -8,7 +8,7 @@ import * as Actions from 'actions/integrations'; import * as TeamsActions from 'actions/teams'; import {Client4} from 'client'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/integrations.js b/src/actions/integrations.ts similarity index 95% rename from src/actions/integrations.js rename to src/actions/integrations.ts index a74317d04..3315fefcd 100644 --- a/src/actions/integrations.js +++ b/src/actions/integrations.ts @@ -1,23 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {IntegrationTypes} from 'action_types'; -import {General} from 'constants'; -import {batchActions} from 'redux-batched-actions'; - +import {General} from '../constants'; import {Client4} from 'client'; - import {getCurrentUserId} from 'selectors/entities/users'; import {getCurrentChannelId} from 'selectors/entities/channels'; import {getCurrentTeamId} from 'selectors/entities/teams'; -import {logError} from './errors'; -import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; +import {batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; -import type {DispatchFunc, GetStateFunc} from 'types/actions'; -import type {Command, DialogSubmission, IncomingWebhook, OAuthApp, OutgoingWebhook} from 'types/integrations'; +import {Command, DialogSubmission, IncomingWebhook, OAuthApp, OutgoingWebhook} from 'types/integrations'; +import {logError} from './errors'; +import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; export function createIncomingHook(hook: IncomingWebhook) { return bindClientFunc({ clientFunc: Client4.createIncomingWebhook, @@ -42,7 +37,7 @@ export function getIncomingHook(hookId: string) { }); } -export function getIncomingHooks(teamId: string = '', page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { +export function getIncomingHooks(teamId = '', page = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { return bindClientFunc({ clientFunc: Client4.getIncomingWebhooks, onRequest: IntegrationTypes.GET_INCOMING_HOOKS_REQUEST, @@ -122,7 +117,7 @@ export function getOutgoingHook(hookId: string) { }); } -export function getOutgoingHooks(channelId: string = '', teamId: string = '', page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { +export function getOutgoingHooks(channelId = '', teamId = '', page = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { return bindClientFunc({ clientFunc: Client4.getOutgoingWebhooks, onRequest: IntegrationTypes.GET_OUTGOING_HOOKS_REQUEST, @@ -203,7 +198,7 @@ export function getCommands(teamId: string) { }); } -export function getAutocompleteCommands(teamId: string, page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { +export function getAutocompleteCommands(teamId: string, page = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { return bindClientFunc({ clientFunc: Client4.getAutocompleteCommandsList, onRequest: IntegrationTypes.GET_AUTOCOMPLETE_COMMANDS_REQUEST, @@ -354,7 +349,7 @@ export function editOAuthApp(app: OAuthApp) { }); } -export function getOAuthApps(page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { +export function getOAuthApps(page = 0, perPage: number = General.PAGE_SIZE_DEFAULT) { return bindClientFunc({ clientFunc: Client4.getOAuthApps, onRequest: IntegrationTypes.GET_OAUTH_APPS_REQUEST, diff --git a/src/actions/jobs.test.js b/src/actions/jobs.test.js index 2c137a87e..f26796839 100644 --- a/src/actions/jobs.test.js +++ b/src/actions/jobs.test.js @@ -7,7 +7,7 @@ import nock from 'nock'; import * as Actions from 'actions/jobs'; import {Client4} from 'client'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/jobs.js b/src/actions/jobs.ts similarity index 84% rename from src/actions/jobs.js rename to src/actions/jobs.ts index e8de44bc6..00c7375af 100644 --- a/src/actions/jobs.js +++ b/src/actions/jobs.ts @@ -1,17 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {JobTypes} from 'action_types'; - import {Client4} from 'client'; -import {General} from 'constants'; +import {General} from '../constants'; -import {bindClientFunc} from './helpers'; - -import type {ActionFunc} from 'types/actions'; -import type {JobType, Job} from 'types/jobs'; +import {ActionFunc} from 'types/actions'; +import {JobType, Job} from 'types/jobs'; +import {bindClientFunc} from './helpers'; export function createJob(job: Job): ActionFunc { return bindClientFunc({ clientFunc: Client4.createJob, @@ -36,7 +32,7 @@ export function getJob(id: string): ActionFunc { }); } -export function getJobs(page: number = 0, perPage: number = General.JOBS_CHUNK_SIZE): ActionFunc { +export function getJobs(page = 0, perPage: number = General.JOBS_CHUNK_SIZE): ActionFunc { return bindClientFunc({ clientFunc: Client4.getJobs, onRequest: JobTypes.GET_JOBS_REQUEST, @@ -49,7 +45,7 @@ export function getJobs(page: number = 0, perPage: number = General.JOBS_CHUNK_S }); } -export function getJobsByType(type: JobType, page: number = 0, perPage: number = General.JOBS_CHUNK_SIZE): ActionFunc { +export function getJobsByType(type: JobType, page = 0, perPage: number = General.JOBS_CHUNK_SIZE): ActionFunc { return bindClientFunc({ clientFunc: Client4.getJobsByType, onRequest: JobTypes.GET_JOBS_REQUEST, diff --git a/src/actions/plugins.js b/src/actions/plugins.ts similarity index 100% rename from src/actions/plugins.js rename to src/actions/plugins.ts diff --git a/src/actions/posts.test.js b/src/actions/posts.test.js index 499fc430b..675263134 100644 --- a/src/actions/posts.test.js +++ b/src/actions/posts.test.js @@ -9,7 +9,7 @@ import * as Actions from 'actions/posts'; import {login} from 'actions/users'; import {setSystemEmojis, createCustomEmoji} from 'actions/emojis'; import {Client4} from 'client'; -import {Preferences, Posts, RequestStatus} from 'constants'; +import {Preferences, Posts, RequestStatus} from '../constants'; import {PostTypes} from 'action_types'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/posts.js b/src/actions/posts.ts similarity index 89% rename from src/actions/posts.js rename to src/actions/posts.ts index 6af498209..d0484d7de 100644 --- a/src/actions/posts.js +++ b/src/actions/posts.ts @@ -1,10 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {batchActions} from 'redux-batched-actions'; - -import {Client4} from 'client'; -import {General, Preferences, Posts, WebsocketEvents} from 'constants'; +import {Client4, DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE} from 'client'; +import {General, Preferences, Posts, WebsocketEvents} from '../constants'; import {PostTypes, ChannelTypes, FileTypes, IntegrationTypes} from 'action_types'; import {getCurrentChannelId, getMyChannelMember as getMyChannelMemberSelector} from 'selectors/entities/channels'; @@ -29,7 +27,9 @@ import { savePreferences, } from './preferences'; import {getProfilesByIds, getProfilesByUsernames, getStatusesByIds} from './users'; -import {DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE} from '../client/client4'; +import {Action, ActionFunc, ActionResult, batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; +import {GlobalState} from 'types/store'; +import {Post} from 'types/posts'; // receivedPost should be dispatched after a single post from the server. This typically happens when an existing post // is updated. @@ -131,7 +131,7 @@ export function postRemoved(post) { } export function getPost(postId) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let post; try { @@ -157,8 +157,8 @@ export function getPost(postId) { }; } -export function createPost(post, files = []) { - return async (dispatch, getState) => { +export function createPost(post, files: any[] = []) { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const currentUserId = state.entities.users.currentUserId; @@ -206,7 +206,7 @@ export function createPost(post, files = []) { offline: { effect: () => Client4.createPost({...newPost, create_at: 0}), commit: (success, payload) => { - const actions = [ + const actions: Action[] = [ receivedPost(payload), { type: PostTypes.CREATE_POST_SUCCESS, @@ -254,7 +254,7 @@ export function createPost(post, files = []) { error.server_error_id === 'api.post.create_post.town_square_read_only' || error.server_error_id === 'plugin.message_will_be_posted.dismiss_post' ) { - dispatch(removePost(data)); + dispatch(removePost(data) as any); } else { dispatch(receivedPost(data)); } @@ -267,15 +267,15 @@ export function createPost(post, files = []) { }; } -export function createPostImmediately(post, files = []) { - return async (dispatch, getState) => { +export function createPostImmediately(post: Post, files: any[] = []) { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const currentUserId = state.entities.users.currentUserId; const timestamp = Date.now(); const pendingPostId = `${currentUserId}:${timestamp}`; - let newPost = { + let newPost: Post = { ...post, pending_post_id: pendingPostId, create_at: timestamp, @@ -309,13 +309,13 @@ export function createPostImmediately(post, files = []) { forceLogoutIfNecessary(error, dispatch, getState); dispatch(batchActions([ {type: PostTypes.CREATE_POST_FAILURE, error}, - removePost({id: pendingPostId, ...newPost}), + removePost({id: pendingPostId, ...newPost}) as any, logError(error), ]), getState); return {error}; } - const actions = [ + const actions: Action[] = [ receivedPost(newPost), { type: PostTypes.CREATE_POST_SUCCESS, @@ -355,7 +355,7 @@ export function resetCreatePostRequest() { } export function deletePost(post) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const delPost = {...post}; if (delPost.type === Posts.POST_TYPES.COMBINED_USER_ACTIVITY) { @@ -396,7 +396,7 @@ export function editPost(post) { } export function pinPost(postId) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: PostTypes.EDIT_POST_REQUEST}, getState); let posts; @@ -411,7 +411,7 @@ export function pinPost(postId) { return {error}; } - const actions = [ + const actions: Action[] = [ { type: PostTypes.EDIT_POST_SUCCESS, }, @@ -433,7 +433,7 @@ export function pinPost(postId) { } export function unpinPost(postId) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: PostTypes.EDIT_POST_REQUEST}, getState); let posts; @@ -448,7 +448,7 @@ export function unpinPost(postId) { return {error}; } - const actions = [ + const actions: Action[] = [ { type: PostTypes.EDIT_POST_SUCCESS, }, @@ -470,7 +470,7 @@ export function unpinPost(postId) { } export function addReaction(postId, emojiName) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const currentUserId = getState().entities.users.currentUserId; let reaction; @@ -492,7 +492,7 @@ export function addReaction(postId, emojiName) { } export function removeReaction(postId, emojiName) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const currentUserId = getState().entities.users.currentUserId; try { @@ -513,7 +513,7 @@ export function removeReaction(postId, emojiName) { } export function getCustomEmojiForReaction(name) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const nonExistentEmoji = getState().entities.emojis.nonExistentEmoji; const customEmojisByName = selectCustomEmojisByName(getState()); @@ -534,7 +534,7 @@ export function getCustomEmojiForReaction(name) { } export function getReactionsForPost(postId) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let reactions; try { reactions = await Client4.getReactionsForPost(postId); @@ -547,7 +547,7 @@ export function getReactionsForPost(postId) { if (reactions && reactions.length > 0) { const nonExistentEmoji = getState().entities.emojis.nonExistentEmoji; const customEmojisByName = selectCustomEmojisByName(getState()); - const emojisToLoad = new Set(); + const emojisToLoad = new Set(); reactions.forEach((r) => { const name = r.emoji_name; @@ -586,7 +586,7 @@ export function getReactionsForPost(postId) { } export function flagPost(postId) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; const preference = { user_id: currentUserId, @@ -597,12 +597,12 @@ export function flagPost(postId) { Client4.trackEvent('action', 'action_posts_flag'); - return savePreferences(currentUserId, [preference])(dispatch, getState); + return savePreferences(currentUserId, [preference])(dispatch); }; } export function getPostThread(rootId, fetchThreads = true) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: PostTypes.GET_POST_THREAD_REQUEST}, getState); let posts; @@ -631,7 +631,7 @@ export function getPostThread(rootId, fetchThreads = true) { } export function getPosts(channelId, page = 0, perPage = Posts.POST_CHUNK_SIZE, fetchThreads = true) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let posts; try { @@ -653,7 +653,7 @@ export function getPosts(channelId, page = 0, perPage = Posts.POST_CHUNK_SIZE, f } export function getPostsUnread(channelId, fetchThreads = true) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const userId = getCurrentUserId(getState()); let posts; try { @@ -680,7 +680,7 @@ export function getPostsUnread(channelId, fetchThreads = true) { } export function getPostsSince(channelId, since, fetchThreads = true) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let posts; try { posts = await Client4.getPostsSince(channelId, since, fetchThreads); @@ -704,7 +704,7 @@ export function getPostsSince(channelId, since, fetchThreads = true) { } export function getPostsBefore(channelId, postId, page = 0, perPage = Posts.POST_CHUNK_SIZE, fetchThreads = true) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let posts; try { posts = await Client4.getPostsBefore(channelId, postId, page, perPage, fetchThreads); @@ -725,7 +725,7 @@ export function getPostsBefore(channelId, postId, page = 0, perPage = Posts.POST } export function getPostsAfter(channelId, postId, page = 0, perPage = Posts.POST_CHUNK_SIZE, fetchThreads = true) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let posts; try { posts = await Client4.getPostsAfter(channelId, postId, page, perPage, fetchThreads); @@ -746,7 +746,7 @@ export function getPostsAfter(channelId, postId, page = 0, perPage = Posts.POST_ } export function getPostsAround(channelId, postId, perPage = Posts.POST_CHUNK_SIZE / 2, fetchThreads = true) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let after; let thread; let before; @@ -793,13 +793,13 @@ export function getPostsAround(channelId, postId, perPage = Posts.POST_CHUNK_SIZ // getThreadsForPosts is intended for an array of posts that have been batched // (see the actions/websocket_actions/handleNewPostEvents function in the webapp) export function getThreadsForPosts(posts, fetchThreads = true) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { if (!Array.isArray(posts) || !posts.length) { return {data: true}; } const state = getState(); - const promises = []; + const promises: Promise[] = []; posts.forEach((post) => { if (!post.root_id) { @@ -817,7 +817,7 @@ export function getThreadsForPosts(posts, fetchThreads = true) { } // Note that getProfilesAndStatusesForPosts can take either an array of posts or a map of ids to posts -export function getProfilesAndStatusesForPosts(postsArrayOrMap, dispatch, getState) { +export function getProfilesAndStatusesForPosts(postsArrayOrMap: Array|Map, dispatch: DispatchFunc, getState: GetStateFunc) { if (!postsArrayOrMap) { // Some API methods return {error} for no results return Promise.resolve(); @@ -833,8 +833,8 @@ export function getProfilesAndStatusesForPosts(postsArrayOrMap, dispatch, getSta const {currentUserId, profiles, statuses} = state.entities.users; // Statuses and profiles of the users who made the posts - const userIdsToLoad = new Set(); - const statusesToLoad = new Set(); + const userIdsToLoad = new Set(); + const statusesToLoad = new Set(); Object.values(posts).forEach((post) => { const userId = post.user_id; @@ -852,7 +852,7 @@ export function getProfilesAndStatusesForPosts(postsArrayOrMap, dispatch, getSta } }); - const promises = []; + const promises: any[] = []; if (userIdsToLoad.size > 0) { promises.push(getProfilesByIds(Array.from(userIdsToLoad))(dispatch, getState)); } @@ -878,10 +878,10 @@ export function getProfilesAndStatusesForPosts(postsArrayOrMap, dispatch, getSta return Promise.all(promises); } -export function getNeededAtMentionedUsernames(state, posts) { +export function getNeededAtMentionedUsernames(state, posts): Set { let usersByUsername; // Populate this lazily since it's relatively expensive - const usernamesToLoad = new Set(); + const usernamesToLoad = new Set(); posts.forEach((post) => { if (!post.message.includes('@')) { @@ -938,17 +938,17 @@ function buildPostAttachmentText(attachments) { return attachmentText; } -export function getNeededCustomEmojis(state, posts) { +export function getNeededCustomEmojis(state: GlobalState, posts): Set { if (getConfig(state).EnableCustomEmoji !== 'true') { - return new Set(); + return new Set(); } // If post metadata is supported, custom emojis will have been provided as part of that if (posts[0].metadata) { - return new Set(); + return new Set(); } - let customEmojisToLoad = new Set(); + let customEmojisToLoad = new Set(); let customEmojisByName; // Populate this lazily since it's relatively expensive const nonExistentEmoji = state.entities.emojis.nonExistentEmoji; @@ -988,7 +988,7 @@ export function getNeededCustomEmojis(state, posts) { } export function removePost(post) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { if (post.type === Posts.POST_TYPES.COMBINED_USER_ACTIVITY) { const state = getState(); @@ -996,7 +996,7 @@ export function removePost(post) { const systemPost = Selectors.getPost(state, systemPostId); if (systemPost) { - dispatch(removePost(systemPost)); + dispatch(removePost(systemPost) as any); } } } else { @@ -1006,7 +1006,7 @@ export function removePost(post) { } export function selectPost(postId) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({ type: PostTypes.RECEIVED_POST_SELECTED, data: postId, @@ -1024,7 +1024,7 @@ export function selectFocusedPostId(postId) { } export function unflagPost(postId) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; const preference = { user_id: currentUserId, @@ -1039,7 +1039,7 @@ export function unflagPost(postId) { } export function getOpenGraphMetadata(url) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; try { data = await Client4.getOpenGraphMetadata(url); @@ -1066,7 +1066,7 @@ export function doPostAction(postId, actionId, selectedOption = '') { } export function doPostActionWithCookie(postId, actionId, actionCookie, selectedOption = '') { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; try { data = await Client4.doPostActionWithCookie(postId, actionId, actionCookie, selectedOption); @@ -1088,7 +1088,7 @@ export function doPostActionWithCookie(postId, actionId, actionCookie, selectedO } export function addMessageIntoHistory(message) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({ type: PostTypes.ADD_MESSAGE_INTO_HISTORY, data: message, @@ -1099,7 +1099,7 @@ export function addMessageIntoHistory(message) { } export function resetHistoryIndex(index) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({ type: PostTypes.RESET_HISTORY_INDEX, data: index, @@ -1110,7 +1110,7 @@ export function resetHistoryIndex(index) { } export function moveHistoryIndexBack(index) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({ type: PostTypes.MOVE_HISTORY_INDEX_BACK, data: index, @@ -1121,7 +1121,7 @@ export function moveHistoryIndexBack(index) { } export function moveHistoryIndexForward(index) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({ type: PostTypes.MOVE_HISTORY_INDEX_FORWARD, data: index, @@ -1132,18 +1132,18 @@ export function moveHistoryIndexForward(index) { } export function handleNewPost(msg) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const currentUserId = getCurrentUserId(state); const post = JSON.parse(msg.data.post); const myChannelMember = getMyChannelMemberSelector(state, post.channel_id); const websocketMessageProps = msg.data; - if (myChannelMember && Object.keys(myChannelMember).length === 0 && myChannelMember.constructor === 'Object') { + if (myChannelMember && Object.keys(myChannelMember).length === 0 && (myChannelMember as any).constructor === 'Object') { await dispatch(getMyChannelMember(post.channel_id)); } - dispatch(completePostReceive(post, websocketMessageProps)); + dispatch(completePostReceive(post, websocketMessageProps) as any); if (msg.data.channel_type === General.DM_CHANNEL) { const otherUserId = getUserIdFromChannelName(currentUserId, msg.data.channel_name); @@ -1151,11 +1151,13 @@ export function handleNewPost(msg) { } else if (msg.data.channel_type === General.GM_CHANNEL) { dispatch(makeGroupMessageVisibleIfNecessary(post.channel_id)); } + + return {data: true}; }; } -function completePostReceive(post, websocketMessageProps) { - return (dispatch, getState) => { +function completePostReceive(post: Post, websocketMessageProps) { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const rootPost = Selectors.getPost(state, post.root_id); @@ -1163,12 +1165,12 @@ function completePostReceive(post, websocketMessageProps) { dispatch(getPostThread(post.root_id, true)); } - dispatch(lastPostActions(post, websocketMessageProps)); + dispatch(lastPostActions(post, websocketMessageProps) as any); }; } function lastPostActions(post, websocketMessageProps) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const actions = [ receivedNewPost(post), @@ -1203,7 +1205,7 @@ function lastPostActions(post, websocketMessageProps) { } if (markAsRead) { - dispatch(markChannelAsRead(post.channel_id, null, markAsReadOnServer)); + dispatch(markChannelAsRead(post.channel_id, undefined, markAsReadOnServer)); dispatch(markChannelAsViewed(post.channel_id)); } else { dispatch(markChannelAsUnread(websocketMessageProps.team_id, post.channel_id, websocketMessageProps.mentions)); diff --git a/src/actions/preferences.test.js b/src/actions/preferences.test.js index 40dd2bbbe..b69150646 100644 --- a/src/actions/preferences.test.js +++ b/src/actions/preferences.test.js @@ -7,7 +7,7 @@ import nock from 'nock'; import * as Actions from 'actions/preferences'; import {login} from 'actions/users'; import {Client4} from 'client'; -import {Preferences, RequestStatus} from 'constants'; +import {Preferences, RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/preferences.js b/src/actions/preferences.ts similarity index 96% rename from src/actions/preferences.js rename to src/actions/preferences.ts index bb7043946..2a2587cff 100644 --- a/src/actions/preferences.js +++ b/src/actions/preferences.ts @@ -1,21 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {Client4} from 'client'; -import {Preferences} from 'constants'; +import {Preferences} from '../constants'; import {PreferenceTypes} from 'action_types'; import {getMyPreferences as getMyPreferencesSelector, makeGetCategory} from 'selectors/entities/preferences'; import {getCurrentUserId} from 'selectors/entities/users'; import {getPreferenceKey} from 'utils/preference_utils'; +import {GetStateFunc, DispatchFunc, ActionFunc} from 'types/actions'; + +import {PreferenceType} from 'types/preferences'; + import {bindClientFunc} from './helpers'; import {getProfilesByIds, getProfilesInChannel} from './users'; import {getChannelAndMyMember, getMyChannelMember} from './channels'; - -import type {GetStateFunc, DispatchFunc, ActionFunc} from 'types/actions'; -import type {PreferenceType} from 'types/preferences'; - export function deletePreferences(userId: string, preferences: Array): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); @@ -149,8 +147,7 @@ export function deleteTeamSpecificThemes(): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); - // $FlowFixMe - const getCategory: (state: any, preferenceId: string) => void = makeGetCategory(); + const getCategory: (state: any, preferenceId: string) => Array = makeGetCategory(); const themePreferences: Array = getCategory(state, Preferences.CATEGORY_THEME); const currentUserId = getCurrentUserId(state); diff --git a/src/actions/roles.test.js b/src/actions/roles.test.js index 494109dec..7f3e8ab02 100644 --- a/src/actions/roles.test.js +++ b/src/actions/roles.test.js @@ -6,7 +6,7 @@ import nock from 'nock'; import * as Actions from 'actions/roles'; import {Client4} from 'client'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/roles.js b/src/actions/roles.ts similarity index 89% rename from src/actions/roles.js rename to src/actions/roles.ts index f9dac2fb6..aaf8e4354 100644 --- a/src/actions/roles.js +++ b/src/actions/roles.ts @@ -1,16 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import {Client4} from 'client'; import {RoleTypes} from 'action_types'; - -import {getRoles} from 'selectors/entities/roles'; +import {getRoles} from 'selectors/entities/roles_helpers'; import {hasNewPermissions} from 'selectors/entities/general'; -import {bindClientFunc} from './helpers'; -import type {DispatchFunc, GetStateFunc, ActionFunc} from 'types/actions'; -import type {Role} from 'types/roles'; +import {DispatchFunc, GetStateFunc, ActionFunc} from 'types/actions'; +import {Role} from 'types/roles'; +import {bindClientFunc} from './helpers'; export function getRolesByNames(rolesNames: Array) { return bindClientFunc({ clientFunc: Client4.getRolesByNames, @@ -70,12 +68,13 @@ export function setPendingRoles(roles: Array) { export function loadRolesIfNeeded(roles: Iterable): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); - let pendingRoles = new Set(); + let pendingRoles = new Set(); + try { - pendingRoles = new Set(state.entities.roles.pending); - } catch (e) { - // eslint-disable-line + pendingRoles = new Set(state.entities.roles.pending); + } catch (e) {// eslint-disable-line } + for (const role of roles) { pendingRoles.add(role); } @@ -91,7 +90,8 @@ export function loadRolesIfNeeded(roles: Iterable): ActionFunc { return {data: []}; } const loadedRoles = getRoles(state); - const newRoles = new Set(); + const newRoles = new Set(); + for (const role of pendingRoles) { if (!loadedRoles[role] && role.trim() !== '') { newRoles.add(role); diff --git a/src/actions/schemes.test.js b/src/actions/schemes.test.js index 03c3c166b..da19b6e29 100644 --- a/src/actions/schemes.test.js +++ b/src/actions/schemes.test.js @@ -6,7 +6,7 @@ import nock from 'nock'; import * as Actions from 'actions/schemes'; import {Client4} from 'client'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/schemes.js b/src/actions/schemes.ts similarity index 81% rename from src/actions/schemes.js rename to src/actions/schemes.ts index c0e311011..01e4fb1ff 100644 --- a/src/actions/schemes.js +++ b/src/actions/schemes.ts @@ -1,17 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {Client4} from 'client'; import {SchemeTypes} from 'action_types'; -import {General} from 'constants'; -import {batchActions} from 'redux-batched-actions'; +import {General} from '../constants'; + +import {Scheme, SchemeScope, SchemePatch} from 'types/schemes'; + +import {ActionFunc, batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; import {logError} from './errors'; -import type {Scheme, SchemeScope, SchemePatch} from 'types/schemes'; -import type {ActionFunc} from 'types/actions'; - export function getScheme(schemeId: string): ActionFunc { return bindClientFunc({ clientFunc: Client4.getScheme, @@ -24,7 +22,7 @@ export function getScheme(schemeId: string): ActionFunc { }); } -export function getSchemes(scope: SchemeScope, page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getSchemes(scope: SchemeScope, page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getSchemes, onRequest: SchemeTypes.GET_SCHEMES_REQUEST, @@ -51,9 +49,11 @@ export function createScheme(scheme: Scheme): ActionFunc { } export function deleteScheme(schemeId: string): ActionFunc { - return async (dispatch, getState) => { - dispatch({type: SchemeTypes.DELETE_SCHEME_REQUEST, data: null}, getState); - + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { + dispatch({ + type: SchemeTypes.DELETE_SCHEME_REQUEST, + data: null, + }, getState); let data = null; try { data = await Client4.deleteScheme(schemeId); @@ -86,7 +86,7 @@ export function patchScheme(schemeId: string, scheme: SchemePatch): ActionFunc { }); } -export function getSchemeTeams(schemeId: string, page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getSchemeTeams(schemeId: string, page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getSchemeTeams, onRequest: SchemeTypes.GET_SCHEME_TEAMS_REQUEST, @@ -100,7 +100,7 @@ export function getSchemeTeams(schemeId: string, page: number = 0, perPage: numb }); } -export function getSchemeChannels(schemeId: string, page: number = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { +export function getSchemeChannels(schemeId: string, page = 0, perPage: number = General.PAGE_SIZE_DEFAULT): ActionFunc { return bindClientFunc({ clientFunc: Client4.getSchemeChannels, onRequest: SchemeTypes.GET_SCHEME_CHANNELS_REQUEST, diff --git a/src/actions/search.js b/src/actions/search.ts similarity index 70% rename from src/actions/search.js rename to src/actions/search.ts index 96075f331..805a099f5 100644 --- a/src/actions/search.js +++ b/src/actions/search.ts @@ -1,31 +1,29 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - -import {batchActions} from 'redux-batched-actions'; - import {Client4} from 'client'; import {SearchTypes} from 'action_types'; - import {getCurrentTeamId} from 'selectors/entities/teams'; import {getCurrentUserId, getCurrentUserMentionKeys} from 'selectors/entities/users'; import {getChannelAndMyMember, getChannelMembers} from './channels'; import {forceLogoutIfNecessary} from './helpers'; import {logError} from './errors'; -import { - getProfilesAndStatusesForPosts, - receivedPosts, -} from './posts'; - +import {getProfilesAndStatusesForPosts, receivedPosts} from './posts'; +import {ActionResult, batchActions, DispatchFunc, GetStateFunc, ActionFunc} from 'types/actions'; +import {RelationOneToOne} from 'types/utilities'; +import {Post} from 'types/posts'; const WEBAPP_SEARCH_PER_PAGE = 20; - -export function getMissingChannelsFromPosts(posts) { - return async (dispatch, getState) => { - const {channels, membersInChannel, myMembers} = getState().entities.channels; - const promises = []; - +export function getMissingChannelsFromPosts(posts: RelationOneToOne): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { + const { + channels, + membersInChannel, + myMembers, + } = getState().entities.channels; + const promises: Promise[] = []; Object.values(posts).forEach((post) => { const id = post.channel_id; + if (!channels[id] || !myMembers[id]) { promises.push(dispatch(getChannelAndMyMember(id))); } @@ -34,27 +32,26 @@ export function getMissingChannelsFromPosts(posts) { promises.push(dispatch(getChannelMembers(id))); } }); - return Promise.all(promises); }; } -export function searchPostsWithParams(teamId, params) { - return async (dispatch, getState) => { - const isGettingMore = (params.page > 0); +export function searchPostsWithParams(teamId, params): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { + const isGettingMore = params.page > 0; dispatch({ type: SearchTypes.SEARCH_POSTS_REQUEST, isGettingMore, }); - let posts; + try { posts = await Client4.searchPostsWithParams(teamId, params); - await Promise.all([ - getProfilesAndStatusesForPosts(posts.posts, dispatch, getState), - dispatch(getMissingChannelsFromPosts(posts.posts)), - ]); + const profilesAndStatuses = getProfilesAndStatusesForPosts(posts.posts, dispatch, getState); + const missingChannels = dispatch(getMissingChannelsFromPosts(posts.posts)); + const arr: [Promise, Promise] = [profilesAndStatuses, missingChannels]; + await Promise.all(arr); } catch (error) { forceLogoutIfNecessary(error, dispatch, getState); dispatch(batchActions([ @@ -92,8 +89,8 @@ export function searchPosts(teamId, terms, isOrSearch, includeDeletedChannels) { return searchPostsWithParams(teamId, {terms, is_or_search: isOrSearch, include_deleted_channels: includeDeletedChannels, page: 0, per_page: WEBAPP_SEARCH_PER_PAGE}); } -export function getMorePostsForSearch() { - return async (dispatch, getState) => { +export function getMorePostsForSearch(): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const teamId = getCurrentTeamId(getState()); const {params, isEnd} = getState().entities.search.current[teamId]; if (!isEnd) { @@ -101,11 +98,11 @@ export function getMorePostsForSearch() { newParams.page += 1; return dispatch(searchPostsWithParams(teamId, newParams)); } - return {}; + return {data: true}; }; } -export function clearSearch() { +export function clearSearch(): ActionFunc { return async (dispatch) => { dispatch({type: SearchTypes.REMOVE_SEARCH_POSTS}); @@ -113,8 +110,8 @@ export function clearSearch() { }; } -export function getFlaggedPosts() { - return async (dispatch, getState) => { +export function getFlaggedPosts(): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const userId = getCurrentUserId(state); const teamId = getCurrentTeamId(state); @@ -124,10 +121,8 @@ export function getFlaggedPosts() { let posts; try { posts = await Client4.getFlaggedPosts(userId, '', teamId); - await Promise.all([ - getProfilesAndStatusesForPosts(posts.posts, dispatch, getState), - dispatch(getMissingChannelsFromPosts(posts.posts)), - ]); + + await Promise.all([getProfilesAndStatusesForPosts(posts.posts, dispatch, getState) as any, dispatch(getMissingChannelsFromPosts(posts.posts)) as any]); } catch (error) { forceLogoutIfNecessary(error, dispatch, getState); dispatch(batchActions([ @@ -152,17 +147,18 @@ export function getFlaggedPosts() { }; } -export function getPinnedPosts(channelId) { - return async (dispatch, getState) => { +export function getPinnedPosts(channelId): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: SearchTypes.SEARCH_PINNED_POSTS_REQUEST}); let result; try { result = await Client4.getPinnedPosts(channelId); - await Promise.all([ - getProfilesAndStatusesForPosts(result.posts, dispatch, getState), - dispatch(getMissingChannelsFromPosts(result.posts)), - ]); + + const profilesAndStatuses = getProfilesAndStatusesForPosts(result.posts, dispatch, getState); + const missingChannels = dispatch(getMissingChannelsFromPosts(result.posts)); + const arr: [Promise, Promise] = [profilesAndStatuses, missingChannels]; + await Promise.all(arr); } catch (error) { forceLogoutIfNecessary(error, dispatch, getState); dispatch(batchActions([ @@ -190,7 +186,7 @@ export function getPinnedPosts(channelId) { }; } -export function clearPinnedPosts(channelId) { +export function clearPinnedPosts(channelId): ActionFunc { return async (dispatch) => { dispatch({ type: SearchTypes.REMOVE_SEARCH_PINNED_POSTS, @@ -203,8 +199,8 @@ export function clearPinnedPosts(channelId) { }; } -export function getRecentMentions() { - return async (dispatch, getState) => { +export function getRecentMentions(): ActionFunc { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const teamId = getCurrentTeamId(state); @@ -221,10 +217,10 @@ export function getRecentMentions() { Client4.trackEvent('api', 'api_posts_search_mention'); posts = await Client4.searchPosts(teamId, terms, true); - await Promise.all([ - getProfilesAndStatusesForPosts(posts.posts, dispatch, getState), - dispatch(getMissingChannelsFromPosts(posts.posts)), - ]); + const profilesAndStatuses = getProfilesAndStatusesForPosts(posts.posts, dispatch, getState); + const missingChannels = dispatch(getMissingChannelsFromPosts(posts.posts)); + const arr: [Promise, Promise] = [profilesAndStatuses, missingChannels]; + await Promise.all(arr); } catch (error) { forceLogoutIfNecessary(error, dispatch, getState); dispatch(batchActions([ @@ -249,7 +245,7 @@ export function getRecentMentions() { }; } -export function removeSearchTerms(teamId, terms) { +export function removeSearchTerms(teamId, terms): ActionFunc { return async (dispatch) => { dispatch({ type: SearchTypes.REMOVE_SEARCH_TERM, diff --git a/src/actions/teams.test.js b/src/actions/teams.test.js index 2f825c169..81d86f552 100644 --- a/src/actions/teams.test.js +++ b/src/actions/teams.test.js @@ -8,7 +8,7 @@ import fs from 'fs'; import * as Actions from 'actions/teams'; import {login} from 'actions/users'; import {Client4} from 'client'; -import {General, RequestStatus} from 'constants'; +import {General, RequestStatus} from '../constants'; import {GeneralTypes} from 'action_types'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; diff --git a/src/actions/teams.js b/src/actions/teams.ts similarity index 93% rename from src/actions/teams.js rename to src/actions/teams.ts index dab88196e..be32df7e6 100644 --- a/src/actions/teams.js +++ b/src/actions/teams.ts @@ -1,31 +1,35 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {batchActions} from 'redux-batched-actions'; import {Client4} from 'client'; -import {General} from 'constants'; +import {General} from '../constants'; import {ChannelTypes, TeamTypes, UserTypes} from 'action_types'; import EventEmitter from 'utils/event_emitter'; +import {isCompatibleWithJoinViewTeamPermissions} from 'selectors/entities/general'; + +import {getCurrentTeamId} from 'selectors/entities/teams'; + +import {getCurrentUserId} from 'selectors/entities/users'; + +import {GetStateFunc, DispatchFunc, ActionFunc, ActionResult, batchActions, Action} from 'types/actions'; + +import {Team} from 'types/teams'; + import {selectChannel} from './channels'; import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; import {getProfilesByIds, getStatusesByIds} from './users'; import {loadRolesIfNeeded} from './roles'; - -import {isCompatibleWithJoinViewTeamPermissions} from 'selectors/entities/general'; -import {getCurrentTeamId} from 'selectors/entities/teams'; -import {getCurrentUserId} from 'selectors/entities/users'; - -import type {GetStateFunc, DispatchFunc, ActionFunc, ActionResult} from 'types/actions'; -import type {Team} from 'types/teams'; +import {UserProfile} from 'types/users'; async function getProfilesAndStatusesForMembers(userIds, dispatch, getState) { - const {currentUserId, profiles, statuses} = getState().entities.users; - const profilesToLoad = []; - const statusesToLoad = []; - + const { + currentUserId, + profiles, + statuses, + } = getState().entities.users; + const profilesToLoad: string[] = []; + const statusesToLoad: string[] = []; userIds.forEach((userId) => { if (!profiles[userId] && !profilesToLoad.includes(userId) && userId !== currentUserId) { profilesToLoad.push(userId); @@ -35,8 +39,7 @@ async function getProfilesAndStatusesForMembers(userIds, dispatch, getState) { statusesToLoad.push(userId); } }); - - const requests = []; + const requests: Promise[] = []; if (profilesToLoad.length) { requests.push(getProfilesByIds(profilesToLoad)(dispatch, getState)); @@ -96,7 +99,7 @@ export function getTeamByName(teamName: string): ActionFunc { }); } -export function getTeams(page: number = 0, perPage: number = General.TEAMS_CHUNK_SIZE, includeTotalCount: boolean = false): ActionFunc { +export function getTeams(page = 0, perPage: number = General.TEAMS_CHUNK_SIZE, includeTotalCount = false): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; @@ -111,7 +114,7 @@ export function getTeams(page: number = 0, perPage: number = General.TEAMS_CHUNK return {error}; } - const actions = [ + const actions: Action[] = [ { type: TeamTypes.RECEIVED_TEAMS_LIST, data: includeTotalCount ? data.teams : data, @@ -198,8 +201,10 @@ export function deleteTeam(teamId: string): ActionFunc { } const entities = getState().entities; - const {currentTeamId} = entities.teams; - const actions = []; + const { + currentTeamId, + } = entities.teams; + const actions: Action[] = []; if (teamId === currentTeamId) { EventEmitter.emit('leave_team'); actions.push({type: ChannelTypes.SELECT_CHANNEL, data: ''}); @@ -254,11 +259,11 @@ export function getMyTeamMembers(): ActionFunc { clientFunc: Client4.getMyTeamMembers, onSuccess: TeamTypes.RECEIVED_MY_TEAM_MEMBERS, }); + const teamMembers = (await getMyTeamMembersFunc(dispatch, getState)) as ActionResult; - const teamMembers: ActionResult = await getMyTeamMembersFunc(dispatch, getState); + if ('data' in teamMembers && teamMembers.data) { + const roles = new Set(); - if (teamMembers.data) { - const roles = new Set(); for (const teamMember of teamMembers.data) { for (const role of teamMember.roles.split(' ')) { roles.add(role); @@ -273,7 +278,7 @@ export function getMyTeamMembers(): ActionFunc { }; } -export function getTeamMembers(teamId: string, page: number = 0, perPage: number = General.TEAMS_CHUNK_SIZE): ActionFunc { +export function getTeamMembers(teamId: string, page = 0, perPage: number = General.TEAMS_CHUNK_SIZE): ActionFunc { return bindClientFunc({ clientFunc: Client4.getTeamMembers, onRequest: TeamTypes.GET_TEAM_MEMBERS_REQUEST, @@ -417,7 +422,7 @@ export function addUsersToTeam(teamId: string, userIds: Array): ActionFu return {error}; } - const profiles = []; + const profiles: Partial[] = []; members.forEach((m) => profiles.push({id: m.user_id})); dispatch(batchActions([ @@ -451,7 +456,7 @@ export function removeUserFromTeam(teamId: string, userId: string): ActionFunc { user_id: userId, }; - const actions = [ + const actions: Action[] = [ { type: UserTypes.RECEIVED_PROFILE_NOT_IN_TEAM, data: {id: teamId, user_id: userId}, @@ -469,9 +474,8 @@ export function removeUserFromTeam(teamId: string, userId: string): ActionFunc { const {channels, myMembers} = state.entities.channels; for (const channelMember of Object.values(myMembers)) { - // https://github.com/facebook/flow/issues/2221 - // $FlowFixMe - Object.values currently does not have good flow support const channel = channels[channelMember.channel_id]; + if (channel && channel.team_id === teamId) { actions.push({ type: ChannelTypes.LEAVE_CHANNEL, @@ -645,7 +649,7 @@ export function invalidateAllEmailInvites(): ActionFunc { }); } -export function membersMinusGroupMembers(teamID: string, groupIDs: Array, page: number = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { +export function membersMinusGroupMembers(teamID: string, groupIDs: Array, page = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { return bindClientFunc({ clientFunc: Client4.teamMembersMinusGroupMembers, onSuccess: TeamTypes.RECEIVED_TEAM_MEMBERS_MINUS_GROUP_MEMBERS, diff --git a/src/actions/timezone.js b/src/actions/timezone.ts similarity index 90% rename from src/actions/timezone.js rename to src/actions/timezone.ts index 91235eb84..e36d8ed30 100644 --- a/src/actions/timezone.js +++ b/src/actions/timezone.ts @@ -1,11 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import {getCurrentUser} from 'selectors/entities/users'; import {getUserTimezone} from 'selectors/entities/timezone'; -import {updateMe} from 'actions/users'; -import type {DispatchFunc, GetStateFunc} from 'types/actions'; - +import {updateMe} from './users'; +import {DispatchFunc, GetStateFunc} from 'types/actions'; export function autoUpdateTimezone(deviceTimezone: string) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const currentUer = getCurrentUser(getState()); diff --git a/src/actions/users.test.js b/src/actions/users.test.js index 7532a3a89..f644dda89 100644 --- a/src/actions/users.test.js +++ b/src/actions/users.test.js @@ -7,7 +7,7 @@ import fs from 'fs'; import * as Actions from 'actions/users'; import {Client4} from 'client'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../constants'; import TestHelper from 'test/test_helper'; import configureStore from 'test/test_store'; import deepFreeze from 'utils/deep_freeze'; diff --git a/src/actions/users.js b/src/actions/users.ts similarity index 91% rename from src/actions/users.js rename to src/actions/users.ts index 2d62d1062..c68e8e3b7 100644 --- a/src/actions/users.js +++ b/src/actions/users.ts @@ -1,42 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import type {ActionFunc, ActionResult, DispatchFunc, GetStateFunc} from 'types/actions'; -import type {UserProfile} from 'types/users'; -import type {TeamMembership} from 'types/teams'; - -import {batchActions} from 'redux-batched-actions'; +import {Action, ActionFunc, ActionResult, batchActions, DispatchFunc, GetStateFunc} from 'types/actions'; +import {UserProfile} from 'types/users'; +import {TeamMembership} from 'types/teams'; import {Client4} from 'client'; -import {General} from 'constants'; +import {General} from '../constants'; import {UserTypes, TeamTypes, AdminTypes} from 'action_types'; -import {getAllCustomEmojis} from 'actions/emojis'; -import {getClientConfig, setServerVersion} from 'actions/general'; -import {getMyTeams, getMyTeamMembers, getMyTeamUnreads} from 'actions/teams'; -import {loadRolesIfNeeded} from 'actions/roles'; - -import { - getUserIdFromChannelName, - isDirectChannel, - isDirectChannelVisible, - isGroupChannel, - isGroupChannelVisible, -} from 'utils/channel_utils'; - +import {getAllCustomEmojis} from './emojis'; +import {getClientConfig, setServerVersion} from './general'; +import {getMyTeams, getMyTeamMembers, getMyTeamUnreads} from './teams'; +import {loadRolesIfNeeded} from './roles'; +import {getUserIdFromChannelName, isDirectChannel, isDirectChannelVisible, isGroupChannel, isGroupChannelVisible} from 'utils/channel_utils'; import {removeUserFromList} from 'utils/user_utils'; import {isMinimumServerVersion} from 'utils/helpers'; -import {logError} from './errors'; -import {bindClientFunc, forceLogoutIfNecessary, debounce} from './helpers'; -import { - getMyPreferences, - makeDirectChannelVisibleIfNecessary, - makeGroupMessageVisibleIfNecessary, -} from './preferences'; - import {getConfig, getServerVersion} from 'selectors/entities/general'; + import {getCurrentUserId, getUsers} from 'selectors/entities/users'; +import {logError} from './errors'; +import {bindClientFunc, forceLogoutIfNecessary, debounce} from './helpers'; +import {getMyPreferences, makeDirectChannelVisibleIfNecessary, makeGroupMessageVisibleIfNecessary} from './preferences'; export function checkMfa(loginId: string): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: UserTypes.CHECK_MFA_REQUEST, data: null}, getState); @@ -65,7 +49,8 @@ export function generateMfaSecret(userId: string): ActionFunc { export function createUser(user: UserProfile, token: string, inviteId: string): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { - let created = null; + let created; + try { created = await Client4.createUser(user, token, inviteId); } catch (error) { @@ -74,7 +59,9 @@ export function createUser(user: UserProfile, token: string, inviteId: string): return {error}; } - const profiles: { [userId: string]: UserProfile } = { + const profiles: { + [userId: string]: UserProfile; + } = { [created.id]: created, }; dispatch({type: UserTypes.RECEIVED_PROFILES, data: profiles}); @@ -83,13 +70,13 @@ export function createUser(user: UserProfile, token: string, inviteId: string): }; } -export function login(loginId: string, password: string, mfaToken: string = '', ldapOnly: boolean = false): ActionFunc { +export function login(loginId: string, password: string, mfaToken = '', ldapOnly = false): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: UserTypes.LOGIN_REQUEST, data: null}, getState); const deviceId = getState().entities.general.deviceToken; + let data; - let data = null; try { data = await Client4.login(loginId, password, mfaToken, deviceId, ldapOnly); } catch (error) { @@ -107,13 +94,13 @@ export function login(loginId: string, password: string, mfaToken: string = '', }; } -export function loginById(id: string, password: string, mfaToken: string = ''): ActionFunc { +export function loginById(id: string, password: string, mfaToken = ''): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: UserTypes.LOGIN_REQUEST, data: null}, getState); const deviceId = getState().entities.general.deviceToken; + let data; - let data = null; try { data = await Client4.loginById(id, password, mfaToken, deviceId); } catch (error) { @@ -140,8 +127,8 @@ function completeLogin(data: UserProfile): ActionFunc { Client4.setUserId(data.id); Client4.setUserRoles(data.roles); + let teamMembers; - let teamMembers = null; try { const membersRequest: Promise> = Client4.getMyTeamMembers(); const unreadsRequest = Client4.getMyTeamUnreads(); @@ -196,8 +183,8 @@ function completeLogin(data: UserProfile): ActionFunc { type: UserTypes.LOGIN_SUCCESS, }, ])); + const roles = new Set(); - const roles = new Set(); for (const teamMember of teamMembers) { for (const role of teamMember.roles.split(' ')) { roles.add(role); @@ -278,11 +265,11 @@ export function getTotalUsersStats(): ActionFunc { }); } -export function getProfiles(page: number = 0, perPage: number = General.PROFILE_CHUNK_SIZE, options: Object = {}): ActionFunc { +export function getProfiles(page = 0, perPage: number = General.PROFILE_CHUNK_SIZE, options: any = {}): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; + let profiles: UserProfile[]; - let profiles = null; try { profiles = await Client4.getProfiles(page, perPage, options); removeUserFromList(currentUserId, profiles); @@ -304,8 +291,7 @@ export function getProfiles(page: number = 0, perPage: number = General.PROFILE_ export function getMissingProfilesByIds(userIds: Array): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {profiles} = getState().entities.users; - - const missingIds = []; + const missingIds: string[] = []; userIds.forEach((id) => { if (!profiles[id]) { missingIds.push(id); @@ -329,8 +315,7 @@ export function getMissingProfilesByUsernames(usernames: Array): ActionF acc[profile.username] = profile; return acc; }, {}); - - const missingUsernames = []; + const missingUsernames: string[] = []; usernames.forEach((username) => { if (!usernameProfiles[username]) { missingUsernames.push(username); @@ -345,11 +330,11 @@ export function getMissingProfilesByUsernames(usernames: Array): ActionF }; } -export function getProfilesByIds(userIds: Array, options: Object): ActionFunc { +export function getProfilesByIds(userIds: Array, options?: any): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; + let profiles: UserProfile[]; - let profiles = null; try { profiles = await Client4.getProfilesByIds(userIds, options); removeUserFromList(currentUserId, profiles); @@ -371,8 +356,8 @@ export function getProfilesByIds(userIds: Array, options: Object): Actio export function getProfilesByUsernames(usernames: Array): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; + let profiles; - let profiles = null; try { profiles = await Client4.getProfilesByUsernames(usernames); removeUserFromList(currentUserId, profiles); @@ -391,11 +376,11 @@ export function getProfilesByUsernames(usernames: Array): ActionFunc { }; } -export function getProfilesInTeam(teamId: string, page: number, perPage: number = General.PROFILE_CHUNK_SIZE, sort: string = '', options: Object = {}): ActionFunc { +export function getProfilesInTeam(teamId: string, page: number, perPage: number = General.PROFILE_CHUNK_SIZE, sort = '', options: any = {}): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; + let profiles; - let profiles: null; try { profiles = await Client4.getProfilesInTeam(teamId, page, perPage, sort, options); } catch (error) { @@ -422,7 +407,7 @@ export function getProfilesInTeam(teamId: string, page: number, perPage: number export function getProfilesNotInTeam(teamId: string, groupConstrained: boolean, page: number, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { - let profiles: null; + let profiles; try { profiles = await Client4.getProfilesNotInTeam(teamId, groupConstrained, page, perPage); } catch (error) { @@ -451,7 +436,7 @@ export function getProfilesNotInTeam(teamId: string, groupConstrained: boolean, }; } -export function getProfilesWithoutTeam(page: number, perPage: number = General.PROFILE_CHUNK_SIZE, options: Object = {}): ActionFunc { +export function getProfilesWithoutTeam(page: number, perPage: number = General.PROFILE_CHUNK_SIZE, options: any = {}): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let profiles = null; try { @@ -477,11 +462,11 @@ export function getProfilesWithoutTeam(page: number, perPage: number = General.P }; } -export function getProfilesInChannel(channelId: string, page: number, perPage: number = General.PROFILE_CHUNK_SIZE, sort: string = ''): ActionFunc { +export function getProfilesInChannel(channelId: string, page: number, perPage: number = General.PROFILE_CHUNK_SIZE, sort = ''): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; + let profiles; - let profiles = null; try { profiles = await Client4.getProfilesInChannel(channelId, page, perPage, sort); } catch (error) { @@ -509,8 +494,8 @@ export function getProfilesInChannel(channelId: string, page: number, perPage: n export function getProfilesInGroupChannels(channelsIds: Array): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; + let channelProfiles; - let channelProfiles = null; try { channelProfiles = await Client4.getProfilesInGroupChannels(channelsIds.slice(0, General.MAX_GROUP_CHANNELS_FOR_PROFILES)); } catch (error) { @@ -519,7 +504,7 @@ export function getProfilesInGroupChannels(channelsIds: Array): ActionFu return {error}; } - const actions = []; + const actions: Action[] = []; for (const channelId in channelProfiles) { if (channelProfiles.hasOwnProperty(channelId)) { const profiles = channelProfiles[channelId]; @@ -547,8 +532,8 @@ export function getProfilesInGroupChannels(channelsIds: Array): ActionFu export function getProfilesNotInChannel(teamId: string, channelId: string, groupConstrained: boolean, page: number, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; + let profiles; - let profiles = null; try { profiles = await Client4.getProfilesNotInChannel(teamId, channelId, groupConstrained, page, perPage); } catch (error) { @@ -583,26 +568,29 @@ export function getMe(): ActionFunc { clientFunc: Client4.getMe, onSuccess: UserTypes.RECEIVED_ME, }); - const me: $Subtype = await getMeFunc(dispatch, getState); - if (me.error) { + const me = await getMeFunc(dispatch, getState); + + if ('error' in me) { return me; } - dispatch(loadRolesIfNeeded(me.data.roles.split(' '))); + if ('data' in me) { + dispatch(loadRolesIfNeeded(me.data.roles.split(' '))); + } return me; }; } export function updateMyTermsOfServiceStatus(termsOfServiceId: string, accepted: boolean): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { - const response: $Subtype = await dispatch(bindClientFunc({ + const response: ActionResult = await dispatch(bindClientFunc({ clientFunc: Client4.updateMyTermsOfServiceStatus, params: [ termsOfServiceId, accepted, ], })); - const {data, error} = response; - if (data) { + + if ('data' in response) { if (accepted) { dispatch({ type: UserTypes.RECEIVED_TERMS_OF_SERVICE_STATUS, @@ -613,9 +601,15 @@ export function updateMyTermsOfServiceStatus(termsOfServiceId: string, accepted: }, }); } - return {data}; + + return { + data: response.data, + }; } - return {error}; + + return { + error: response.error, + }; }; } @@ -835,7 +829,7 @@ export function loadProfilesForDirect(): ActionFunc { }; } -export function getUserAudits(userId: string, page: number = 0, perPage: number = General.AUDITS_CHUNK_SIZE): ActionFunc { +export function getUserAudits(userId: string, page = 0, perPage: number = General.AUDITS_CHUNK_SIZE): ActionFunc { return bindClientFunc({ clientFunc: Client4.getUserAudits, onSuccess: UserTypes.RECEIVED_AUDITS, @@ -847,7 +841,11 @@ export function getUserAudits(userId: string, page: number = 0, perPage: number }); } -export function autocompleteUsers(term: string, teamId: string = '', channelId: string = '', options: {|limit: number|} = {limit: General.AUTOCOMPLETE_LIMIT_DEFAULT}): ActionFunc { +export function autocompleteUsers(term: string, teamId = '', channelId = '', options: { + limit: number; +} = { + limit: General.AUTOCOMPLETE_LIMIT_DEFAULT, +}): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { dispatch({type: UserTypes.AUTOCOMPLETE_USERS_REQUEST, data: null}, getState); @@ -870,16 +868,12 @@ export function autocompleteUsers(term: string, teamId: string = '', channelId: users = [...users, ...data.out_of_channel]; } removeUserFromList(currentUserId, users); - - const actions = [ - { - type: UserTypes.RECEIVED_PROFILES_LIST, - data: users, - }, - { - type: UserTypes.AUTOCOMPLETE_USERS_SUCCESS, - }, - ]; + const actions: Action[] = [{ + type: UserTypes.RECEIVED_PROFILES_LIST, + data: users, + }, { + type: UserTypes.AUTOCOMPLETE_USERS_SUCCESS, + }]; if (channelId) { actions.push( @@ -914,7 +908,7 @@ export function autocompleteUsers(term: string, teamId: string = '', channelId: }; } -export function searchProfiles(term: string, options: Object = {}): ActionFunc { +export function searchProfiles(term: string, options: any = {}): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const {currentUserId} = getState().entities.users; @@ -927,7 +921,7 @@ export function searchProfiles(term: string, options: Object = {}): ActionFunc { return {error}; } - const actions = [{type: UserTypes.RECEIVED_PROFILES_LIST, data: removeUserFromList(currentUserId, [...profiles])}]; + const actions: Action[] = [{type: UserTypes.RECEIVED_PROFILES_LIST, data: removeUserFromList(currentUserId, [...profiles])}]; if (options.in_channel_id) { actions.push({ @@ -967,7 +961,7 @@ export function searchProfiles(term: string, options: Object = {}): ActionFunc { }; } -let statusIntervalId = null; +let statusIntervalId; export function startPeriodicStatusUpdates(): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { if (statusIntervalId) { @@ -1064,7 +1058,7 @@ export function updateUserRoles(userId: string, roles: Array): ActionFun }; } -export function updateUserMfa(userId: string, activate: boolean, code: string = ''): ActionFunc { +export function updateUserMfa(userId: string, activate: boolean, code = ''): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { try { await Client4.updateUserMfa(userId, activate, code); @@ -1191,7 +1185,7 @@ export function uploadProfileImage(userId: string, imageData: any): ActionFunc { }; } -export function switchEmailToOAuth(service: string, email: string, password: string, mfaCode: string = ''): ActionFunc { +export function switchEmailToOAuth(service: string, email: string, password: string, mfaCode = ''): ActionFunc { return bindClientFunc({ clientFunc: Client4.switchEmailToOAuth, params: [ @@ -1214,7 +1208,7 @@ export function switchOAuthToEmail(currentService: string, email: string, passwo }); } -export function switchEmailToLdap(email: string, emailPassword: string, ldapId: string, ldapPassword: string, mfaCode: string = ''): ActionFunc { +export function switchEmailToLdap(email: string, emailPassword: string, ldapId: string, ldapPassword: string, mfaCode = ''): ActionFunc { return bindClientFunc({ clientFunc: Client4.switchEmailToLdap, params: [ @@ -1227,7 +1221,7 @@ export function switchEmailToLdap(email: string, emailPassword: string, ldapId: }); } -export function switchLdapToEmail(ldapPassword: string, email: string, emailPassword: string, mfaCode: string = ''): ActionFunc { +export function switchLdapToEmail(ldapPassword: string, email: string, emailPassword: string, mfaCode = ''): ActionFunc { return bindClientFunc({ clientFunc: Client4.switchLdapToEmail, params: [ @@ -1242,6 +1236,7 @@ export function switchLdapToEmail(ldapPassword: string, email: string, emailPass export function createUserAccessToken(userId: string, description: string): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; + try { data = await Client4.createUserAccessToken(userId, description); } catch (error) { @@ -1250,12 +1245,12 @@ export function createUserAccessToken(userId: string, description: string): Acti return {error}; } - const actions = [ - { - type: AdminTypes.RECEIVED_USER_ACCESS_TOKEN, - data: {...data, token: ''}, + const actions: Action[] = [{ + type: AdminTypes.RECEIVED_USER_ACCESS_TOKEN, + data: {...data, + token: '', }, - ]; + }]; const {currentUserId} = getState().entities.users; if (userId === currentUserId) { @@ -1284,12 +1279,10 @@ export function getUserAccessToken(tokenId: string): ActionFunc { return {error}; } - const actions = [ - { - type: AdminTypes.RECEIVED_USER_ACCESS_TOKEN, - data, - }, - ]; + const actions: Action[] = [{ + type: AdminTypes.RECEIVED_USER_ACCESS_TOKEN, + data, + }]; const {currentUserId} = getState().entities.users; if (data.user_id === currentUserId) { @@ -1307,9 +1300,10 @@ export function getUserAccessToken(tokenId: string): ActionFunc { }; } -export function getUserAccessTokens(page: number = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { +export function getUserAccessTokens(page = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; + try { data = await Client4.getUserAccessTokens(page, perPage); } catch (error) { @@ -1331,7 +1325,7 @@ export function getUserAccessTokens(page: number = 0, perPage: number = General. }; } -export function getUserAccessTokensForUser(userId: string, page: number = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { +export function getUserAccessTokensForUser(userId: string, page = 0, perPage: number = General.PROFILE_CHUNK_SIZE): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let data; try { @@ -1342,13 +1336,11 @@ export function getUserAccessTokensForUser(userId: string, page: number = 0, per return {error}; } - const actions = [ - { - type: AdminTypes.RECEIVED_USER_ACCESS_TOKENS_FOR_USER, - data, - userId, - }, - ]; + const actions: Action[] = [{ + type: AdminTypes.RECEIVED_USER_ACCESS_TOKENS_FOR_USER, + data, + userId, + }]; const {currentUserId} = getState().entities.users; if (userId === currentUserId) { diff --git a/src/actions/websocket.test.js b/src/actions/websocket.test.js index 19084b33d..d6eb513bd 100644 --- a/src/actions/websocket.test.js +++ b/src/actions/websocket.test.js @@ -14,7 +14,7 @@ import * as TeamActions from 'actions/teams'; import * as UserActions from 'actions/users'; import {Client4} from 'client'; -import {General, Posts, RequestStatus, WebsocketEvents} from 'constants'; +import {General, Posts, RequestStatus, WebsocketEvents} from '../constants'; import { PostTypes, TeamTypes, diff --git a/src/actions/websocket.js b/src/actions/websocket.ts similarity index 91% rename from src/actions/websocket.js rename to src/actions/websocket.ts index 28474ee81..71b31309e 100644 --- a/src/actions/websocket.js +++ b/src/actions/websocket.ts @@ -1,52 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {Client4} from 'client'; -import websocketClient from 'client/websocket_client'; -import { - checkForModifiedUsers, - getMe, - getProfilesByIds, - getStatusesByIds, - loadProfilesForDirect, -} from './users'; -import { - fetchMyChannelsAndMembers, - getChannelAndMyMember, - getChannelStats, - markChannelAsRead, -} from './channels'; -import { - getPost, - getPosts, - getProfilesAndStatusesForPosts, - getCustomEmojiForReaction, - handleNewPost, - postDeleted, - receivedPost, -} from './posts'; -import { - getTeam, - getMyTeamUnreads, - getMyTeams, - getMyTeamMembers, -} from './teams'; - -import { - ChannelTypes, - GeneralTypes, - EmojiTypes, - PostTypes, - PreferenceTypes, - TeamTypes, - UserTypes, - RoleTypes, - AdminTypes, - IntegrationTypes, -} from 'action_types'; -import {General, WebsocketEvents, Preferences} from 'constants'; +import websocketClient from '../client/websocket_client'; +import {ChannelTypes, GeneralTypes, EmojiTypes, PostTypes, PreferenceTypes, TeamTypes, UserTypes, RoleTypes, AdminTypes, IntegrationTypes} from 'action_types'; +import {General, WebsocketEvents, Preferences} from '../constants'; import {getAllChannels, getChannel, getChannelsNameMapInTeam, getCurrentChannelId, getRedirectChannelNameForTeam, getCurrentChannelStats} from 'selectors/entities/channels'; import {getConfig} from 'selectors/entities/general'; import {getAllPosts} from 'selectors/entities/posts'; @@ -56,16 +14,15 @@ import {getCurrentUser, getCurrentUserId, getUsers, getUserStatuses} from 'selec import {getChannelByName} from 'utils/channel_utils'; import {fromAutoResponder} from 'utils/post_utils'; import EventEmitter from 'utils/event_emitter'; -import type { - ActionFunc, - DispatchFunc, - GetStateFunc, - PlatformType, -} from '../types/actions'; -let doDispatch; +import {ActionFunc, DispatchFunc, GetStateFunc, PlatformType} from '../types/actions'; -export function init(platform: PlatformType, siteUrl: ?string, token: ?string, optionalWebSocket: Object, additionalOptions: Object = {}) { +import {getTeam, getMyTeamUnreads, getMyTeams, getMyTeamMembers} from './teams'; +import {getPost, getPosts, getProfilesAndStatusesForPosts, getCustomEmojiForReaction, handleNewPost, postDeleted, receivedPost} from './posts'; +import {fetchMyChannelsAndMembers, getChannelAndMyMember, getChannelStats, markChannelAsRead} from './channels'; +import {checkForModifiedUsers, getMe, getProfilesByIds, getStatusesByIds, loadProfilesForDirect} from './users'; +let doDispatch; +export function init(platform: PlatformType, siteUrl: string | undefined | null, token: string | undefined | null, optionalWebSocket: any, additionalOptions: any = {}) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const config = getConfig(getState()); let connUrl = siteUrl || config.WebsocketURL || Client4.getUrl(); @@ -114,7 +71,7 @@ export function init(platform: PlatformType, siteUrl: ?string, token: ?string, o } let reconnect = false; -export function close(shouldReconnect: boolean = false) { +export function close(shouldReconnect = false) { return async (dispatch: DispatchFunc) => { reconnect = shouldReconnect; websocketClient.close(true); @@ -175,11 +132,12 @@ export function doReconnect(now: number) { if (currentTeamMembership) { dispatch(getPosts(currentChannelId)); const fethcResult = await dispatch(fetchMyChannelsAndMembers(currentTeamId)); - const data = fethcResult.data || null; + const data = (fethcResult as any).data || null; dispatch(loadProfilesForDirect()); if (data && data.members) { const stillMemberOfCurrentChannel = data.members.find((m) => m.channel_id === currentChannelId); + if (!stillMemberOfCurrentChannel) { EventEmitter.emit(General.SWITCH_TO_DEFAULT_CHANNEL, currentTeamId); } @@ -338,7 +296,7 @@ function handleEvent(msg) { } function handleNewPostEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const post = JSON.parse(msg.data.post); dispatch(handleNewPost(msg)); @@ -355,7 +313,7 @@ function handleNewPostEvent(msg) { } function handlePostEdited(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const data = JSON.parse(msg.data.post); getProfilesAndStatusesForPosts([data], dispatch, getState); @@ -371,7 +329,7 @@ function handlePostDeleted(msg) { } function handleLeaveTeamEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const teams = getTeamsSelector(state); const currentTeamId = getCurrentTeamId(state); @@ -407,7 +365,7 @@ function handleTeamAddedEvent(msg) { } function handleUserAddedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const currentChannelId = getCurrentChannelId(state); const currentTeamId = getCurrentTeamId(state); @@ -434,7 +392,7 @@ function handleUserAddedEvent(msg) { } function handleUserRemovedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const channels = getAllChannels(state); const currentChannelId = getCurrentChannelId(state); @@ -478,7 +436,7 @@ function handleUserRemovedEvent(msg) { } function handleUserUpdatedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const currentUser = getCurrentUser(getState()); const user = msg.data.user; @@ -528,7 +486,7 @@ function handleRoleUpdatedEvent(msg) { } function handleChannelCreatedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const {channel_id: channelId, team_id: teamId} = msg.data; const state = getState(); const channels = getAllChannels(state); @@ -542,7 +500,7 @@ function handleChannelCreatedEvent(msg) { } function handleChannelDeletedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const currentChannelId = getCurrentChannelId(state); const currentTeamId = getCurrentTeamId(state); @@ -568,7 +526,7 @@ function handleChannelDeletedEvent(msg) { } function handleChannelUpdatedEvent(msg) { - return async (dispatch, getState) => { + return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let channel; try { channel = msg.data ? JSON.parse(msg.data.channel) : null; @@ -594,8 +552,9 @@ function handleChannelUpdatedEvent(msg) { } // handleChannelConvertedEvent handles updating of channel which is converted from public to private + function handleChannelConvertedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const channelId = msg.data.channel_id; if (channelId) { const channel = getChannel(getState(), channelId); @@ -611,14 +570,14 @@ function handleChannelConvertedEvent(msg) { } function handleChannelViewedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const {channel_id: channelId} = msg.data; const currentChannelId = getCurrentChannelId(state); const currentUserId = getCurrentUserId(state); if (channelId !== currentChannelId && currentUserId === msg.broadcast.user_id) { - dispatch(markChannelAsRead(channelId, null, false)); + dispatch(markChannelAsRead(channelId, undefined, false)); } return {data: true}; }; @@ -651,7 +610,7 @@ function handlePreferenceChangedEvent(msg) { } function handlePreferencesChangedEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const preferences = JSON.parse(msg.data.preferences); const posts = getAllPosts(getState()); @@ -689,7 +648,7 @@ function handleHelloEvent(msg) { } function handleUserTypingEvent(msg) { - return (dispatch, getState) => { + return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); const profiles = getUsers(state); const statuses = getUserStatuses(state); @@ -799,8 +758,8 @@ function handleOpenDialogEvent(msg) { // Helpers function getAddedDmUsersIfNecessary(preferences) { - return (dispatch, getState) => { - const userIds = []; + return (dispatch: DispatchFunc, getState: GetStateFunc) => { + const userIds: string[] = []; for (const preference of preferences) { if (preference.category === Preferences.CATEGORY_DIRECT_CHANNEL_SHOW && preference.value === 'true') { @@ -817,8 +776,8 @@ function getAddedDmUsersIfNecessary(preferences) { const statuses = getUserStatuses(state); const currentUserId = getCurrentUserId(state); - const needProfiles = []; - const needStatuses = []; + const needProfiles: string[] = []; + const needStatuses: string[] = []; for (const userId of userIds) { if (!profiles[userId] && userId !== currentUserId) { diff --git a/src/client/client4.js b/src/client/client4.ts similarity index 96% rename from src/client/client4.js rename to src/client/client4.ts index 71de05291..d903d8156 100644 --- a/src/client/client4.js +++ b/src/client/client4.ts @@ -1,15 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {isSystemAdmin} from '../utils/user_utils'; +import {buildQueryString, isMinimumServerVersion} from 'utils/helpers'; +import {cleanUrlForLogging} from 'utils/sentry'; +import {General} from '../constants'; -const FormData = require('form-data'); +import {isSystemAdmin} from 'utils/user_utils'; import fetch from './fetch_etag'; -import {buildQueryString, isMinimumServerVersion} from 'src/utils/helpers'; -import {cleanUrlForLogging} from 'src/utils/sentry'; -import {General} from 'constants'; +import {UserProfile} from 'types/users'; +const FormData = require('form-data'); const HEADER_AUTH = 'Authorization'; const HEADER_BEARER = 'BEARER'; const HEADER_REQUESTED_WITH = 'X-Requested-With'; @@ -17,7 +18,6 @@ const HEADER_USER_AGENT = 'User-Agent'; const HEADER_X_CLUSTER_ID = 'X-Cluster-Id'; const HEADER_X_CSRF_TOKEN = 'X-CSRF-Token'; export const HEADER_X_VERSION_ID = 'X-Version-Id'; - const PER_PAGE_DEFAULT = 60; const LOGS_PER_PAGE_DEFAULT = 10000; export const DEFAULT_LIMIT_BEFORE = 30; @@ -25,26 +25,24 @@ export const DEFAULT_LIMIT_AFTER = 30; /* eslint-disable no-throw-literal */ export default class Client4 { - constructor() { - this.logToConsole = false; - this.serverVersion = ''; - this.clusterId = ''; - this.token = ''; - this.csrf = ''; - this.url = ''; - this.urlVersion = '/api/v4'; - this.userAgent = null; - this.enableLogging = false; - this.defaultHeaders = {}; - this.userId = ''; - this.diagnosticId = ''; - this.includeCookies = true; - - this.translations = { - connectionError: 'There appears to be a problem with your internet connection.', - unknownError: 'We received an unexpected status code from the server.', - }; - } + logToConsole = false; + serverVersion = ''; + clusterId = ''; + token = ''; + csrf = ''; + url = ''; + urlVersion = '/api/v4'; + userAgent = null; + enableLogging = false; + defaultHeaders = {}; + userId = ''; + diagnosticId = ''; + includeCookies = true; + translations = { + connectionError: 'There appears to be a problem with your internet connection.', + unknownError: 'We received an unexpected status code from the server.', + }; + userRoles?: any; getUrl() { return this.url; @@ -334,7 +332,7 @@ export default class Client4 { createUser = async (user, token, inviteId) => { this.trackEvent('api', 'api_users_create'); - const queryParams = {}; + const queryParams: any = {}; if (token) { queryParams.t = token; @@ -400,10 +398,12 @@ export default class Client4 { `${this.getUserRoute(userId)}/roles`, {method: 'put', body: JSON.stringify({roles})} ); - } - + }; updateUserMfa = async (userId, activate, code) => { - const body = {activate}; + const body: any = { + activate, + }; + if (activate) { body.code = code; } @@ -455,8 +455,7 @@ export default class Client4 { const formData = new FormData(); formData.append('image', imageData); - - const request = { + const request: any = { method: 'post', body: formData, }; @@ -524,7 +523,7 @@ export default class Client4 { this.trackEvent('api', 'api_users_login_ldap'); } - const body = { + const body: any = { device_id: deviceId, login_id: loginId, password, @@ -545,8 +544,7 @@ export default class Client4 { loginById = async (id, password, token = '', deviceId = '') => { this.trackEvent('api', 'api_users_login'); - - const body = { + const body: any = { device_id: deviceId, id, password, @@ -617,7 +615,7 @@ export default class Client4 { getProfilesNotInTeam = async (teamId, groupConstrained, page = 0, perPage = PER_PAGE_DEFAULT) => { this.trackEvent('api', 'api_profiles_get_not_in_team', {team_id: teamId, group_constrained: groupConstrained}); - const queryStringObj = {not_in_team: teamId, page, per_page: perPage}; + const queryStringObj: any = {not_in_team: teamId, page, per_page: perPage}; if (groupConstrained) { queryStringObj.group_constrained = true; } @@ -665,7 +663,7 @@ export default class Client4 { getProfilesNotInChannel = async (teamId, channelId, groupConstrained, page = 0, perPage = PER_PAGE_DEFAULT) => { this.trackEvent('api', 'api_profiles_get_not_in_channel', {team_id: teamId, channel_id: channelId, group_constrained: groupConstrained}); - const queryStringObj = {in_team: teamId, not_in_channel: channelId, page, per_page: perPage}; + const queryStringObj: any = {in_team: teamId, not_in_channel: channelId, page, per_page: perPage}; if (groupConstrained) { queryStringObj.group_constrained = true; } @@ -705,25 +703,29 @@ export default class Client4 { }; getProfilePictureUrl = (userId, lastPictureUpdate) => { - const params = {}; + const params: any = {}; + if (lastPictureUpdate) { params._ = lastPictureUpdate; } return `${this.getUserRoute(userId)}/image${buildQueryString(params)}`; }; - getDefaultProfilePictureUrl = (userId) => { return `${this.getUserRoute(userId)}/image/default`; }; - - autocompleteUsers = async (name, teamId, channelId, options = {limit: General.AUTOCOMPLETE_LIMIT_DEFAULT}) => { - return this.doFetch( - `${this.getUsersRoute()}/autocomplete${buildQueryString({in_team: teamId, in_channel: channelId, name, limit: options.limit})}`, - {method: 'get'} - ); + autocompleteUsers = async (name, teamId, channelId, options = { + limit: General.AUTOCOMPLETE_LIMIT_DEFAULT, + }) => { + return this.doFetch(`${this.getUsersRoute()}/autocomplete${buildQueryString({ + in_team: teamId, + in_channel: channelId, + name, + limit: options.limit, + })}`, { + method: 'get', + }); }; - getSessions = async (userId) => { return this.doFetch( `${this.getUserRoute(userId)}/sessions`, @@ -1096,7 +1098,7 @@ export default class Client4 { addUsersToTeam = async (teamId, userIds) => { this.trackEvent('api', 'api_teams_batch_add_members', {team_id: teamId, count: userIds.length}); - const members = []; + const members: any = []; userIds.forEach((id) => members.push({team_id: teamId, user_id: id})); return this.doFetch( `${this.getTeamMembersRoute(teamId)}/batch`, @@ -1182,7 +1184,7 @@ export default class Client4 { formData.append('filesize', file.size); formData.append('importFrom', importFrom); - const request = { + const request: any = { method: 'post', body: formData, }; @@ -1200,7 +1202,7 @@ export default class Client4 { }; getTeamIconUrl = (teamId, lastTeamIconUpdate) => { - const params = {}; + const params: any = {}; if (lastTeamIconUpdate) { params._ = lastTeamIconUpdate; } @@ -1214,7 +1216,7 @@ export default class Client4 { const formData = new FormData(); formData.append('image', imageData); - const request = { + const request: any = { method: 'post', body: formData, }; @@ -1719,7 +1721,7 @@ export default class Client4 { this.trackEvent('api', 'api_interactive_messages_button_clicked'); } - const msg = { + const msg: any = { selected_option: selectedOption, }; if (actionCookie !== '') { @@ -1762,8 +1764,7 @@ export default class Client4 { uploadFile = async (fileFormData, formBoundary) => { this.trackEvent('api', 'api_files_upload'); - - const request = { + const request: any = { method: 'post', body: fileFormData, }; @@ -1886,7 +1887,10 @@ export default class Client4 { }; getIncomingWebhooks = async (teamId = '', page = 0, perPage = PER_PAGE_DEFAULT) => { - const queryParams = {page, per_page: perPage}; + const queryParams: any = { + page, + per_page: perPage, + }; if (teamId) { queryParams.team_id = teamId; @@ -1933,7 +1937,10 @@ export default class Client4 { }; getOutgoingWebhooks = async (channelId = '', teamId = '', page = 0, perPage = PER_PAGE_DEFAULT) => { - const queryParams = {page, per_page: perPage}; + const queryParams: any = { + page, + per_page: perPage, + }; if (channelId) { queryParams.channel_id = channelId; @@ -2107,8 +2114,7 @@ export default class Client4 { const formData = new FormData(); formData.append('image', imageData); formData.append('emoji', JSON.stringify(emoji)); - - const request = { + const request: any = { method: 'post', body: formData, }; @@ -2335,8 +2341,7 @@ export default class Client4 { uploadBrandImage = async (imageData) => { const formData = new FormData(); formData.append('image', imageData); - - const request = { + const request: any = { method: 'post', body: formData, }; @@ -2490,7 +2495,7 @@ export default class Client4 { const formData = new FormData(); formData.append('license', fileData); - const request = { + const request: any = { method: 'post', body: formData, }; @@ -2619,7 +2624,7 @@ export default class Client4 { } formData.append('plugin', fileData); - const request = { + const request: any = { method: 'post', body: formData, }; @@ -2932,7 +2937,7 @@ export default class Client4 { }); }; - trackEvent(category, event, props) { + trackEvent(category, event, props?) { // Temporary change to allow only certain events to reduce data rate - see MM-13062 if (![ 'api_posts_create', @@ -2967,14 +2972,15 @@ export default class Client4 { }, anonymousId: '00000000000000000000000000', }; - - if (global && global.window && global.window.analytics && global.window.analytics.initialized) { - global.window.analytics.track('event', properties, options); - } else if (global && global.analytics) { - if (global.analytics_context) { - options.context = global.analytics_context; + const globalAny: any = global; + if (globalAny && globalAny.window && globalAny.window.analytics && globalAny.window.analytics.initialized) { + globalAny.window.analytics.track('event', properties, options); + } else if (globalAny && globalAny.analytics) { + if (globalAny.analytics_context) { + options.context = globalAny.analytics_context; } - global.analytics.track(Object.assign({ + + globalAny.analytics.track(Object.assign({ event: 'event', userId: this.diagnosticId, }, {properties}, options)); @@ -3002,6 +3008,10 @@ function parseAndMergeNestedHeaders(originalHeaders) { } export class ClientError extends Error { + url: string; + intl: { defaultMessage: string; id: string } | { defaultMessage: string; id: string } | { id: string; defaultMessage: string; values: any } | { id: string; defaultMessage: string }; + server_error_id: any; + status_code: any; constructor(baseUrl, data) { super(data.message + ': ' + cleanUrlForLogging(baseUrl, data.url)); diff --git a/src/client/fetch_etag.js b/src/client/fetch_etag.ts similarity index 80% rename from src/client/fetch_etag.js rename to src/client/fetch_etag.ts index 0346251d4..1ab98236f 100644 --- a/src/client/fetch_etag.js +++ b/src/client/fetch_etag.ts @@ -1,20 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - const data = {}; const etags = {}; - -export default (url = null, options = {headers: {}}) => { +type Options = { headers: any; method?: string;url?: string }; +export default ((url?: string, options: Options = {headers: {}}) => { url = url || options.url; // eslint-disable-line no-param-reassign if (options.method === 'GET' || !options.method) { - const etag = etags[url]; + const etag = etags[url!]; const cachedResponse = data[`${url}${etag}`]; // ensure etag is for url if (etag) { options.headers['If-None-Match'] = etag; } - return fetch(url, options). + return fetch(url!, options). then((response) => { if (response.status === 304) { return cachedResponse.clone(); @@ -25,7 +24,7 @@ export default (url = null, options = {headers: {}}) => { if (responseEtag) { data[`${url}${responseEtag}`] = response.clone(); - etags[url] = responseEtag; + etags[url!] = responseEtag; } } @@ -35,4 +34,4 @@ export default (url = null, options = {headers: {}}) => { // all other requests go straight to fetch return Reflect.apply(fetch, undefined, [url, options]); //eslint-disable-line no-undefined -}; +}); diff --git a/src/client/index.ts b/src/client/index.ts new file mode 100644 index 000000000..f1e500cfd --- /dev/null +++ b/src/client/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import ClientClass4, {DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID} from './client4'; +const Client4 = new ClientClass4(); +export {Client4, DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID}; diff --git a/src/client/websocket_client.js b/src/client/websocket_client.ts similarity index 91% rename from src/client/websocket_client.js rename to src/client/websocket_client.ts index d1957f446..278cbfb89 100644 --- a/src/client/websocket_client.js +++ b/src/client/websocket_client.ts @@ -1,25 +1,33 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - const MAX_WEBSOCKET_FAILS = 7; const MIN_WEBSOCKET_RETRY_TIME = 3000; // 3 sec + const MAX_WEBSOCKET_RETRY_TIME = 300000; // 5 mins let Socket; class WebSocketClient { + conn?: WebSocket; + connectionUrl: null; + token: null; + sequence: number; + connectFailCount: number; + eventCallback?: Function; + firstConnectCallback?: Function; + reconnectCallback?: Function; + errorCallback?: Function; + closeCallback?: Function; + connectingCallback?: Function; + stop: boolean; + platform: string; + connectionTimeout: any; + constructor() { - this.conn = null; this.connectionUrl = null; this.token = null; this.sequence = 1; this.connectFailCount = 0; - this.eventCallback = null; - this.firstConnectCallback = null; - this.reconnectCallback = null; - this.errorCallback = null; - this.closeCallback = null; - this.connectingCallback = null; this.stop = false; this.platform = ''; } @@ -90,7 +98,7 @@ class WebSocketClient { this.connectionUrl = connectionUrl; this.token = token; - this.conn.onopen = () => { + this.conn!.onopen = () => { if (token) { // we check for the platform as a workaround until we fix on the server that further authentications // are ignored @@ -110,8 +118,8 @@ class WebSocketClient { resolve(); }; - this.conn.onclose = () => { - this.conn = null; + this.conn!.onclose = () => { + this.conn = undefined; this.sequence = 1; if (this.connectFailCount === 0) { @@ -150,7 +158,7 @@ class WebSocketClient { ); }; - this.conn.onerror = (evt) => { + this.conn!.onerror = (evt) => { if (this.connectFailCount <= 1) { console.log('websocket error'); //eslint-disable-line no-console console.log(evt); //eslint-disable-line no-console @@ -161,7 +169,7 @@ class WebSocketClient { } }; - this.conn.onmessage = (evt) => { + this.conn!.onmessage = (evt) => { const msg = JSON.parse(evt.data); if (msg.seq_reply) { if (msg.error) { @@ -205,7 +213,7 @@ class WebSocketClient { if (this.conn && this.conn.readyState === Socket.OPEN) { this.conn.onclose = () => {}; //eslint-disable-line no-empty-function this.conn.close(); - this.conn = null; + this.conn = undefined; console.log('websocket closed'); //eslint-disable-line no-console } } @@ -220,7 +228,7 @@ class WebSocketClient { if (this.conn && this.conn.readyState === Socket.OPEN) { this.conn.send(JSON.stringify(msg)); } else if (!this.conn || this.conn.readyState === Socket.CLOSED) { - this.conn = null; + this.conn = undefined; this.initialize(this.token, {platform: this.platform}); } } diff --git a/src/constants/alerts.js b/src/constants/alerts.ts similarity index 58% rename from src/constants/alerts.js rename to src/constants/alerts.ts index edf348e49..dc76e5887 100644 --- a/src/constants/alerts.js +++ b/src/constants/alerts.ts @@ -1,9 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow +import {AlertTypeType} from 'types/alerts'; +import {Dictionary} from 'types/utilities'; -export default { +const alerts: Dictionary = +{ ALERT_NOTIFICATION: 'notification', ALERT_DEVELOPER: 'developer', ALERT_ERROR: 'error', }; +export default alerts; diff --git a/src/constants/emoji.js b/src/constants/emoji.ts similarity index 94% rename from src/constants/emoji.js rename to src/constants/emoji.ts index aff4379b1..836704696 100644 --- a/src/constants/emoji.js +++ b/src/constants/emoji.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { SORT_BY_NAME: 'name', }; diff --git a/src/constants/files.js b/src/constants/files.ts similarity index 99% rename from src/constants/files.js rename to src/constants/files.ts index e9271e38e..d5e860d9e 100644 --- a/src/constants/files.js +++ b/src/constants/files.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { AUDIO_TYPES: ['mp3', 'wav', 'wma', 'm4a', 'flac', 'aac', 'ogg'], CODE_TYPES: ['as', 'applescript', 'osascript', 'scpt', 'bash', 'sh', 'zsh', 'clj', 'boot', 'cl2', 'cljc', 'cljs', 'cljs.hl', 'cljscm', 'cljx', 'hic', 'coffee', '_coffee', 'cake', 'cjsx', 'cson', 'iced', 'cpp', 'c', 'cc', 'h', 'c++', 'h++', 'hpp', 'cs', 'csharp', 'css', 'd', 'di', 'dart', 'delphi', 'dpr', 'dfm', 'pas', 'pascal', 'freepascal', 'lazarus', 'lpr', 'lfm', 'diff', 'django', 'jinja', 'dockerfile', 'docker', 'erl', 'f90', 'f95', 'fsharp', 'fs', 'gcode', 'nc', 'go', 'groovy', 'handlebars', 'hbs', 'html.hbs', 'html.handlebars', 'hs', 'hx', 'java', 'jsp', 'js', 'jsx', 'json', 'jl', 'kt', 'ktm', 'kts', 'less', 'lisp', 'lua', 'mk', 'mak', 'md', 'mkdown', 'mkd', 'matlab', 'm', 'mm', 'objc', 'obj-c', 'ml', 'perl', 'pl', 'php', 'php3', 'php4', 'php5', 'php6', 'ps', 'ps1', 'pp', 'py', 'gyp', 'r', 'ruby', 'rb', 'gemspec', 'podspec', 'thor', 'irb', 'rs', 'scala', 'scm', 'sld', 'scss', 'st', 'sql', 'swift', 'tex', 'txt', 'vbnet', 'vb', 'bas', 'vbs', 'v', 'veo', 'xml', 'html', 'xhtml', 'rss', 'atom', 'xsl', 'plist', 'yaml'], diff --git a/src/constants/general.js b/src/constants/general.ts similarity index 95% rename from src/constants/general.js rename to src/constants/general.ts index 5b86e19da..99d428732 100644 --- a/src/constants/general.js +++ b/src/constants/general.ts @@ -1,11 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { CONFIG_CHANGED: 'config_changed', SERVER_VERSION_CHANGED: 'server_version_changed', - PAGE_SIZE_DEFAULT: 60, PAGE_SIZE_MAXIMUM: 200, LOGS_PAGE_SIZE_DEFAULT: 10000, @@ -16,80 +13,58 @@ export default { JOBS_CHUNK_SIZE: 50, SEARCH_TIMEOUT_MILLISECONDS: 100, STATUS_INTERVAL: 60000, - AUTOCOMPLETE_LIMIT_DEFAULT: 25, AUTOCOMPLETE_SPLIT_CHARACTERS: ['.', '-', '_'], - MENTION: 'mention', - OUT_OF_OFFICE: 'ooo', OFFLINE: 'offline', AWAY: 'away', ONLINE: 'online', DND: 'dnd', - PERMISSIONS_ALL: 'all', PERMISSIONS_CHANNEL_ADMIN: 'channel_admin', PERMISSIONS_TEAM_ADMIN: 'team_admin', PERMISSIONS_SYSTEM_ADMIN: 'system_admin', - TEAM_GUEST_ROLE: 'team_guest', TEAM_USER_ROLE: 'team_user', TEAM_ADMIN_ROLE: 'team_admin', - CHANNEL_GUEST_ROLE: 'channel_guest', CHANNEL_USER_ROLE: 'channel_user', CHANNEL_ADMIN_ROLE: 'channel_admin', - SYSTEM_GUEST_ROLE: 'system_guest', SYSTEM_USER_ROLE: 'system_user', SYSTEM_ADMIN_ROLE: 'system_admin', SYSTEM_USER_ACCESS_TOKEN_ROLE: 'system_user_access_token', SYSTEM_POST_ALL_ROLE: 'system_post_all', SYSTEM_POST_ALL_PUBLIC_ROLE: 'system_post_all_public', - ALLOW_EDIT_POST_ALWAYS: 'always', ALLOW_EDIT_POST_NEVER: 'never', ALLOW_EDIT_POST_TIME_LIMIT: 'time_limit', DEFAULT_POST_EDIT_TIME_LIMIT: 300, - RESTRICT_DIRECT_MESSAGE_ANY: 'any', RESTRICT_DIRECT_MESSAGE_TEAM: 'team', - SWITCH_TO_DEFAULT_CHANNEL: 'switch_to_default_channel', DEFAULT_CHANNEL: 'town-square', DM_CHANNEL: 'D', OPEN_CHANNEL: 'O', PRIVATE_CHANNEL: 'P', GM_CHANNEL: 'G', - PUSH_NOTIFY_APPLE_REACT_NATIVE: 'apple_rn', PUSH_NOTIFY_ANDROID_REACT_NATIVE: 'android_rn', - STORE_REHYDRATION_COMPLETE: 'store_hydation_complete', OFFLINE_STORE_RESET: 'offline_store_reset', OFFLINE_STORE_PURGE: 'offline_store_purge', - TEAMMATE_NAME_DISPLAY: { SHOW_USERNAME: 'username', SHOW_NICKNAME_FULLNAME: 'nickname_full_name', SHOW_FULLNAME: 'full_name', }, - - SPECIAL_MENTIONS: [ - 'all', - 'channel', - 'here', - ], - + SPECIAL_MENTIONS: ['all', 'channel', 'here'], MAX_USERS_IN_GM: 8, MIN_USERS_IN_GM: 3, MAX_GROUP_CHANNELS_FOR_PROFILES: 50, - DEFAULT_LOCALE: 'en', - DEFAULT_AUTOLINKED_URL_SCHEMES: ['http', 'https', 'ftp', 'mailto', 'tel'], - DISABLED: 'disabled', DEFAULT_ON: 'default_on', DEFAULT_OFF: 'default_off', diff --git a/src/constants/groups.js b/src/constants/groups.ts similarity index 95% rename from src/constants/groups.js rename to src/constants/groups.ts index 3cd5c0f1a..b66273891 100644 --- a/src/constants/groups.js +++ b/src/constants/groups.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { SYNCABLE_TYPE_TEAM: 'team', SYNCABLE_TYPE_CHANNEL: 'channel', diff --git a/src/constants/index.js b/src/constants/index.ts similarity index 73% rename from src/constants/index.js rename to src/constants/index.ts index 4ce58e84f..a71ccaff2 100644 --- a/src/constants/index.js +++ b/src/constants/index.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import General from './general'; import RequestStatus from './request_status'; import WebsocketEvents from './websocket'; @@ -16,21 +14,4 @@ import Emoji from './emoji'; import Plugins from './plugins'; import Groups from './groups'; import Users from './users'; - -export { - General, - Preferences, - Posts, - Files, - RequestStatus, - WebsocketEvents, - Alerts, - Teams, - Stats, - Permissions, - Emoji, - Plugins, - Groups, - Users, -}; - +export {General, Preferences, Posts, Files, RequestStatus, WebsocketEvents, Alerts, Teams, Stats, Permissions, Emoji, Plugins, Groups, Users}; diff --git a/src/constants/permissions.js b/src/constants/permissions.ts similarity index 99% rename from src/constants/permissions.js rename to src/constants/permissions.ts index ddc8f2408..f54a380c2 100644 --- a/src/constants/permissions.js +++ b/src/constants/permissions.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { INVITE_USER: 'invite_user', ADD_USER_TO_TEAM: 'add_user_to_team', diff --git a/src/constants/plugins.js b/src/constants/plugins.ts similarity index 98% rename from src/constants/plugins.js rename to src/constants/plugins.ts index f3b823085..3b0b93088 100644 --- a/src/constants/plugins.js +++ b/src/constants/plugins.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { PLUGIN_STATE_NOT_RUNNING: 0, PLUGIN_STATE_STARTING: 1, diff --git a/src/constants/posts.js b/src/constants/posts.ts similarity index 99% rename from src/constants/posts.js rename to src/constants/posts.ts index 50dbd8380..cb84a63d2 100644 --- a/src/constants/posts.js +++ b/src/constants/posts.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow export const PostTypes = { CHANNEL_DELETED: 'system_channel_deleted', diff --git a/src/constants/preferences.js b/src/constants/preferences.ts similarity index 96% rename from src/constants/preferences.js rename to src/constants/preferences.ts index f179f80c5..90fcd08fc 100644 --- a/src/constants/preferences.js +++ b/src/constants/preferences.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { CATEGORY_CHANNEL_OPEN_TIME: 'channel_open_time', CATEGORY_CHANNEL_APPROXIMATE_VIEW_TIME: 'channel_approximate_view_time', @@ -10,39 +8,31 @@ export default { CATEGORY_FLAGGED_POST: 'flagged_post', CATEGORY_FAVORITE_CHANNEL: 'favorite_channel', CATEGORY_AUTO_RESET_MANUAL_STATUS: 'auto_reset_manual_status', - CATEGORY_NOTIFICATIONS: 'notifications', - COMMENTS: 'comments', COMMENTS_ANY: 'any', COMMENTS_ROOT: 'root', COMMENTS_NEVER: 'never', - EMAIL: 'email', - EMAIL_INTERVAL: 'email_interval', INTERVAL_FIFTEEN_MINUTES: 15 * 60, INTERVAL_HOUR: 60 * 60, - INTERVAL_IMMEDIATE: 30, // "immediate" is a 30 second interval + INTERVAL_IMMEDIATE: 30, + + // "immediate" is a 30 second interval INTERVAL_NEVER: 0, INTERVAL_NOT_SET: -1, - CATEGORY_DISPLAY_SETTINGS: 'display_settings', NAME_NAME_FORMAT: 'name_format', DISPLAY_PREFER_NICKNAME: 'nickname_full_name', DISPLAY_PREFER_FULL_NAME: 'full_name', - MENTION_KEYS: 'mention_keys', - USE_MILITARY_TIME: 'use_military_time', - CATEGORY_SIDEBAR_SETTINGS: 'sidebar_settings', - CATEGORY_ADVANCED_SETTINGS: 'advanced_settings', ADVANCED_FILTER_JOIN_LEAVE: 'join_leave', ADVANCED_CODE_BLOCK_ON_CTRL_ENTER: 'code_block_ctrl_enter', ADVANCED_SEND_ON_CTRL_ENTER: 'send_on_ctrl_enter', - CATEGORY_THEME: 'theme', THEMES: { default: { @@ -58,6 +48,7 @@ export default { onlineIndicator: '#06d6a0', awayIndicator: '#ffbc42', dndIndicator: '#f74343', + mentionBg: '#ffffff', mentionBj: '#ffffff', mentionColor: '#145dbf', centerChannelBg: '#ffffff', @@ -84,6 +75,7 @@ export default { onlineIndicator: '#7dbe00', awayIndicator: '#dcbd4e', dndIndicator: '#ff6a6a', + mentionBg: '#fbfbfb', mentionBj: '#fbfbfb', mentionColor: '#2071f7', centerChannelBg: '#f2f4f8', @@ -110,6 +102,7 @@ export default { onlineIndicator: '#65dcc8', awayIndicator: '#c1b966', dndIndicator: '#e81023', + mentionBg: '#b74a4a', mentionBj: '#b74a4a', mentionColor: '#ffffff', centerChannelBg: '#2f3e4e', @@ -136,6 +129,7 @@ export default { onlineIndicator: '#399fff', awayIndicator: '#c1b966', dndIndicator: '#e81023', + mentionBg: '#0177e7', mentionBj: '#0177e7', mentionColor: '#ffffff', centerChannelBg: '#1f1f1f', diff --git a/src/constants/request_status.js b/src/constants/request_status.ts similarity index 59% rename from src/constants/request_status.js rename to src/constants/request_status.ts index c6a1f83c9..e87a28343 100644 --- a/src/constants/request_status.js +++ b/src/constants/request_status.ts @@ -1,11 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow +import {RequestStatusOption} from 'types/requests'; +import {Dictionary} from 'types/utilities'; -export default { +const status: Dictionary = { NOT_STARTED: 'not_started', STARTED: 'started', SUCCESS: 'success', FAILURE: 'failure', CANCELLED: 'cancelled', }; + +export default status; diff --git a/src/constants/schemes.js b/src/constants/schemes.ts similarity index 94% rename from src/constants/schemes.js rename to src/constants/schemes.ts index d84c8b5e9..94544b6a1 100644 --- a/src/constants/schemes.js +++ b/src/constants/schemes.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export const ScopeTypes = { TEAM: 'team', CHANNEL: 'channel', diff --git a/src/constants/stats.js b/src/constants/stats.ts similarity index 98% rename from src/constants/stats.js rename to src/constants/stats.ts index 9123e4aa7..30474fdf4 100644 --- a/src/constants/stats.js +++ b/src/constants/stats.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow import keyMirror from 'utils/key_mirror'; diff --git a/src/constants/teams.js b/src/constants/teams.ts similarity index 94% rename from src/constants/teams.js rename to src/constants/teams.ts index 894b8a618..e26ce91b1 100644 --- a/src/constants/teams.js +++ b/src/constants/teams.ts @@ -1,9 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { TEAM_TYPE_OPEN: 'O', TEAM_TYPE_INVITE: 'I', }; - diff --git a/src/constants/users.js b/src/constants/users.ts similarity index 96% rename from src/constants/users.js rename to src/constants/users.ts index 8f4512745..1bce8032a 100644 --- a/src/constants/users.js +++ b/src/constants/users.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default { IGNORE_CHANNEL_MENTIONS_ON: 'on', IGNORE_CHANNEL_MENTIONS_OFF: 'off', diff --git a/src/constants/websocket.js b/src/constants/websocket.ts similarity index 99% rename from src/constants/websocket.js rename to src/constants/websocket.ts index 2d980f73a..3637c6491 100644 --- a/src/constants/websocket.js +++ b/src/constants/websocket.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - const WebsocketEvents = { POSTED: 'posted', POST_EDITED: 'post_edited', @@ -39,5 +37,4 @@ const WebsocketEvents = { PLUGIN_STATUSES_CHANGED: 'plugin_statuses_changed', OPEN_DIALOG: 'open_dialog', }; - export default WebsocketEvents; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 000000000..f0632bcf7 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,14 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import * as action_types from './action_types'; +import * as actions from './actions'; +import * as client from './client'; +import * as constants from './constants'; +import * as reducers from './reducers'; +import * as selectors from './selectors'; +import store from './store'; +import * as types from './types'; +import * as utils from './utils'; + +export {action_types, actions, client, constants, reducers, selectors, store, types, utils}; diff --git a/src/reducers/entities/admin.js b/src/reducers/entities/admin.ts similarity index 99% rename from src/reducers/entities/admin.js rename to src/reducers/entities/admin.ts index 04aca5631..14f9955cd 100644 --- a/src/reducers/entities/admin.js +++ b/src/reducers/entities/admin.ts @@ -3,8 +3,8 @@ import {combineReducers} from 'redux'; import {AdminTypes, UserTypes} from 'action_types'; -import {Stats, Plugins} from 'constants'; -import PluginState from 'constants/plugins'; +import {Stats, Plugins} from '../../constants'; +import PluginState from '../../constants/plugins'; function logs(state = [], action) { switch (action.type) { @@ -36,7 +36,7 @@ function audits(state = {}, action) { } } -function config(state = {}, action) { +function config(state: any = {}, action) { switch (action.type) { case AdminTypes.RECEIVED_CONFIG: { return action.data; diff --git a/src/reducers/entities/alerts.js b/src/reducers/entities/alerts.ts similarity index 78% rename from src/reducers/entities/alerts.js rename to src/reducers/entities/alerts.ts index 6ed9fb1f7..99942c947 100644 --- a/src/reducers/entities/alerts.js +++ b/src/reducers/entities/alerts.ts @@ -1,12 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {AlertTypes, UserTypes} from 'action_types'; - -import type {AlertType} from 'types/alerts'; -import type {GenericAction} from 'types/actions'; +import {AlertType} from 'types/alerts'; +import {GenericAction} from 'types/actions'; function alertStack(state: Array = [], action: GenericAction) { const nextState = [...state]; @@ -32,6 +29,8 @@ export default (combineReducers({ // array acting as a stack where every object is an alert alertStack, - -}): ({| alertStack: Array |}, GenericAction) => {| alertStack: Array |}); - +}) as (b: { + alertStack: Array; +}, a: GenericAction) => { + alertStack: Array; +}); diff --git a/src/reducers/entities/bots.js b/src/reducers/entities/bots.ts similarity index 99% rename from src/reducers/entities/bots.js rename to src/reducers/entities/bots.ts index 15d7c87e9..9f96f4312 100644 --- a/src/reducers/entities/bots.js +++ b/src/reducers/entities/bots.ts @@ -1,8 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {combineReducers} from 'redux'; - import {BotTypes, UserTypes} from 'action_types'; function accounts(state = {}, action) { diff --git a/src/reducers/entities/channels.js b/src/reducers/entities/channels.ts similarity index 99% rename from src/reducers/entities/channels.js rename to src/reducers/entities/channels.ts index 53ed9423c..249b53b36 100644 --- a/src/reducers/entities/channels.js +++ b/src/reducers/entities/channels.ts @@ -1,9 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {combineReducers} from 'redux'; import {ChannelTypes, UserTypes, SchemeTypes, GroupTypes} from 'action_types'; -import {General} from 'constants'; +import {General} from '../../constants'; function channelListToSet(state, action) { const nextState = {...state}; @@ -437,7 +436,7 @@ function groupsAssociatedToChannel(state = {}, action) { case GroupTypes.RECEIVED_ALL_GROUPS_ASSOCIATED_TO_CHANNEL: { const {channelID, groups} = action.data; const nextState = {...state}; - const associatedGroupIDs = new Set([]); + const associatedGroupIDs = new Set([]); for (const group of groups) { associatedGroupIDs.add(group.id); } diff --git a/src/reducers/entities/emojis.js b/src/reducers/entities/emojis.ts similarity index 86% rename from src/reducers/entities/emojis.js rename to src/reducers/entities/emojis.ts index 54231541b..b88e46fac 100644 --- a/src/reducers/entities/emojis.js +++ b/src/reducers/entities/emojis.ts @@ -1,19 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; -import { - EmojiTypes, - PostTypes, - UserTypes, -} from 'action_types'; - -import type {EmojisState, CustomEmoji} from 'types/emojis'; -import type {Post} from 'types/posts'; -import type {GenericAction} from 'types/actions'; -import type {IDMappedObjects} from 'types/utilities'; - +import {EmojiTypes, PostTypes, UserTypes} from 'action_types'; +import {EmojisState, CustomEmoji} from 'types/emojis'; +import {Post} from 'types/posts'; +import {GenericAction} from 'types/actions'; +import {IDMappedObjects} from 'types/utilities'; export function customEmoji(state: IDMappedObjects = {}, action: GenericAction): IDMappedObjects { switch (action.type) { case EmojiTypes.RECEIVED_CUSTOM_EMOJI: { @@ -45,8 +37,7 @@ export function customEmoji(state: IDMappedObjects = {}, action: Ge } case PostTypes.RECEIVED_POSTS: { const posts = Object.values(action.data.posts); - - return (posts: any).reduce(storeEmojisForPost, state); // Cast to any to avoid typing problems caused by Object.values + return (posts as any).reduce(storeEmojisForPost, state); // Cast to any to avoid typing problems caused by Object.values } default: @@ -119,5 +110,4 @@ export default (combineReducers({ // set containing custom emoji names that do not exist nonExistentEmoji, - -}): (EmojisState, GenericAction) => EmojisState); +}) as (b: EmojisState, a: GenericAction) => EmojisState); diff --git a/src/reducers/entities/files.js b/src/reducers/entities/files.ts similarity index 100% rename from src/reducers/entities/files.js rename to src/reducers/entities/files.ts diff --git a/src/reducers/entities/general.js b/src/reducers/entities/general.ts similarity index 100% rename from src/reducers/entities/general.js rename to src/reducers/entities/general.ts diff --git a/src/reducers/entities/gifs.js b/src/reducers/entities/gifs.ts similarity index 99% rename from src/reducers/entities/gifs.js rename to src/reducers/entities/gifs.ts index c4d7b52cd..b4f3ea69a 100644 --- a/src/reducers/entities/gifs.js +++ b/src/reducers/entities/gifs.ts @@ -179,9 +179,8 @@ const TERM_SELECTOR = { }, }), }; - const PAGE_SELECTOR = { - [GifTypes.REQUEST_SEARCH]: ((state) = {}) => { + [GifTypes.REQUEST_SEARCH]: (state: {pages?} = {}) => { if (typeof state.pages == 'undefined') { return {}; } diff --git a/src/reducers/entities/groups.js b/src/reducers/entities/groups.ts similarity index 96% rename from src/reducers/entities/groups.js rename to src/reducers/entities/groups.ts index 819920719..f83664bfb 100644 --- a/src/reducers/entities/groups.js +++ b/src/reducers/entities/groups.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {combineReducers} from 'redux'; import {GroupTypes} from 'action_types'; +import {GroupChannel, GroupSyncables, GroupTeam} from 'types/groups'; function syncables(state = {}, action) { switch (action.type) { @@ -25,7 +25,7 @@ function syncables(state = {}, action) { }; } case GroupTypes.LINKED_GROUP_TEAM: { - let nextGroupTeams = []; + let nextGroupTeams: GroupTeam[] = []; if (!state[action.data.group_id] || !state[action.data.group_id].teams) { nextGroupTeams = [action.data]; @@ -47,7 +47,7 @@ function syncables(state = {}, action) { }; } case GroupTypes.LINKED_GROUP_CHANNEL: { - let nextGroupChannels = []; + let nextGroupChannels: GroupChannel[] = []; if (!state[action.data.group_id] || !state[action.data.group_id].channels) { nextGroupChannels = [action.data]; diff --git a/src/reducers/entities/index.js b/src/reducers/entities/index.ts similarity index 100% rename from src/reducers/entities/index.js rename to src/reducers/entities/index.ts diff --git a/src/reducers/entities/integrations.js b/src/reducers/entities/integrations.ts similarity index 100% rename from src/reducers/entities/integrations.js rename to src/reducers/entities/integrations.ts diff --git a/src/reducers/entities/jobs.js b/src/reducers/entities/jobs.ts similarity index 79% rename from src/reducers/entities/jobs.js rename to src/reducers/entities/jobs.ts index 165cd3ba7..3bb8415cb 100644 --- a/src/reducers/entities/jobs.js +++ b/src/reducers/entities/jobs.ts @@ -1,13 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {JobTypes} from 'action_types'; - -import type {JobsState, JobType, Job} from 'types/jobs'; -import type {GenericAction} from 'types/actions'; -import type {IDMappedObjects} from 'types/utilities'; +import {JobsState, JobType, Job, JobsByType} from 'types/jobs'; +import {GenericAction} from 'types/actions'; +import {IDMappedObjects} from 'types/utilities'; function jobs(state: IDMappedObjects = {}, action: GenericAction): IDMappedObjects { switch (action.type) { @@ -28,7 +25,7 @@ function jobs(state: IDMappedObjects = {}, action: GenericAction): IDMapped } } -function jobsByTypeList(state: {[JobType]: Array} = {}, action: GenericAction): {[JobType]: Array} { +function jobsByTypeList(state: JobsByType = {}, action: GenericAction): JobsByType { switch (action.type) { case JobTypes.RECEIVED_JOBS_BY_TYPE: { const nextState = {...state}; @@ -49,5 +46,4 @@ export default (combineReducers({ // object where every key is a job type and contains a list of jobs. jobsByTypeList, - -}): (JobsState, GenericAction) => JobsState); +}) as (b: JobsState, a: GenericAction) => JobsState); diff --git a/src/reducers/entities/plugins.js b/src/reducers/entities/plugins.ts similarity index 100% rename from src/reducers/entities/plugins.js rename to src/reducers/entities/plugins.ts diff --git a/src/reducers/entities/posts.test.js b/src/reducers/entities/posts.test.js index 0bd26d7dc..a3bd6d4d4 100644 --- a/src/reducers/entities/posts.test.js +++ b/src/reducers/entities/posts.test.js @@ -9,7 +9,7 @@ import { GeneralTypes, PostTypes, } from 'action_types'; -import {Posts} from 'constants'; +import {Posts} from '../../constants'; import * as reducers from 'reducers/entities/posts'; import deepFreeze from 'utils/deep_freeze'; diff --git a/src/reducers/entities/posts.js b/src/reducers/entities/posts.ts similarity index 97% rename from src/reducers/entities/posts.js rename to src/reducers/entities/posts.ts index a354e5959..e1901a3de 100644 --- a/src/reducers/entities/posts.js +++ b/src/reducers/entities/posts.ts @@ -1,14 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - -import { - ChannelTypes, - GeneralTypes, - PostTypes, - UserTypes, -} from 'action_types'; -import {Posts} from 'constants'; +import {ChannelTypes, GeneralTypes, PostTypes, UserTypes} from 'action_types'; +import {Posts} from '../../constants'; import {comparePosts} from 'utils/post_utils'; +import {Post, PostsState} from 'types/posts'; +import {RelationOneToOne, Dictionary} from 'types/utilities'; export function removeUnneededMetadata(post) { if (!post.metadata) { @@ -67,7 +63,7 @@ export function removeUnneededMetadata(post) { }; } -export function handlePosts(state = {}, action) { +export function handlePosts(state: RelationOneToOne = {}, action) { switch (action.type) { case PostTypes.RECEIVED_POST: case PostTypes.RECEIVED_NEW_POST: { @@ -100,7 +96,7 @@ export function handlePosts(state = {}, action) { } case PostTypes.POST_DELETED: { - const post = action.data; + const post: Post = action.data; if (!state[post.id]) { return state; @@ -216,7 +212,7 @@ function handlePostReceived(nextState, post) { return nextState; } -export function handlePendingPosts(state = [], action) { +export function handlePendingPosts(state: Array = [], action) { switch (action.type) { case PostTypes.RECEIVED_NEW_POST: { const post = action.data; @@ -761,7 +757,7 @@ export function mergePostOrder(left, right, posts) { return result; } -export function postsInThread(state = {}, action, prevPosts) { +export function postsInThread(state: Dictionary = {}, action, prevPosts) { switch (action.type) { case PostTypes.RECEIVED_NEW_POST: case PostTypes.RECEIVED_POST: { @@ -806,14 +802,14 @@ export function postsInThread(state = {}, action, prevPosts) { case PostTypes.RECEIVED_POSTS_BEFORE: case PostTypes.RECEIVED_POSTS_IN_CHANNEL: case PostTypes.RECEIVED_POSTS_SINCE: { - const newPosts = Object.values(action.data.posts); + const newPosts: Post[] = Object.values(action.data.posts); if (newPosts.length === 0) { // Nothing to add return state; } - const nextState = {}; + const nextState: Dictionary = {}; for (const post of newPosts) { if (!post.root_id) { @@ -843,7 +839,7 @@ export function postsInThread(state = {}, action, prevPosts) { } case PostTypes.RECEIVED_POSTS_IN_THREAD: { - const newPosts = Object.values(action.data.posts); + const newPosts: Post[] = Object.values(action.data.posts); if (newPosts.length === 0) { // Nothing to add @@ -1119,7 +1115,7 @@ function storeOpenGraphForPost(state, post) { }, state); } -function messagesHistory(state = {}, action) { +function messagesHistory(state: {messages?;index?} = {}, action) { switch (action.type) { case PostTypes.ADD_MESSAGE_INTO_HISTORY: { const nextIndex = {}; @@ -1211,7 +1207,7 @@ export function expandedURLs(state = {}, action) { } } -export default function(state = {}, action) { +export default function(state: Partial = {}, action) { const nextPosts = handlePosts(state.posts, action); const nextPostsInChannel = postsInChannel(state.postsInChannel, action, state.posts, nextPosts); diff --git a/src/reducers/entities/preferences.js b/src/reducers/entities/preferences.ts similarity index 100% rename from src/reducers/entities/preferences.js rename to src/reducers/entities/preferences.ts diff --git a/src/reducers/entities/roles.js b/src/reducers/entities/roles.ts similarity index 100% rename from src/reducers/entities/roles.js rename to src/reducers/entities/roles.ts diff --git a/src/reducers/entities/schemes.js b/src/reducers/entities/schemes.ts similarity index 74% rename from src/reducers/entities/schemes.js rename to src/reducers/entities/schemes.ts index 66d2e669e..883552c56 100644 --- a/src/reducers/entities/schemes.js +++ b/src/reducers/entities/schemes.ts @@ -1,13 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {SchemeTypes, UserTypes} from 'action_types'; -import type {GenericAction} from 'types/actions'; -import type {SchemesState, Scheme} from 'types/schemes'; +import {GenericAction} from 'types/actions'; +import {SchemesState, Scheme} from 'types/schemes'; -function schemes(state: { [string]: Scheme } = {}, action: GenericAction): { [string]: Scheme } { +function schemes(state: { + [x: string]: Scheme; +} = {}, action: GenericAction): { + [x: string]: Scheme; + } { switch (action.type) { case SchemeTypes.CREATED_SCHEME: case SchemeTypes.PATCHED_SCHEME: @@ -40,4 +42,6 @@ function schemes(state: { [string]: Scheme } = {}, action: GenericAction): { [st } } -export default (combineReducers({schemes}): (SchemesState, GenericAction) => SchemesState); +export default (combineReducers({ + schemes, +}) as (b: SchemesState, a: GenericAction) => SchemesState); diff --git a/src/reducers/entities/search.js b/src/reducers/entities/search.ts similarity index 96% rename from src/reducers/entities/search.js rename to src/reducers/entities/search.ts index 3c1321cb1..b6b4394a7 100644 --- a/src/reducers/entities/search.js +++ b/src/reducers/entities/search.ts @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {combineReducers} from 'redux'; import {PostTypes, PreferenceTypes, SearchTypes, UserTypes} from 'action_types'; -import {Preferences} from 'constants'; +import {Preferences} from '../../constants'; +import {PreferenceType} from 'types/preferences'; -function results(state = [], action) { +function results(state: Array = [], action) { switch (action.type) { case SearchTypes.RECEIVED_SEARCH_POSTS: { if (action.isGettingMore) { @@ -57,7 +57,7 @@ function matches(state = {}, action) { } } -function flagged(state = [], action) { +function flagged(state: Array = [], action) { switch (action.type) { case SearchTypes.RECEIVED_SEARCH_FLAGGED_POSTS: { return action.data.order; @@ -95,7 +95,7 @@ function flagged(state = [], action) { if (action.data) { const nextState = [...state]; let flaggedPostsRemoved = false; - action.data.forEach((pref) => { + action.data.forEach((pref: PreferenceType) => { if (pref.category === Preferences.CATEGORY_FLAGGED_POST) { const index = state.indexOf(pref.name); if (index !== -1) { @@ -155,7 +155,8 @@ function pinned(state = {}, action) { const post = action.data; if (post && post.is_pinned) { const channelId = post.channel_id; - let pinnedPosts = []; + let pinnedPosts: string[] = []; + if (state[channelId]) { pinnedPosts = [...state[channelId]]; } diff --git a/src/reducers/entities/teams.js b/src/reducers/entities/teams.ts similarity index 98% rename from src/reducers/entities/teams.js rename to src/reducers/entities/teams.ts index d911c686d..74ff63af3 100644 --- a/src/reducers/entities/teams.js +++ b/src/reducers/entities/teams.ts @@ -1,6 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {combineReducers} from 'redux'; import {ChannelTypes, TeamTypes, UserTypes, SchemeTypes, GroupTypes} from 'action_types'; import {teamListToMap} from 'utils/team_utils'; @@ -99,14 +98,14 @@ function myMembers(state = {}, action) { case TeamTypes.RECEIVED_TEAMS_LIST: { const nextState = {...state}; const receivedTeams = teamListToMap(action.data); - - return updateState(receivedTeams, nextState) || nextState; + updateState(receivedTeams, nextState); + return nextState; } case TeamTypes.RECEIVED_TEAMS: { const nextState = {...state}; const receivedTeams = action.data; - - return updateState(receivedTeams, nextState) || nextState; + updateState(receivedTeams, nextState); + return nextState; } case TeamTypes.RECEIVED_MY_TEAM_UNREADS: { const nextState = {...state}; @@ -335,7 +334,7 @@ function groupsAssociatedToTeam(state = {}, action) { case GroupTypes.RECEIVED_ALL_GROUPS_ASSOCIATED_TO_TEAM: { const {teamID, groups} = action.data; const nextState = {...state}; - const associatedGroupIDs = new Set([]); + const associatedGroupIDs = new Set([]); for (const group of groups) { associatedGroupIDs.add(group.id); } diff --git a/src/reducers/entities/typing.test.js b/src/reducers/entities/typing.test.js index 29e85b6fb..c8786cf77 100644 --- a/src/reducers/entities/typing.test.js +++ b/src/reducers/entities/typing.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {WebsocketEvents} from 'constants'; +import {WebsocketEvents} from '../../constants'; import typingReducer from 'reducers/entities/typing'; diff --git a/src/reducers/entities/typing.js b/src/reducers/entities/typing.ts similarity index 89% rename from src/reducers/entities/typing.js rename to src/reducers/entities/typing.ts index 5ed365883..8d2893051 100644 --- a/src/reducers/entities/typing.js +++ b/src/reducers/entities/typing.ts @@ -1,12 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {WebsocketEvents} from 'constants'; - -import type {Typing} from 'types/typing'; -import type {GenericAction} from 'types/actions'; - +import {WebsocketEvents} from '../../constants'; +import {Typing} from 'types/typing'; +import {GenericAction} from 'types/actions'; export default function typing(state: Typing = {}, action: GenericAction): Typing { const { data, diff --git a/src/reducers/entities/users.js b/src/reducers/entities/users.ts similarity index 99% rename from src/reducers/entities/users.js rename to src/reducers/entities/users.ts index 927c589ce..d4a03a420 100644 --- a/src/reducers/entities/users.js +++ b/src/reducers/entities/users.ts @@ -87,7 +87,7 @@ function currentUserId(state = '', action) { return state; } -function mySessions(state = [], action) { +function mySessions(state: Array<{id}> = [], action) { switch (action.type) { case UserTypes.RECEIVED_SESSIONS: return [...action.data]; diff --git a/src/reducers/errors/index.js b/src/reducers/errors/index.ts similarity index 90% rename from src/reducers/errors/index.js rename to src/reducers/errors/index.ts index b25fac6f0..ba47c9a6e 100644 --- a/src/reducers/errors/index.js +++ b/src/reducers/errors/index.ts @@ -1,9 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {ErrorTypes} from 'action_types'; - -export default (state = [], action) => { +export default ((state: Array<{error;displayable;date}> = [], action) => { switch (action.type) { case ErrorTypes.DISMISS_ERROR: { const nextState = [...state]; @@ -30,4 +28,4 @@ export default (state = [], action) => { default: return state; } -}; +}); diff --git a/src/reducers/index.js b/src/reducers/index.ts similarity index 97% rename from src/reducers/index.js rename to src/reducers/index.ts index 834be1c19..936a290e8 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import entities from './entities'; import errors from './errors'; import requests from './requests'; diff --git a/src/reducers/requests/admin.js b/src/reducers/requests/admin.ts similarity index 98% rename from src/reducers/requests/admin.js rename to src/reducers/requests/admin.ts index b2c51b8e9..ef565e7f4 100644 --- a/src/reducers/requests/admin.js +++ b/src/reducers/requests/admin.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {AdminTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {AdminRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {AdminRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function getLogs(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -451,4 +449,4 @@ export default (combineReducers({ removePlugin, enablePlugin, disablePlugin, -}): (AdminRequestsStatuses, GenericAction) => AdminRequestsStatuses); +}) as (b: AdminRequestsStatuses, a: GenericAction) => AdminRequestsStatuses); diff --git a/src/reducers/requests/channels.js b/src/reducers/requests/channels.ts similarity index 89% rename from src/reducers/requests/channels.js rename to src/reducers/requests/channels.ts index 662b3d61b..73e566f01 100644 --- a/src/reducers/requests/channels.js +++ b/src/reducers/requests/channels.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {ChannelTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {ChannelsRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {ChannelsRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function myChannels(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -66,4 +64,4 @@ export default (combineReducers({ myChannels, createChannel, updateChannel, -}): (ChannelsRequestsStatuses, GenericAction) => ChannelsRequestsStatuses); +}) as (b: ChannelsRequestsStatuses, a: GenericAction) => ChannelsRequestsStatuses); diff --git a/src/reducers/requests/files.js b/src/reducers/requests/files.ts similarity index 86% rename from src/reducers/requests/files.js rename to src/reducers/requests/files.ts index 07d6fa4f8..812b537d1 100644 --- a/src/reducers/requests/files.js +++ b/src/reducers/requests/files.ts @@ -1,15 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {FileTypes} from 'action_types'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../../constants'; -import {initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {FilesRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {FilesRequestsStatuses, RequestStatusType} from 'types/requests'; +import {initialRequestState} from './helpers'; export function handleUploadFilesRequest( REQUEST: string, @@ -68,4 +66,4 @@ function uploadFiles(state: RequestStatusType = initialRequestState(), action: G export default (combineReducers({ uploadFiles, -}): (FilesRequestsStatuses, GenericAction) => FilesRequestsStatuses); +}) as (b: FilesRequestsStatuses, a: GenericAction) => FilesRequestsStatuses); diff --git a/src/reducers/requests/general.js b/src/reducers/requests/general.ts similarity index 92% rename from src/reducers/requests/general.js rename to src/reducers/requests/general.ts index bf9149188..6a53797f8 100644 --- a/src/reducers/requests/general.js +++ b/src/reducers/requests/general.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {GeneralTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {GeneralRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {GeneralRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function server(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { if (action.type === GeneralTypes.PING_RESET) { @@ -85,4 +83,4 @@ export default (combineReducers({ license, websocket, redirectLocation, -}): (GeneralRequestsStatuses, GenericAction) => GeneralRequestsStatuses); +}) as (b: GeneralRequestsStatuses, a: GenericAction) => GeneralRequestsStatuses); diff --git a/src/reducers/requests/groups.js b/src/reducers/requests/groups.ts similarity index 95% rename from src/reducers/requests/groups.js rename to src/reducers/requests/groups.ts index 9e3c5da5c..034e96f74 100644 --- a/src/reducers/requests/groups.js +++ b/src/reducers/requests/groups.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {GroupTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from '../../types/actions'; +import {RequestStatusType, GroupsRequestsStatuses} from '../../types/requests'; -import type {GenericAction} from '../../types/actions'; -import type {RequestStatusType, GroupsRequestsStatuses} from '../../types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function linkGroupSyncable(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -132,5 +130,4 @@ export default (combineReducers({ getGroupsAssociatedToChannel, getGroupsNotAssociatedToTeam, getGroupsNotAssociatedToChannel, -}): (GroupsRequestsStatuses, GenericAction) => GroupsRequestsStatuses); - +}) as (b: GroupsRequestsStatuses, a: GenericAction) => GroupsRequestsStatuses); diff --git a/src/reducers/requests/helpers.js b/src/reducers/requests/helpers.ts similarity index 85% rename from src/reducers/requests/helpers.js rename to src/reducers/requests/helpers.ts index 065506712..f28d55f16 100644 --- a/src/reducers/requests/helpers.js +++ b/src/reducers/requests/helpers.ts @@ -1,12 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {RequestStatus} from 'constants'; - -import type {GenericAction} from 'types/actions'; -import type {RequestStatusType} from 'types/requests'; - +import {RequestStatus} from '../../constants'; +import {GenericAction} from 'types/actions'; +import {RequestStatusType} from 'types/requests'; export function initialRequestState(): RequestStatusType { return { status: RequestStatus.NOT_STARTED, diff --git a/src/reducers/requests/index.js b/src/reducers/requests/index.ts similarity index 100% rename from src/reducers/requests/index.js rename to src/reducers/requests/index.ts diff --git a/src/reducers/requests/integrations.js b/src/reducers/requests/integrations.ts similarity index 97% rename from src/reducers/requests/integrations.js rename to src/reducers/requests/integrations.ts index 1dfe0ad6c..21718aea6 100644 --- a/src/reducers/requests/integrations.js +++ b/src/reducers/requests/integrations.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {IntegrationTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {IntegrationsRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {IntegrationsRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function createIncomingHook(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -253,4 +251,4 @@ export default (combineReducers({ executeCommand, getAutocompleteCommands, submitInteractiveDialog, -}): (IntegrationsRequestsStatuses, GenericAction) => IntegrationsRequestsStatuses); +}) as (b: IntegrationsRequestsStatuses, a: GenericAction) => IntegrationsRequestsStatuses); diff --git a/src/reducers/requests/jobs.js b/src/reducers/requests/jobs.ts similarity index 87% rename from src/reducers/requests/jobs.js rename to src/reducers/requests/jobs.ts index 284849782..225180ab3 100644 --- a/src/reducers/requests/jobs.js +++ b/src/reducers/requests/jobs.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {JobTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {JobsRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {JobsRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function createJob(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -55,5 +53,4 @@ export default (combineReducers({ getJob, getJobs, cancelJob, -}): (JobsRequestsStatuses, GenericAction) => JobsRequestsStatuses); - +}) as (b: JobsRequestsStatuses, a: GenericAction) => JobsRequestsStatuses); diff --git a/src/reducers/requests/posts.js b/src/reducers/requests/posts.ts similarity index 86% rename from src/reducers/requests/posts.js rename to src/reducers/requests/posts.ts index 92bc9910f..e36638406 100644 --- a/src/reducers/requests/posts.js +++ b/src/reducers/requests/posts.ts @@ -1,14 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {PostTypes} from 'action_types'; - import {handleRequest, initialRequestState} from './helpers'; - -import type {GenericAction} from 'types/actions'; -import type {PostsRequestsStatuses, RequestStatusType} from 'types/requests'; +import {GenericAction} from 'types/actions'; +import {PostsRequestsStatuses, RequestStatusType} from 'types/requests'; function createPost(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { if (action.type === PostTypes.CREATE_POST_RESET_REQUEST) { @@ -48,4 +44,4 @@ export default (combineReducers({ createPost, editPost, getPostThread, -}): (PostsRequestsStatuses, GenericAction) => PostsRequestsStatuses); +}) as (b: PostsRequestsStatuses, a: GenericAction) => PostsRequestsStatuses); diff --git a/src/reducers/requests/preferences.js b/src/reducers/requests/preferences.ts similarity index 85% rename from src/reducers/requests/preferences.js rename to src/reducers/requests/preferences.ts index 3cfc8e0e6..f22afa762 100644 --- a/src/reducers/requests/preferences.js +++ b/src/reducers/requests/preferences.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {PreferenceTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {PreferencesRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {PreferencesRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function getMyPreferences(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -44,4 +42,4 @@ export default (combineReducers({ getMyPreferences, savePreferences, deletePreferences, -}): (PreferencesRequestsStatuses, GenericAction) => PreferencesRequestsStatuses); +}) as (b: PreferencesRequestsStatuses, a: GenericAction) => PreferencesRequestsStatuses); diff --git a/src/reducers/requests/roles.js b/src/reducers/requests/roles.ts similarity index 88% rename from src/reducers/requests/roles.js rename to src/reducers/requests/roles.ts index 156caa256..edde2679e 100644 --- a/src/reducers/requests/roles.js +++ b/src/reducers/requests/roles.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {RoleTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {RolesRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {RolesRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function getRolesByNames(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -55,4 +53,4 @@ export default (combineReducers({ getRoleByName, getRole, editRole, -}): (RolesRequestsStatuses, GenericAction) => RolesRequestsStatuses); +}) as (b: RolesRequestsStatuses, a: GenericAction) => RolesRequestsStatuses); diff --git a/src/reducers/requests/schemes.js b/src/reducers/requests/schemes.ts similarity index 92% rename from src/reducers/requests/schemes.js rename to src/reducers/requests/schemes.ts index f24d56293..22ee6c675 100644 --- a/src/reducers/requests/schemes.js +++ b/src/reducers/requests/schemes.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {SchemeTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {SchemesRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {SchemesRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function getSchemes(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -88,4 +86,4 @@ export default (combineReducers({ patchScheme, getSchemeTeams, getSchemeChannels, -}): (SchemesRequestsStatuses, GenericAction) => SchemesRequestsStatuses); +}) as (b: SchemesRequestsStatuses, a: GenericAction) => SchemesRequestsStatuses); diff --git a/src/reducers/requests/search.js b/src/reducers/requests/search.ts similarity index 90% rename from src/reducers/requests/search.js rename to src/reducers/requests/search.ts index d70b550ba..40437a4e2 100644 --- a/src/reducers/requests/search.js +++ b/src/reducers/requests/search.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {SearchTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {SearchRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {SearchRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function searchPosts(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { if (action.type === SearchTypes.REMOVE_SEARCH_POSTS) { @@ -71,4 +69,4 @@ export default (combineReducers({ pinnedPosts, recentMentions, searchPosts, -}): (SearchRequestsStatuses, GenericAction) => SearchRequestsStatuses); +}) as (b: SearchRequestsStatuses, a: GenericAction) => SearchRequestsStatuses); diff --git a/src/reducers/requests/teams.js b/src/reducers/requests/teams.ts similarity index 85% rename from src/reducers/requests/teams.js rename to src/reducers/requests/teams.ts index f192f5c3a..5b5af8b2e 100644 --- a/src/reducers/requests/teams.js +++ b/src/reducers/requests/teams.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; import {TeamTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {TeamsRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {TeamsRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function getMyTeams(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { return handleRequest( @@ -44,4 +42,4 @@ export default (combineReducers({ getTeams, getMyTeams, joinTeam, -}): (TeamsRequestsStatuses, GenericAction) => TeamsRequestsStatuses); +}) as (b: TeamsRequestsStatuses, a: GenericAction) => TeamsRequestsStatuses); diff --git a/src/reducers/requests/users.js b/src/reducers/requests/users.ts similarity index 91% rename from src/reducers/requests/users.js rename to src/reducers/requests/users.ts index 2837848be..e6933f718 100644 --- a/src/reducers/requests/users.js +++ b/src/reducers/requests/users.ts @@ -1,15 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {combineReducers} from 'redux'; -import {RequestStatus} from 'constants'; +import {RequestStatus} from '../../constants'; import {UserTypes} from 'action_types'; -import {handleRequest, initialRequestState} from './helpers'; +import {GenericAction} from 'types/actions'; +import {UsersRequestsStatuses, RequestStatusType} from 'types/requests'; -import type {GenericAction} from 'types/actions'; -import type {UsersRequestsStatuses, RequestStatusType} from 'types/requests'; +import {handleRequest, initialRequestState} from './helpers'; function checkMfa(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { switch (action.type) { @@ -94,4 +92,4 @@ export default (combineReducers({ logout, autocompleteUsers, updateMe, -}): (UsersRequestsStatuses, GenericAction) => UsersRequestsStatuses); +}) as (b: UsersRequestsStatuses, a: GenericAction) => UsersRequestsStatuses); diff --git a/src/reducers/websocket.js b/src/reducers/websocket.ts similarity index 100% rename from src/reducers/websocket.js rename to src/reducers/websocket.ts diff --git a/src/selectors/entities/admin.js b/src/selectors/entities/admin.ts similarity index 100% rename from src/selectors/entities/admin.js rename to src/selectors/entities/admin.ts diff --git a/src/selectors/entities/alerts.js b/src/selectors/entities/alerts.js deleted file mode 100644 index 2677205d6..000000000 --- a/src/selectors/entities/alerts.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import {createSelector} from 'reselect'; - -import {Alerts} from 'constants'; - -import type {AlertType} from 'types/alerts'; -import type {GlobalState} from 'types/store'; - -export function getAlerts(state: GlobalState) { - return state.entities.alerts.alertStack; -} - -export function getLatestAlert(state: GlobalState) { - return state.entities.alerts.alertStack[0]; -} - -export const getLatestNotificationAlert: (state: GlobalState) => ?AlertType = createSelector( - getAlerts, - (alerts) => { - return alerts.find((a) => a.type === Alerts.ALERT_NOTIFICATION); - } -); - -export const getLatestDeveloperAlert: (state: GlobalState) => ?AlertType = createSelector( - getAlerts, - (alerts) => { - return alerts.find((a) => a.type === Alerts.ALERT_DEVELOPER); - } -); - -export const getLatestErrorAlert: (state: GlobalState) => ?AlertType = createSelector( - getAlerts, - (alerts) => { - return alerts.find((a) => a.type === Alerts.ALERT_ERROR); - } -); - diff --git a/src/selectors/entities/alerts.test.js b/src/selectors/entities/alerts.test.js index 162d9b5c5..4098dc741 100644 --- a/src/selectors/entities/alerts.test.js +++ b/src/selectors/entities/alerts.test.js @@ -5,7 +5,7 @@ import assert from 'assert'; import deepFreezeAndThrowOnMutation from 'utils/deep_freeze'; import * as Selectors from 'selectors/entities/alerts'; -import {Alerts} from 'constants'; +import {Alerts} from '../../constants'; describe('Selectors.Alerts', () => { const alertStack = [ diff --git a/src/selectors/entities/alerts.ts b/src/selectors/entities/alerts.ts new file mode 100644 index 000000000..585639ff6 --- /dev/null +++ b/src/selectors/entities/alerts.ts @@ -0,0 +1,24 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {createSelector} from 'reselect'; +import {Alerts} from '../../constants'; +import {AlertType} from 'types/alerts'; +import {GlobalState} from 'types/store'; + +export function getAlerts(state: GlobalState) { + return state.entities.alerts.alertStack; +} + +export function getLatestAlert(state: GlobalState) { + return state.entities.alerts.alertStack[0]; +} + +export const getLatestNotificationAlert: (state: GlobalState) => AlertType | undefined | null = createSelector(getAlerts, (alerts) => { + return alerts.find((a) => a.type === Alerts.ALERT_NOTIFICATION); +}); +export const getLatestDeveloperAlert: (state: GlobalState) => AlertType | undefined | null = createSelector(getAlerts, (alerts) => { + return alerts.find((a) => a.type === Alerts.ALERT_DEVELOPER); +}); +export const getLatestErrorAlert: (state: GlobalState) => AlertType | undefined | null = createSelector(getAlerts, (alerts) => { + return alerts.find((a) => a.type === Alerts.ALERT_ERROR); +}); diff --git a/src/selectors/entities/bots.js b/src/selectors/entities/bots.ts similarity index 100% rename from src/selectors/entities/bots.js rename to src/selectors/entities/bots.ts diff --git a/src/selectors/entities/channels.js b/src/selectors/entities/channels.js deleted file mode 100644 index 19c63e5e9..000000000 --- a/src/selectors/entities/channels.js +++ /dev/null @@ -1,1247 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import {createSelector} from 'reselect'; - -import {General, Permissions} from 'constants'; - -import { - getCurrentChannelId, - getCurrentUser, - getUsers, - getMyChannelMemberships, - getMyCurrentChannelMembership, -} from 'selectors/entities/common'; -import {getConfig, getLicense, hasNewPermissions} from 'selectors/entities/general'; -import { - getFavoritesPreferences, - getMyPreferences, - getTeammateNameDisplaySetting, - getVisibleTeammate, - getVisibleGroupIds, -} from 'selectors/entities/preferences'; -import {getLastPostPerChannel, getAllPosts} from 'selectors/entities/posts'; -import {getCurrentTeamId, getCurrentTeamMembership, getMyTeams, getTeamMemberships} from 'selectors/entities/teams'; -import {haveICurrentChannelPermission, haveIChannelPermission, haveITeamPermission} from 'selectors/entities/roles'; -import {isCurrentUserSystemAdmin, getCurrentUserId} from 'selectors/entities/users'; - -import { - buildDisplayableChannelList, - buildDisplayableChannelListWithUnreadSection, - canManageMembersOldPermissions, - completeDirectChannelInfo, - completeDirectChannelDisplayName, - getUserIdFromChannelName, - getChannelByName as getChannelByNameHelper, - isChannelMuted, - getDirectChannelName, - isAutoClosed, - isDirectChannelVisible, - isGroupChannelVisible, - isGroupOrDirectChannelVisible, - sortChannelsByDisplayName, - isFavoriteChannel, - isDefault, - sortChannelsByRecency, -} from 'utils/channel_utils'; -import {createIdsSelector} from 'utils/helpers'; -import {getUserIdsInChannels} from './users'; - -export { - getCurrentChannelId, - getMyChannelMemberships, - getMyCurrentChannelMembership, -}; - -import type {GlobalState} from 'types/store'; -import type {Channel, ChannelStats, ChannelMembership} from 'types/channels'; -import type {UsersState, UserProfile} from 'types/users'; -import type {PreferenceType} from 'types/preferences'; -import type {Post} from 'types/posts'; -import type {TeamMembership, Team} from 'types/teams'; -import type {NameMappedObjects, UserIDMappedObjects, IDMappedObjects, RelationOneToOne, RelationOneToMany} from 'types/utilities'; - -type SortingType = 'recent' | 'alpha'; - -export function getAllChannels(state: GlobalState): IDMappedObjects { - return state.entities.channels.channels; -} - -export function getAllChannelStats(state: GlobalState): RelationOneToOne { - return state.entities.channels.stats; -} - -export function getChannelsInTeam(state: GlobalState): RelationOneToMany { - return state.entities.channels.channelsInTeam; -} - -export const getDirectChannelsSet: (GlobalState) => Set = createSelector( - getChannelsInTeam, - (channelsInTeam: RelationOneToMany): Set => { - return (channelsInTeam && new Set(channelsInTeam[''])) || new Set(); - } -); - -export function getChannelMembersInChannels(state: GlobalState): RelationOneToOne> { - return state.entities.channels.membersInChannel; -} - -function sortChannelsByRecencyOrAlpha(locale, lastPosts, sorting: SortingType, a, b) { - if (sorting === 'recent') { - return sortChannelsByRecency(lastPosts, a, b); - } - - return sortChannelsByDisplayName(locale, a, b); -} - -// mapAndSortChannelIds sorts channels, primarily by: -// For all sections except unreads: -// a. All other unread channels -// b. Muted channels -// For unreads section: -// a. Non-muted channels with mentions -// b. Muted channels with mentions -// c. Remaining unread channels -// And then secondary by alphabetical ("alpha") or chronological ("recency") order -export const mapAndSortChannelIds = (channels: Array, currentUser: UserProfile, myMembers: RelationOneToOne, lastPosts: RelationOneToOne, sorting: SortingType, sortMentionsFirst: boolean = false): Array => { - const locale = currentUser.locale || General.DEFAULT_LOCALE; - - const mutedChannelIds = channels. - filter((channel) => isChannelMuted(myMembers[channel.id])). - sort(sortChannelsByRecencyOrAlpha.bind(null, locale, lastPosts, sorting)). - map((channel) => channel.id); - - let hasMentionedChannelIds = []; - if (sortMentionsFirst) { - hasMentionedChannelIds = channels. - filter((channel) => { - const member = myMembers[channel.id]; - return member && member.mention_count > 0 && !isChannelMuted(member); - }). - sort(sortChannelsByRecencyOrAlpha.bind(null, locale, lastPosts, sorting)). - map((channel) => channel.id); - } - - const otherChannelIds = channels. - filter((channel) => { - return !mutedChannelIds.includes(channel.id) && !hasMentionedChannelIds.includes(channel.id); - }). - sort(sortChannelsByRecencyOrAlpha.bind(null, locale, lastPosts, sorting)). - map((channel) => channel.id); - - return sortMentionsFirst ? hasMentionedChannelIds.concat(mutedChannelIds, otherChannelIds) : otherChannelIds.concat(mutedChannelIds); -}; - -export function filterChannels(unreadIds: Array, favoriteIds: Array, channelIds: Array, unreadsAtTop: boolean, favoritesAtTop: boolean): Array { - let channels: Array = channelIds; - - if (unreadsAtTop) { - channels = channels.filter((id) => { - return !unreadIds.includes(id); - }); - } - - if (favoritesAtTop) { - channels = channels.filter((id) => { - return !favoriteIds.includes(id); - }); - } - - return channels; -} - -export function makeGetChannel(): (GlobalState, {id: string}) => Channel { - return createSelector( - getAllChannels, - (state: GlobalState, props) => props.id, - (state: GlobalState) => state.entities.users, - getTeammateNameDisplaySetting, - (allChannels, channelId, users, teammateNameDisplay) => { - const channel = allChannels[channelId]; - if (channel) { - return completeDirectChannelInfo(users, teammateNameDisplay, channel); - } - return channel; - } - ); -} - -export const getChannel: (GlobalState, string) => Channel = createSelector( - getAllChannels, - (state: GlobalState, id: string): string => id, - (state: GlobalState): UsersState => state.entities.users, - getTeammateNameDisplaySetting, - (allChannels: IDMappedObjects, channelId: string, users: UsersState, teammateNameDisplay: string): Channel => { - const channel = allChannels[channelId]; - if (channel) { - return completeDirectChannelInfo(users, teammateNameDisplay, channel); - } - return channel; - } -); - -export const getCurrentChannel: (GlobalState) => Channel = createSelector( - getAllChannels, - getCurrentChannelId, - (state: GlobalState): UsersState => state.entities.users, - getTeammateNameDisplaySetting, - (allChannels: IDMappedObjects, currentChannelId: string, users: UsersState, teammateNameDisplay: string): Channel => { - const channel = allChannels[currentChannelId]; - if (channel) { - return completeDirectChannelInfo(users, teammateNameDisplay, channel); - } - return channel; - } -); - -export const getMyChannelMember: (GlobalState, string) => ?ChannelMembership = createSelector( - getMyChannelMemberships, - (state: GlobalState, channelId: string): string => channelId, - (channelMemberships: RelationOneToOne, channelId: string): ?ChannelMembership => { - return channelMemberships[channelId] || null; - } -); - -export const getCurrentChannelStats: (GlobalState) => ChannelStats = createSelector( - getAllChannelStats, - getCurrentChannelId, - (allChannelStats: RelationOneToOne, currentChannelId: string): ChannelStats => { - return allChannelStats[currentChannelId]; - } -); - -export const isCurrentChannelFavorite: (GlobalState) => boolean = createSelector( - getMyPreferences, - getCurrentChannelId, - (preferences: {[string]: PreferenceType}, channelId: string): boolean => isFavoriteChannel(preferences, channelId), -); - -export const isCurrentChannelMuted: (GlobalState) => boolean = createSelector( - getMyCurrentChannelMembership, - (membership: ?ChannelMembership): boolean => { - if (!membership) { - return false; - } - return isChannelMuted(membership); - } -); - -export const isCurrentChannelArchived: (GlobalState) => boolean = createSelector( - getCurrentChannel, - (channel: Channel): boolean => channel.delete_at !== 0, -); - -export const isCurrentChannelDefault: (GlobalState) => boolean = createSelector( - getCurrentChannel, - (channel: Channel): boolean => isDefault(channel), -); - -export function isCurrentChannelReadOnly(state: GlobalState): boolean { - return isChannelReadOnly(state, getCurrentChannel(state)); -} - -export function isChannelReadOnlyById(state: GlobalState, channelId: string): boolean { - return isChannelReadOnly(state, getChannel(state, channelId)); -} - -export function isChannelReadOnly(state: GlobalState, channel: Channel): boolean { - return channel && channel.name === General.DEFAULT_CHANNEL && - !isCurrentUserSystemAdmin(state) && getConfig(state).ExperimentalTownSquareIsReadOnly === 'true'; -} - -export function shouldHideDefaultChannel(state: GlobalState, channel: Channel): boolean { - return channel && channel.name === General.DEFAULT_CHANNEL && - !isCurrentUserSystemAdmin(state) && getConfig(state).ExperimentalHideTownSquareinLHS === 'true'; -} - -export function getChannelByName(state: GlobalState, channelName: string): ?Channel { - return getChannelByNameHelper(getAllChannels(state), channelName); -} - -export const getChannelSetInCurrentTeam: (GlobalState) => Array = createSelector( - getCurrentTeamId, - getChannelsInTeam, - (currentTeamId: string, channelsInTeam: RelationOneToMany): Array => { - return (channelsInTeam && channelsInTeam[currentTeamId]) || []; - } -); - -function sortAndInjectChannels(channels: IDMappedObjects, channelSet: Array, locale: string): Array { - const currentChannels = []; - if (typeof channelSet === 'undefined') { - return currentChannels; - } - - channelSet.forEach((c) => { - currentChannels.push(channels[c]); - }); - - return currentChannels.sort(sortChannelsByDisplayName.bind(null, locale)); -} - -export const getChannelsInCurrentTeam: (GlobalState) => Array = createSelector( - getAllChannels, - getChannelSetInCurrentTeam, - getCurrentUser, - (channels: IDMappedObjects, currentTeamChannelSet: Array, currentUser: UserProfile): Array => { - let locale = General.DEFAULT_LOCALE; - if (currentUser && currentUser.locale) { - locale = currentUser.locale; - } - return sortAndInjectChannels(channels, currentTeamChannelSet, locale); - } -); - -export const getChannelsNameMapInTeam: (GlobalState, string) => NameMappedObjects = createSelector( - getAllChannels, - getChannelsInTeam, - (state: GlobalState, teamId: string): string => teamId, - (channels: IDMappedObjects, channelsInTeams: RelationOneToMany, teamId: string): NameMappedObjects => { - const channelsInTeam = channelsInTeams[teamId] || []; - const channelMap = {}; - channelsInTeam.forEach((id) => { - const channel = channels[id]; - channelMap[channel.name] = channel; - }); - return channelMap; - } -); - -export const getChannelsNameMapInCurrentTeam: (GlobalState) => NameMappedObjects = createSelector( - getAllChannels, - getChannelSetInCurrentTeam, - (channels: IDMappedObjects, currentTeamChannelSet: Array): NameMappedObjects => { - const channelMap = {}; - currentTeamChannelSet.forEach((id) => { - const channel = channels[id]; - channelMap[channel.name] = channel; - }); - return channelMap; - } -); - -// Returns both DMs and GMs -export const getAllDirectChannels: (GlobalState) => Array = createSelector( - getAllChannels, - getDirectChannelsSet, - (state: GlobalState): UsersState => state.entities.users, - getTeammateNameDisplaySetting, - (channels: IDMappedObjects, channelSet: Set, users: UsersState, teammateNameDisplay: string): Array => { - const dmChannels = []; - channelSet.forEach((c) => { - dmChannels.push(completeDirectChannelInfo(users, teammateNameDisplay, channels[c])); - }); - return dmChannels; - } -); - -// Returns only GMs -export const getGroupChannels: (GlobalState) => Array = createSelector( - getAllChannels, - getDirectChannelsSet, - (state: GlobalState): UsersState => state.entities.users, - getTeammateNameDisplaySetting, - (channels: IDMappedObjects, channelSet: Set, users: UsersState, teammateNameDisplay: string): Array => { - const gmChannels = []; - channelSet.forEach((id) => { - const channel = channels[id]; - if (channel.type === General.GM_CHANNEL) { - gmChannels.push(completeDirectChannelInfo(users, teammateNameDisplay, channel)); - } - }); - return gmChannels; - } -); - -export const getMyChannels: (GlobalState) => Array = createSelector( - getChannelsInCurrentTeam, - getAllDirectChannels, - getMyChannelMemberships, - (channels: Array, directChannels: Array, myMembers: RelationOneToOne): Array => { - return [...channels, ...directChannels].filter((c) => myMembers.hasOwnProperty(c.id)); - } -); - -export const getOtherChannels: (GlobalState, ?boolean) => Array = createSelector( - getChannelsInCurrentTeam, - getMyChannelMemberships, - (state: GlobalState, archived: ?boolean = true) => archived, - (channels: Array, myMembers: RelationOneToOne, archived: ?boolean): Array => { - return channels.filter((c) => !myMembers.hasOwnProperty(c.id) && c.type === General.OPEN_CHANNEL && (archived ? true : c.delete_at === 0)); - } -); - -export const getArchivedChannels: (GlobalState) => Array = createSelector( - getChannelsInCurrentTeam, - getMyChannelMemberships, - (channels: Array, myMembers: RelationOneToOne): Array => { - return channels.filter((c) => myMembers.hasOwnProperty(c.id) && c.delete_at !== 0); - } -); - -export const getChannelsByCategory: (GlobalState) => {favoriteChannels: Array, publicChannels: Array, privateChannels: Array, directAndGroupChannels: Array} = createSelector( - getCurrentChannelId, - getMyChannels, - getMyChannelMemberships, - getConfig, - getMyPreferences, - getTeammateNameDisplaySetting, - (state: GlobalState): UsersState => state.entities.users, - getLastPostPerChannel, - (currentChannelId: string, channels: Array, myMembers: RelationOneToOne, config: Object, myPreferences: {[string]: PreferenceType}, teammateNameDisplay: string, usersState: UsersState, lastPosts: RelationOneToOne) => { - const allChannels = channels.map((c) => { - const channel = {...c}; - channel.isCurrent = c.id === currentChannelId; - return channel; - }); - - return buildDisplayableChannelList(usersState, allChannels, myMembers, config, myPreferences, teammateNameDisplay, lastPosts); - } -); - -export const getChannelsWithUnreadSection: (GlobalState) => {unreadChannels: Array, favoriteChannels: Array, publicChannels: Array, privateChannels: Array, directAndGroupChannels: Array} = createSelector( - getCurrentChannelId, - getMyChannels, - getMyChannelMemberships, - getConfig, - getMyPreferences, - getTeammateNameDisplaySetting, - (state: GlobalState): UsersState => state.entities.users, - getLastPostPerChannel, - (currentChannelId: string, channels: Array, myMembers: RelationOneToOne, config: Object, myPreferences: {[string]: PreferenceType}, teammateNameDisplay: string, usersState: UsersState, lastPosts: RelationOneToOne) => { - const allChannels = channels.map((c) => { - const channel = {...c}; - channel.isCurrent = c.id === currentChannelId; - return channel; - }); - - return buildDisplayableChannelListWithUnreadSection(usersState, allChannels, myMembers, config, myPreferences, teammateNameDisplay, lastPosts); - } -); - -export const getDefaultChannel: (GlobalState) => ?Channel = createSelector( - getAllChannels, - getCurrentTeamId, - (channels: IDMappedObjects, teamId: string): ?Channel => { - return Object.keys(channels).map((key) => channels[key]).find((c) => c && c.team_id === teamId && c.name === General.DEFAULT_CHANNEL); - } -); - -export const getMembersInCurrentChannel: (GlobalState) => UserIDMappedObjects = createSelector( - getCurrentChannelId, - getChannelMembersInChannels, - (currentChannelId: string, members: RelationOneToOne>): UserIDMappedObjects => { - return members[currentChannelId]; - } -); - -export const getUnreads: (GlobalState) => {messageCount: number, mentionCount: number} = createSelector( - getAllChannels, - getMyChannelMemberships, - getUsers, - getCurrentUserId, - getCurrentTeamId, - getMyTeams, - getTeamMemberships, - (channels: IDMappedObjects, myMembers: RelationOneToOne, users: IDMappedObjects, currentUserId: string, currentTeamId: string, myTeams: Array, myTeamMemberships: RelationOneToOne): {messageCount: number, mentionCount: number} => { - let messageCountForCurrentTeam = 0; // Includes message count from channels of current team plus all GM'S and all DM's across teams - let mentionCountForCurrentTeam = 0; // Includes mention count from channels of current team plus all GM'S and all DM's across teams - Object.keys(myMembers).forEach((channelId) => { - const channel = channels[channelId]; - const m = myMembers[channelId]; - - if (channel && m && (channel.team_id === currentTeamId || channel.type === General.DM_CHANNEL || channel.type === General.GM_CHANNEL)) { - let otherUserId = ''; - if (channel.type === 'D') { - otherUserId = getUserIdFromChannelName(currentUserId, channel.name); - if (users[otherUserId] && users[otherUserId].delete_at === 0) { - mentionCountForCurrentTeam += channel.total_msg_count - m.msg_count; - } - } else if (m.mention_count > 0 && channel.delete_at === 0) { - mentionCountForCurrentTeam += m.mention_count; - } - - if (m.notify_props && m.notify_props.mark_unread !== 'mention' && channel.total_msg_count - m.msg_count > 0) { - if (channel.type === 'D') { - if (users[otherUserId] && users[otherUserId].delete_at === 0) { - messageCountForCurrentTeam += 1; - } - } else if (channel.delete_at === 0) { - messageCountForCurrentTeam += 1; - } - } - } - }); - - // Includes mention count and message count from teams other than the current team - // This count does not include GM's and DM's - const otherTeamsUnreadCountForChannels = myTeams.reduce((acc, team) => { - if (currentTeamId !== team.id) { - const member = myTeamMemberships[team.id]; - acc.messageCount += member.msg_count; - acc.mentionCount += member.mention_count; - } - - return acc; - }, {messageCount: 0, mentionCount: 0}); - - const totalTeamsUnreadCount = { - messageCount: messageCountForCurrentTeam + otherTeamsUnreadCountForChannels.messageCount, - mentionCount: mentionCountForCurrentTeam + otherTeamsUnreadCountForChannels.mentionCount, - }; - - return totalTeamsUnreadCount; - } -); - -export const getUnreadsInCurrentTeam: (GlobalState) => {messageCount: number, mentionCount: number} = createSelector( - getCurrentChannelId, - getMyChannels, - getMyChannelMemberships, - getUsers, - getCurrentUserId, - (currentChannelId: string, channels: Array, myMembers: RelationOneToOne, users: IDMappedObjects, currentUserId: string): {messageCount: number, mentionCount: number} => { - let messageCount = 0; - let mentionCount = 0; - - channels.forEach((channel) => { - const m = myMembers[channel.id]; - if (m && channel.id !== currentChannelId) { - let otherUserId = ''; - if (channel.type === 'D') { - otherUserId = getUserIdFromChannelName(currentUserId, channel.name); - if (users[otherUserId] && users[otherUserId].delete_at === 0) { - mentionCount += channel.total_msg_count - m.msg_count; - } - } else if (m.mention_count > 0 && channel.delete_at === 0) { - mentionCount += m.mention_count; - } - if (m.notify_props && m.notify_props.mark_unread !== 'mention' && channel.total_msg_count - m.msg_count > 0) { - if (channel.type === 'D') { - if (users[otherUserId] && users[otherUserId].delete_at === 0) { - messageCount += 1; - } - } else if (channel.delete_at === 0) { - messageCount += 1; - } - } - } - }); - - return {messageCount, mentionCount}; - } -); - -export const canManageChannelMembers: (GlobalState) => boolean = createSelector( - getCurrentChannel, - getCurrentUser, - getCurrentTeamMembership, - getMyCurrentChannelMembership, - getConfig, - getLicense, - hasNewPermissions, - (state: GlobalState): boolean => haveICurrentChannelPermission(state, {permission: Permissions.MANAGE_PRIVATE_CHANNEL_MEMBERS}), - (state: GlobalState): boolean => haveICurrentChannelPermission(state, {permission: Permissions.MANAGE_PUBLIC_CHANNEL_MEMBERS}), - (channel: Channel, user: UserProfile, teamMembership: TeamMembership, channelMembership: ?ChannelMembership, config: Object, license: Object, newPermissions: boolean, managePrivateMembers: boolean, managePublicMembers: boolean): boolean => { - if (!channel) { - return false; - } - - if (channel.delete_at !== 0) { - return false; - } - - if (channel.type === General.DM_CHANNEL || - channel.type === General.GM_CHANNEL || - channel.name === General.DEFAULT_CHANNEL) { - return false; - } - - if (newPermissions) { - if (channel.type === General.OPEN_CHANNEL) { - return managePublicMembers; - } else if (channel.type === General.PRIVATE_CHANNEL) { - return managePrivateMembers; - } - return true; - } - - if (!channelMembership) { - return false; - } - - return canManageMembersOldPermissions(channel, user, teamMembership, channelMembership, config, license); - } -); - -// Determine if the user has permissions to manage members in at least one channel of the current team -export const canManageAnyChannelMembersInCurrentTeam: (GlobalState) => boolean = createSelector( - getMyChannelMemberships, - getCurrentTeamId, - (state: GlobalState): GlobalState => state, - (members: RelationOneToOne, currentTeamId: string, state: GlobalState): boolean => { - for (const channelId of Object.keys(members)) { - const channel = getChannel(state, channelId); - - if (!channel || channel.team_id !== currentTeamId) { - continue; - } - - if (channel.type === General.OPEN_CHANNEL && haveIChannelPermission(state, {permission: Permissions.MANAGE_PUBLIC_CHANNEL_MEMBERS, channel: channelId, team: currentTeamId})) { - return true; - } else if (channel.type === General.PRIVATE_CHANNEL && haveIChannelPermission(state, {permission: Permissions.MANAGE_PRIVATE_CHANNEL_MEMBERS, channel: channelId, team: currentTeamId})) { - return true; - } - } - return false; - } -); - -export const getAllDirectChannelIds: (GlobalState) => Array = createIdsSelector( - getDirectChannelsSet, - (directIds: Set): Array => { - return Array.from(directIds); - } -); - -export const getChannelIdsInCurrentTeam: (GlobalState) => Array = createIdsSelector( - getCurrentTeamId, - getChannelsInTeam, - (currentTeamId: string, channelsInTeam: RelationOneToMany): Array => { - return Array.from(channelsInTeam[currentTeamId] || []); - } -); - -export const getChannelIdsForCurrentTeam: (GlobalState) => Array = createIdsSelector( - getChannelIdsInCurrentTeam, - getAllDirectChannelIds, - (channels, direct) => { - return [...channels, ...direct]; - } -); - -export const getUnreadChannelIds: (GlobalState, ?Channel) => Array = createIdsSelector( - getAllChannels, - getMyChannelMemberships, - getChannelIdsForCurrentTeam, - (state: GlobalState, lastUnreadChannel: ?Channel = null): ?Channel => lastUnreadChannel, - (channels: IDMappedObjects, members: RelationOneToOne, teamChannelIds: Array, lastUnreadChannel: ?Channel): Array => { - const unreadIds = teamChannelIds.filter((id) => { - const c = channels[id]; - const m = members[id]; - - if (c && m) { - const chHasUnread = (c.total_msg_count - m.msg_count) > 0; - const chHasMention = m.mention_count > 0; - if ((m.notify_props && m.notify_props.mark_unread !== 'mention' && chHasUnread) || chHasMention) { - return true; - } - } - return false; - }); - - if (lastUnreadChannel && !unreadIds.includes(lastUnreadChannel.id)) { - unreadIds.push(lastUnreadChannel.id); - } - - return unreadIds; - } -); - -export const getUnreadChannels: (GlobalState, ?Channel) => Array = createIdsSelector( - getCurrentUser, - getUsers, - getUserIdsInChannels, - getAllChannels, - getUnreadChannelIds, - getTeammateNameDisplaySetting, - (currentUser, profiles, userIdsInChannels: Object, channels, unreadIds, settings) => { - // If we receive an unread for a channel and then a mention the channel - // won't be sorted correctly until we receive a message in another channel - if (!currentUser) { - return []; - } - - const allUnreadChannels = unreadIds.filter((id) => channels[id] && channels[id].delete_at === 0).map((id) => { - const c = channels[id]; - - if (c.type === General.DM_CHANNEL || c.type === General.GM_CHANNEL) { - return completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[id], settings, c); - } - - return c; - }); - - return allUnreadChannels; - } -); - -export const getMapAndSortedUnreadChannelIds: (GlobalState, Channel, SortingType) => Array = createIdsSelector( - getUnreadChannels, - getCurrentUser, - getMyChannelMemberships, - getLastPostPerChannel, - (state, lastUnreadChannel, sorting: SortingType = 'alpha') => sorting, - (channels, currentUser, myMembers, lastPosts, sorting: SortingType) => { - return mapAndSortChannelIds(channels, currentUser, myMembers, lastPosts, sorting, true); - }, -); - -export const getSortedUnreadChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => { - return getMapAndSortedUnreadChannelIds(state, lastUnreadChannel, sorting); - }, - (unreadChannelIds, mappedAndSortedUnreadChannelIds) => mappedAndSortedUnreadChannelIds, -); - -// Favorites -export const getFavoriteChannels: (GlobalState) => Array = createIdsSelector( - getCurrentUser, - getUsers, - getUserIdsInChannels, - getAllChannels, - getMyChannelMemberships, - getFavoritesPreferences, - getChannelIdsForCurrentTeam, - getTeammateNameDisplaySetting, - getConfig, - getMyPreferences, - getCurrentChannelId, - (currentUser: UserProfile, profiles: IDMappedObjects, userIdsInChannels: Object, channels: IDMappedObjects, myMembers: RelationOneToOne, favoriteIds: Array, teamChannelIds: Array, settings: string, config: Object, prefs: {[string]: PreferenceType}, currentChannelId: string): Array => { - if (!currentUser) { - return []; - } - - const favoriteChannel = favoriteIds.filter((id) => { - if (!myMembers[id] || !channels[id]) { - return false; - } - - const channel = channels[id]; - const otherUserId = getUserIdFromChannelName(currentUser.id, channel.name); - - if (channel.delete_at !== 0 && channel.id !== currentChannelId) { - return false; - } - - // Deleted users from CLI will not have a profiles entry - if (channel.type === General.DM_CHANNEL && !profiles[otherUserId]) { - return false; - } - - if (channel.type === General.DM_CHANNEL && !isDirectChannelVisible(profiles[otherUserId] || otherUserId, config, prefs, channel, null, false, currentChannelId)) { - return false; - } else if (channel.type === General.GM_CHANNEL && !isGroupChannelVisible(config, prefs, channel)) { - return false; - } - - return teamChannelIds.includes(id); - }).map((id) => { - const c = channels[id]; - if (c.type === General.DM_CHANNEL || c.type === General.GM_CHANNEL) { - return completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[id], settings, c); - } - - return c; - }); - - return favoriteChannel; - } -); - -export const getFavoriteChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getFavoriteChannels, - getCurrentUser, - getMyChannelMemberships, - getLastPostPerChannel, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, - mapAndSortChannelIds, -); - -export const getSortedFavoriteChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType) => getFavoriteChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), - (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, - (unreadChannelIds, favoritePreferences, favoriteChannelIds, unreadsAtTop) => { - return filterChannels(unreadChannelIds, favoritePreferences, favoriteChannelIds, unreadsAtTop, false); - }, -); - -// Public Channels -export const getPublicChannels: (GlobalState) => Array = createSelector( - getCurrentUser, - getAllChannels, - getMyChannelMemberships, - getChannelIdsForCurrentTeam, - (currentUser, channels, myMembers, teamChannelIds) => { - if (!currentUser) { - return []; - } - - const publicChannels = teamChannelIds.filter((id) => { - if (!myMembers[id]) { - return false; - } - const channel = channels[id]; - return teamChannelIds.includes(id) && channel.type === General.OPEN_CHANNEL; - }).map((id) => channels[id]); - - return publicChannels; - }, -); - -export const getPublicChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getPublicChannels, - getCurrentUser, - getMyChannelMemberships, - getLastPostPerChannel, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, - mapAndSortChannelIds, -); - -export const getSortedPublicChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getPublicChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), - (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, - filterChannels, -); - -// Private Channels -export const getPrivateChannels: (GlobalState) => Array = createSelector( - getCurrentUser, - getAllChannels, - getMyChannelMemberships, - getChannelIdsForCurrentTeam, - (currentUser, channels, myMembers, teamChannelIds) => { - if (!currentUser) { - return []; - } - - const privateChannels = teamChannelIds.filter((id) => { - if (!myMembers[id]) { - return false; - } - const channel = channels[id]; - return teamChannelIds.includes(id) && - channel.type === General.PRIVATE_CHANNEL; - }).map((id) => channels[id]); - - return privateChannels; - } -); - -export const getPrivateChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getPrivateChannels, - getCurrentUser, - getMyChannelMemberships, - getLastPostPerChannel, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, - mapAndSortChannelIds, -); - -export const getSortedPrivateChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getPrivateChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), - (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, - filterChannels, -); - -// Direct Messages -export const getDirectChannels: (GlobalState) => Array = createSelector( - getCurrentUser, - getUsers, - getUserIdsInChannels, - getAllChannels, - getVisibleTeammate, - getVisibleGroupIds, - getTeammateNameDisplaySetting, - getConfig, - getMyPreferences, - getLastPostPerChannel, - getCurrentChannelId, - (currentUser: UserProfile, profiles: IDMappedObjects, userIdsInChannels: Object, channels: IDMappedObjects, teammates: Array, groupIds: Array, settings: Object, config: Object, preferences: {[string]: PreferenceType}, lastPosts: RelationOneToOne, currentChannelId: string): Array => { - if (!currentUser) { - return []; - } - - const channelValues = Object.keys(channels).map((key) => channels[key]); - const directChannelsIds = []; - teammates.reduce((result, teammateId) => { - const name = getDirectChannelName(currentUser.id, teammateId); - const channel = channelValues.find((c: Channel) => c && c.name === name); //eslint-disable-line max-nested-callbacks - if (channel) { - const lastPost = lastPosts[channel.id]; - const otherUser = profiles[getUserIdFromChannelName(currentUser.id, channel.name)]; - if (!isAutoClosed(config, preferences, channel, lastPost ? lastPost.create_at : 0, otherUser ? otherUser.delete_at : 0, currentChannelId)) { - result.push(channel.id); - } - } - return result; - }, directChannelsIds); - const directChannels = groupIds.filter((id) => { - const channel = channels[id]; - if (channel) { - const lastPost = lastPosts[channel.id]; - return !isAutoClosed(config, preferences, channels[id], lastPost ? lastPost.create_at : 0, 0, currentChannelId); - } - - return false; - }).concat(directChannelsIds).map((id) => { - const channel = channels[id]; - return completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[id], settings, channel); - }); - - return directChannels; - } -); - -// getDirectAndGroupChannels returns all direct and group channels, even if they have been manually -// or automatically closed. -// -// This is similar to the getDirectChannels above (which actually also returns group channels, -// but suppresses manually closed group channels but not manually closed direct channels.) This -// method does away with all the suppression, since the webapp client downstream uses this for -// the channel switcher and puts such suppressed channels in a separate category. -export const getDirectAndGroupChannels: (GlobalState) => Array = createSelector( - getCurrentUser, - getUsers, - getUserIdsInChannels, - getAllChannels, - getTeammateNameDisplaySetting, - (currentUser: UserProfile, profiles: IDMappedObjects, userIdsInChannels: Object, channels: IDMappedObjects, settings): Array => { - if (!currentUser) { - return []; - } - - return Object.keys(channels).map((key) => channels[key]).filter((channel: Channel): boolean => - Boolean(channel) - ).filter((channel: Channel): boolean => - channel.type === General.DM_CHANNEL || channel.type === General.GM_CHANNEL - ).map((channel: Channel): Channel => - completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[channel.id], settings, channel) - ); - } -); - -export const getDirectChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getDirectChannels, - getCurrentUser, - getMyChannelMemberships, - getLastPostPerChannel, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, - mapAndSortChannelIds, -); - -export const getSortedDirectChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getDirectChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), - (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, - filterChannels, -); - -export function getGroupOrDirectChannelVisibility(state: GlobalState, channelId: string): boolean { - return isGroupOrDirectChannelVisible( - getChannel(state, channelId), - getMyChannelMemberships(state), - getConfig(state), - getMyPreferences(state), - getCurrentUser(state).id, - getUsers(state), - getLastPostPerChannel(state) - ); -} - -// Filters post IDs by the given condition. -// The condition function receives as parameters the associated channel object and the post object. -export const filterPostIds = (condition: (Channel, Post) => boolean) => { - if (typeof condition !== 'function') { - throw new TypeError(`${condition} is not a function`); - } - return (createSelector( - getAllChannels, - getAllPosts, - (state: GlobalState, postIds: Array): Array => postIds, - (channels: IDMappedObjects, posts: IDMappedObjects, postIds: Array): Array => { - return postIds.filter((postId) => { - const post = posts[postId]; - let channel; - if (post) { - channel = channels[post.channel_id]; - } - return post && channel && condition(channel, post); - }); - } - ): (GlobalState, Array) => Array); -}; - -const getProfiles = (currentUserId: string, usersIdsInChannel: Array, users: IDMappedObjects): Array => { - const profiles = []; - usersIdsInChannel.forEach((userId) => { - if (userId !== currentUserId) { - profiles.push(users[userId]); - } - }); - return profiles; -}; - -export const getChannelsWithUserProfiles: (GlobalState) => Array<{|...Channel, profiles: Array|}> = createSelector( - getUserIdsInChannels, - getUsers, - getGroupChannels, - getCurrentUserId, - (channelUserMap: RelationOneToMany, users: IDMappedObjects, channels: Array, currentUserId: string) => { - return channels.map((channel: Channel): {|...Channel, profiles: Array|} => { - const profiles = getProfiles(currentUserId, channelUserMap[channel.id] || [], users); - return {...channel, profiles}; - }); - } -); - -const getAllActiveChannels = createSelector( - getPublicChannels, - getPrivateChannels, - getDirectChannels, - ( - publicChannels, - privateChannels, - directChannels, - ) => { - const allChannels = [ - ...publicChannels, - ...privateChannels, - ...directChannels, - ]; - - return allChannels; - } -); - -export const getAllChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getAllActiveChannels, - getCurrentUser, - getMyChannelMemberships, - getLastPostPerChannel, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, - mapAndSortChannelIds, -); - -export const getAllSortedChannelIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getAllChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), - (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, - filterChannels, -); - -let lastChannels; -const hasChannelsChanged = (channels) => { - if (!lastChannels || lastChannels.length !== channels.length) { - return true; - } - - for (let i = 0; i < channels.length; i++) { - if (channels[i].type !== lastChannels[i].type || channels[i].items !== lastChannels[i].items) { - return true; - } - } - - return false; -}; - -export const getOrderedChannelIds = (state: GlobalState, lastUnreadChannel: Channel, grouping: 'by_type' | 'none', sorting: SortingType, unreadsAtTop: boolean, favoritesAtTop: boolean) => { - const channels = []; - - if (grouping === 'by_type') { - channels.push({ - type: 'public', - name: 'PUBLIC CHANNELS', - items: getSortedPublicChannelIds( - state, - lastUnreadChannel, - unreadsAtTop, - favoritesAtTop, - sorting, - ), - }); - - channels.push({ - type: 'private', - name: 'PRIVATE CHANNELS', - items: getSortedPrivateChannelIds( - state, - lastUnreadChannel, - unreadsAtTop, - favoritesAtTop, - sorting, - ), - }); - - channels.push({ - type: 'direct', - name: 'DIRECT MESSAGES', - items: getSortedDirectChannelIds( - state, - lastUnreadChannel, - unreadsAtTop, - favoritesAtTop, - sorting, - ), - }); - } else { - // Combine all channel types - let type = 'alpha'; - let name = 'CHANNELS'; - if (sorting === 'recent') { - type = 'recent'; - name = 'RECENT ACTIVITY'; - } - - channels.push({ - type, - name, - items: getAllSortedChannelIds( - state, - lastUnreadChannel, - unreadsAtTop, - favoritesAtTop, - sorting, - ), - }); - } - - if (favoritesAtTop) { - channels.unshift({ - type: 'favorite', - name: 'FAVORITE CHANNELS', - items: getSortedFavoriteChannelIds( - state, - lastUnreadChannel, - unreadsAtTop, - favoritesAtTop, - sorting, - ), - }); - } - - if (unreadsAtTop) { - channels.unshift({ - type: 'unreads', - name: 'UNREADS', - items: getSortedUnreadChannelIds( - state, - lastUnreadChannel, - unreadsAtTop, - favoritesAtTop, - sorting, - ), - }); - } - - if (hasChannelsChanged(channels)) { - lastChannels = channels; - } - - return lastChannels; -}; - -// Added for backwards compatibility -// Can be removed once webapp includes new sidebar preferences - -export const getSortedPublicChannelWithUnreadsIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - getPublicChannelIds, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, - (unreadChannelIds, favoritePreferences, publicChannelIds, favoritesAtTop) => { - return filterChannels(unreadChannelIds, favoritePreferences, publicChannelIds, false, favoritesAtTop); - }, -); - -export const getSortedPrivateChannelWithUnreadsIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - getPrivateChannelIds, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, - (unreadChannelIds, favoritePreferences, privateChannelId, favoritesAtTop) => { - return filterChannels(unreadChannelIds, favoritePreferences, privateChannelId, false, favoritesAtTop); - }, -); - -export const getSortedFavoriteChannelWithUnreadsIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoriteChannelIds, - (unreadChannelIds, favoriteChannelIds) => favoriteChannelIds, -); - -export const getSortedDirectChannelWithUnreadsIds: (GlobalState, Channel, boolean, boolean, SortingType) => Array = createIdsSelector( - getUnreadChannelIds, - getFavoritesPreferences, - getDirectChannelIds, - (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, - (unreadChannelIds, favoritePreferences, directChannelIds, favoritesAtTop) => { - return filterChannels(unreadChannelIds, favoritePreferences, directChannelIds, false, favoritesAtTop); - }, -); - -export const getDefaultChannelForTeams: (GlobalState) => RelationOneToOne = createSelector( - getAllChannels, - (channels: IDMappedObjects): RelationOneToOne => { - const result = {}; - for (const channel of Object.keys(channels).map((key) => channels[key])) { - if (channel && channel.name === General.DEFAULT_CHANNEL) { - result[channel.team_id] = channel; - } - } - return result; - } -); - -export const getMyFirstChannelForTeams: (GlobalState) => RelationOneToOne = createSelector( - getAllChannels, - getMyChannelMemberships, - getMyTeams, - getCurrentUser, - (allChannels: IDMappedObjects, myChannelMemberships: RelationOneToOne, myTeams: Array, currentUser: UserProfile): RelationOneToOne => { - const locale = currentUser.locale || General.DEFAULT_LOCALE; - - const result = {}; - for (const team of myTeams) { - // Get a sorted array of all channels in the team that the current user is a member of - // $FlowFixMe - const teamChannels = Object.values(allChannels). - filter((channel: Channel) => channel && channel.team_id === team.id && Boolean(myChannelMemberships[channel.id])). - sort(sortChannelsByDisplayName.bind(null, locale)); - - if (teamChannels.length === 0) { - continue; - } - - result[team.id] = teamChannels[0]; - } - - return result; - } -); - -export const getRedirectChannelNameForTeam = (state: GlobalState, teamId: string): string => { - const defaultChannelForTeam = getDefaultChannelForTeams(state)[teamId]; - const myFirstChannelForTeam = getMyFirstChannelForTeams(state)[teamId]; - const canIJoinPublicChannelsInTeam = !hasNewPermissions(state) || haveITeamPermission(state, {team: teamId, permission: Permissions.JOIN_PUBLIC_CHANNELS}); - const myChannelMemberships = getMyChannelMemberships(state); - - const iAmMemberOfTheTeamDefaultChannel = Boolean(defaultChannelForTeam && myChannelMemberships[defaultChannelForTeam.id]); - if (iAmMemberOfTheTeamDefaultChannel || canIJoinPublicChannelsInTeam) { - return General.DEFAULT_CHANNEL; - } - return (myFirstChannelForTeam && myFirstChannelForTeam.name) || General.DEFAULT_CHANNEL; -}; diff --git a/src/selectors/entities/channels.test.js b/src/selectors/entities/channels.test.js index 1618286bc..a69f4d178 100644 --- a/src/selectors/entities/channels.test.js +++ b/src/selectors/entities/channels.test.js @@ -7,7 +7,7 @@ import deepFreezeAndThrowOnMutation from 'utils/deep_freeze'; import TestHelper from 'test/test_helper'; import {sortChannelsByDisplayName, getDirectChannelName} from 'utils/channel_utils'; import * as Selectors from 'selectors/entities/channels'; -import {General, Preferences} from 'constants'; +import {General, Preferences} from '../../constants'; describe('Selectors.Channels', () => { const team1 = TestHelper.fakeTeamWithId(); diff --git a/src/selectors/entities/channels.ts b/src/selectors/entities/channels.ts new file mode 100644 index 000000000..7007282e5 --- /dev/null +++ b/src/selectors/entities/channels.ts @@ -0,0 +1,830 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {createSelector} from 'reselect'; +import {General, Permissions} from '../../constants'; +import {getCurrentChannelId, getCurrentUser, getUsers, getMyChannelMemberships, getMyCurrentChannelMembership} from 'selectors/entities/common'; +import {getConfig, getLicense, hasNewPermissions} from 'selectors/entities/general'; +import {getFavoritesPreferences, getMyPreferences, getTeammateNameDisplaySetting, getVisibleTeammate, getVisibleGroupIds} from 'selectors/entities/preferences'; +import {getLastPostPerChannel, getAllPosts} from 'selectors/entities/posts'; +import {getCurrentTeamId, getCurrentTeamMembership, getMyTeams, getTeamMemberships} from 'selectors/entities/teams'; +import {haveICurrentChannelPermission, haveIChannelPermission, haveITeamPermission} from 'selectors/entities/roles'; +import {isCurrentUserSystemAdmin, getCurrentUserId} from 'selectors/entities/users'; +import {buildDisplayableChannelList, buildDisplayableChannelListWithUnreadSection, canManageMembersOldPermissions, completeDirectChannelInfo, completeDirectChannelDisplayName, getUserIdFromChannelName, getChannelByName as getChannelByNameHelper, isChannelMuted, getDirectChannelName, isAutoClosed, isDirectChannelVisible, isGroupChannelVisible, isGroupOrDirectChannelVisible, sortChannelsByDisplayName, isFavoriteChannel, isDefault, sortChannelsByRecency} from 'utils/channel_utils'; +import {createIdsSelector} from 'utils/helpers'; + +export {getCurrentChannelId, getMyChannelMemberships, getMyCurrentChannelMembership}; +import {GlobalState} from 'types/store'; +import {Channel, ChannelStats, ChannelMembership} from 'types/channels'; +import {UsersState, UserProfile} from 'types/users'; +import {PreferenceType} from 'types/preferences'; +import {Post} from 'types/posts'; +import {TeamMembership, Team} from 'types/teams'; +import {NameMappedObjects, UserIDMappedObjects, IDMappedObjects, RelationOneToOne, RelationOneToMany} from 'types/utilities'; + +import {getUserIdsInChannels} from './users'; +type SortingType = 'recent' | 'alpha'; +export function getAllChannels(state: GlobalState): IDMappedObjects { + return state.entities.channels.channels; +} + +export function getAllChannelStats(state: GlobalState): RelationOneToOne { + return state.entities.channels.stats; +} + +export function getChannelsInTeam(state: GlobalState): RelationOneToMany { + return state.entities.channels.channelsInTeam; +} + +export const getDirectChannelsSet: (a: GlobalState) => Set = createSelector(getChannelsInTeam, (channelsInTeam: RelationOneToMany): Set => { + return channelsInTeam && new Set(channelsInTeam['']) || new Set(); +}); +export function getChannelMembersInChannels(state: GlobalState): RelationOneToOne> { + return state.entities.channels.membersInChannel; +} + +function sortChannelsByRecencyOrAlpha(locale, lastPosts, sorting: SortingType, a, b) { + if (sorting === 'recent') { + return sortChannelsByRecency(lastPosts, a, b); + } + + return sortChannelsByDisplayName(locale, a, b); +} + +// mapAndSortChannelIds sorts channels, primarily by: +// For all sections except unreads: +// a. All other unread channels +// b. Muted channels +// For unreads section: +// a. Non-muted channels with mentions +// b. Muted channels with mentions +// c. Remaining unread channels +// And then secondary by alphabetical ("alpha") or chronological ("recency") order + +export const mapAndSortChannelIds = (channels: Array, currentUser: UserProfile, myMembers: RelationOneToOne, lastPosts: RelationOneToOne, sorting: SortingType, sortMentionsFirst = false): Array => { + const locale = currentUser.locale || General.DEFAULT_LOCALE; + + const mutedChannelIds = channels. + filter((channel) => isChannelMuted(myMembers[channel.id])). + sort(sortChannelsByRecencyOrAlpha.bind(null, locale, lastPosts, sorting)). + map((channel) => channel.id); + + let hasMentionedChannelIds: string[] = []; + if (sortMentionsFirst) { + hasMentionedChannelIds = channels. + filter((channel) => { + const member = myMembers[channel.id]; + return member && member.mention_count > 0 && !isChannelMuted(member); + }). + sort(sortChannelsByRecencyOrAlpha.bind(null, locale, lastPosts, sorting)). + map((channel) => channel.id); + } + + const otherChannelIds = channels. + filter((channel) => { + return !mutedChannelIds.includes(channel.id) && !hasMentionedChannelIds.includes(channel.id); + }). + sort(sortChannelsByRecencyOrAlpha.bind(null, locale, lastPosts, sorting)). + map((channel) => channel.id); + + return sortMentionsFirst ? hasMentionedChannelIds.concat(mutedChannelIds, otherChannelIds) : otherChannelIds.concat(mutedChannelIds); +}; + +export function filterChannels(unreadIds: Array, favoriteIds: Array, channelIds: Array, unreadsAtTop: boolean, favoritesAtTop: boolean): Array { + let channels: Array = channelIds; + + if (unreadsAtTop) { + channels = channels.filter((id) => { + return !unreadIds.includes(id); + }); + } + + if (favoritesAtTop) { + channels = channels.filter((id) => { + return !favoriteIds.includes(id); + }); + } + + return channels; +} + +export function makeGetChannel(): (b: GlobalState, a: { + id: string; +}) => Channel { + return createSelector(getAllChannels, (state: GlobalState, props) => props.id, (state: GlobalState) => state.entities.users, getTeammateNameDisplaySetting, (allChannels, channelId, users, teammateNameDisplay) => { + const channel = allChannels[channelId]; + + if (channel) { + return completeDirectChannelInfo(users, teammateNameDisplay, channel); + } + + return channel; + }); +} + +export const getChannel: (b: GlobalState, a: string) => Channel = createSelector(getAllChannels, (state: GlobalState, id: string): string => id, (state: GlobalState): UsersState => state.entities.users, getTeammateNameDisplaySetting, (allChannels: IDMappedObjects, channelId: string, users: UsersState, teammateNameDisplay: string): Channel => { + const channel = allChannels[channelId]; + + if (channel) { + return completeDirectChannelInfo(users, teammateNameDisplay, channel); + } + + return channel; +}); +export const getCurrentChannel: (a: GlobalState) => Channel = createSelector(getAllChannels, getCurrentChannelId, (state: GlobalState): UsersState => state.entities.users, getTeammateNameDisplaySetting, (allChannels: IDMappedObjects, currentChannelId: string, users: UsersState, teammateNameDisplay: string): Channel => { + const channel = allChannels[currentChannelId]; + + if (channel) { + return completeDirectChannelInfo(users, teammateNameDisplay, channel); + } + + return channel; +}); +export const getMyChannelMember: (b: GlobalState, a: string) => ChannelMembership | undefined | null = createSelector(getMyChannelMemberships, (state: GlobalState, channelId: string): string => channelId, (channelMemberships: RelationOneToOne, channelId: string): ChannelMembership | undefined | null => { + return channelMemberships[channelId] || null; +}); +export const getCurrentChannelStats: (a: GlobalState) => ChannelStats = createSelector(getAllChannelStats, getCurrentChannelId, (allChannelStats: RelationOneToOne, currentChannelId: string): ChannelStats => { + return allChannelStats[currentChannelId]; +}); +export const isCurrentChannelFavorite: (a: GlobalState) => boolean = createSelector(getMyPreferences, getCurrentChannelId, (preferences: { + [x: string]: PreferenceType; +}, channelId: string): boolean => isFavoriteChannel(preferences, channelId)); +export const isCurrentChannelMuted: (a: GlobalState) => boolean = createSelector(getMyCurrentChannelMembership, (membership?: ChannelMembership | null): boolean => { + if (!membership) { + return false; + } + + return isChannelMuted(membership); +}); +export const isCurrentChannelArchived: (a: GlobalState) => boolean = createSelector(getCurrentChannel, (channel: Channel): boolean => channel.delete_at !== 0); +export const isCurrentChannelDefault: (a: GlobalState) => boolean = createSelector(getCurrentChannel, (channel: Channel): boolean => isDefault(channel)); +export function isCurrentChannelReadOnly(state: GlobalState): boolean { + return isChannelReadOnly(state, getCurrentChannel(state)); +} + +export function isChannelReadOnlyById(state: GlobalState, channelId: string): boolean { + return isChannelReadOnly(state, getChannel(state, channelId)); +} + +export function isChannelReadOnly(state: GlobalState, channel: Channel): boolean { + return channel && channel.name === General.DEFAULT_CHANNEL && !isCurrentUserSystemAdmin(state) && getConfig(state).ExperimentalTownSquareIsReadOnly === 'true'; +} + +export function shouldHideDefaultChannel(state: GlobalState, channel: Channel): boolean { + return channel && channel.name === General.DEFAULT_CHANNEL && !isCurrentUserSystemAdmin(state) && getConfig(state).ExperimentalHideTownSquareinLHS === 'true'; +} + +export function getChannelByName(state: GlobalState, channelName: string): Channel | undefined | null { + return getChannelByNameHelper(getAllChannels(state), channelName); +} + +export const getChannelSetInCurrentTeam: (a: GlobalState) => Array = createSelector(getCurrentTeamId, getChannelsInTeam, (currentTeamId: string, channelsInTeam: RelationOneToMany): Array => { + return channelsInTeam && channelsInTeam[currentTeamId] || []; +}); + +function sortAndInjectChannels(channels: IDMappedObjects, channelSet: Array, locale: string): Array { + const currentChannels: Channel[] = []; + + if (typeof channelSet === 'undefined') { + return currentChannels; + } + + channelSet.forEach((c) => { + currentChannels.push(channels[c]); + }); + return currentChannels.sort(sortChannelsByDisplayName.bind(null, locale)); +} + +export const getChannelsInCurrentTeam: (a: GlobalState) => Array = createSelector(getAllChannels, getChannelSetInCurrentTeam, getCurrentUser, (channels: IDMappedObjects, currentTeamChannelSet: Array, currentUser: UserProfile): Array => { + let locale = General.DEFAULT_LOCALE; + + if (currentUser && currentUser.locale) { + locale = currentUser.locale; + } + + return sortAndInjectChannels(channels, currentTeamChannelSet, locale); +}); +export const getChannelsNameMapInTeam: (b: GlobalState, a: string) => NameMappedObjects = createSelector(getAllChannels, getChannelsInTeam, (state: GlobalState, teamId: string): string => teamId, (channels: IDMappedObjects, channelsInTeams: RelationOneToMany, teamId: string): NameMappedObjects => { + const channelsInTeam = channelsInTeams[teamId] || []; + const channelMap = {}; + channelsInTeam.forEach((id) => { + const channel = channels[id]; + channelMap[channel.name] = channel; + }); + return channelMap; +}); +export const getChannelsNameMapInCurrentTeam: (a: GlobalState) => NameMappedObjects = createSelector(getAllChannels, getChannelSetInCurrentTeam, (channels: IDMappedObjects, currentTeamChannelSet: Array): NameMappedObjects => { + const channelMap = {}; + currentTeamChannelSet.forEach((id) => { + const channel = channels[id]; + channelMap[channel.name] = channel; + }); + return channelMap; +}); // Returns both DMs and GMs + +export const getAllDirectChannels: (a: GlobalState) => Array = createSelector(getAllChannels, getDirectChannelsSet, (state: GlobalState): UsersState => state.entities.users, getTeammateNameDisplaySetting, (channels: IDMappedObjects, channelSet: Set, users: UsersState, teammateNameDisplay: string): Array => { + const dmChannels: Channel[] = []; + channelSet.forEach((c) => { + dmChannels.push(completeDirectChannelInfo(users, teammateNameDisplay, channels[c])); + }); + return dmChannels; +}); // Returns only GMs + +export const getGroupChannels: (a: GlobalState) => Array = createSelector(getAllChannels, getDirectChannelsSet, (state: GlobalState): UsersState => state.entities.users, getTeammateNameDisplaySetting, (channels: IDMappedObjects, channelSet: Set, users: UsersState, teammateNameDisplay: string): Array => { + const gmChannels: Channel[] = []; + channelSet.forEach((id) => { + const channel = channels[id]; + + if (channel.type === General.GM_CHANNEL) { + gmChannels.push(completeDirectChannelInfo(users, teammateNameDisplay, channel)); + } + }); + return gmChannels; +}); +export const getMyChannels: (a: GlobalState) => Array = createSelector(getChannelsInCurrentTeam, getAllDirectChannels, getMyChannelMemberships, (channels: Array, directChannels: Array, myMembers: RelationOneToOne): Array => { + return [...channels, ...directChannels].filter((c) => myMembers.hasOwnProperty(c.id)); +}); +export const getOtherChannels: (b: GlobalState, a?: boolean | null) => Array = createSelector(getChannelsInCurrentTeam, getMyChannelMemberships, (state: GlobalState, archived: boolean | undefined | null = true) => archived, (channels: Array, myMembers: RelationOneToOne, archived?: boolean | null): Array => { + return channels.filter((c) => !myMembers.hasOwnProperty(c.id) && c.type === General.OPEN_CHANNEL && (archived ? true : c.delete_at === 0)); +}); +export const getArchivedChannels: (a: GlobalState) => Array = createSelector(getChannelsInCurrentTeam, getMyChannelMemberships, (channels: Array, myMembers: RelationOneToOne): Array => { + return channels.filter((c) => myMembers.hasOwnProperty(c.id) && c.delete_at !== 0); +}); +export const getChannelsByCategory: (a: GlobalState) => { + favoriteChannels: Array; + publicChannels: Array; + privateChannels: Array; + directAndGroupChannels: Array; +} = createSelector(getCurrentChannelId, getMyChannels, getMyChannelMemberships, getConfig, getMyPreferences, getTeammateNameDisplaySetting, (state: GlobalState): UsersState => state.entities.users, getLastPostPerChannel, (currentChannelId: string, channels: Array, myMembers: RelationOneToOne, config: any, myPreferences: { + [x: string]: PreferenceType; +}, teammateNameDisplay: string, usersState: UsersState, lastPosts: RelationOneToOne) => { + const allChannels = channels.map((c) => { + const channel = {...c, + }; + channel.isCurrent = c.id === currentChannelId; + return channel; + }); + return buildDisplayableChannelList(usersState, allChannels, myMembers, config, myPreferences, teammateNameDisplay, lastPosts); +}); +export const getChannelsWithUnreadSection: (a: GlobalState) => { + unreadChannels: Array; + favoriteChannels: Array; + publicChannels: Array; + privateChannels: Array; + directAndGroupChannels: Array; +} = createSelector(getCurrentChannelId, getMyChannels, getMyChannelMemberships, getConfig, getMyPreferences, getTeammateNameDisplaySetting, (state: GlobalState): UsersState => state.entities.users, getLastPostPerChannel, (currentChannelId: string, channels: Array, myMembers: RelationOneToOne, config: any, myPreferences: { + [x: string]: PreferenceType; +}, teammateNameDisplay: string, usersState: UsersState, lastPosts: RelationOneToOne) => { + const allChannels = channels.map((c) => { + const channel = {...c, + }; + channel.isCurrent = c.id === currentChannelId; + return channel; + }); + return buildDisplayableChannelListWithUnreadSection(usersState, allChannels, myMembers, config, myPreferences, teammateNameDisplay, lastPosts); +}); +export const getDefaultChannel: (a: GlobalState) => Channel | undefined | null = createSelector(getAllChannels, getCurrentTeamId, (channels: IDMappedObjects, teamId: string): Channel | undefined | null => { + return Object.keys(channels).map((key) => channels[key]).find((c) => c && c.team_id === teamId && c.name === General.DEFAULT_CHANNEL); +}); +export const getMembersInCurrentChannel: (a: GlobalState) => UserIDMappedObjects = createSelector(getCurrentChannelId, getChannelMembersInChannels, (currentChannelId: string, members: RelationOneToOne>): UserIDMappedObjects => { + return members[currentChannelId]; +}); +export const getUnreads: (a: GlobalState) => { + messageCount: number; + mentionCount: number; +} = createSelector(getAllChannels, getMyChannelMemberships, getUsers, getCurrentUserId, getCurrentTeamId, getMyTeams, getTeamMemberships, (channels: IDMappedObjects, myMembers: RelationOneToOne, users: IDMappedObjects, currentUserId: string, currentTeamId: string, myTeams: Array, myTeamMemberships: RelationOneToOne): { + messageCount: number; + mentionCount: number; +} => { + let messageCountForCurrentTeam = 0; // Includes message count from channels of current team plus all GM'S and all DM's across teams + + let mentionCountForCurrentTeam = 0; // Includes mention count from channels of current team plus all GM'S and all DM's across teams + + Object.keys(myMembers).forEach((channelId) => { + const channel = channels[channelId]; + const m = myMembers[channelId]; + + if (channel && m && (channel.team_id === currentTeamId || channel.type === General.DM_CHANNEL || channel.type === General.GM_CHANNEL)) { + let otherUserId = ''; + + if (channel.type === 'D') { + otherUserId = getUserIdFromChannelName(currentUserId, channel.name); + + if (users[otherUserId] && users[otherUserId].delete_at === 0) { + mentionCountForCurrentTeam += channel.total_msg_count - m.msg_count; + } + } else if (m.mention_count > 0 && channel.delete_at === 0) { + mentionCountForCurrentTeam += m.mention_count; + } + + if (m.notify_props && m.notify_props.mark_unread !== 'mention' && channel.total_msg_count - m.msg_count > 0) { + if (channel.type === 'D') { + if (users[otherUserId] && users[otherUserId].delete_at === 0) { + messageCountForCurrentTeam += 1; + } + } else if (channel.delete_at === 0) { + messageCountForCurrentTeam += 1; + } + } + } + }); // Includes mention count and message count from teams other than the current team + // This count does not include GM's and DM's + + const otherTeamsUnreadCountForChannels = myTeams.reduce((acc, team) => { + if (currentTeamId !== team.id) { + const member = myTeamMemberships[team.id]; + acc.messageCount += member.msg_count; + acc.mentionCount += member.mention_count; + } + + return acc; + }, { + messageCount: 0, + mentionCount: 0, + }); + const totalTeamsUnreadCount = { + messageCount: messageCountForCurrentTeam + otherTeamsUnreadCountForChannels.messageCount, + mentionCount: mentionCountForCurrentTeam + otherTeamsUnreadCountForChannels.mentionCount, + }; + return totalTeamsUnreadCount; +}); +export const getUnreadsInCurrentTeam: (a: GlobalState) => { + messageCount: number; + mentionCount: number; +} = createSelector(getCurrentChannelId, getMyChannels, getMyChannelMemberships, getUsers, getCurrentUserId, (currentChannelId: string, channels: Array, myMembers: RelationOneToOne, users: IDMappedObjects, currentUserId: string): { + messageCount: number; + mentionCount: number; +} => { + let messageCount = 0; + let mentionCount = 0; + channels.forEach((channel) => { + const m = myMembers[channel.id]; + + if (m && channel.id !== currentChannelId) { + let otherUserId = ''; + + if (channel.type === 'D') { + otherUserId = getUserIdFromChannelName(currentUserId, channel.name); + + if (users[otherUserId] && users[otherUserId].delete_at === 0) { + mentionCount += channel.total_msg_count - m.msg_count; + } + } else if (m.mention_count > 0 && channel.delete_at === 0) { + mentionCount += m.mention_count; + } + + if (m.notify_props && m.notify_props.mark_unread !== 'mention' && channel.total_msg_count - m.msg_count > 0) { + if (channel.type === 'D') { + if (users[otherUserId] && users[otherUserId].delete_at === 0) { + messageCount += 1; + } + } else if (channel.delete_at === 0) { + messageCount += 1; + } + } + } + }); + return { + messageCount, + mentionCount, + }; +}); +export const canManageChannelMembers: (a: GlobalState) => boolean = createSelector(getCurrentChannel, getCurrentUser, getCurrentTeamMembership, getMyCurrentChannelMembership, getConfig, getLicense, hasNewPermissions, (state: GlobalState): boolean => haveICurrentChannelPermission(state, { + permission: Permissions.MANAGE_PRIVATE_CHANNEL_MEMBERS, +}), (state: GlobalState): boolean => haveICurrentChannelPermission(state, { + permission: Permissions.MANAGE_PUBLIC_CHANNEL_MEMBERS, +}), (channel: Channel, user: UserProfile, teamMembership: TeamMembership, channelMembership: ChannelMembership | undefined | null, config: any, license: any, newPermissions: boolean, managePrivateMembers: boolean, managePublicMembers: boolean): boolean => { + if (!channel) { + return false; + } + + if (channel.delete_at !== 0) { + return false; + } + + if (channel.type === General.DM_CHANNEL || channel.type === General.GM_CHANNEL || channel.name === General.DEFAULT_CHANNEL) { + return false; + } + + if (newPermissions) { + if (channel.type === General.OPEN_CHANNEL) { + return managePublicMembers; + } else if (channel.type === General.PRIVATE_CHANNEL) { + return managePrivateMembers; + } + + return true; + } + + if (!channelMembership) { + return false; + } + + return canManageMembersOldPermissions(channel, user, teamMembership, channelMembership, config, license); +}); // Determine if the user has permissions to manage members in at least one channel of the current team + +export const canManageAnyChannelMembersInCurrentTeam: (a: GlobalState) => boolean = createSelector(getMyChannelMemberships, getCurrentTeamId, (state: GlobalState): GlobalState => state, (members: RelationOneToOne, currentTeamId: string, state: GlobalState): boolean => { + for (const channelId of Object.keys(members)) { + const channel = getChannel(state, channelId); + + if (!channel || channel.team_id !== currentTeamId) { + continue; + } + + if (channel.type === General.OPEN_CHANNEL && haveIChannelPermission(state, { + permission: Permissions.MANAGE_PUBLIC_CHANNEL_MEMBERS, + channel: channelId, + team: currentTeamId, + })) { + return true; + } else if (channel.type === General.PRIVATE_CHANNEL && haveIChannelPermission(state, { + permission: Permissions.MANAGE_PRIVATE_CHANNEL_MEMBERS, + channel: channelId, + team: currentTeamId, + })) { + return true; + } + } + + return false; +}); +export const getAllDirectChannelIds: (a: GlobalState) => Array = createIdsSelector(getDirectChannelsSet, (directIds: Set): Array => { + return Array.from(directIds); +}); +export const getChannelIdsInCurrentTeam: (a: GlobalState) => Array = createIdsSelector(getCurrentTeamId, getChannelsInTeam, (currentTeamId: string, channelsInTeam: RelationOneToMany): Array => { + return Array.from(channelsInTeam[currentTeamId] || []); +}); +export const getChannelIdsForCurrentTeam: (a: GlobalState) => Array = createIdsSelector(getChannelIdsInCurrentTeam, getAllDirectChannelIds, (channels, direct) => { + return [...channels, ...direct]; +}); +export const getUnreadChannelIds: (b: GlobalState, a?: Channel | null) => Array = createIdsSelector(getAllChannels, getMyChannelMemberships, getChannelIdsForCurrentTeam, (state: GlobalState, lastUnreadChannel: Channel | undefined | null = null): Channel | undefined | null => lastUnreadChannel, (channels: IDMappedObjects, members: RelationOneToOne, teamChannelIds: Array, lastUnreadChannel?: Channel | null): Array => { + const unreadIds = teamChannelIds.filter((id) => { + const c = channels[id]; + const m = members[id]; + + if (c && m) { + const chHasUnread = c.total_msg_count - m.msg_count > 0; + const chHasMention = m.mention_count > 0; + + if (m.notify_props && m.notify_props.mark_unread !== 'mention' && chHasUnread || chHasMention) { + return true; + } + } + + return false; + }); + + if (lastUnreadChannel && !unreadIds.includes(lastUnreadChannel.id)) { + unreadIds.push(lastUnreadChannel.id); + } + + return unreadIds; +}); +export const getUnreadChannels: (b: GlobalState, a?: Channel | null) => Array = createIdsSelector(getCurrentUser, getUsers, getUserIdsInChannels, getAllChannels, getUnreadChannelIds, getTeammateNameDisplaySetting, (currentUser, profiles, userIdsInChannels: any, channels, unreadIds, settings) => { + // If we receive an unread for a channel and then a mention the channel + // won't be sorted correctly until we receive a message in another channel + if (!currentUser) { + return []; + } + + const allUnreadChannels = unreadIds.filter((id) => channels[id] && channels[id].delete_at === 0).map((id) => { + const c = channels[id]; + + if (c.type === General.DM_CHANNEL || c.type === General.GM_CHANNEL) { + return completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[id], settings, c); + } + + return c; + }); + return allUnreadChannels; +}); +export const getMapAndSortedUnreadChannelIds: (c: GlobalState, b: Channel, a: SortingType) => Array = createIdsSelector(getUnreadChannels, getCurrentUser, getMyChannelMemberships, getLastPostPerChannel, (state, lastUnreadChannel, sorting: SortingType = 'alpha') => sorting, (channels, currentUser, myMembers, lastPosts: RelationOneToOne, sorting: SortingType) => { + return mapAndSortChannelIds(channels, currentUser, myMembers, lastPosts, sorting, true); +}); +export const getSortedUnreadChannelIds: (e: GlobalState, d: Channel|null, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => { + return getMapAndSortedUnreadChannelIds(state, lastUnreadChannel, sorting); +}, (unreadChannelIds, mappedAndSortedUnreadChannelIds) => mappedAndSortedUnreadChannelIds); // Favorites + +export const getFavoriteChannels: (a: GlobalState) => Array = createIdsSelector(getCurrentUser, getUsers, getUserIdsInChannels, getAllChannels, getMyChannelMemberships, getFavoritesPreferences, getChannelIdsForCurrentTeam, getTeammateNameDisplaySetting, getConfig, getMyPreferences, getCurrentChannelId, (currentUser: UserProfile, profiles: IDMappedObjects, userIdsInChannels: any, channels: IDMappedObjects, myMembers: RelationOneToOne, favoriteIds: Array, teamChannelIds: Array, settings: string, config: any, prefs: { + [x: string]: PreferenceType; +}, currentChannelId: string): Array => { + if (!currentUser) { + return []; + } + + const favoriteChannel = favoriteIds.filter((id) => { + if (!myMembers[id] || !channels[id]) { + return false; + } + + const channel = channels[id]; + const otherUserId = getUserIdFromChannelName(currentUser.id, channel.name); + + if (channel.delete_at !== 0 && channel.id !== currentChannelId) { + return false; + } + + // Deleted users from CLI will not have a profiles entry + + if (channel.type === General.DM_CHANNEL && !profiles[otherUserId]) { + return false; + } + + if (channel.type === General.DM_CHANNEL && !isDirectChannelVisible(profiles[otherUserId] || otherUserId, config, prefs, channel, null, false, currentChannelId)) { + return false; + } else if (channel.type === General.GM_CHANNEL && !isGroupChannelVisible(config, prefs, channel)) { + return false; + } + + return teamChannelIds.includes(id); + }).map((id) => { + const c = channels[id]; + + if (c.type === General.DM_CHANNEL || c.type === General.GM_CHANNEL) { + return completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[id], settings, c); + } + + return c; + }); + return favoriteChannel; +}); +export const getFavoriteChannelIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getFavoriteChannels, getCurrentUser, getMyChannelMemberships, getLastPostPerChannel, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, mapAndSortChannelIds); +export const getSortedFavoriteChannelIds: (e: GlobalState, d: Channel|null, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType) => getFavoriteChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, (unreadChannelIds, favoritePreferences, favoriteChannelIds, unreadsAtTop) => { + return filterChannels(unreadChannelIds, favoritePreferences, favoriteChannelIds, unreadsAtTop, false); +}); // Public Channels + +export const getPublicChannels: (a: GlobalState) => Array = createSelector(getCurrentUser, getAllChannels, getMyChannelMemberships, getChannelIdsForCurrentTeam, (currentUser, channels, myMembers, teamChannelIds) => { + if (!currentUser) { + return []; + } + + const publicChannels = teamChannelIds.filter((id) => { + if (!myMembers[id]) { + return false; + } + + const channel = channels[id]; + return teamChannelIds.includes(id) && channel.type === General.OPEN_CHANNEL; + }).map((id) => channels[id]); + return publicChannels; +}); +export const getPublicChannelIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getPublicChannels, getCurrentUser, getMyChannelMemberships, getLastPostPerChannel, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, mapAndSortChannelIds); +export const getSortedPublicChannelIds: (e: GlobalState, d: Channel|null, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getPublicChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, filterChannels); // Private Channels + +export const getPrivateChannels: (a: GlobalState) => Array = createSelector(getCurrentUser, getAllChannels, getMyChannelMemberships, getChannelIdsForCurrentTeam, (currentUser, channels, myMembers, teamChannelIds) => { + if (!currentUser) { + return []; + } + + const privateChannels = teamChannelIds.filter((id) => { + if (!myMembers[id]) { + return false; + } + + const channel = channels[id]; + return teamChannelIds.includes(id) && channel.type === General.PRIVATE_CHANNEL; + }).map((id) => channels[id]); + return privateChannels; +}); +export const getPrivateChannelIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getPrivateChannels, getCurrentUser, getMyChannelMemberships, getLastPostPerChannel, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, mapAndSortChannelIds); +export const getSortedPrivateChannelIds: (e: GlobalState, d: Channel|null, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getPrivateChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, filterChannels); // Direct Messages + +export const getDirectChannels: (a: GlobalState) => Array = createSelector(getCurrentUser, getUsers, getUserIdsInChannels, getAllChannels, getVisibleTeammate, getVisibleGroupIds, getTeammateNameDisplaySetting, getConfig, getMyPreferences, getLastPostPerChannel, getCurrentChannelId, (currentUser: UserProfile, profiles: IDMappedObjects, userIdsInChannels: any, channels: IDMappedObjects, teammates: Array, groupIds: Array, settings: any, config: any, preferences: { + [x: string]: PreferenceType; +}, lastPosts: RelationOneToOne, currentChannelId: string): Array => { + if (!currentUser) { + return []; + } + + const channelValues = Object.keys(channels).map((key) => channels[key]); + const directChannelsIds: string[] = []; + teammates.reduce((result, teammateId) => { + const name = getDirectChannelName(currentUser.id, teammateId); + const channel = channelValues.find((c: Channel) => c && c.name === name); //eslint-disable-line max-nested-callbacks + + if (channel) { + const lastPost = lastPosts[channel.id]; + const otherUser = profiles[getUserIdFromChannelName(currentUser.id, channel.name)]; + + if (!isAutoClosed(config, preferences, channel, lastPost ? lastPost.create_at : 0, otherUser ? otherUser.delete_at : 0, currentChannelId)) { + result.push(channel.id); + } + } + + return result; + }, directChannelsIds); + const directChannels = groupIds.filter((id) => { + const channel = channels[id]; + + if (channel) { + const lastPost = lastPosts[channel.id]; + return !isAutoClosed(config, preferences, channels[id], lastPost ? lastPost.create_at : 0, 0, currentChannelId); + } + + return false; + }).concat(directChannelsIds).map((id) => { + const channel = channels[id]; + return completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[id], settings, channel); + }); + return directChannels; +}); // getDirectAndGroupChannels returns all direct and group channels, even if they have been manually +// or automatically closed. +// +// This is similar to the getDirectChannels above (which actually also returns group channels, +// but suppresses manually closed group channels but not manually closed direct channels.) This +// method does away with all the suppression, since the webapp client downstream uses this for +// the channel switcher and puts such suppressed channels in a separate category. + +export const getDirectAndGroupChannels: (a: GlobalState) => Array = createSelector(getCurrentUser, getUsers, getUserIdsInChannels, getAllChannels, getTeammateNameDisplaySetting, (currentUser: UserProfile, profiles: IDMappedObjects, userIdsInChannels: any, channels: IDMappedObjects, settings): Array => { + if (!currentUser) { + return []; + } + + return Object.keys(channels).map((key) => channels[key]).filter((channel: Channel): boolean => Boolean(channel)).filter((channel: Channel): boolean => channel.type === General.DM_CHANNEL || channel.type === General.GM_CHANNEL).map((channel: Channel): Channel => completeDirectChannelDisplayName(currentUser.id, profiles, userIdsInChannels[channel.id], settings, channel)); +}); +export const getDirectChannelIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getDirectChannels, getCurrentUser, getMyChannelMemberships, getLastPostPerChannel, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, mapAndSortChannelIds); +export const getSortedDirectChannelIds: (e: GlobalState, d: Channel|null, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getDirectChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, filterChannels); +export function getGroupOrDirectChannelVisibility(state: GlobalState, channelId: string): boolean { + return isGroupOrDirectChannelVisible(getChannel(state, channelId), getMyChannelMemberships(state), getConfig(state), getMyPreferences(state), getCurrentUser(state).id, getUsers(state), getLastPostPerChannel(state)); +} + +// Filters post IDs by the given condition. +// The condition function receives as parameters the associated channel object and the post object. + +export const filterPostIds = (condition: (b: Channel, a: Post) => boolean) => { + if (typeof condition !== 'function') { + throw new TypeError(`${condition} is not a function`); + } + + return (createSelector(getAllChannels, getAllPosts, (state: GlobalState, postIds: Array): Array => postIds, (channels: IDMappedObjects, posts: IDMappedObjects, postIds: Array): Array => { + return postIds.filter((postId) => { + const post = posts[postId]; + let channel; + + if (post) { + channel = channels[post.channel_id]; + } + + return post && channel && condition(channel, post); + }); + }) as (b: GlobalState, a: Array) => Array); +}; + +const getProfiles = (currentUserId: string, usersIdsInChannel: Array, users: IDMappedObjects): Array => { + const profiles: UserProfile[] = []; + usersIdsInChannel.forEach((userId) => { + if (userId !== currentUserId) { + profiles.push(users[userId]); + } + }); + return profiles; +}; + +export const getChannelsWithUserProfiles: (a: GlobalState) => Array<{ + profiles: Array; +} & Channel> = createSelector(getUserIdsInChannels, getUsers, getGroupChannels, getCurrentUserId, (channelUserMap: RelationOneToMany, users: IDMappedObjects, channels: Array, currentUserId: string) => { + return channels.map((channel: Channel): { + profiles: Array; + } & Channel => { + const profiles = getProfiles(currentUserId, channelUserMap[channel.id] || [], users); + return {...channel, + profiles, + }; + }); +}); +const getAllActiveChannels = createSelector(getPublicChannels, getPrivateChannels, getDirectChannels, (publicChannels, privateChannels, directChannels) => { + const allChannels = [...publicChannels, ...privateChannels, ...directChannels]; + return allChannels; +}); +export const getAllChannelIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getAllActiveChannels, getCurrentUser, getMyChannelMemberships, getLastPostPerChannel, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => sorting, mapAndSortChannelIds); +export const getAllSortedChannelIds: (e: GlobalState, d: Channel| null, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting: SortingType = 'alpha') => getAllChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), (state, lastUnreadChannel, unreadsAtTop = true) => unreadsAtTop, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, filterChannels); +let lastChannels; + +const hasChannelsChanged = (channels) => { + if (!lastChannels || lastChannels.length !== channels.length) { + return true; + } + + for (let i = 0; i < channels.length; i++) { + if (channels[i].type !== lastChannels[i].type || channels[i].items !== lastChannels[i].items) { + return true; + } + } + + return false; +}; + +export const getOrderedChannelIds = (state: GlobalState, lastUnreadChannel: Channel|null, grouping: 'by_type' | 'none', sorting: SortingType, unreadsAtTop: boolean, favoritesAtTop: boolean) => { + const channels: {type;name;items}[] = []; + + if (grouping === 'by_type') { + channels.push({ + type: 'public', + name: 'PUBLIC CHANNELS', + items: getSortedPublicChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), + }); + channels.push({ + type: 'private', + name: 'PRIVATE CHANNELS', + items: getSortedPrivateChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), + }); + channels.push({ + type: 'direct', + name: 'DIRECT MESSAGES', + items: getSortedDirectChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), + }); + } else { + // Combine all channel types + let type = 'alpha'; + let name = 'CHANNELS'; + + if (sorting === 'recent') { + type = 'recent'; + name = 'RECENT ACTIVITY'; + } + + channels.push({ + type, + name, + items: getAllSortedChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), + }); + } + + if (favoritesAtTop) { + channels.unshift({ + type: 'favorite', + name: 'FAVORITE CHANNELS', + items: getSortedFavoriteChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), + }); + } + + if (unreadsAtTop) { + channels.unshift({ + type: 'unreads', + name: 'UNREADS', + items: getSortedUnreadChannelIds(state, lastUnreadChannel, unreadsAtTop, favoritesAtTop, sorting), + }); + } + + if (hasChannelsChanged(channels)) { + lastChannels = channels; + } + + return lastChannels; +}; // Added for backwards compatibility +// Can be removed once webapp includes new sidebar preferences + +export const getSortedPublicChannelWithUnreadsIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, getPublicChannelIds, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, (unreadChannelIds, favoritePreferences, publicChannelIds, favoritesAtTop) => { + return filterChannels(unreadChannelIds, favoritePreferences, publicChannelIds, false, favoritesAtTop); +}); +export const getSortedPrivateChannelWithUnreadsIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, getPrivateChannelIds, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, (unreadChannelIds, favoritePreferences, privateChannelId, favoritesAtTop) => { + return filterChannels(unreadChannelIds, favoritePreferences, privateChannelId, false, favoritesAtTop); +}); +export const getSortedFavoriteChannelWithUnreadsIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoriteChannelIds, (unreadChannelIds, favoriteChannelIds) => favoriteChannelIds); +export const getSortedDirectChannelWithUnreadsIds: (e: GlobalState, d: Channel, c: boolean, b: boolean, a: SortingType) => Array = createIdsSelector(getUnreadChannelIds, getFavoritesPreferences, getDirectChannelIds, (state, lastUnreadChannel, unreadsAtTop, favoritesAtTop = true) => favoritesAtTop, (unreadChannelIds, favoritePreferences, directChannelIds, favoritesAtTop) => { + return filterChannels(unreadChannelIds, favoritePreferences, directChannelIds, false, favoritesAtTop); +}); +export const getDefaultChannelForTeams: (a: GlobalState) => RelationOneToOne = createSelector(getAllChannels, (channels: IDMappedObjects): RelationOneToOne => { + const result = {}; + + for (const channel of Object.keys(channels).map((key) => channels[key])) { + if (channel && channel.name === General.DEFAULT_CHANNEL) { + result[channel.team_id] = channel; + } + } + + return result; +}); +export const getMyFirstChannelForTeams: (a: GlobalState) => RelationOneToOne = createSelector(getAllChannels, getMyChannelMemberships, getMyTeams, getCurrentUser, (allChannels: IDMappedObjects, myChannelMemberships: RelationOneToOne, myTeams: Array, currentUser: UserProfile): RelationOneToOne => { + const locale = currentUser.locale || General.DEFAULT_LOCALE; + const result = {}; + + for (const team of myTeams) { + // Get a sorted array of all channels in the team that the current user is a member of + // $FlowFixMe + const teamChannels = Object.values(allChannels).filter((channel: Channel) => channel && channel.team_id === team.id && Boolean(myChannelMemberships[channel.id])).sort(sortChannelsByDisplayName.bind(null, locale)); + + if (teamChannels.length === 0) { + continue; + } + + result[team.id] = teamChannels[0]; + } + + return result; +}); +export const getRedirectChannelNameForTeam = (state: GlobalState, teamId: string): string => { + const defaultChannelForTeam = getDefaultChannelForTeams(state)[teamId]; + const myFirstChannelForTeam = getMyFirstChannelForTeams(state)[teamId]; + const canIJoinPublicChannelsInTeam = !hasNewPermissions(state) || haveITeamPermission(state, { + team: teamId, + permission: Permissions.JOIN_PUBLIC_CHANNELS, + }); + const myChannelMemberships = getMyChannelMemberships(state); + const iAmMemberOfTheTeamDefaultChannel = Boolean(defaultChannelForTeam && myChannelMemberships[defaultChannelForTeam.id]); + + if (iAmMemberOfTheTeamDefaultChannel || canIJoinPublicChannelsInTeam) { + return General.DEFAULT_CHANNEL; + } + + return myFirstChannelForTeam && myFirstChannelForTeam.name || General.DEFAULT_CHANNEL; +}; diff --git a/src/selectors/entities/common.js b/src/selectors/entities/common.ts similarity index 61% rename from src/selectors/entities/common.js rename to src/selectors/entities/common.ts index be46f7253..f00e5714b 100644 --- a/src/selectors/entities/common.js +++ b/src/selectors/entities/common.ts @@ -1,11 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import type {GlobalState} from 'types/store'; -import type {UserProfile} from 'types/users'; -import type {ChannelMembership, Channel} from 'types/channels'; -import type {RelationOneToOne, IDMappedObjects} from 'types/utilities'; +import {GlobalState} from 'types/store'; +import {UserProfile} from 'types/users'; +import {ChannelMembership, Channel} from 'types/channels'; +import {RelationOneToOne, IDMappedObjects} from 'types/utilities'; import {createSelector} from 'reselect'; @@ -19,13 +17,9 @@ export function getMyChannelMemberships(state: GlobalState): RelationOneToOne ?ChannelMembership = createSelector( - getCurrentChannelId, - getMyChannelMemberships, - (currentChannelId, channelMemberships) => { - return channelMemberships[currentChannelId] || null; - } -); +export const getMyCurrentChannelMembership: (a: GlobalState) => ChannelMembership | undefined | null = createSelector(getCurrentChannelId, getMyChannelMemberships, (currentChannelId, channelMemberships) => { + return channelMemberships[currentChannelId] || null; +}); // Users diff --git a/src/selectors/entities/emojis.js b/src/selectors/entities/emojis.ts similarity index 90% rename from src/selectors/entities/emojis.js rename to src/selectors/entities/emojis.ts index 02fafad80..4a191fc7b 100644 --- a/src/selectors/entities/emojis.js +++ b/src/selectors/entities/emojis.ts @@ -1,18 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {createSelector} from 'reselect'; import {createIdsSelector} from 'utils/helpers'; - -import type {GlobalState} from 'types/store'; -import type {CustomEmoji} from 'types/emojis'; -import type {IDMappedObjects} from 'types/utilities'; - +import {GlobalState} from 'types/store'; +import {CustomEmoji} from 'types/emojis'; +import {IDMappedObjects} from 'types/utilities'; export function getCustomEmojis(state: GlobalState): IDMappedObjects { if (state.entities.general.config.EnableCustomEmoji !== 'true') { return {}; } + return state.entities.emojis.customEmoji; } diff --git a/src/selectors/entities/files.js b/src/selectors/entities/files.ts similarity index 100% rename from src/selectors/entities/files.js rename to src/selectors/entities/files.ts diff --git a/src/selectors/entities/general.test.js b/src/selectors/entities/general.test.js index ca6d5f2ca..876755618 100644 --- a/src/selectors/entities/general.test.js +++ b/src/selectors/entities/general.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {General} from 'constants'; +import {General} from '../../constants'; import * as Selectors from 'selectors/entities/general'; diff --git a/src/selectors/entities/general.js b/src/selectors/entities/general.ts similarity index 79% rename from src/selectors/entities/general.js rename to src/selectors/entities/general.ts index c6803dddc..4692b5ec3 100644 --- a/src/selectors/entities/general.js +++ b/src/selectors/entities/general.ts @@ -1,19 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {createSelector} from 'reselect'; import {isMinimumServerVersion} from 'utils/helpers'; - -import {General} from 'constants'; - -import type {GlobalState} from 'types/store'; - -export function getConfig(state: GlobalState): Object { +import {General} from '../../constants'; +import {GlobalState} from 'types/store'; +export function getConfig(state: GlobalState): any { return state.entities.general.config; } -export function getLicense(state: GlobalState): Object { +export function getLicense(state: GlobalState): any { return state.entities.general.license; } @@ -41,28 +36,28 @@ export function hasNewPermissions(state: GlobalState): boolean { (version.match(/^4.8.\d.\d\d\d\d.*$/) !== null && isMinimumServerVersion(version, 4, 8, 0)); } -export const canUploadFilesOnMobile: (GlobalState) => boolean = createSelector( +export const canUploadFilesOnMobile: (a: GlobalState) => boolean = createSelector( getConfig, getLicense, - (config: Object, license: Object): boolean => { + (config: any, license: any): boolean => { // Defaults to true if either setting doesn't exist return config.EnableFileAttachments !== 'false' && (license.IsLicensed === 'false' || license.Compliance === 'false' || config.EnableMobileFileUpload !== 'false'); } ); -export const canDownloadFilesOnMobile: (GlobalState) => boolean = createSelector( +export const canDownloadFilesOnMobile: (a: GlobalState) => boolean = createSelector( getConfig, getLicense, - (config: Object, license: Object): boolean => { + (config: any, license: any): boolean => { // Defaults to true if the setting doesn't exist return license.IsLicensed === 'false' || license.Compliance === 'false' || config.EnableMobileFileDownload !== 'false'; } ); -export const getAutolinkedUrlSchemes: (GlobalState) => string[] = createSelector( +export const getAutolinkedUrlSchemes: (a: GlobalState) => string[] = createSelector( getConfig, - (config: Object): string[] => { + (config: any): string[] => { if (!config.CustomUrlSchemes) { return General.DEFAULT_AUTOLINKED_URL_SCHEMES; } diff --git a/src/selectors/entities/groups.js b/src/selectors/entities/groups.ts similarity index 80% rename from src/selectors/entities/groups.js rename to src/selectors/entities/groups.ts index 50d432137..b96253403 100644 --- a/src/selectors/entities/groups.js +++ b/src/selectors/entities/groups.ts @@ -1,8 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {createSelector} from 'reselect'; - +import {GlobalState} from 'types/store'; const emptyList = []; const emptySyncables = { teams: [], @@ -46,9 +45,9 @@ export function getGroupMembers(state, id) { return groupMemberData.members; } -const teamGroupIDs = (state, teamID) => state.entities.teams.groupsAssociatedToTeam[teamID]?.ids || []; +const teamGroupIDs = (state: GlobalState, teamID) => (state.entities.teams.groupsAssociatedToTeam[teamID] == null ? undefined : state.entities.teams.groupsAssociatedToTeam[teamID].ids == null ? undefined : state.entities.teams.groupsAssociatedToTeam[teamID].ids) || []; -const channelGroupIDs = (state, channelID) => state.entities.channels.groupsAssociatedToChannel[channelID]?.ids || []; +const channelGroupIDs = (state: GlobalState, channelID) => (state.entities.channels.groupsAssociatedToChannel[channelID] == null ? undefined : state.entities.channels.groupsAssociatedToChannel[channelID].ids == null ? undefined : state.entities.channels.groupsAssociatedToChannel[channelID].ids) || []; const getTeamGroupIDSet = createSelector( teamGroupIDs, diff --git a/src/selectors/entities/i18n.js b/src/selectors/entities/i18n.ts similarity index 64% rename from src/selectors/entities/i18n.js rename to src/selectors/entities/i18n.ts index c7c061117..ebc69fb8a 100644 --- a/src/selectors/entities/i18n.js +++ b/src/selectors/entities/i18n.ts @@ -1,11 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {getCurrentUser} from 'selectors/entities/common'; - -import {General} from 'constants'; - -export function getCurrentUserLocale(state, defaultLocale = General.DEFAULT_LOCALE) { +import {General} from '../../constants'; +import {GlobalState} from 'types/store'; +export function getCurrentUserLocale(state: GlobalState, defaultLocale = General.DEFAULT_LOCALE) { const currentUser = getCurrentUser(state); if (!currentUser) { diff --git a/src/selectors/entities/index.ts b/src/selectors/entities/index.ts new file mode 100644 index 000000000..39055b67d --- /dev/null +++ b/src/selectors/entities/index.ts @@ -0,0 +1,52 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import * as admin from './admin'; +import * as alerts from './alerts'; +import * as bots from './bots'; +import * as channels from './channels'; +import * as common from './common'; +import * as emojis from './emojis'; +import * as files from './files'; +import * as general from './general'; +import * as groups from './groups'; +import * as i18n from './i18n'; +import * as integrations from './integrations'; +import * as jobs from './jobs'; +import * as plugins from './plugins'; +import * as posts from './posts'; +import * as preferences from './preferences'; +import * as roles_helpers from './roles_helpers'; +import * as roles from './roles'; +import * as schemes from './schemes'; +import * as search from './search'; +import * as teams from './teams'; +import * as timezone from './timezone'; +import * as typing from './typing'; +import * as users from './users'; + +export { + admin, + alerts, + bots, + channels, + common, + emojis, + files, + general, + groups, + i18n, + integrations, + jobs, + plugins, + posts, + preferences, + roles_helpers, + roles, + schemes, + search, + teams, + timezone, + typing, + users, +}; diff --git a/src/selectors/entities/integrations.js b/src/selectors/entities/integrations.ts similarity index 81% rename from src/selectors/entities/integrations.js rename to src/selectors/entities/integrations.ts index 9a612936f..48f601110 100644 --- a/src/selectors/entities/integrations.js +++ b/src/selectors/entities/integrations.ts @@ -4,24 +4,25 @@ import {createSelector} from 'reselect'; import {getCurrentTeamId} from 'selectors/entities/teams'; +import {GlobalState} from 'types/store'; -export function getIncomingHooks(state) { +export function getIncomingHooks(state: GlobalState) { return state.entities.integrations.incomingHooks; } -export function getOutgoingHooks(state) { +export function getOutgoingHooks(state: GlobalState) { return state.entities.integrations.outgoingHooks; } -export function getCommands(state) { +export function getCommands(state: GlobalState) { return state.entities.integrations.commands; } -export function getOAuthApps(state) { +export function getOAuthApps(state: GlobalState) { return state.entities.integrations.oauthApps; } -export function getSystemCommands(state) { +export function getSystemCommands(state: GlobalState) { return state.entities.integrations.systemCommands; } diff --git a/src/selectors/entities/jobs.js b/src/selectors/entities/jobs.ts similarity index 69% rename from src/selectors/entities/jobs.js rename to src/selectors/entities/jobs.ts index e30a5d7e8..4b7d36c1e 100644 --- a/src/selectors/entities/jobs.js +++ b/src/selectors/entities/jobs.ts @@ -1,18 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {createSelector} from 'reselect'; - -import type {GlobalState} from 'types/store'; -import type {JobType, Job} from 'types/jobs'; -import type {IDMappedObjects} from 'types/utilities'; - +import {GlobalState} from 'types/store'; +import {JobType, Job, JobsByType} from 'types/jobs'; +import {IDMappedObjects} from 'types/utilities'; export function getAllJobs(state: GlobalState): IDMappedObjects { return state.entities.jobs.jobs; } -export function getJobsByType(state: GlobalState): {[JobType]: Array} { +export function getJobsByType(state: GlobalState): JobsByType { return state.entities.jobs.jobsByTypeList; } diff --git a/src/selectors/entities/plugins.js b/src/selectors/entities/plugins.ts similarity index 81% rename from src/selectors/entities/plugins.js rename to src/selectors/entities/plugins.ts index d395c3217..b87e1cd39 100644 --- a/src/selectors/entities/plugins.js +++ b/src/selectors/entities/plugins.ts @@ -10,6 +10,6 @@ export function getMarketplacePlugins(state) { export const getMarketplaceInstalledPlugins = createSelector( getMarketplacePlugins, (plugins) => { - return Object.values(plugins).filter((p) => p.installed_version !== ''); + return Object.values(plugins).filter((p: any) => p.installed_version !== ''); } ); diff --git a/src/selectors/entities/posts.test.js b/src/selectors/entities/posts.test.js index 7c6ff9564..833b90e6b 100644 --- a/src/selectors/entities/posts.test.js +++ b/src/selectors/entities/posts.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {Posts, Preferences} from 'constants'; +import {Posts, Preferences} from '../../constants'; import * as Selectors from 'selectors/entities/posts'; import {makeGetProfilesForReactions} from 'selectors/entities/users'; diff --git a/src/selectors/entities/posts.js b/src/selectors/entities/posts.ts similarity index 76% rename from src/selectors/entities/posts.js rename to src/selectors/entities/posts.ts index f88988b3f..5cb17491d 100644 --- a/src/selectors/entities/posts.js +++ b/src/selectors/entities/posts.ts @@ -1,25 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {createSelector} from 'reselect'; - import {getCurrentUser} from 'selectors/entities/common'; import {getMyPreferences} from 'selectors/entities/preferences'; import {createIdsSelector} from 'utils/helpers'; - -import {Posts, Preferences} from 'constants'; +import {Posts, Preferences} from '../../constants'; import {isPostEphemeral, isSystemMessage, shouldFilterJoinLeavePost, comparePosts, isPostPendingOrFailed, isPostCommentMention} from 'utils/post_utils'; import {getPreferenceKey} from 'utils/preference_utils'; - -import type {GlobalState} from 'types/store'; -import type {Post, PostWithFormatData} from 'types/posts'; -import type {Reaction} from 'types/reactions'; -import type {UserProfile} from 'types/users'; -import type {Channel} from 'types/channels'; - -import type {$ID, IDMappedObjects, RelationOneToOne, RelationOneToMany} from '../../types/utilities'; - +import {GlobalState} from 'types/store'; +import {Post, PostWithFormatData} from 'types/posts'; +import {Reaction} from 'types/reactions'; +import {UserProfile} from 'types/users'; +import {Channel} from 'types/channels'; +import {$ID, IDMappedObjects, RelationOneToOne, RelationOneToMany} from '../../types/utilities'; export function getAllPosts(state: GlobalState) { return state.entities.posts.posts; } @@ -32,53 +25,53 @@ export function getPostsInThread(state: GlobalState): RelationOneToMany { +export function getReactionsForPosts(state: GlobalState): RelationOneToOne { return state.entities.posts.reactions; } -export function makeGetReactionsForPost(): (GlobalState, $ID) => ?{[string]: Reaction} { - return createSelector( - getReactionsForPosts, - (state: GlobalState, postId) => postId, - (reactions, postId) => { - if (reactions[postId]) { - return reactions[postId]; - } - - return null; +export function makeGetReactionsForPost(): (b: GlobalState, a: $ID) => { + [x: string]: Reaction; +} | undefined | null { + return createSelector(getReactionsForPosts, (state: GlobalState, postId) => postId, (reactions, postId) => { + if (reactions[postId]) { + return reactions[postId]; } - ); + + return null; + }); } -export function getOpenGraphMetadata(state: GlobalState): RelationOneToOne { +export function getOpenGraphMetadata(state: GlobalState): RelationOneToOne { return state.entities.posts.openGraph; } -export function getOpenGraphMetadataForUrl(state: GlobalState, url: string): Object { +export function getOpenGraphMetadataForUrl(state: GlobalState, url: string): object { return state.entities.posts.openGraph[url]; } // getPostIdsInCurrentChannel returns the IDs of posts loaded at the bottom of the channel. It does not include older // posts such as those loaded by viewing a thread or a permalink. -export function getPostIdsInCurrentChannel(state: GlobalState): ?Array<$ID> { + +export function getPostIdsInCurrentChannel(state: GlobalState): Array<$ID> | undefined | null { return getPostIdsInChannel(state, state.entities.channels.currentChannelId); } // getPostsInCurrentChannel returns the posts loaded at the bottom of the channel. It does not include older posts // such as those loaded by viewing a thread or a permalink. -export const getPostsInCurrentChannel: (GlobalState) => ?Array = (() => { - const getPostsInChannel = makeGetPostsInChannel(); +export const getPostsInCurrentChannel: (a: GlobalState) => Array | undefined | null = (() => { + const getPostsInChannel = makeGetPostsInChannel(); return (state: GlobalState) => getPostsInChannel(state, state.entities.channels.currentChannelId, -1); })(); - -export function makeGetPostIdsForThread(): (GlobalState, $ID) => Array<$ID> { +export function makeGetPostIdsForThread(): (b: GlobalState, a: $ID) => Array<$ID> { return createIdsSelector( getAllPosts, (state: GlobalState, rootId) => state.entities.posts.postsInThread[rootId] || [], (state: GlobalState, rootId) => state.entities.posts.posts[rootId], (posts, postsForThread, rootPost) => { - const thread = []; + const thread: Post[] = []; if (rootPost) { thread.push(rootPost); @@ -98,7 +91,7 @@ export function makeGetPostIdsForThread(): (GlobalState, $ID) => Array<$ID ); } -export function makeGetPostsChunkAroundPost(): (GlobalState, $ID, $ID) => Object { +export function makeGetPostsChunkAroundPost(): (c: GlobalState, b: $ID, a: $ID) => any { return createIdsSelector( (state: GlobalState, postId, channelId) => state.entities.posts.postsInChannel[channelId], (state: GlobalState, postId) => postId, @@ -107,7 +100,7 @@ export function makeGetPostsChunkAroundPost(): (GlobalState, $ID, $ID, $ID, $ID, {postsBeforeCount: number, postsAfterCount: number}) => ?Array<$ID> { +export function makeGetPostIdsAroundPost(): (d: GlobalState, c: $ID, b: $ID, a: { + postsBeforeCount: number; + postsAfterCount: number; +}) => Array<$ID> | undefined | null { const getPostsChunkAroundPost = makeGetPostsChunkAroundPost(); return createIdsSelector( (state: GlobalState, postId, channelId) => getPostsChunkAroundPost(state, postId, channelId), @@ -148,7 +144,7 @@ export function makeGetPostIdsAroundPost(): (GlobalState, $ID, $ID, postsInThread: RelationOneToMany, postIds: Array<$ID>, currentUser: UserProfile, focusedPostId: $ID): PostWithFormatData { +function formatPostInChannel(post: Post, previousPost: Post | undefined | null, index: number, allPosts: IDMappedObjects, postsInThread: RelationOneToMany, postIds: Array<$ID>, currentUser: UserProfile, focusedPostId: $ID): PostWithFormatData { let isFirstReply = false; let isLastReply = false; let highlight = false; @@ -175,6 +171,7 @@ function formatPostInChannel(post: Post, previousPost: ?Post, index: number, all } let previousPostIsComment = false; + if (previousPost && previousPost.root_id) { previousPostIsComment = true; } @@ -234,7 +231,8 @@ function formatPostInChannel(post: Post, previousPost: ?Post, index: number, all // makeGetPostsInChannel creates a selector that returns up to the given number of posts loaded at the bottom of the // given channel. It does not include older posts such as those loaded by viewing a thread or a permalink. -export function makeGetPostsInChannel(): (GlobalState, $ID, number) => ?Array { + +export function makeGetPostsInChannel(): (c: GlobalState, b: $ID, a: number) => Array | undefined | null { return createSelector( getAllPosts, getPostsInThread, @@ -247,7 +245,7 @@ export function makeGetPostsInChannel(): (GlobalState, $ID, number) => return null; } - const posts = []; + const posts: PostWithFormatData[] = []; const joinLeavePref = myPreferences[getPreferenceKey(Preferences.CATEGORY_ADVANCED_SETTINGS, Preferences.ADVANCED_FILTER_JOIN_LEAVE)]; const showJoinLeave = joinLeavePref ? joinLeavePref.value !== 'false' : true; @@ -270,7 +268,7 @@ export function makeGetPostsInChannel(): (GlobalState, $ID, number) => ); } -export function makeGetPostsAroundPost(): (GlobalState, $ID, $ID) => ?Array { +export function makeGetPostsAroundPost(): (c: GlobalState, b: $ID, a: $ID) => Array | undefined | null { const getPostIdsAroundPost = makeGetPostIdsAroundPost(); const options = { postsBeforeCount: -1, // Where this is used in the web app, view state is used to determine how far back to display @@ -289,7 +287,7 @@ export function makeGetPostsAroundPost(): (GlobalState, $ID, $ID) return null; } - const posts = []; + const posts: PostWithFormatData[] = []; const joinLeavePref = myPreferences[getPreferenceKey(Preferences.CATEGORY_ADVANCED_SETTINGS, Preferences.ADVANCED_FILTER_JOIN_LEAVE)]; const showJoinLeave = joinLeavePref ? joinLeavePref.value !== 'false' : true; @@ -314,33 +312,36 @@ export function makeGetPostsAroundPost(): (GlobalState, $ID, $ID) // Returns a function that creates a creates a selector that will get the posts for a given thread. // That selector will take a props object (containing a rootId field) as its // only argument and will be memoized based on that argument. -export function makeGetPostsForThread(): (GlobalState, {rootId: $ID}) => Array { - return createSelector( - getAllPosts, - (state: GlobalState, {rootId}) => state.entities.posts.postsInThread[rootId] || [], - (state: GlobalState, {rootId}) => state.entities.posts.posts[rootId], - (posts, postsForThread, rootPost) => { - const thread = []; - if (rootPost) { - thread.push(rootPost); - } - - postsForThread.forEach((id) => { - const post = posts[id]; - if (post) { - thread.push(post); - } - }); +export function makeGetPostsForThread(): (b: GlobalState, a: { + rootId: $ID; +}) => Array { + return createSelector(getAllPosts, (state: GlobalState, { + rootId, + }) => state.entities.posts.postsInThread[rootId] || [], (state: GlobalState, { + rootId, + }) => state.entities.posts.posts[rootId], (posts, postsForThread, rootPost) => { + const thread: Post[] = []; + + if (rootPost) { + thread.push(rootPost); + } - thread.sort(comparePosts); + postsForThread.forEach((id) => { + const post = posts[id]; - return thread; - } - ); + if (post) { + thread.push(post); + } + }); + thread.sort(comparePosts); + return thread; + }); } -export function makeGetCommentCountForPost(): (GlobalState, {post: Post}) => number { +export function makeGetCommentCountForPost(): (b: GlobalState, a: { + post: Post; +}) => number { return createSelector( getAllPosts, (state, {post}) => state.entities.posts.postsInThread[post ? post.id : ''] || [], @@ -362,7 +363,7 @@ export function makeGetCommentCountForPost(): (GlobalState, {post: Post}) => num ); } -export const getSearchResults: (GlobalState) => Array = createSelector( +export const getSearchResults: (a: GlobalState) => Array = createSelector( getAllPosts, (state: GlobalState) => state.entities.search.results, (posts, postIds) => { @@ -377,11 +378,14 @@ export const getSearchResults: (GlobalState) => Array = createSelector( // Returns the matched text from the search results, if the server has provided them. // These matches will only be present if the server is running Mattermost 5.1 or higher // with Elasticsearch enabled to search posts. Otherwise, null will be returned. -export function getSearchMatches(state: GlobalState): {[string]: Array} { + +export function getSearchMatches(state: GlobalState): { + [x: string]: Array; +} { return state.entities.search.matches; } -export function makeGetMessageInHistoryItem(type: string): (GlobalState) => string { +export function makeGetMessageInHistoryItem(type: string): (a: GlobalState) => string { return createSelector( (state: GlobalState) => state.entities.posts.messagesHistory, (messagesHistory) => { @@ -395,7 +399,7 @@ export function makeGetMessageInHistoryItem(type: string): (GlobalState) => stri ); } -export function makeGetPostsForIds(): (GlobalState, Array<$ID>) => Array { +export function makeGetPostsForIds(): (b: GlobalState, a: Array<$ID>) => Array { return createIdsSelector( getAllPosts, (state: GlobalState, postIds) => postIds, @@ -409,14 +413,14 @@ export function makeGetPostsForIds(): (GlobalState, Array<$ID>) => Array

RelationOneToOne = createSelector( +export const getLastPostPerChannel: (a: GlobalState) => RelationOneToOne = createSelector( getAllPosts, (state: GlobalState) => state.entities.posts.postsInChannel, (allPosts, postsInChannel) => { const ret = {}; for (const [channelId, postsForChannel] of Object.entries(postsInChannel)) { - const recentBlock = (postsForChannel: any).find((block) => block.recent); + const recentBlock = (postsForChannel as any).find((block) => block.recent); if (!recentBlock) { continue; } @@ -430,37 +434,32 @@ export const getLastPostPerChannel: (GlobalState) => RelationOneToOne) => ?$ID = createSelector( - getAllPosts, - (state: GlobalState, channelId) => getPostIdsInChannel(state, channelId), - getMyPreferences, - (posts, postIdsInChannel, preferences) => { - if (!postIdsInChannel) { - return ''; - } - const key = getPreferenceKey(Preferences.CATEGORY_ADVANCED_SETTINGS, Preferences.ADVANCED_FILTER_JOIN_LEAVE); - const allowSystemMessages = preferences[key] ? preferences[key].value === 'true' : true; - - if (!allowSystemMessages) { - // return the most recent non-system message in the channel - let postId; - for (let i = 0; i < postIdsInChannel.length; i++) { - const p = posts[postIdsInChannel[i]]; - if (!p.type || !p.type.startsWith(Posts.SYSTEM_MESSAGE_PREFIX)) { - postId = p.id; - break; - } +export const getMostRecentPostIdInChannel: (b: GlobalState, a: $ID) => $ID | undefined | null = createSelector(getAllPosts, (state: GlobalState, channelId) => getPostIdsInChannel(state, channelId), getMyPreferences, (posts, postIdsInChannel, preferences) => { + if (!postIdsInChannel) { + return ''; + } + const key = getPreferenceKey(Preferences.CATEGORY_ADVANCED_SETTINGS, Preferences.ADVANCED_FILTER_JOIN_LEAVE); + const allowSystemMessages = preferences[key] ? preferences[key].value === 'true' : true; + + if (!allowSystemMessages) { + // return the most recent non-system message in the channel + let postId; + for (let i = 0; i < postIdsInChannel.length; i++) { + const p = posts[postIdsInChannel[i]]; + if (!p.type || !p.type.startsWith(Posts.SYSTEM_MESSAGE_PREFIX)) { + postId = p.id; + break; } - return postId; } - - // return the most recent message in the channel - return postIdsInChannel[0]; + return postId; } + + // return the most recent message in the channel + return postIdsInChannel[0]; +} ); -export const getLatestReplyablePostId: (GlobalState) => $ID = createSelector( +export const getLatestReplyablePostId: (a: GlobalState) => $ID = createSelector( getPostsInCurrentChannel, (posts) => { if (!posts) { @@ -475,38 +474,28 @@ export const getLatestReplyablePostId: (GlobalState) => $ID = createSelect return latestReplyablePost.id; } ); +export const getCurrentUsersLatestPost: (b: GlobalState, a: $ID) => PostWithFormatData | undefined | null = createSelector(getPostsInCurrentChannel, getCurrentUser, (_, rootId) => rootId, (posts, currentUser, rootId) => { + if (!posts) { + return null; + } -export const getCurrentUsersLatestPost: (GlobalState, $ID) => ?PostWithFormatData = createSelector( - getPostsInCurrentChannel, - getCurrentUser, - (_, rootId) => rootId, - (posts, currentUser, rootId) => { - if (!posts) { - return null; + const lastPost = posts.find((post) => { + // don't edit webhook posts, deleted posts, or system messages + if (post.user_id !== currentUser.id || post.props && post.props.from_webhook || post.state === Posts.POST_DELETED || isSystemMessage(post) || isPostEphemeral(post) || isPostPendingOrFailed(post)) { + return false; } - const lastPost = posts.find((post) => { - // don't edit webhook posts, deleted posts, or system messages - if (post.user_id !== currentUser.id || - (post.props && post.props.from_webhook) || - post.state === Posts.POST_DELETED || - (isSystemMessage(post) || isPostEphemeral(post)) || isPostPendingOrFailed(post)) { - return false; - } - - if (rootId) { - return post.root_id === rootId || post.id === rootId; - } - - return true; - }); - - return lastPost; - } -); + if (rootId) { + return post.root_id === rootId || post.id === rootId; + } -export function getRecentPostsChunkInChannel(state: GlobalState, channelId: $ID): Object { + return true; + }); + return lastPost; +}); +export function getRecentPostsChunkInChannel(state: GlobalState, channelId: $ID): any { const postsForChannel = state.entities.posts.postsInChannel[channelId]; + if (!postsForChannel) { return null; } @@ -514,8 +503,9 @@ export function getRecentPostsChunkInChannel(state: GlobalState, channelId: $ID< return postsForChannel.find((block) => block.recent); } -export function getOldestPostsChunkInChannel(state: GlobalState, channelId: $ID): Object { +export function getOldestPostsChunkInChannel(state: GlobalState, channelId: $ID): any { const postsForChannel = state.entities.posts.postsInChannel[channelId]; + if (!postsForChannel) { return null; } @@ -525,7 +515,8 @@ export function getOldestPostsChunkInChannel(state: GlobalState, channelId: $ID< // getPostIdsInChannel returns the IDs of posts loaded at the bottom of the given channel. It does not include older // posts such as those loaded by viewing a thread or a permalink. -export function getPostIdsInChannel(state: GlobalState, channelId: $ID): ?Array<$ID> { + +export function getPostIdsInChannel(state: GlobalState, channelId: $ID): Array<$ID> | undefined | null { const recentBlock = getRecentPostsChunkInChannel(state, channelId); if (!recentBlock) { @@ -535,7 +526,7 @@ export function getPostIdsInChannel(state: GlobalState, channelId: $ID) return recentBlock.order; } -export function getPostsChunkInChannelAroundTime(state: GlobalState, channelId: $ID, timeStamp: number): ?Object { +export function getPostsChunkInChannelAroundTime(state: GlobalState, channelId: $ID, timeStamp: number): object | undefined | null { const postsEntity = state.entities.posts; const postsForChannel = postsEntity.postsInChannel[channelId]; const posts = postsEntity.posts; @@ -556,7 +547,7 @@ export function getPostsChunkInChannelAroundTime(state: GlobalState, channelId: return blockAroundTimestamp; } -export function getUnreadPostsChunk(state: GlobalState, channelId: $ID, timeStamp: number): ?Object { +export function getUnreadPostsChunk(state: GlobalState, channelId: $ID, timeStamp: number): object | undefined | null { const postsEntity = state.entities.posts; const posts = postsEntity.posts; const recentChunk = getRecentPostsChunkInChannel(state, channelId); @@ -610,7 +601,7 @@ export function getUnreadPostsChunk(state: GlobalState, channelId: $ID, export const isPostIdSending = (state: GlobalState, postId: $ID): boolean => state.entities.posts.pendingPostIds.some((sendingPostId) => sendingPostId === postId); -export const makeIsPostCommentMention = (): ((GlobalState, $ID) => boolean) => { +export const makeIsPostCommentMention = (): ((b: GlobalState, a: $ID) => boolean) => { return createSelector( getAllPosts, getPostsInThread, diff --git a/src/selectors/entities/preferences.test.js b/src/selectors/entities/preferences.test.js index 18f8651e8..cbbc07c31 100644 --- a/src/selectors/entities/preferences.test.js +++ b/src/selectors/entities/preferences.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {General, Preferences} from 'constants'; +import {General, Preferences} from '../../constants'; import * as Selectors from 'selectors/entities/preferences'; diff --git a/src/selectors/entities/preferences.js b/src/selectors/entities/preferences.ts similarity index 95% rename from src/selectors/entities/preferences.js rename to src/selectors/entities/preferences.ts index 7941169f2..f0bb874cd 100644 --- a/src/selectors/entities/preferences.js +++ b/src/selectors/entities/preferences.ts @@ -1,21 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {createSelector} from 'reselect'; - -import {General, Preferences} from 'constants'; - +import {General, Preferences} from '../../constants'; import {getConfig} from 'selectors/entities/general'; import {getCurrentTeamId} from 'selectors/entities/teams'; - import {createShallowSelector} from 'utils/helpers'; import {getPreferenceKey} from 'utils/preference_utils'; - +import {GlobalState} from 'types/store'; +import {PreferencesType, PreferenceType} from 'types/preferences'; export function getMyPreferences(state) { return state.entities.preferences.myPreferences; } -export function get(state, category, name, defaultValue = '') { +export function get(state: GlobalState, category, name, defaultValue: any = '') { const key = getPreferenceKey(category, name); const prefs = getMyPreferences(state); @@ -28,13 +25,11 @@ export function get(state, category, name, defaultValue = '') { export function getBool(state, category, name, defaultValue = false) { const value = get(state, category, name, String(defaultValue)); - return value !== 'false'; } export function getInt(state, category, name, defaultValue = 0) { const value = get(state, category, name, defaultValue); - return parseInt(value, 10); } @@ -44,7 +39,7 @@ export function makeGetCategory() { (state, category) => category, (preferences, category) => { const prefix = category + '--'; - const prefsInCategory = []; + const prefsInCategory: PreferenceType[] = []; for (const key in preferences) { if (key.startsWith(prefix)) { @@ -199,7 +194,7 @@ const defaultSidebarPrefs = { }; export const getSidebarPreferences = createSelector( - (state) => { + (state: GlobalState) => { const config = getConfig(state); return config.ExperimentalGroupUnreadChannels !== General.DISABLED && getBool( state, diff --git a/src/selectors/entities/roles.test.js b/src/selectors/entities/roles.test.js index fcdea2388..f735a9045 100644 --- a/src/selectors/entities/roles.test.js +++ b/src/selectors/entities/roles.test.js @@ -6,7 +6,8 @@ import assert from 'assert'; import deepFreezeAndThrowOnMutation from 'utils/deep_freeze'; import TestHelper from 'test/test_helper'; import * as Selectors from 'selectors/entities/roles'; -import {General} from 'constants'; +import {General} from '../../constants'; +import {getMySystemPermissions, getMySystemRoles, getRoles} from 'selectors/entities/roles_helpers'; describe('Selectors.Roles', () => { const team1 = TestHelper.fakeTeamWithId(); @@ -140,7 +141,7 @@ describe('Selectors.Roles', () => { channel: channelsRoles, }; assert.deepEqual(Selectors.getMyRoles(testState), myRoles); - assert.deepEqual(Selectors.getMySystemRoles(testState), myRoles.system); + assert.deepEqual(getMySystemRoles(testState), myRoles.system); assert.deepEqual(Selectors.getMyTeamRoles(testState), myRoles.team); assert.deepEqual(Selectors.getMyChannelRoles(testState), myRoles.channel); }); @@ -157,11 +158,11 @@ describe('Selectors.Roles', () => { test_channel_c_role2: {permissions: ['channel_c_role2']}, test_user_role2: {permissions: ['user_role2']}, }; - assert.deepEqual(Selectors.getRoles(testState), loadedRoles); + assert.deepEqual(getRoles(testState), loadedRoles); }); it('should return my system permission on getMySystemPermissions', () => { - assert.deepEqual(Selectors.getMySystemPermissions(testState), new Set([ + assert.deepEqual(getMySystemPermissions(testState), new Set([ 'user_role2', ])); }); diff --git a/src/selectors/entities/roles.js b/src/selectors/entities/roles.ts similarity index 84% rename from src/selectors/entities/roles.js rename to src/selectors/entities/roles.ts index fb0994d53..ec33fa28d 100644 --- a/src/selectors/entities/roles.js +++ b/src/selectors/entities/roles.ts @@ -1,20 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {createSelector} from 'reselect'; - import {getCurrentUser, getCurrentChannelId} from 'selectors/entities/common'; -import {getTeamMemberships, getCurrentTeamId} from 'selectors/entities/teams'; +import {getTeamMemberships, getCurrentTeamId} from './teams'; +import {GlobalState} from 'types/store'; +import {getMySystemPermissions, getMySystemRoles, getRoles} from 'selectors/entities/roles_helpers'; -export const getMySystemRoles = createSelector( - getCurrentUser, - (user) => { - if (user) { - return new Set(user.roles.split(' ')); - } - return new Set(); - } -); +export {getMySystemPermissions, getMySystemRoles, getRoles}; export const getMyTeamRoles = createSelector( getTeamMemberships, @@ -23,7 +15,7 @@ export const getMyTeamRoles = createSelector( if (teamsMemberships) { for (const key in teamsMemberships) { if (teamsMemberships.hasOwnProperty(key) && teamsMemberships[key].roles) { - roles[key] = new Set(teamsMemberships[key].roles.split(' ')); + roles[key] = new Set(teamsMemberships[key].roles.split(' ')); } } } @@ -32,13 +24,13 @@ export const getMyTeamRoles = createSelector( ); export const getMyChannelRoles = createSelector( - (state) => state.entities.channels.myMembers, + (state: GlobalState) => state.entities.channels.myMembers, (channelsMemberships) => { const roles = {}; if (channelsMemberships) { for (const key in channelsMemberships) { if (channelsMemberships.hasOwnProperty(key) && channelsMemberships[key].roles) { - roles[key] = new Set(channelsMemberships[key].roles.split(' ')); + roles[key] = new Set(channelsMemberships[key].roles.split(' ')); } } } @@ -59,10 +51,6 @@ export const getMyRoles = createSelector( } ); -export function getRoles(state) { - return state.entities.roles.roles; -} - export const getRolesById = createSelector( getRoles, (rolesByName) => { @@ -74,22 +62,6 @@ export const getRolesById = createSelector( } ); -export const getMySystemPermissions = createSelector( - getMySystemRoles, - getRoles, - (mySystemRoles, roles) => { - const permissions = new Set(); - for (const roleName of mySystemRoles) { - if (roles[roleName]) { - for (const permission of roles[roleName].permissions) { - permissions.add(permission); - } - } - } - return permissions; - } -); - export const getMyCurrentTeamPermissions = createSelector( getMyTeamRoles, getRoles, diff --git a/src/selectors/entities/roles_helpers.ts b/src/selectors/entities/roles_helpers.ts new file mode 100644 index 000000000..84b00631b --- /dev/null +++ b/src/selectors/entities/roles_helpers.ts @@ -0,0 +1,36 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {createSelector} from 'reselect'; +import {GlobalState} from 'types/store'; +import {getCurrentUser} from 'selectors/entities/common'; +import {UserProfile} from 'types/users'; + +export function getRoles(state: GlobalState) { + return state.entities.roles.roles; +} + +export const getMySystemRoles = createSelector(getCurrentUser, (user: UserProfile) => { + if (user) { + return new Set(user.roles.split(' ')); + } + + return new Set(); +}); + +export const getMySystemPermissions = createSelector(getMySystemRoles, getRoles, (mySystemRoles: Set, roles) => { + const permissions = new Set(); + + for (const roleName of mySystemRoles) { + if (roles[roleName]) { + for (const permission of roles[roleName].permissions) { + permissions.add(permission); + } + } + } + + return permissions; +}); + +export const haveISystemPermission = createSelector(getMySystemPermissions, (state, options) => options.permission, (permissions, permission) => { + return permissions.has(permission); +}); diff --git a/src/selectors/entities/schemes.js b/src/selectors/entities/schemes.ts similarity index 80% rename from src/selectors/entities/schemes.js rename to src/selectors/entities/schemes.ts index 31a2e3592..4c30ac997 100644 --- a/src/selectors/entities/schemes.js +++ b/src/selectors/entities/schemes.ts @@ -1,17 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow +import {ScopeTypes} from 'constants/schemes'; import {createSelector} from 'reselect'; import {getAllChannels} from 'selectors/entities/channels'; import {getTeams} from 'selectors/entities/teams'; -import {ScopeTypes} from 'constants/schemes'; -import type {GlobalState} from 'types/store'; -import type {Scheme} from 'types/schemes'; -import type {Channel} from 'types/channels'; -import type {Team} from 'types/teams'; - -export function getSchemes(state: GlobalState): { [string]: Scheme } { +import {GlobalState} from 'types/store'; +import {Scheme} from 'types/schemes'; +import {Channel} from 'types/channels'; +import {Team} from 'types/teams'; +export function getSchemes(state: GlobalState): { + [x: string]: Scheme; +} { return state.entities.schemes.schemes; } @@ -37,17 +37,17 @@ export function makeGetSchemeChannels() { const schemeChannels: Array = []; - // $FlowFixMe Object.entries(allChannels).forEach((item: [string, Channel]) => { - const [, channel: Channel] = item; + const [, channel] = item; if (channel.scheme_id === scheme.id) { schemeChannels.push(channel); } }); return schemeChannels; - } - ): (GlobalState, {schemeId: string}) => Array); + }) as (b: GlobalState, a: { + schemeId: string; + }) => Array); } export function makeGetSchemeTeams() { @@ -67,15 +67,15 @@ export function makeGetSchemeTeams() { const schemeTeams: Array = []; - // $FlowFixMe Object.entries(allTeams).forEach((item: [string, Team]) => { - const [, team: Team] = item; + const [, team] = item; if (team.scheme_id === scheme.id) { schemeTeams.push(team); } }); return schemeTeams; - } - ): (GlobalState, {schemeId: string}) => Array); + }) as (b: GlobalState, a: { + schemeId: string; + }) => Array); } diff --git a/src/selectors/entities/search.js b/src/selectors/entities/search.ts similarity index 100% rename from src/selectors/entities/search.js rename to src/selectors/entities/search.ts diff --git a/src/selectors/entities/teams.test.js b/src/selectors/entities/teams.test.js index e5a3e2600..a7a4e62b4 100644 --- a/src/selectors/entities/teams.test.js +++ b/src/selectors/entities/teams.test.js @@ -6,7 +6,7 @@ import assert from 'assert'; import deepFreezeAndThrowOnMutation from 'utils/deep_freeze'; import TestHelper from 'test/test_helper'; import * as Selectors from 'selectors/entities/teams'; -import {General} from 'constants'; +import {General} from '../../constants'; describe('Selectors.Teams', () => { TestHelper.initMockEntities(); diff --git a/src/selectors/entities/teams.js b/src/selectors/entities/teams.ts similarity index 91% rename from src/selectors/entities/teams.js rename to src/selectors/entities/teams.ts index b59e25801..f2df6ee47 100644 --- a/src/selectors/entities/teams.js +++ b/src/selectors/entities/teams.ts @@ -1,42 +1,35 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {createSelector} from 'reselect'; - -import {Permissions} from 'constants'; - +import {Permissions} from '../../constants'; import {getConfig, getCurrentUrl, isCompatibleWithJoinViewTeamPermissions} from 'selectors/entities/general'; -import {haveISystemPermission} from 'selectors/entities/roles'; - +import {haveISystemPermission} from 'selectors/entities/roles_helpers'; import {createIdsSelector} from 'utils/helpers'; import {isTeamAdmin} from 'utils/user_utils'; import {sortTeamsWithLocale} from 'utils/team_utils'; +import {Team, TeamMembership} from 'types/teams'; +import {GlobalState} from 'types/store'; -export function getCurrentTeamId(state) { +export function getCurrentTeamId(state: GlobalState) { return state.entities.teams.currentTeamId; } -export const getTeamByName = createSelector( - getTeams, - (state, name) => name, - (teams, name) => { - return Object.values(teams).find((team) => team.name === name); - } -); - -export function getTeams(state) { +export const getTeamByName = createSelector(getTeams, (state, name) => name, (teams, name) => { + return Object.values(teams).find((team: Team) => team.name === name); +}); +export function getTeams(state: GlobalState) { return state.entities.teams.teams; } -export function getTeamStats(state) { +export function getTeamStats(state: GlobalState) { return state.entities.teams.stats; } -export function getTeamMemberships(state) { +export function getTeamMemberships(state: GlobalState) { return state.entities.teams.myMembers; } -export function getMembersInTeams(state) { +export function getMembersInTeams(state: GlobalState) { return state.entities.teams.membersInTeam; } @@ -253,7 +246,7 @@ export const getChannelDrawerBadgeCount = createSelector( (currentTeamId, teamMembers) => { let mentionCount = 0; let messageCount = 0; - Object.values(teamMembers).forEach((m) => { + Object.values(teamMembers).forEach((m: TeamMembership) => { if (m.team_id !== currentTeamId) { mentionCount += (m.mention_count || 0); messageCount += (m.msg_count || 0); diff --git a/src/selectors/entities/timezone.js b/src/selectors/entities/timezone.ts similarity index 100% rename from src/selectors/entities/timezone.js rename to src/selectors/entities/timezone.ts diff --git a/src/selectors/entities/typing.js b/src/selectors/entities/typing.ts similarity index 59% rename from src/selectors/entities/typing.js rename to src/selectors/entities/typing.ts index a7daece70..715d7bc75 100644 --- a/src/selectors/entities/typing.js +++ b/src/selectors/entities/typing.ts @@ -1,21 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {createSelector} from 'reselect'; - -import { - getCurrentChannelId, - getUsers, -} from 'selectors/entities/common'; +import {getCurrentChannelId, getUsers} from 'selectors/entities/common'; import {getTeammateNameDisplaySetting} from 'selectors/entities/preferences'; - import {displayUsername} from 'utils/user_utils'; - -import type {Typing} from 'types/typing'; -import type {UserProfile} from 'types/users'; -import type {GlobalState} from 'types/store'; -import type {IDMappedObjects} from 'types/utilities'; +import {Typing} from 'types/typing'; +import {UserProfile} from 'types/users'; +import {GlobalState} from 'types/store'; +import {IDMappedObjects} from 'types/utilities'; const getUsersTypingImpl = (profiles: IDMappedObjects, teammateNameDisplay: string, channelId: string, parentPostId: string, typing: Typing): Array => { const id = channelId + parentPostId; @@ -34,14 +26,16 @@ const getUsersTypingImpl = (profiles: IDMappedObjects, teammateName }; export const makeGetUsersTypingByChannelAndPost = () => { - return (createSelector( - getUsers, - getTeammateNameDisplaySetting, - (state: GlobalState, options: {channelId: string, postId: string}): string => options.channelId, - (state: GlobalState, options: {channelId: string, postId: string}): string => options.postId, - (state: GlobalState): Typing => state.entities.typing, - getUsersTypingImpl, - ): (state: GlobalState, {channelId: string, postId: string}) => Array); + return (createSelector(getUsers, getTeammateNameDisplaySetting, (state: GlobalState, options: { + channelId: string; + postId: string; + }): string => options.channelId, (state: GlobalState, options: { + channelId: string; + postId: string; + }): string => options.postId, (state: GlobalState): Typing => state.entities.typing, getUsersTypingImpl) as (state: GlobalState, a: { + channelId: string; + postId: string; + }) => Array); }; export const getUsersTyping: (state: GlobalState) => Array = createSelector( diff --git a/src/selectors/entities/users.test.js b/src/selectors/entities/users.test.js index 0ad5c4123..7a382de0c 100644 --- a/src/selectors/entities/users.test.js +++ b/src/selectors/entities/users.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {General, Preferences} from 'constants'; +import {General, Preferences} from '../../constants'; import deepFreezeAndThrowOnMutation from 'utils/deep_freeze'; import {sortByUsername} from 'utils/user_utils'; import TestHelper from 'test/test_helper'; diff --git a/src/selectors/entities/users.js b/src/selectors/entities/users.ts similarity index 72% rename from src/selectors/entities/users.js rename to src/selectors/entities/users.ts index 1495f1e11..fd02216f0 100644 --- a/src/selectors/entities/users.js +++ b/src/selectors/entities/users.ts @@ -1,46 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {createSelector} from 'reselect'; - -import { - getCurrentChannelId, - getCurrentUser, - getCurrentUserId, - getMyCurrentChannelMembership, - getUsers, -} from 'selectors/entities/common'; - +import {getCurrentChannelId, getCurrentUser, getCurrentUserId, getMyCurrentChannelMembership, getUsers} from 'selectors/entities/common'; import {getConfig, getLicense} from 'selectors/entities/general'; import {getDirectShowPreferences, getTeammateNameDisplaySetting} from 'selectors/entities/preferences'; - -import { - displayUsername, - filterProfilesMatchingTerm, - sortByUsername, - isSystemAdmin, - profileListToMap, -} from 'utils/user_utils'; - -export { - getCurrentUserId, - getCurrentUser, - getUsers, +import {displayUsername, filterProfilesMatchingTerm, sortByUsername, isSystemAdmin, profileListToMap} from 'utils/user_utils'; +export {getCurrentUserId, getCurrentUser, getUsers}; +import {GlobalState} from 'types/store'; +import {UserProfile} from 'types/users'; +import {Reaction} from 'types/reactions'; +import {Team} from 'types/teams'; +import {Channel} from 'types/channels'; +import {RelationOneToOne, RelationOneToMany, IDMappedObjects, UsernameMappedObjects, EmailMappedObjects, $ID, $Username, $Email} from 'types/utilities'; +type Filters = { + role?: string; + inactive?: boolean; }; - -import type {GlobalState} from 'types/store.js'; -import type {UserProfile} from 'types/users.js'; -import type {Reaction} from 'types/reactions.js'; -import type {Team} from 'types/teams.js'; -import type {Channel} from 'types/channels.js'; -import type {RelationOneToOne, RelationOneToMany, IDMappedObjects, UsernameMappedObjects, EmailMappedObjects, $ID, $Username, $Email} from 'types/utilities.js'; - -type Filters = {| - role?: string, - inactive?: boolean, -|} - export function getUserIdsInChannels(state: GlobalState): RelationOneToMany { return state.entities.users.profilesInChannel; } @@ -65,11 +40,11 @@ export function getUserStatuses(state: GlobalState): RelationOneToOne { +export function getUserSessions(state: GlobalState): Array { return state.entities.users.mySessions; } -export function getUserAudits(state: GlobalState): Array { +export function getUserAudits(state: GlobalState): Array { return state.entities.users.myAudits; } @@ -122,62 +97,58 @@ export const isCurrentUserSystemAdmin: (GlobalState) => boolean = createSelector } ); -export const getCurrentUserRoles: (GlobalState) => $PropertyType = createSelector( - getMyCurrentChannelMembership, - (state) => state.entities.teams.myMembers[state.entities.teams.currentTeamId], - getCurrentUser, - (currentChannelMembership, currentTeamMembership, currentUser) => { - let roles = ''; - if (currentTeamMembership) { - roles += `${currentTeamMembership.roles} `; - } +export const getCurrentUserRoles: (a: GlobalState) => UserProfile['roles'] = createSelector(getMyCurrentChannelMembership, (state) => state.entities.teams.myMembers[state.entities.teams.currentTeamId], getCurrentUser, (currentChannelMembership, currentTeamMembership, currentUser) => { + let roles = ''; + if (currentTeamMembership) { + roles += `${currentTeamMembership.roles} `; + } - if (currentChannelMembership) { - roles += `${currentChannelMembership.roles} `; - } + if (currentChannelMembership) { + roles += `${currentChannelMembership.roles} `; + } - if (currentUser) { - roles += currentUser.roles; - } - return roles.trim(); + if (currentUser) { + roles += currentUser.roles; } + return roles.trim(); +} ); +export const getCurrentUserMentionKeys: (a: GlobalState) => Array<{ + key: string; + caseSensitive?: boolean; +}> = createSelector(getCurrentUser, (user: UserProfile) => { + let keys: {key;caseSensitive?}[] = []; -export const getCurrentUserMentionKeys: (GlobalState) => Array<{key: string, caseSensitive?: boolean}> = createSelector( - getCurrentUser, - (user) => { - let keys = []; - - if (!user || !user.notify_props) { - return keys; - } - - if (user.notify_props.mention_keys) { - keys = keys.concat(user.notify_props.mention_keys.split(',').map((key) => { - return {key}; - })); - } + if (!user || !user.notify_props) { + return keys; + } - if (user.notify_props.first_name === 'true' && user.first_name) { - keys.push({key: user.first_name, caseSensitive: true}); - } + if (user.notify_props.mention_keys) { + keys = keys.concat(user.notify_props.mention_keys.split(',').map((key) => { + return {key}; + })); + } - if (user.notify_props.channel === 'true') { - keys.push({key: '@channel'}); - keys.push({key: '@all'}); - keys.push({key: '@here'}); - } + if (user.notify_props.first_name === 'true' && user.first_name) { + keys.push({key: user.first_name, caseSensitive: true}); + } - const usernameKey = '@' + user.username; - if (keys.findIndex((key) => key.key === usernameKey) === -1) { - keys.push({key: usernameKey}); - } + if (user.notify_props.channel === 'true') { + keys.push({key: '@channel'}); + keys.push({key: '@all'}); + keys.push({key: '@here'}); + } - return keys; + const usernameKey = '@' + user.username; + if (keys.findIndex((key) => key.key === usernameKey) === -1) { + keys.push({key: usernameKey}); } + + return keys; +} ); -export const getProfileSetInCurrentChannel: (GlobalState) => Array<$ID> = createSelector( +export const getProfileSetInCurrentChannel: (a: GlobalState) => Array<$ID> = createSelector( getCurrentChannelId, getUserIdsInChannels, (currentChannel, channelProfiles) => { @@ -185,7 +156,7 @@ export const getProfileSetInCurrentChannel: (GlobalState) => Array<$ID Array<$ID> = createSelector( +export const getProfileSetNotInCurrentChannel: (a: GlobalState) => Array<$ID> = createSelector( getCurrentChannelId, getUserIdsNotInChannels, (currentChannel, channelProfiles) => { @@ -193,7 +164,7 @@ export const getProfileSetNotInCurrentChannel: (GlobalState) => Array<$ID Array<$ID> = createSelector( +export const getProfileSetInCurrentTeam: (a: GlobalState) => Array<$ID> = createSelector( (state) => state.entities.teams.currentTeamId, getUserIdsInTeams, (currentTeam, teamProfiles) => { @@ -201,7 +172,7 @@ export const getProfileSetInCurrentTeam: (GlobalState) => Array<$ID } ); -export const getProfileSetNotInCurrentTeam: (GlobalState) => Array<$ID> = createSelector( +export const getProfileSetNotInCurrentTeam: (a: GlobalState) => Array<$ID> = createSelector( (state) => state.entities.teams.currentTeamId, getUserIdsNotInTeams, (currentTeam, teamProfiles) => { @@ -211,7 +182,8 @@ export const getProfileSetNotInCurrentTeam: (GlobalState) => Array<$ID, profileSet?: 'all' | Array<$ID> | Set<$ID>, skipInactive = false): Array { - let currentProfiles = []; + let currentProfiles: UserProfile[] = []; + if (typeof profileSet === 'undefined') { return currentProfiles; } else if (profileSet === PROFILE_SET_ALL) { @@ -229,7 +201,7 @@ function sortAndInjectProfiles(profiles: IDMappedObjects, profileSe return currentProfiles.sort(sortByUsername); } -export const getProfiles: (GlobalState, Filters) => Array = createSelector( +export const getProfiles: (a: GlobalState, b: Filters) => Array = createSelector( getUsers, (state, filters) => filters, (profiles, filters) => { @@ -258,7 +230,7 @@ function filterProfiles(profiles: IDMappedObjects, filters?: Filter }, {}); } -export const getProfilesInCurrentChannel: (GlobalState) => Array = createSelector( +export const getProfilesInCurrentChannel: (a: GlobalState) => Array = createSelector( getUsers, getProfileSetInCurrentChannel, (profiles, currentChannelProfileSet) => { @@ -266,7 +238,7 @@ export const getProfilesInCurrentChannel: (GlobalState) => Array = } ); -export const getProfilesNotInCurrentChannel: (GlobalState) => Array = createSelector( +export const getProfilesNotInCurrentChannel: (a: GlobalState) => Array = createSelector( getUsers, getProfileSetNotInCurrentChannel, (profiles, notInCurrentChannelProfileSet) => { @@ -274,7 +246,7 @@ export const getProfilesNotInCurrentChannel: (GlobalState) => Array } ); -export const getProfilesInCurrentTeam: (GlobalState) => Array = createSelector( +export const getProfilesInCurrentTeam: (a: GlobalState) => Array = createSelector( getUsers, getProfileSetInCurrentTeam, (profiles, currentTeamProfileSet) => { @@ -282,7 +254,7 @@ export const getProfilesInCurrentTeam: (GlobalState) => Array = cre } ); -export const getProfilesInTeam: (GlobalState, $ID) => Array = createSelector( +export const getProfilesInTeam: (a: GlobalState, b: $ID) => Array = createSelector( getUsers, getUserIdsInTeams, (state, teamId) => teamId, @@ -292,7 +264,7 @@ export const getProfilesInTeam: (GlobalState, $ID) => Array = } ); -export const getProfilesNotInCurrentTeam: (GlobalState) => Array = createSelector( +export const getProfilesNotInCurrentTeam: (a: GlobalState) => Array = createSelector( getUsers, getProfileSetNotInCurrentTeam, (profiles, notInCurrentTeamProfileSet) => { @@ -300,7 +272,7 @@ export const getProfilesNotInCurrentTeam: (GlobalState) => Array = } ); -export const getProfilesWithoutTeam: (GlobalState, filters?: Filters) => Array = createSelector( +export const getProfilesWithoutTeam: (a: GlobalState, filters?: Filters) => Array = createSelector( getUsers, getUserIdsWithoutTeam, (state, filters) => filters, @@ -308,20 +280,20 @@ export const getProfilesWithoutTeam: (GlobalState, filters?: Filters) => Array): string { return getUserStatuses(state)[userId]; } -export function getTotalUsersStats(state: GlobalState): Object { +export function getTotalUsersStats(state: GlobalState): any { return state.entities.users.stats; } -export function searchProfiles(state: GlobalState, term: string, skipCurrent: boolean = false, filters?: Filters): Array { +export function searchProfiles(state: GlobalState, term: string, skipCurrent = false, filters?: Filters): Array { const users = getUsers(state); const profiles = filterProfilesMatchingTerm(Object.keys(users).map((key) => users[key]), term); const filteredProfilesMap = filterProfiles(profileListToMap(profiles), filters); const filteredProfiles = Object.keys(filteredProfilesMap).map((key) => filteredProfilesMap[key]); + if (skipCurrent) { removeCurrentUserFromList(filteredProfiles, getCurrentUserId(state)); } @@ -329,8 +301,9 @@ export function searchProfiles(state: GlobalState, term: string, skipCurrent: bo return filteredProfiles; } -export function searchProfilesInCurrentChannel(state: GlobalState, term: string, skipCurrent: boolean = false): Array { +export function searchProfilesInCurrentChannel(state: GlobalState, term: string, skipCurrent = false): Array { const profiles = filterProfilesMatchingTerm(getProfilesInCurrentChannel(state), term); + if (skipCurrent) { removeCurrentUserFromList(profiles, getCurrentUserId(state)); } @@ -338,7 +311,7 @@ export function searchProfilesInCurrentChannel(state: GlobalState, term: string, return profiles; } -export function searchProfilesNotInCurrentChannel(state: GlobalState, term: string, skipCurrent: boolean = false): Array { +export function searchProfilesNotInCurrentChannel(state: GlobalState, term: string, skipCurrent = false): Array { const profiles = filterProfilesMatchingTerm(getProfilesNotInCurrentChannel(state), term); if (skipCurrent) { removeCurrentUserFromList(profiles, getCurrentUserId(state)); @@ -347,7 +320,7 @@ export function searchProfilesNotInCurrentChannel(state: GlobalState, term: stri return profiles; } -export function searchProfilesInCurrentTeam(state: GlobalState, term: string, skipCurrent: boolean = false): Array { +export function searchProfilesInCurrentTeam(state: GlobalState, term: string, skipCurrent = false): Array { const profiles = filterProfilesMatchingTerm(getProfilesInCurrentTeam(state), term); if (skipCurrent) { removeCurrentUserFromList(profiles, getCurrentUserId(state)); @@ -356,7 +329,7 @@ export function searchProfilesInCurrentTeam(state: GlobalState, term: string, sk return profiles; } -export function searchProfilesInTeam(state: GlobalState, teamId: $ID, term: string, skipCurrent: boolean = false, filters?: Filters): Array { +export function searchProfilesInTeam(state: GlobalState, teamId: $ID, term: string, skipCurrent = false, filters?: Filters): Array { const profiles = filterProfilesMatchingTerm(getProfilesInTeam(state, teamId), term); const filteredProfilesMap = filterProfiles(profileListToMap(profiles), filters); const filteredProfiles = Object.keys(filteredProfilesMap).map((key) => filteredProfilesMap[key]); @@ -367,7 +340,7 @@ export function searchProfilesInTeam(state: GlobalState, teamId: $ID, term return filteredProfiles; } -export function searchProfilesNotInCurrentTeam(state: GlobalState, term: string, skipCurrent: boolean = false): Array { +export function searchProfilesNotInCurrentTeam(state: GlobalState, term: string, skipCurrent = false): Array { const profiles = filterProfilesMatchingTerm(getProfilesNotInCurrentTeam(state), term); if (skipCurrent) { removeCurrentUserFromList(profiles, getCurrentUserId(state)); @@ -376,7 +349,7 @@ export function searchProfilesNotInCurrentTeam(state: GlobalState, term: string, return profiles; } -export function searchProfilesWithoutTeam(state: GlobalState, term: string, skipCurrent: boolean = false, filters?: Filters): Array { +export function searchProfilesWithoutTeam(state: GlobalState, term: string, skipCurrent = false, filters?: Filters): Array { const filteredProfiles = filterProfilesMatchingTerm(getProfilesWithoutTeam(state, filters), term); if (skipCurrent) { removeCurrentUserFromList(filteredProfiles, getCurrentUserId(state)); @@ -392,7 +365,7 @@ function removeCurrentUserFromList(profiles: Array, currentUserId: } } -export const shouldShowTermsOfService: (GlobalState) => boolean = createSelector( +export const shouldShowTermsOfService: (a: GlobalState) => boolean = createSelector( getConfig, getCurrentUser, getLicense, @@ -408,11 +381,11 @@ export const shouldShowTermsOfService: (GlobalState) => boolean = createSelector } ); -export const getUsersInVisibleDMs: (GlobalState) => Array = createSelector( +export const getUsersInVisibleDMs: (a: GlobalState) => Array = createSelector( getUsers, getDirectShowPreferences, (users, preferences) => { - const dmUsers = []; + const dmUsers: UserProfile[] = []; preferences.forEach((pref) => { if (pref.value === 'true' && users[pref.name]) { dmUsers.push(users[pref.name]); @@ -422,12 +395,12 @@ export const getUsersInVisibleDMs: (GlobalState) => Array = createS } ); -export function makeGetProfilesForReactions(): (GlobalState, Array) => Array { +export function makeGetProfilesForReactions(): (a: GlobalState, b: Array) => Array { return createSelector( getUsers, (state, reactions) => reactions, (users, reactions) => { - const profiles = []; + const profiles: UserProfile[] = []; reactions.forEach((r) => { if (users[r.user_id]) { profiles.push(users[r.user_id]); @@ -438,7 +411,7 @@ export function makeGetProfilesForReactions(): (GlobalState, Array) => ); } -export function makeGetProfilesInChannel(): (GlobalState, $ID, boolean) => Array { +export function makeGetProfilesInChannel(): (a: GlobalState, b: $ID, c: boolean) => Array { return createSelector( getUsers, getUserIdsInChannels, @@ -456,7 +429,7 @@ export function makeGetProfilesInChannel(): (GlobalState, $ID, boolean) ); } -export function makeGetProfilesNotInChannel(): (GlobalState, $ID, boolean) => Array { +export function makeGetProfilesNotInChannel(): (a: GlobalState, b: $ID, c: boolean) => Array { return createSelector( getUsers, getUserIdsNotInChannels, @@ -474,14 +447,14 @@ export function makeGetProfilesNotInChannel(): (GlobalState, $ID, boole ); } -export function makeGetProfilesByIdsAndUsernames(): (GlobalState, {allUserIds: Array<$ID>, allUsernames: Array<$Username>}) => Array { +export function makeGetProfilesByIdsAndUsernames(): (a: GlobalState, b: {allUserIds: Array<$ID>; allUsernames: Array<$Username>}) => Array { return createSelector( getUsers, getUsersByUsername, (state, props) => props.allUserIds, (state, props) => props.allUsernames, (allProfilesById, allProfilesByUsername, allUserIds, allUsernames) => { - const userProfiles = []; + const userProfiles: UserProfile[] = []; if (allUserIds && allUserIds.length > 0) { const profilesById = allUserIds. @@ -508,7 +481,7 @@ export function makeGetProfilesByIdsAndUsernames(): (GlobalState, {allUserIds: A ); } -export function makeGetDisplayName(): (GlobalState, $ID, boolean) => string { +export function makeGetDisplayName(): (a: GlobalState, b: $ID, c: boolean) => string { return createSelector( (state, userId) => getUser(state, userId), getTeammateNameDisplaySetting, diff --git a/src/selectors/errors.js b/src/selectors/errors.ts similarity index 100% rename from src/selectors/errors.js rename to src/selectors/errors.ts diff --git a/src/selectors/index.ts b/src/selectors/index.ts new file mode 100644 index 000000000..2a2f93334 --- /dev/null +++ b/src/selectors/index.ts @@ -0,0 +1,7 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import * as entities from './entities'; +import * as errors from './errors'; + +export {errors, entities}; diff --git a/src/store/configureStore.dev.js b/src/store/configureStore.dev.ts similarity index 84% rename from src/store/configureStore.dev.js rename to src/store/configureStore.dev.ts index 2f9adf808..e8a6039f3 100644 --- a/src/store/configureStore.dev.js +++ b/src/store/configureStore.dev.ts @@ -1,27 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -/* eslint-disable no-undefined */ +/* eslint-disable no-undefined */ import {createStore} from 'redux'; import devTools from 'remote-redux-devtools'; import {createOfflineReducer, networkStatusChangedAction, offlineCompose} from 'redux-offline'; import defaultOfflineConfig from 'redux-offline/lib/defaults'; -import reducerRegistry from 'store/reducer_registry'; +import reducerRegistry from './reducer_registry'; -const devToolsEnhancer = ( - typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ ? // eslint-disable-line no-underscore-dangle - window.__REDUX_DEVTOOLS_EXTENSION__ : // eslint-disable-line no-underscore-dangle - () => { - return devTools({ - name: 'Mattermost', - hostname: 'localhost', - port: 5678, - realtime: true, - }); - } -); +const windowAny = window as any; -import serviceReducer from 'reducers'; +const devToolsEnhancer = typeof windowAny !== 'undefined' && windowAny.__REDUX_DEVTOOLS_EXTENSION__ ? // eslint-disable-line no-underscore-dangle + windowAny.__REDUX_DEVTOOLS_EXTENSION__ : // eslint-disable-line no-underscore-dangle + () => { + return devTools({ + name: 'Mattermost', + hostname: 'localhost', + port: 5678, + realtime: true, + }); + }; +import serviceReducer from '../reducers'; import deepFreezeAndThrowOnMutation from 'utils/deep_freeze'; import initialState from './initial_state'; import {offlineConfig, createReducer} from './helpers'; @@ -68,9 +67,9 @@ export default function configureServiceStore(preloadedState, appReducer, userOf }); } - if (module.hot) { - // Enable Webpack hot module replacement for reducers - module.hot.accept(() => { + if ((module as any).hot) { + // Enable Webpack hot module replacement for reducers + (module as any).hot.accept(() => { const nextServiceReducer = require('../reducers').default; // eslint-disable-line global-require let nextAppReducer; if (getAppReducer) { diff --git a/src/store/configureStore.prod.js b/src/store/configureStore.prod.ts similarity index 96% rename from src/store/configureStore.prod.js rename to src/store/configureStore.prod.ts index 91fdfd4c5..60f839f4c 100644 --- a/src/store/configureStore.prod.js +++ b/src/store/configureStore.prod.ts @@ -4,9 +4,9 @@ import {createStore} from 'redux'; import {createOfflineReducer, networkStatusChangedAction, offlineCompose} from 'redux-offline'; import defaultOfflineConfig from 'redux-offline/lib/defaults'; -import reducerRegistry from 'store/reducer_registry'; +import reducerRegistry from './reducer_registry'; -import serviceReducer from 'reducers'; +import serviceReducer from '../reducers'; import {offlineConfig, createReducer} from './helpers'; import initialState from './initial_state'; diff --git a/src/store/helpers.js b/src/store/helpers.ts similarity index 90% rename from src/store/helpers.js rename to src/store/helpers.ts index f8a5eb172..7c0249153 100644 --- a/src/store/helpers.js +++ b/src/store/helpers.ts @@ -1,11 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {combineReducers} from 'redux'; -import {enableBatching} from 'redux-batched-actions'; -import {General} from 'constants'; -import reducerRegistry from 'store/reducer_registry'; - +import {General} from '../constants'; +import reducerRegistry from './reducer_registry'; +import {enableBatching} from 'types/actions'; export const offlineConfig = { effect: (effect, action) => { if (typeof effect !== 'function') { diff --git a/src/store/index.js b/src/store/index.js deleted file mode 100644 index 82c39ded5..000000000 --- a/src/store/index.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow -/* eslint-disable global-require, no-process-env */ - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./configureStore.prod.js'); -} else { - module.exports = require('./configureStore.dev.js'); -} - -/* eslint-enable global-require, no-process-env */ diff --git a/src/store/index.ts b/src/store/index.ts new file mode 100644 index 000000000..2c2a0e8d3 --- /dev/null +++ b/src/store/index.ts @@ -0,0 +1,6 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +/* eslint-disable global-require, no-process-env */ +const config = process.env.NODE_ENV === 'production' ? require('./configureStore.prod').default : require('./configureStore.dev').default; +export default config; diff --git a/src/store/initial_state.js b/src/store/initial_state.ts similarity index 99% rename from src/store/initial_state.js rename to src/store/initial_state.ts index 8907a6070..27f754720 100644 --- a/src/store/initial_state.js +++ b/src/store/initial_state.ts @@ -1,9 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import type {GlobalState} from 'types/store'; - +import {GlobalState} from 'types/store'; const state: GlobalState = { entities: { general: { @@ -102,6 +99,7 @@ const state: GlobalState = { }, search: { results: [], + current: {}, recent: {}, matches: {}, }, @@ -127,7 +125,9 @@ const state: GlobalState = { priorLocation: null, }, }, - schemes: {schemes: {}}, + schemes: { + schemes: {}, + }, groups: { groups: {}, syncables: {}, @@ -643,5 +643,4 @@ const state: GlobalState = { lastDisconnectAt: 0, }, }; - export default state; diff --git a/src/store/middleware.js b/src/store/middleware.ts similarity index 90% rename from src/store/middleware.js rename to src/store/middleware.ts index cf00d1445..f7378f2c5 100644 --- a/src/store/middleware.js +++ b/src/store/middleware.ts @@ -1,16 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import createActionBuffer from 'redux-action-buffer'; import {REHYDRATE} from 'redux-persist/constants'; -import thunk from 'redux-thunk'; - +import thunk, {ThunkMiddleware} from 'redux-thunk'; const defaultOptions = { additionalMiddleware: [], enableBuffer: true, enableThunk: true, }; - export function createMiddleware(clientOptions) { const options = Object.assign({}, defaultOptions, clientOptions); const { @@ -18,8 +15,7 @@ export function createMiddleware(clientOptions) { enableBuffer, enableThunk, } = options; - - const middleware = []; + const middleware: ThunkMiddleware[] = []; if (enableThunk) { middleware.push(thunk); diff --git a/src/store/reducer_registry.js b/src/store/reducer_registry.ts similarity index 85% rename from src/store/reducer_registry.js rename to src/store/reducer_registry.ts index 10507f1df..057a7620d 100644 --- a/src/store/reducer_registry.js +++ b/src/store/reducer_registry.ts @@ -3,10 +3,8 @@ // Based on http://nicolasgallagher.com/redux-modules-and-code-splitting/ export class ReducerRegistry { - constructor() { - this.emitChange = null; - this.reducers = {}; - } + emitChange?: Function; + reducers = {}; setReducers = (reducers) => { this.reducers = reducers; @@ -29,4 +27,4 @@ export class ReducerRegistry { } const reducerRegistry = new ReducerRegistry(); -export default reducerRegistry; \ No newline at end of file +export default reducerRegistry; diff --git a/src/types/actions.js b/src/types/actions.js deleted file mode 100644 index ece3d4c7c..000000000 --- a/src/types/actions.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import type {GlobalState} from './store'; - -export type GetStateFunc = () => GlobalState; - -export type GenericAction = {| - type: string, - data: any, - meta?: any, - error?: any, - index?: number, - displayable?: boolean, - postId?: string, - sessionId?: string, - currentUserId?: string, - remove?: Function, - timestamp?: number, -|}; - -type Thunk = (DispatchFunc, GetStateFunc) => (Promise | ActionResult); // eslint-disable-line no-use-before-define - -type BatchAction = { - type: 'BATCHING_REDUCER.BATCH'; - payload: Array; -} - -type Action = GenericAction | Thunk | BatchAction - -export type ActionResult = {|data: any|} | {|error: any|}; -export type DispatchFunc = (Action, ?GetStateFunc) => Promise; -export type ActionFunc = (DispatchFunc, GetStateFunc) => Promise; - -export type PlatformType = 'web' | 'ios' | 'android' diff --git a/src/types/actions.ts b/src/types/actions.ts new file mode 100644 index 000000000..90af666bd --- /dev/null +++ b/src/types/actions.ts @@ -0,0 +1,75 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {GlobalState} from './store'; + +export type GetStateFunc = () => GlobalState; +export type GenericAction = { + type: string; + data?: any; + meta?: any; + error?: any; + index?: number; + displayable?: boolean; + postId?: string; + sessionId?: string; + currentUserId?: string; + remove?: Function|string[]; + timestamp?: number; + [extraProps: string]: any; +}; +type Thunk = (b: DispatchFunc, a: GetStateFunc) => Promise | ActionResult; + +type BatchAction = { + type: 'BATCHING_REDUCER.BATCH'; + payload: Array; + meta: { + batch: true; + }; +}; +export type Action = GenericAction | Thunk | BatchAction | ActionFunc; + +export type ActionResult = { + data: any; +} | { + error: any; +}; + +export type DispatchFunc = (action: Action, getState?: GetStateFunc | null) => Promise; +export type ActionFunc = (dispatch: DispatchFunc, getState: GetStateFunc) => Promise; +export type PlatformType = 'web' | 'ios' | 'android'; + +export const BATCH = 'BATCHING_REDUCER.BATCH'; + +export function batchActions(actions: Action[], type = BATCH) { + return {type, meta: {batch: true}, payload: actions}; +} + +export function enableBatching(reduce) { + return function batchingReducer(state, action) { + if (action && action.meta && action.meta.batch) { + return action.payload.reduce(batchingReducer, state); + } + return reduce(state, action); + }; +} + +export function batchDispatchMiddleware(store_) { + function dispatchChildActions(store, action) { + if (action.meta && action.meta.batch) { + action.payload.forEach((childAction) => { + dispatchChildActions(store, childAction); + }); + } else { + store.dispatch(action); + } + } + + return (next) => { + return (action) => { + if (action && action.meta && action.meta.batch) { + dispatchChildActions(store_, action); + } + return next(action); + }; + }; +} diff --git a/src/types/admin.js b/src/types/admin.js deleted file mode 100644 index 4f6e986e9..000000000 --- a/src/types/admin.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type AdminState = {| - logs: Array, - audits: Object, - config: Object, - environmentConfig: Object, - complianceReports: Object, - ldapGroups: Object, - ldapGroupsCount: number -|}; diff --git a/src/types/admin.ts b/src/types/admin.ts new file mode 100644 index 000000000..5d4f8c7e7 --- /dev/null +++ b/src/types/admin.ts @@ -0,0 +1,11 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type AdminState = { + logs: Array; + audits: any; + config: any; + environmentConfig: any; + complianceReports: any; + ldapGroups: any; + ldapGroupsCount: number; +}; diff --git a/src/types/alerts.js b/src/types/alerts.ts similarity index 68% rename from src/types/alerts.js rename to src/types/alerts.ts index 9743a5ac5..3e8c05091 100644 --- a/src/types/alerts.js +++ b/src/types/alerts.ts @@ -1,9 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow export type AlertTypeType = 'notification' | 'developer' | 'error'; -export type AlertType = {| - type: AlertTypeType, - message: string -|}; +export type AlertType = { + type: AlertTypeType; + message: string; +}; diff --git a/src/types/channels.js b/src/types/channels.js deleted file mode 100644 index afc0a2a7b..000000000 --- a/src/types/channels.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import type {IDMappedObjects, UserIDMappedObjects, RelationOneToMany, RelationOneToOne} from './utilities'; -import type {Team} from './teams'; - -export type ChannelType = 'O' | 'P' | 'D' | 'G'; - -export type ChannelStats = {| - channel_id: string, - member_count: number -|}; - -export type ChannelNotifyProps = {| - desktop: 'default' | 'all' | 'mention' | 'none', - email: 'default' | 'all' | 'mention' | 'none', - mark_unread: 'all' | 'mention', - push: 'default' | 'all' | 'mention' | 'none', - ignore_channel_mentions: 'default' | 'off' | 'on', -|}; - -export type Channel = {| - id: string, - create_at: number, - update_at: number, - delete_at: number, - team_id: string, - type: ChannelType, - display_name: string, - name: string, - header: string, - purpose: string, - last_post_at: number, - total_msg_count: number, - extra_update_at: number, - creator_id: string, - scheme_id: string, - isCurrent?: boolean, - teammate_id?: string, - status?: string, - fake?: boolean, - group_constrained: boolean, -|}; - -export type ChannelMembership = {| - channel_id: string, - user_id: string, - roles: string, - last_viewed_at: number, - msg_count: number, - mention_count: number, - notify_props: ChannelNotifyProps, - last_update_at: number, - scheme_user: boolean, - scheme_admin: boolean, - post_root_id?: string -|} - -export type ChannelsState = {| - currentChannelId: string, - channels: IDMappedObjects, - channelsInTeam: RelationOneToMany, - myMembers: RelationOneToOne, - membersInChannel: RelationOneToOne>, - stats: RelationOneToOne, - groupsAssociatedToChannel: Object, - totalCount: number, -|}; diff --git a/src/types/channels.ts b/src/types/channels.ts new file mode 100644 index 000000000..17f4a6be1 --- /dev/null +++ b/src/types/channels.ts @@ -0,0 +1,61 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {IDMappedObjects, UserIDMappedObjects, RelationOneToMany, RelationOneToOne} from './utilities'; +import {Team} from './teams'; +export type ChannelType = 'O' | 'P' | 'D' | 'G'; +export type ChannelStats = { + channel_id: string; + member_count: number; +}; +export type ChannelNotifyProps = { + desktop: 'default' | 'all' | 'mention' | 'none'; + email: 'default' | 'all' | 'mention' | 'none'; + mark_unread: 'all' | 'mention'; + push: 'default' | 'all' | 'mention' | 'none'; + ignore_channel_mentions: 'default' | 'off' | 'on'; +}; +export type Channel = { + id: string; + create_at: number; + update_at: number; + delete_at: number; + team_id: string; + type: ChannelType; + display_name: string; + name: string; + header: string; + purpose: string; + last_post_at: number; + total_msg_count: number; + extra_update_at: number; + creator_id: string; + scheme_id: string; + isCurrent?: boolean; + teammate_id?: string; + status?: string; + fake?: boolean; + group_constrained: boolean; +}; +export type ChannelMembership = { + channel_id: string; + user_id: string; + roles: string; + last_viewed_at: number; + msg_count: number; + mention_count: number; + notify_props: Partial; + last_update_at: number; + scheme_user: boolean; + scheme_admin: boolean; + post_root_id?: string; +}; +export type ChannelsState = { + currentChannelId: string; + channels: IDMappedObjects; + channelsInTeam: RelationOneToMany; + myMembers: RelationOneToOne; + membersInChannel: RelationOneToOne>; + stats: RelationOneToOne; + groupsAssociatedToChannel: any; + totalCount: number; +}; diff --git a/src/types/client4.js b/src/types/client4.js deleted file mode 100644 index e23138483..000000000 --- a/src/types/client4.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -// I assume these are the loglevels -export type logLevel = 'ERROR' | 'WARNING' | 'INFO' - -export type GenericClientResponse = { - response: Object, - headers: Map, - data: Object, -} - -type ErrorOffline = {| - message: string, - url: string -|} - -type ErrorInvalidResponse = {| - intl: { - id: string, - defaultMessage: string - } -|} - -type ErrorApi = {| - message: string, - server_error_id: string, - status_code: number, - url: string -|} - -export type Client4Error = ErrorOffline | ErrorInvalidResponse | ErrorApi; \ No newline at end of file diff --git a/src/types/client4.ts b/src/types/client4.ts new file mode 100644 index 000000000..32bdaa1e0 --- /dev/null +++ b/src/types/client4.ts @@ -0,0 +1,26 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +// I assume these are the loglevels +export type logLevel = 'ERROR' | 'WARNING' | 'INFO'; +export type GenericClientResponse = { + response: any; + headers: Map; + data: any; +}; +type ErrorOffline = { + message: string; + url: string; +}; +type ErrorInvalidResponse = { + intl: { + id: string; + defaultMessage: string; + }; +}; +export type ErrorApi = { + message: string; + server_error_id: string; + status_code: number; + url: string; +}; +export type Client4Error = ErrorOffline | ErrorInvalidResponse | ErrorApi; diff --git a/src/types/emojis.js b/src/types/emojis.js deleted file mode 100644 index 91628429f..000000000 --- a/src/types/emojis.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type CustomEmoji = {| - id: string, - create_at: number, - update_at: number, - delete_at: number, - creator_id: string, - name: string, -|} - -export type SystemEmoji = {| - id: string, - name: string, - filename: string, - aliases: Array, - category: string, - batch: number, -|} - -export type Emoji = SystemEmoji | CustomEmoji; - -export type EmojisState = {| - customEmoji: { - [string]: CustomEmoji - }, - nonExistentEmoji: Set -|}; diff --git a/src/types/emojis.ts b/src/types/emojis.ts new file mode 100644 index 000000000..6be076e9d --- /dev/null +++ b/src/types/emojis.ts @@ -0,0 +1,25 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type CustomEmoji = { + id: string; + create_at: number; + update_at: number; + delete_at: number; + creator_id: string; + name: string; +}; +export type SystemEmoji = { + id: string; + name: string; + filename: string; + aliases: Array; + category: string; + batch: number; +}; +export type Emoji = SystemEmoji | CustomEmoji; +export type EmojisState = { + customEmoji: { + [x: string]: CustomEmoji; + }; + nonExistentEmoji: Set; +}; diff --git a/src/types/errors.js b/src/types/errors.js deleted file mode 100644 index 1f66a5616..000000000 --- a/src/types/errors.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type Error = {| - server_error_id?: string, - stack?: string, - message: string, - status_code?: number, -|}; diff --git a/src/types/errors.ts b/src/types/errors.ts new file mode 100644 index 000000000..7003f4bbe --- /dev/null +++ b/src/types/errors.ts @@ -0,0 +1,8 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type Error = { + server_error_id?: string; + stack?: string; + message: string; + status_code?: number; +}; diff --git a/src/types/files.js b/src/types/files.js deleted file mode 100644 index 1ca6c3ec9..000000000 --- a/src/types/files.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type FileInfo = {| - id: string, - user_id: string, - create_at: number, - update_at: number, - delete_at: number, - name: string, - extension: string, - size: number, - mime_type: string, - width: number, - height: number, - has_preview_image: boolean, - clientId: string -|} - -export type FilesState = {| - files: {[string]: FileInfo}, - fileIdsByPostId: {[string]: Array} -|}; diff --git a/src/types/files.ts b/src/types/files.ts new file mode 100644 index 000000000..7e5d13001 --- /dev/null +++ b/src/types/files.ts @@ -0,0 +1,25 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type FileInfo = { + id: string; + user_id: string; + create_at: number; + update_at: number; + delete_at: number; + name: string; + extension: string; + size: number; + mime_type: string; + width: number; + height: number; + has_preview_image: boolean; + clientId: string; +}; +export type FilesState = { + files: { + [x: string]: FileInfo; + }; + fileIdsByPostId: { + [x: string]: Array; + }; +}; diff --git a/src/types/general.js b/src/types/general.js deleted file mode 100644 index b32b940f7..000000000 --- a/src/types/general.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type GeneralState = {| - appState: boolean, - credentials: Object, - config: Object, - dataRetentionPolicy: Object, - deviceToken: string, - license: Object, - serverVersion: string, - timezones: Array -|}; diff --git a/src/types/general.ts b/src/types/general.ts new file mode 100644 index 000000000..c76f3d0b1 --- /dev/null +++ b/src/types/general.ts @@ -0,0 +1,12 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type GeneralState = { + appState: boolean; + credentials: any; + config: any; + dataRetentionPolicy: any; + deviceToken: string; + license: any; + serverVersion: string; + timezones: Array; +}; diff --git a/src/types/groups.js b/src/types/groups.js deleted file mode 100644 index ac9b8a776..000000000 --- a/src/types/groups.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type SyncableType = 'team' | 'channel'; - -export type SyncablePatch = {| - auto_add: boolean -|}; - -export type Group = {| - id: string, - name: string, - display_name: string, - description: string, - type: string, - remote_id: string, - create_at: number, - update_at: number, - delete_at: number, - has_syncables: boolean, - member_count: number, -|}; - -export type GroupTeam = {| - team_id: string, - team_display_name: string, - team_type: string, - group_id: string, - auto_add: boolean, - create_at: number, - delete_at: number, - update_at: number, -|}; - -export type GroupChannel = {| - channel_id: string, - channel_display_name: string, - channel_type: string, - team_id: string, - team_display_name: string, - team_type: string, - group_id: string, - auto_add: boolean, - create_at: number, - delete_at: number, - update_at: number, -|}; - -export type GroupSyncables = {| - teams: Array, - channels: Array, -|}; - -export type GroupsState = {| - syncables: {[string]: GroupSyncables}, - members: Object, - groups: { [string]: Group }, -|}; - -export type GroupSearchOpts = {| - q: string, - is_linked?: boolean, - is_configured?: boolean, -|}; \ No newline at end of file diff --git a/src/types/groups.ts b/src/types/groups.ts new file mode 100644 index 000000000..2638c158a --- /dev/null +++ b/src/types/groups.ts @@ -0,0 +1,60 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type SyncableType = 'team' | 'channel'; +export type SyncablePatch = { + auto_add: boolean; +}; +export type Group = { + id: string; + name: string; + display_name: string; + description: string; + type: string; + remote_id: string; + create_at: number; + update_at: number; + delete_at: number; + has_syncables: boolean; + member_count: number; +}; +export type GroupTeam = { + team_id: string; + team_display_name: string; + team_type: string; + group_id: string; + auto_add: boolean; + create_at: number; + delete_at: number; + update_at: number; +}; +export type GroupChannel = { + channel_id: string; + channel_display_name: string; + channel_type: string; + team_id: string; + team_display_name: string; + team_type: string; + group_id: string; + auto_add: boolean; + create_at: number; + delete_at: number; + update_at: number; +}; +export type GroupSyncables = { + teams: Array; + channels: Array; +}; +export type GroupsState = { + syncables: { + [x: string]: GroupSyncables; + }; + members: any; + groups: { + [x: string]: Group; + }; +}; +export type GroupSearchOpts = { + q: string; + is_linked?: boolean; + is_configured?: boolean; +}; diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 000000000..42fd8fabf --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,54 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import * as actions from './actions'; +import * as admin from './admin'; +import * as alerts from './alerts'; +import * as channels from './channels'; +import * as client4 from './client4'; +import * as errors from './errors'; +import * as emojis from './emojis'; +import * as files from './files'; +import * as general from './general'; +import * as groups from './groups'; +import * as integrations from './integrations'; +import * as jobs from './jobs'; +import * as posts from './posts'; +import * as preferences from './preferences'; +import * as reactions from './reactions'; +import * as requests from './requests'; +import * as roles from './roles'; +import * as schemes from './schemes'; +import * as search from './search'; +import * as store from './store'; +import * as teams from './teams'; +import * as typing from './typing'; +import * as utilities from './utilities'; +import * as users from './users'; + +export { + admin, + actions, + alerts, + store, + channels, + errors, + emojis, + files, + general, + groups, + typing, + integrations, + jobs, + utilities, + posts, + preferences, + roles, + client4, + schemes, + search, + teams, + requests, + reactions, + users, +}; diff --git a/src/types/integrations.js b/src/types/integrations.js deleted file mode 100644 index b27547116..000000000 --- a/src/types/integrations.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import type {IDMappedObjects} from './utilities'; - -export type IncomingWebhook = {| - id: string, - create_at: number, - update_at: number, - delete_at: number, - user_id: string, - channel_id: string, - team_id: string, - display_name: string, - description: string, - username: string, - icon_url: string, - channel_locked: boolean, -|}; - -export type OutgoingWebhook = {| - id: string, - token: string, - create_at: number, - update_at: number, - delete_at: number, - creator_id: string, - channel_id: string, - team_id: string, - trigger_words: Array, - trigger_when: number, - callback_urls: Array, - display_name: string, - description: string, - content_type: string, - username: string, - icon_url: string, -|}; - -export type Command = {| - "id": string, - "token": string, - "create_at": number, - "update_at": number, - "delete_at": number, - "creator_id": string, - "team_id": string, - "trigger": string, - "method": "P" | "G" | "", - "username": string, - "icon_url": string, - "auto_complete": boolean, - "auto_complete_desc": string, - "auto_complete_hint": string, - "display_name": string, - "description": string, - "url": string -|}; - -export type OAuthApp = {| - "id": string, - "creator_id": string, - "create_at": number, - "update_at": number, - "client_secret": string, - "name": string, - "description": string, - "icon_url": string, - "callback_urls": Array, - "homepage": string, - "is_trusted": boolean -|}; - -export type IntegrationsState = {| - incomingHooks: IDMappedObjects, - outgoingHooks: IDMappedObjects, - oauthApps: IDMappedObjects, - systemCommands: IDMappedObjects, - commands: IDMappedObjects -|}; - -export type DialogSubmission = {| - url: string, - callback_id: string, - state: string, - user_id: string, - channel_id: string, - team_id: string, - submission: {[string]: string}, - cancelled: boolean, -|}; - -export type DialogElement = {| - display_name: string, - name: string, - type: string, - subtype: string, - default: string, - placeholder: string, - help_text: string, - optional: boolean, - min_length: number, - max_length: number, - data_source: string, - options: Array<{text: string, value: Object}>, -|}; diff --git a/src/types/integrations.ts b/src/types/integrations.ts new file mode 100644 index 000000000..cf819ac8f --- /dev/null +++ b/src/types/integrations.ts @@ -0,0 +1,103 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {IDMappedObjects} from './utilities'; +export type IncomingWebhook = { + id: string; + create_at: number; + update_at: number; + delete_at: number; + user_id: string; + channel_id: string; + team_id: string; + display_name: string; + description: string; + username: string; + icon_url: string; + channel_locked: boolean; +}; +export type OutgoingWebhook = { + id: string; + token: string; + create_at: number; + update_at: number; + delete_at: number; + creator_id: string; + channel_id: string; + teamId: string; + trigger_words: Array; + trigger_when: number; + callback_urls: Array; + display_name: string; + description: string; + content_type: string; + username: string; + icon_url: string; +}; +export type Command = { + 'id': string; + 'token': string; + 'create_at': number; + 'update_at': number; + 'delete_at': number; + 'creator_id': string; + 'team_id': string; + 'trigger': string; + 'method': 'P' | 'G' | ''; + 'username': string; + 'icon_url': string; + 'auto_complete': boolean; + 'auto_complete_desc': string; + 'auto_complete_hint': string; + 'display_name': string; + 'description': string; + 'url': string; +}; +export type OAuthApp = { + 'id': string; + 'creator_id': string; + 'create_at': number; + 'update_at': number; + 'client_secret': string; + 'name': string; + 'description': string; + 'icon_url': string; + 'callback_urls': Array; + 'homepage': string; + 'is_trusted': boolean; +}; +export type IntegrationsState = { + incomingHooks: IDMappedObjects; + outgoingHooks: IDMappedObjects; + oauthApps: IDMappedObjects; + systemCommands: IDMappedObjects; + commands: IDMappedObjects; +}; +export type DialogSubmission = { + url: string; + callback_id: string; + state: string; + user_id: string; + channel_id: string; + team_id: string; + submission: { + [x: string]: string; + }; + cancelled: boolean; +}; +export type DialogElement = { + display_name: string; + name: string; + type: string; + subtype: string; + default: string; + placeholder: string; + help_text: string; + optional: boolean; + min_length: number; + max_length: number; + data_source: string; + options: Array<{ + text: string; + value: any; + }>; +}; diff --git a/src/types/jobs.js b/src/types/jobs.js deleted file mode 100644 index 62e59797f..000000000 --- a/src/types/jobs.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import type {IDMappedObjects} from './utilities'; - -export type JobType = 'data_retention' | 'elasticsearch_post_indexing' | 'ldap_sync' | 'message_export'; -export type JobStatus = 'pending' | 'in_progress' | 'success' | 'error' | 'cancel_requested' | 'canceled'; - -export type Job = {| - id: string, - type: JobType, - priority: number, - create_at: number, - start_at: number, - last_activity_at: number, - status: JobStatus, - progress: number, - data: Object -|} - -export type JobsState = {| - jobs: IDMappedObjects, - jobsByTypeList: {[JobType]: Array} -|}; diff --git a/src/types/jobs.ts b/src/types/jobs.ts new file mode 100644 index 000000000..cdde5fc57 --- /dev/null +++ b/src/types/jobs.ts @@ -0,0 +1,23 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {IDMappedObjects} from './utilities'; +export type JobType = 'data_retention' | 'elasticsearch_post_indexing' | 'ldap_sync' | 'message_export'; +export type JobStatus = 'pending' | 'in_progress' | 'success' | 'error' | 'cancel_requested' | 'canceled'; +export type Job = { + id: string; + type: JobType; + priority: number; + create_at: number; + start_at: number; + last_activity_at: number; + status: JobStatus; + progress: number; + data: any; +}; +export type JobsByType = { + [x in JobType]?: Array; +}; +export type JobsState = { + jobs: IDMappedObjects; + jobsByTypeList: JobsByType; +}; diff --git a/src/types/posts.js b/src/types/posts.js deleted file mode 100644 index 3c6710bdd..000000000 --- a/src/types/posts.js +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import type {CustomEmoji} from './emojis'; -import type {FileInfo} from './files'; -import type {Reaction} from './reactions'; -import type {Channel} from './channels'; -import type { - $ID, - RelationOneToOne, - RelationOneToMany, - IDMappedObjects, -} from './utilities'; - -export type PostType = 'system_add_remove' | - 'system_add_to_channel' | - 'system_add_to_team' | - 'system_channel_deleted' | - 'system_displayname_change' | - 'system_convert_channel' | - 'system_ephemeral' | - 'system_header_change' | - 'system_join_channel' | - 'system_join_leave' | - 'system_leave_channel' | - 'system_purpose_change' | - 'system_remove_from_channel'; - -export type PostEmbedType = 'image' | 'message_attachment' | 'opengraph'; - -export type PostEmbed = {| - type: PostEmbedType, - url: string, - data: Object -|}; - -export type PostImage = {| - height: number, - width: number -|}; - -export type PostMetadata = {| - embeds: Array, - emojis: Array, - files: Array, - images: {[string]: PostImage}, - reactions: Array -|}; - -export type Post = { - id: string, - create_at: number, - update_at: number, - edit_at: number, - delete_at: number, - is_pinned: boolean, - user_id: string, - channel_id: string, - root_id: string, - parent_id: string, - original_id: string, - message: string, - type: PostType, - props: Object, - hashtags: string, - pending_post_id: string, - metadata: PostMetadata, - failed?: boolean, - user_activity_posts?: Array, - state?: 'DELETED', -}; - -export type PostWithFormatData = Post & { - isFirstReply: boolean, - isLastReply: boolean, - previousPostIsComment: boolean, - commentedOnPost: Post, - consecutivePostByUser: boolean, - replyCount: number, - isCommentMention: boolean, - highlight: boolean, -}; - -export type PostOrderBlock = {| - order: Array, - recent: boolean, - oldest: boolean, -|}; - -export type PostsState = {| - posts: IDMappedObjects, - postsInChannel: {[$ID]: Array}, - postsInThread: RelationOneToMany, - reactions: RelationOneToOne, - openGraph: RelationOneToOne, - pendingPostIds: Array, - selectedPostId: string, - currentFocusedPostId: string, - messagesHistory: {| - messages: Array, - index: {| - post: number, - comment: number - |} - |}, - expandedURLs: {[string]: string}, -|}; diff --git a/src/types/posts.ts b/src/types/posts.ts new file mode 100644 index 000000000..4a0b4c7a4 --- /dev/null +++ b/src/types/posts.ts @@ -0,0 +1,117 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import {CustomEmoji} from './emojis'; +import {FileInfo} from './files'; +import {Reaction} from './reactions'; +import {Channel} from './channels'; +import { + $ID, + RelationOneToOne, + RelationOneToMany, + IDMappedObjects, + Dictionary, +} from './utilities'; + +export type PostType = 'system_add_remove' | + 'system_add_to_channel' | + 'system_add_to_team' | + 'system_channel_deleted' | + 'system_displayname_change' | + 'system_convert_channel' | + 'system_ephemeral' | + 'system_header_change' | + 'system_join_channel' | + 'system_join_leave' | + 'system_leave_channel' | + 'system_purpose_change' | + 'system_remove_from_channel'; + +export type PostEmbedType = 'image' | 'message_attachment' | 'opengraph'; + +export type PostEmbed = { + type: PostEmbedType; + url: string; + data: Record; +}; + +export type PostImage = { + height: number; + width: number; +}; + +export type PostMetadata = { + embeds: Array; + emojis: Array; + files: Array; + images: Dictionary; + reactions: Array; +}; + +export type Post = { + id: string; + create_at: number; + update_at: number; + edit_at: number; + delete_at: number; + is_pinned: boolean; + user_id: string; + channel_id: string; + root_id: string; + parent_id: string; + original_id: string; + message: string; + type: PostType; + props: Record; + hashtags: string; + pending_post_id: string; + reply_count: number; + file_ids?: any[]; + metadata: PostMetadata; + failed?: boolean; + user_activity_posts?: Array; + state?: 'DELETED'; +}; + +export type PostWithFormatData = Post & { + isFirstReply: boolean; + isLastReply: boolean; + previousPostIsComment: boolean; + commentedOnPost: Post; + consecutivePostByUser: boolean; + replyCount: number; + isCommentMention: boolean; + highlight: boolean; +}; + +export type PostOrderBlock = { + order: Array; + recent: boolean; + oldest: boolean; +}; + +export type PostsState = { + posts: IDMappedObjects; + postsInChannel: { + [x: string]: Array; + }; + postsInThread: RelationOneToMany; + reactions: RelationOneToOne< + Post, + { + [x: string]: Reaction; + } + >; + openGraph: RelationOneToOne; + pendingPostIds: Array; + selectedPostId: string; + currentFocusedPostId: string; + messagesHistory: { + messages: Array; + index: { + post: number; + comment: number; + }; + }; + expandedURLs: { [x: string]: string}; +}; diff --git a/src/types/preferences.js b/src/types/preferences.js deleted file mode 100644 index 93cc191e8..000000000 --- a/src/types/preferences.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type PreferenceType = {| - category: string, - name: string, - user_id: string, - value: string -|} diff --git a/src/types/preferences.ts b/src/types/preferences.ts new file mode 100644 index 000000000..32c5e527f --- /dev/null +++ b/src/types/preferences.ts @@ -0,0 +1,12 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type PreferenceType = { + category: string; + name: string; + user_id: string; + value?: string; +}; + +export type PreferencesType = { + [x: string]: PreferenceType; +}; diff --git a/src/types/reactions.js b/src/types/reactions.js deleted file mode 100644 index 4b9262c7e..000000000 --- a/src/types/reactions.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type Reaction = {| - user_id: string, - post_id: string, - emoji_name: string, - create_at: number -|}; diff --git a/src/client/index.js b/src/types/reactions.ts similarity index 50% rename from src/client/index.js rename to src/types/reactions.ts index 9babaf495..ee726c5e3 100644 --- a/src/client/index.js +++ b/src/types/reactions.ts @@ -1,11 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import ClientClass4 from './client4.js'; - -const Client4 = new ClientClass4(); - -export { - Client4, +export type Reaction = { + user_id: string; + post_id: string; + emoji_name: string; + create_at: number; }; diff --git a/src/types/requests.js b/src/types/requests.js deleted file mode 100644 index 4c23c0b5d..000000000 --- a/src/types/requests.js +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type RequestStatusOption = 'not_started' | 'started' | 'success' | 'failure' | 'cancelled'; -export type RequestStatusType = {| - status: RequestStatusOption, - error: null | Object -|}; - -export type ChannelsRequestsStatuses = {| - getChannels: RequestStatusType, - getAllChannels: RequestStatusType, - myChannels: RequestStatusType, - createChannel: RequestStatusType, - updateChannel: RequestStatusType, -|}; - -export type GeneralRequestsStatuses = {| - server: RequestStatusType, - config: RequestStatusType, - dataRetentionPolicy: RequestStatusType, - license: RequestStatusType, - websocket: RequestStatusType, - redirectLocation: RequestStatusType -|}; - -export type PostsRequestsStatuses = {| - createPost: RequestStatusType, - editPost: RequestStatusType, - getPostThread: RequestStatusType, -|}; - -export type TeamsRequestsStatuses = {| - getMyTeams: RequestStatusType, - getTeams: RequestStatusType, - joinTeam: RequestStatusType, -|}; - -export type UsersRequestsStatuses = {| - checkMfa: RequestStatusType, - login: RequestStatusType, - logout: RequestStatusType, - autocompleteUsers: RequestStatusType, - updateMe: RequestStatusType, -|}; - -export type PreferencesRequestsStatuses = {| - getMyPreferences: RequestStatusType, - savePreferences: RequestStatusType, - deletePreferences: RequestStatusType -|}; - -export type AdminRequestsStatuses = {| - getLogs: RequestStatusType, - getAudits: RequestStatusType, - getConfig: RequestStatusType, - updateConfig: RequestStatusType, - reloadConfig: RequestStatusType, - testEmail: RequestStatusType, - testSiteURL: RequestStatusType, - invalidateCaches: RequestStatusType, - recycleDatabase: RequestStatusType, - createCompliance: RequestStatusType, - getCompliance: RequestStatusType, - testS3Connection: RequestStatusType, - getLdapGroups: RequestStatusType, - linkLdapGroup: RequestStatusType, - unlinkLdapGroup: RequestStatusType, - deleteBrandImage: RequestStatusType, - disablePlugin: RequestStatusType, - enablePlugin: RequestStatusType, - getAnalytics: RequestStatusType, - getClusterStatus: RequestStatusType, - getEnvironmentConfig: RequestStatusType, - getPluginStatuses: RequestStatusType, - getPlugins: RequestStatusType, - getSamlCertificateStatus: RequestStatusType, - installPluginFromUrl: RequestStatusType, - purgeElasticsearchIndexes: RequestStatusType, - removeIdpSamlCertificate: RequestStatusType, - removeLicense: RequestStatusType, - removePlugin: RequestStatusType, - removePrivateSamlCertificate: RequestStatusType, - removePublicSamlCertificate: RequestStatusType, - syncLdap: RequestStatusType, - testElasticsearch: RequestStatusType, - testLdap: RequestStatusType, - uploadBrandImage: RequestStatusType, - uploadIdpSamlCertificate: RequestStatusType, - uploadLicense: RequestStatusType, - uploadPlugin: RequestStatusType, - uploadPrivateSamlCertificate: RequestStatusType, - uploadPublicSamlCertificate: RequestStatusType, -|}; - -export type EmojisRequestsStatuses = {| - createCustomEmoji: RequestStatusType, - getCustomEmojis: RequestStatusType, - deleteCustomEmoji: RequestStatusType, - getAllCustomEmojis: RequestStatusType, - getCustomEmoji: RequestStatusType, -|}; - -export type FilesRequestsStatuses = {| - uploadFiles: RequestStatusType, -|}; - -export type IntegrationsRequestsStatuses = {| - createIncomingHook: RequestStatusType, - getIncomingHooks: RequestStatusType, - deleteIncomingHook: RequestStatusType, - updateIncomingHook: RequestStatusType, - createOutgoingHook: RequestStatusType, - getOutgoingHooks: RequestStatusType, - deleteOutgoingHook: RequestStatusType, - updateOutgoingHook: RequestStatusType, - getCommands: RequestStatusType, - getAutocompleteCommands: RequestStatusType, - getCustomTeamCommands: RequestStatusType, - addCommand: RequestStatusType, - regenCommandToken: RequestStatusType, - editCommand: RequestStatusType, - deleteCommand: RequestStatusType, - addOAuthApp: RequestStatusType, - updateOAuthApp: RequestStatusType, - getOAuthApp: RequestStatusType, - getOAuthApps: RequestStatusType, - deleteOAuthApp: RequestStatusType, - executeCommand: RequestStatusType, - submitInteractiveDialog: RequestStatusType, -|}; - -export type RolesRequestsStatuses = {| - getRolesByNames: RequestStatusType, - getRoleByName: RequestStatusType, - getRole: RequestStatusType, - editRole: RequestStatusType -|}; - -export type SchemesRequestsStatuses = {| - getSchemes: RequestStatusType, - getScheme: RequestStatusType, - createScheme: RequestStatusType, - deleteScheme: RequestStatusType, - patchScheme: RequestStatusType, - getSchemeTeams: RequestStatusType, - getSchemeChannels: RequestStatusType -|}; - -export type GroupsRequestsStatuses = {| - linkGroupSyncable: RequestStatusType, - unlinkGroupSyncable: RequestStatusType, - getGroupSyncables: RequestStatusType, - getGroupMembers: RequestStatusType, - getGroup: RequestStatusType, - getAllGroupsAssociatedToTeam: RequestStatusType, - getAllGroupsAssociatedToChannel: RequestStatusType, - getGroupsAssociatedToTeam: RequestStatusType, - getGroupsAssociatedToChannel: RequestStatusType, - getGroupsNotAssociatedToTeam: RequestStatusType, - getGroupsNotAssociatedToChannel: RequestStatusType, -|}; - -export type JobsRequestsStatuses = {| - createJob: RequestStatusType, - getJob: RequestStatusType, - getJobs: RequestStatusType, - cancelJob: RequestStatusType, -|}; - -export type SearchRequestsStatuses = {| - flaggedPosts: RequestStatusType, - pinnedPosts: RequestStatusType, - recentMentions: RequestStatusType, - searchPosts: RequestStatusType, -|}; diff --git a/src/types/requests.ts b/src/types/requests.ts new file mode 100644 index 000000000..a2038af53 --- /dev/null +++ b/src/types/requests.ts @@ -0,0 +1,176 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +export type RequestStatusOption = 'not_started' | 'started' | 'success' | 'failure' | 'cancelled'; +export type RequestStatusType = { + status: RequestStatusOption; + error: null | Record; +}; + +export type ChannelsRequestsStatuses = { + getChannels: RequestStatusType; + getAllChannels: RequestStatusType; + myChannels: RequestStatusType; + createChannel: RequestStatusType; + updateChannel: RequestStatusType; +}; + +export type GeneralRequestsStatuses = { + server: RequestStatusType; + config: RequestStatusType; + dataRetentionPolicy: RequestStatusType; + license: RequestStatusType; + websocket: RequestStatusType; + redirectLocation: RequestStatusType; +}; + +export type PostsRequestsStatuses = { + createPost: RequestStatusType; + editPost: RequestStatusType; + getPostThread: RequestStatusType; +}; + +export type TeamsRequestsStatuses = { + getMyTeams: RequestStatusType; + getTeams: RequestStatusType; + joinTeam: RequestStatusType; +}; + +export type UsersRequestsStatuses = { + checkMfa: RequestStatusType; + login: RequestStatusType; + logout: RequestStatusType; + autocompleteUsers: RequestStatusType; + updateMe: RequestStatusType; +}; + +export type PreferencesRequestsStatuses = { + getMyPreferences: RequestStatusType; + savePreferences: RequestStatusType; + deletePreferences: RequestStatusType; +}; + +export type AdminRequestsStatuses = { + getLogs: RequestStatusType; + getAudits: RequestStatusType; + getConfig: RequestStatusType; + updateConfig: RequestStatusType; + reloadConfig: RequestStatusType; + testEmail: RequestStatusType; + testSiteURL: RequestStatusType; + invalidateCaches: RequestStatusType; + recycleDatabase: RequestStatusType; + createCompliance: RequestStatusType; + getCompliance: RequestStatusType; + testS3Connection: RequestStatusType; + getLdapGroups: RequestStatusType; + linkLdapGroup: RequestStatusType; + unlinkLdapGroup: RequestStatusType; + deleteBrandImage: RequestStatusType; + disablePlugin: RequestStatusType; + enablePlugin: RequestStatusType; + getAnalytics: RequestStatusType; + getClusterStatus: RequestStatusType; + getEnvironmentConfig: RequestStatusType; + getPluginStatuses: RequestStatusType; + getPlugins: RequestStatusType; + getSamlCertificateStatus: RequestStatusType; + installPluginFromUrl: RequestStatusType; + purgeElasticsearchIndexes: RequestStatusType; + removeIdpSamlCertificate: RequestStatusType; + removeLicense: RequestStatusType; + removePlugin: RequestStatusType; + removePrivateSamlCertificate: RequestStatusType; + removePublicSamlCertificate: RequestStatusType; + syncLdap: RequestStatusType; + testElasticsearch: RequestStatusType; + testLdap: RequestStatusType; + uploadBrandImage: RequestStatusType; + uploadIdpSamlCertificate: RequestStatusType; + uploadLicense: RequestStatusType; + uploadPlugin: RequestStatusType; + uploadPrivateSamlCertificate: RequestStatusType; + uploadPublicSamlCertificate: RequestStatusType; +}; + +export type EmojisRequestsStatuses = { + createCustomEmoji: RequestStatusType; + getCustomEmojis: RequestStatusType; + deleteCustomEmoji: RequestStatusType; + getAllCustomEmojis: RequestStatusType; + getCustomEmoji: RequestStatusType; +}; + +export type FilesRequestsStatuses = { + uploadFiles: RequestStatusType; +}; + +export type IntegrationsRequestsStatuses = { + createIncomingHook: RequestStatusType; + getIncomingHooks: RequestStatusType; + deleteIncomingHook: RequestStatusType; + updateIncomingHook: RequestStatusType; + createOutgoingHook: RequestStatusType; + getOutgoingHooks: RequestStatusType; + deleteOutgoingHook: RequestStatusType; + updateOutgoingHook: RequestStatusType; + getCommands: RequestStatusType; + getAutocompleteCommands: RequestStatusType; + getCustomTeamCommands: RequestStatusType; + addCommand: RequestStatusType; + regenCommandToken: RequestStatusType; + editCommand: RequestStatusType; + deleteCommand: RequestStatusType; + addOAuthApp: RequestStatusType; + updateOAuthApp: RequestStatusType; + getOAuthApp: RequestStatusType; + getOAuthApps: RequestStatusType; + deleteOAuthApp: RequestStatusType; + executeCommand: RequestStatusType; + submitInteractiveDialog: RequestStatusType; +}; + +export type RolesRequestsStatuses = { + getRolesByNames: RequestStatusType; + getRoleByName: RequestStatusType; + getRole: RequestStatusType; + editRole: RequestStatusType; +}; + +export type SchemesRequestsStatuses = { + getSchemes: RequestStatusType; + getScheme: RequestStatusType; + createScheme: RequestStatusType; + deleteScheme: RequestStatusType; + patchScheme: RequestStatusType; + getSchemeTeams: RequestStatusType; + getSchemeChannels: RequestStatusType; +}; + +export type GroupsRequestsStatuses = { + linkGroupSyncable: RequestStatusType; + unlinkGroupSyncable: RequestStatusType; + getGroupSyncables: RequestStatusType; + getGroupMembers: RequestStatusType; + getGroup: RequestStatusType; + getAllGroupsAssociatedToTeam: RequestStatusType; + getAllGroupsAssociatedToChannel: RequestStatusType; + getGroupsAssociatedToTeam: RequestStatusType; + getGroupsAssociatedToChannel: RequestStatusType; + getGroupsNotAssociatedToTeam: RequestStatusType; + getGroupsNotAssociatedToChannel: RequestStatusType; +}; + +export type JobsRequestsStatuses = { + createJob: RequestStatusType; + getJob: RequestStatusType; + getJobs: RequestStatusType; + cancelJob: RequestStatusType; +}; + +export type SearchRequestsStatuses = { + flaggedPosts: RequestStatusType; + pinnedPosts: RequestStatusType; + recentMentions: RequestStatusType; + searchPosts: RequestStatusType; +}; diff --git a/src/types/roles.js b/src/types/roles.js deleted file mode 100644 index 6e3d432e1..000000000 --- a/src/types/roles.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type Role = {| - id: string, - name: string, - display_name: string, - description: string, - create_at: number, - update_at: number, - delete_at: number, - permissions: Array, - scheme_managed: boolean, - built_in: boolean, -|} diff --git a/src/types/roles.ts b/src/types/roles.ts new file mode 100644 index 000000000..28c430f3a --- /dev/null +++ b/src/types/roles.ts @@ -0,0 +1,14 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type Role = { + id: string; + name: string; + display_name: string; + description: string; + create_at: number; + update_at: number; + delete_at: number; + permissions: Array; + scheme_managed: boolean; + built_in: boolean; +}; diff --git a/src/types/schemes.js b/src/types/schemes.js deleted file mode 100644 index 1abe17844..000000000 --- a/src/types/schemes.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type SchemeScope = 'team' | 'channel'; - -export type Scheme = {| - id: string, - name: string, - description: string, - create_at: number, - update_at: number, - delete_at: number, - scope: SchemeScope, - default_team_admin_role: string, - default_team_user_role: string, - default_channel_admin_role: string, - default_channel_user_role: string, -|}; - -export type SchemesState = {| - schemes: { [string]: Scheme }, -|}; - -export type SchemePatch = {| - name?: string, - description?: string -|}; diff --git a/src/types/schemes.ts b/src/types/schemes.ts new file mode 100644 index 000000000..e545ca962 --- /dev/null +++ b/src/types/schemes.ts @@ -0,0 +1,25 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type SchemeScope = 'team' | 'channel'; +export type Scheme = { + id: string; + name: string; + description: string; + create_at: number; + update_at: number; + delete_at: number; + scope: SchemeScope; + default_team_admin_role: string; + default_team_user_role: string; + default_channel_admin_role: string; + default_channel_user_role: string; +}; +export type SchemesState = { + schemes: { + [x: string]: Scheme; + }; +}; +export type SchemePatch = { + name?: string; + description?: string; +}; diff --git a/src/types/search.js b/src/types/search.js deleted file mode 100644 index 37c67aca6..000000000 --- a/src/types/search.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type Search = {| - terms: string, - isOrSearch: boolean -|} - -export type SearchState = {| - results: Array, - recent: {[string]: Array}, - matches: {[string]: Array}, -|}; diff --git a/src/types/search.ts b/src/types/search.ts new file mode 100644 index 000000000..97ba00d91 --- /dev/null +++ b/src/types/search.ts @@ -0,0 +1,16 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type Search = { + terms: string; + isOrSearch: boolean; +}; +export type SearchState = { + current: any; + results: Array; + recent: { + [x: string]: Array; + }; + matches: { + [x: string]: Array; + }; +}; diff --git a/src/types/store.js b/src/types/store.js deleted file mode 100644 index 43a3d6931..000000000 --- a/src/types/store.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import type {AlertType} from './alerts'; -import type {GeneralState} from './general'; -import type {UsersState} from './users'; -import type {TeamsState} from './teams'; -import type {ChannelsState} from './channels'; -import type {PostsState} from './posts'; -import type {AdminState} from './admin'; -import type {JobsState} from './jobs'; -import type {SearchState} from './search'; -import type {IntegrationsState} from './integrations'; -import type {FilesState} from './files'; -import type {EmojisState} from './emojis'; -import type {SchemesState} from './schemes'; -import type {Typing} from './typing'; -import type {GroupsState} from './groups'; -import type { - ChannelsRequestsStatuses, - GeneralRequestsStatuses, - PostsRequestsStatuses, - TeamsRequestsStatuses, - UsersRequestsStatuses, - PreferencesRequestsStatuses, - AdminRequestsStatuses, - FilesRequestsStatuses, - IntegrationsRequestsStatuses, - RolesRequestsStatuses, - SchemesRequestsStatuses, - GroupsRequestsStatuses, - JobsRequestsStatuses, - SearchRequestsStatuses, -} from './requests'; -import type {Role} from './roles'; -import type {PreferenceType} from './preferences'; - -export type GlobalState = {| - entities: {| - general: GeneralState, - users: UsersState, - teams: TeamsState, - channels: ChannelsState, - posts: PostsState, - preferences: {| - myPreferences: {[string]: PreferenceType} - |}, - admin: AdminState, - jobs: JobsState, - alerts: {| - alertStack: Array - |}, - search: SearchState, - integrations: IntegrationsState, - files: FilesState, - emojis: EmojisState, - typing: Typing, - roles: { - roles: { [string]: Role }, - pending: Set - - }, - schemes: SchemesState, - gifs: Object, - groups: GroupsState, - |}, - errors: Array, - requests: {| - channels: ChannelsRequestsStatuses, - general: GeneralRequestsStatuses, - posts: PostsRequestsStatuses, - teams: TeamsRequestsStatuses, - users: UsersRequestsStatuses, - preferences: PreferencesRequestsStatuses, - admin: AdminRequestsStatuses, - files: FilesRequestsStatuses, - integrations: IntegrationsRequestsStatuses, - roles: RolesRequestsStatuses, - schemes: SchemesRequestsStatuses, - groups: GroupsRequestsStatuses, - jobs: JobsRequestsStatuses, - schemes: SchemesRequestsStatuses, - search: SearchRequestsStatuses, - |}, - websocket: {| - connected: boolean, - lastConnectAt: number, - lastDisconnectAt: number, - |} -|}; diff --git a/src/types/store.ts b/src/types/store.ts new file mode 100644 index 000000000..f510a51df --- /dev/null +++ b/src/types/store.ts @@ -0,0 +1,75 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {AlertType} from './alerts'; +import {GeneralState} from './general'; +import {UsersState} from './users'; +import {TeamsState} from './teams'; +import {ChannelsState} from './channels'; +import {PostsState} from './posts'; +import {AdminState} from './admin'; +import {JobsState} from './jobs'; +import {SearchState} from './search'; +import {IntegrationsState} from './integrations'; +import {FilesState} from './files'; +import {EmojisState} from './emojis'; +import {SchemesState} from './schemes'; +import {Typing} from './typing'; +import {GroupsState} from './groups'; +import {ChannelsRequestsStatuses, GeneralRequestsStatuses, PostsRequestsStatuses, TeamsRequestsStatuses, UsersRequestsStatuses, PreferencesRequestsStatuses, AdminRequestsStatuses, FilesRequestsStatuses, IntegrationsRequestsStatuses, RolesRequestsStatuses, SchemesRequestsStatuses, GroupsRequestsStatuses, JobsRequestsStatuses, SearchRequestsStatuses} from './requests'; +import {Role} from './roles'; +import {PreferenceType} from './preferences'; +export type GlobalState = { + entities: { + general: GeneralState; + users: UsersState; + teams: TeamsState; + channels: ChannelsState; + posts: PostsState; + preferences: { + myPreferences: { + [x: string]: PreferenceType; + }; + }; + admin: AdminState; + jobs: JobsState; + alerts: { + alertStack: Array; + }; + search: SearchState; + integrations: IntegrationsState; + files: FilesState; + emojis: EmojisState; + typing: Typing; + roles: { + roles: { + [x: string]: Role; + }; + pending: Set; + }; + schemes: SchemesState; + gifs: any; + groups: GroupsState; + }; + errors: Array; + requests: { + channels: ChannelsRequestsStatuses; + general: GeneralRequestsStatuses; + posts: PostsRequestsStatuses; + teams: TeamsRequestsStatuses; + users: UsersRequestsStatuses; + preferences: PreferencesRequestsStatuses; + admin: AdminRequestsStatuses; + files: FilesRequestsStatuses; + integrations: IntegrationsRequestsStatuses; + roles: RolesRequestsStatuses; + schemes: SchemesRequestsStatuses; + groups: GroupsRequestsStatuses; + jobs: JobsRequestsStatuses; + search: SearchRequestsStatuses; + }; + websocket: { + connected: boolean; + lastConnectAt: number; + lastDisconnectAt: number; + }; +}; diff --git a/src/types/teams.js b/src/types/teams.js deleted file mode 100644 index 95a026cc6..000000000 --- a/src/types/teams.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type TeamMembership = {| - mention_count: number, - msg_count: number, - team_id: string, - user_id: string, - roles: string, - delete_at: number, - scheme_user: boolean, - scheme_admin: boolean -|}; - -export type TeamType = 'O' | 'I'; - -export type Team = {| - id: string, - create_at: number, - update_at: number, - delete_at: number, - display_name: string, - name: string, - description: string, - email: string, - type: TeamType, - company_name: string, - allowed_domains: string, - invite_id: string, - allow_open_invite: boolean, - scheme_id: string, - group_constrained: boolean, -|}; - -export type TeamsState = {| - currentTeamId: string, - teams: { [string]: Team }, - myMembers: { [string]: TeamMembership }, - membersInTeam: Object, - stats: Object, - groupsAssociatedToTeam: Object, - totalCount: number, -|}; diff --git a/src/types/teams.ts b/src/types/teams.ts new file mode 100644 index 000000000..dbc536cd2 --- /dev/null +++ b/src/types/teams.ts @@ -0,0 +1,43 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type TeamMembership = { + mention_count: number; + msg_count: number; + team_id: string; + user_id: string; + roles: string; + delete_at: number; + scheme_user: boolean; + scheme_admin: boolean; +}; +export type TeamType = 'O' | 'I'; +export type Team = { + id: string; + create_at: number; + update_at: number; + delete_at: number; + display_name: string; + name: string; + description: string; + email: string; + type: TeamType; + company_name: string; + allowed_domains: string; + invite_id: string; + allow_open_invite: boolean; + scheme_id: string; + group_constrained: boolean; +}; +export type TeamsState = { + currentTeamId: string; + teams: { + [x: string]: Team; + }; + myMembers: { + [x: string]: TeamMembership; + }; + membersInTeam: any; + stats: any; + groupsAssociatedToTeam: any; + totalCount: number; +}; diff --git a/src/types/typing.js b/src/types/typing.ts similarity index 58% rename from src/types/typing.js rename to src/types/typing.ts index d2bcaf3bc..36f867fec 100644 --- a/src/types/typing.js +++ b/src/types/typing.ts @@ -1,5 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -export type Typing = {[string]: {[string]: number}}; +export type Typing = { + [x: string]: { + [x: string]: number; + }; +}; diff --git a/src/types/users.js b/src/types/users.js deleted file mode 100644 index 9cf12c6dc..000000000 --- a/src/types/users.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -import type {Channel} from './channels'; -import type {Team} from './teams'; -import type {PostType} from './posts'; -import type {$ID, IDMappedObjects, RelationOneToMany, RelationOneToOne} from './utilities'; - -export type UserNotifyProps = {| - desktop: 'default' | 'all' | 'mention' | 'none', - desktop_sound: 'true' | 'false', - email: 'true' | 'false', - mark_unread: 'all' | 'mention', - push: 'default' | 'all' | 'mention' | 'none', - push_status: 'ooo' | 'offline' | 'away' | 'dnd' | 'online', - comments: 'never' | 'root' | 'any', - first_name: 'true' | 'false', - channel: 'true' | 'false', - mention_keys: string, -|}; - -export type UserProfile = {| - id: string, - create_at: number, - update_at: number, - delete_at: number, - username: string, - auth_data: string, - auth_service: string, - email: string, - email_verified: boolean, - nickname: string, - first_name: string, - last_name: string, - position: string, - roles: string, - locale: string, - notify_props: UserNotifyProps, - terms_of_service_id: string, - terms_of_service_create_at: number, - timezone?: {| - useAutomaticTimezone: string, - automaticTimezone: string, - manualTimezone: string, - |}, -|}; - -export type UsersState = {| - currentUserId: string, - mySessions: Array, - myAudits: Array, - profiles: IDMappedObjects, - profilesInTeam: RelationOneToMany, - profilesNotInTeam: RelationOneToMany, - profilesWithoutTeam: Set, - profilesInChannel: RelationOneToMany, - profilesNotInChannel: RelationOneToMany, - statuses: RelationOneToOne, - stats: Object, -|}; - -export type UserTimezone = {| - useAutomaticTimezone: boolean | string, - automaticTimezone: string, - manualTimezone: string, -|}; - -export type UserActivity = { - [PostType]: { - [$ID]: {| - ids: Array<$ID>, - usernames: Array<$PropertyType>, - |} | Array<$ID>, - }, -}; diff --git a/src/types/users.ts b/src/types/users.ts new file mode 100644 index 000000000..f613ff85e --- /dev/null +++ b/src/types/users.ts @@ -0,0 +1,65 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +import {Channel} from './channels'; +import {Team} from './teams'; +import {PostType} from './posts'; +import {$ID, IDMappedObjects, RelationOneToMany, RelationOneToOne} from './utilities'; +export type UserNotifyProps = { + desktop: 'default' | 'all' | 'mention' | 'none'; + desktop_sound: 'true' | 'false'; + email: 'true' | 'false'; + mark_unread: 'all' | 'mention'; + push: 'default' | 'all' | 'mention' | 'none'; + push_status: 'ooo' | 'offline' | 'away' | 'dnd' | 'online'; + comments: 'never' | 'root' | 'any'; + first_name: 'true' | 'false'; + channel: 'true' | 'false'; + mention_keys: string; +}; +export type UserProfile = { + id: string; + create_at: number; + update_at: number; + delete_at: number; + username: string; + auth_data: string; + auth_service: string; + email: string; + email_verified: boolean; + nickname: string; + first_name: string; + last_name: string; + position: string; + roles: string; + locale: string; + notify_props: UserNotifyProps; + terms_of_service_id: string; + terms_of_service_create_at: number; + timezone?: UserTimezone; +}; +export type UsersState = { + currentUserId: string; + mySessions: Array; + myAudits: Array; + profiles: IDMappedObjects; + profilesInTeam: RelationOneToMany; + profilesNotInTeam: RelationOneToMany; + profilesWithoutTeam: Set; + profilesInChannel: RelationOneToMany; + profilesNotInChannel: RelationOneToMany; + statuses: RelationOneToOne; + stats: any; +}; +export type UserTimezone = { + useAutomaticTimezone: boolean | string; + automaticTimezone: string; + manualTimezone: string; +}; +export type UserActivity = { + [x in PostType]: { + [x in $ID]: | { + ids: Array<$ID>; + usernames: Array; + } | Array<$ID>; + }; +}; diff --git a/src/types/utilities.js b/src/types/utilities.js deleted file mode 100644 index 132fb4c41..000000000 --- a/src/types/utilities.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -// @flow - -export type $ID = $PropertyType -export type $UserID = $PropertyType -export type $Name = $PropertyType -export type $Username = $PropertyType -export type $Email = $PropertyType - -export type RelationOneToOne = { [$ID]: T } -export type RelationOneToMany = { [$ID]: Array<$ID> } -export type IDMappedObjects = RelationOneToOne -export type UserIDMappedObjects = { [$UserID]: E } -export type NameMappedObjects = { [$Name]: E } -export type UsernameMappedObjects = { [$Username]: E } -export type EmailMappedObjects = { [$Email]: E } diff --git a/src/types/utilities.ts b/src/types/utilities.ts new file mode 100644 index 000000000..2c0bf357c --- /dev/null +++ b/src/types/utilities.ts @@ -0,0 +1,30 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. +export type $ID = E['id']; +export type $UserID = E['user_id']; +export type $Name = E['name']; +export type $Username = E['username']; +export type $Email = E['email']; +export type RelationOneToOne = { + [x in $ID]: T; +}; +export type RelationOneToMany = { + [x in $ID]: Array<$ID>; +}; +export type IDMappedObjects = RelationOneToOne; +export type UserIDMappedObjects = { + [x in $UserID]: E; +}; +export type NameMappedObjects = { + [x in $Name]: E; +}; +export type UsernameMappedObjects = { + [x in $Username]: E; +}; +export type EmailMappedObjects = { + [x in $Email]: E; +}; + +export type Dictionary = { + [key: string]: T; +}; \ No newline at end of file diff --git a/src/utils/channel_utils.test.js b/src/utils/channel_utils.test.js index 680fa873b..611fbc7db 100644 --- a/src/utils/channel_utils.test.js +++ b/src/utils/channel_utils.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {General, Users} from 'constants'; +import {General, Users} from '../constants'; import TestHelper from 'test/test_helper'; import { diff --git a/src/utils/channel_utils.js b/src/utils/channel_utils.ts similarity index 87% rename from src/utils/channel_utils.js rename to src/utils/channel_utils.ts index 73ec92095..11f5e1721 100644 --- a/src/utils/channel_utils.js +++ b/src/utils/channel_utils.ts @@ -1,21 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow +import {General, Preferences, Permissions, Users} from '../constants'; -import {General, Preferences, Permissions, Users} from 'constants'; -import {displayUsername} from './user_utils'; -import {getPreferencesByCategory} from './preference_utils'; import {hasNewPermissions} from 'selectors/entities/general'; import {haveITeamPermission, haveIChannelPermission} from 'selectors/entities/roles'; +import {Channel, ChannelMembership, ChannelType, ChannelNotifyProps} from 'types/channels'; +import {Post} from 'types/posts'; +import {UserProfile, UsersState, UserNotifyProps} from 'types/users'; +import {GlobalState} from 'types/store'; +import {TeamMembership} from 'types/teams'; +import {PreferenceType} from 'types/preferences'; +import {RelationOneToOne, IDMappedObjects} from 'types/utilities'; -import type {Channel, ChannelMembership, ChannelType, ChannelNotifyProps} from 'types/channels'; -import type {Post} from 'types/posts'; -import type {UserProfile, UsersState, UserNotifyProps} from 'types/users'; -import type {GlobalState} from 'types/store'; -import type {TeamMembership} from 'types/teams'; -import type {PreferenceType} from 'types/preferences'; -import type {RelationOneToOne, IDMappedObjects} from 'types/utilities'; - +import {getPreferencesByCategory} from './preference_utils'; +import {displayUsername} from './user_utils'; const channelTypeOrder = { [General.OPEN_CHANNEL]: 0, [General.PRIVATE_CHANNEL]: 1, @@ -33,29 +31,36 @@ const channelTypeOrder = { * favoriteChannels: [...] * } */ -export function buildDisplayableChannelList(usersState: UsersState, allChannels: Array, myMembers: RelationOneToOne, config: Object, myPreferences: {[string]: PreferenceType}, teammateNameDisplay: string, lastPosts: RelationOneToOne) { - const missingDirectChannels = createMissingDirectChannels(usersState.currentUserId, allChannels, myPreferences); - const {currentUserId, profiles} = usersState; +export function buildDisplayableChannelList(usersState: UsersState, allChannels: Array, myMembers: RelationOneToOne, config: any, myPreferences: { + [x: string]: PreferenceType; +}, teammateNameDisplay: string, lastPosts: RelationOneToOne) { + const missingDirectChannels = createMissingDirectChannels(usersState.currentUserId, allChannels, myPreferences); + const { + currentUserId, + profiles, + } = usersState; const locale = getUserLocale(currentUserId, profiles); - const channels = buildChannels(usersState, allChannels, missingDirectChannels, teammateNameDisplay, locale); const favoriteChannels = buildFavoriteChannels(channels, myPreferences, locale); const notFavoriteChannels = buildNotFavoriteChannels(channels, myPreferences); const directAndGroupChannels = buildDirectAndGroupChannels(notFavoriteChannels, myMembers, config, myPreferences, currentUserId, profiles, lastPosts); - return { favoriteChannels, - publicChannels: (notFavoriteChannels.filter(isOpenChannel): Array), - privateChannels: (notFavoriteChannels.filter(isPrivateChannel): Array), + publicChannels: (notFavoriteChannels.filter(isOpenChannel) as Array), + privateChannels: (notFavoriteChannels.filter(isPrivateChannel) as Array), directAndGroupChannels, }; } -export function buildDisplayableChannelListWithUnreadSection(usersState: UsersState, myChannels: Array, myMembers: RelationOneToOne, config: Object, myPreferences: {[string]: PreferenceType}, teammateNameDisplay: string, lastPosts: RelationOneToOne) { - const {currentUserId, profiles} = usersState; +export function buildDisplayableChannelListWithUnreadSection(usersState: UsersState, myChannels: Array, myMembers: RelationOneToOne, config: any, myPreferences: { + [x: string]: PreferenceType; +}, teammateNameDisplay: string, lastPosts: RelationOneToOne) { + const { + currentUserId, + profiles, + } = usersState; const locale = getUserLocale(currentUserId, profiles); - const missingDirectChannels = createMissingDirectChannels(currentUserId, myChannels, myPreferences); const channels = buildChannels(usersState, myChannels, missingDirectChannels, teammateNameDisplay, locale); const unreadChannels = [...buildChannelsWithMentions(channels, myMembers, locale), ...buildUnreadChannels(channels, myMembers, locale)]; @@ -63,12 +68,11 @@ export function buildDisplayableChannelListWithUnreadSection(usersState: UsersSt const favoriteChannels = buildFavoriteChannels(notUnreadChannels, myPreferences, locale); const notFavoriteChannels = buildNotFavoriteChannels(notUnreadChannels, myPreferences); const directAndGroupChannels = buildDirectAndGroupChannels(notFavoriteChannels, myMembers, config, myPreferences, currentUserId, profiles, lastPosts); - return { unreadChannels, favoriteChannels, - publicChannels: (notFavoriteChannels.filter(isOpenChannel): Array), - privateChannels: (notFavoriteChannels.filter(isPrivateChannel): Array), + publicChannels: (notFavoriteChannels.filter(isOpenChannel) as Array), + privateChannels: (notFavoriteChannels.filter(isPrivateChannel) as Array), directAndGroupChannels, }; } @@ -113,7 +117,7 @@ export function cleanUpUrlable(input: string): string { return cleaned; } -export function getChannelByName(channels: IDMappedObjects, name: string): ?Channel { +export function getChannelByName(channels: IDMappedObjects, name: string): Channel | undefined | null { const channelIds = Object.keys(channels); for (let i = 0; i < channelIds.length; i++) { const id = channelIds[i]; @@ -148,17 +152,19 @@ export function getUserIdFromChannelName(userId: string, channelName: string): s return otherUserId; } -export function isAutoClosed(config: Object, myPreferences: {[string]: PreferenceType}, channel: Channel, channelActivity: number, channelArchiveTime: number, currentChannelId: string = ''): boolean { - const cutoff = new Date().getTime() - (7 * 24 * 60 * 60 * 1000); - +export function isAutoClosed(config: any, myPreferences: { + [x: string]: PreferenceType; +}, channel: Channel, channelActivity: number, channelArchiveTime: number, currentChannelId = ''): boolean { + const cutoff = new Date().getTime() - 7 * 24 * 60 * 60 * 1000; const viewTimePref = myPreferences[`${Preferences.CATEGORY_CHANNEL_APPROXIMATE_VIEW_TIME}--${channel.id}`]; - const viewTime = viewTimePref ? parseInt(viewTimePref.value, 10) : 0; + const viewTime = viewTimePref ? parseInt(viewTimePref.value!, 10) : 0; + if (viewTime > cutoff) { return false; } const openTimePref = myPreferences[`${Preferences.CATEGORY_CHANNEL_OPEN_TIME}--${channel.id}`]; - const openTime = openTimePref ? parseInt(openTimePref.value, 10) : 0; + const openTime = openTimePref ? parseInt(openTimePref.value!, 10) : 0; // Only close archived channels when not being viewed if (channel.id !== currentChannelId && channelArchiveTime && channelArchiveTime > openTime) { @@ -186,7 +192,9 @@ export function isDirectChannel(channel: Channel): boolean { return channel.type === General.DM_CHANNEL; } -export function isDirectChannelVisible(otherUserOrOtherUserId: UserProfile | string, config: Object, myPreferences: {[string]: PreferenceType}, channel: Channel, lastPost?: ?Post, isUnread?: boolean, currentChannelId: string = ''): boolean { +export function isDirectChannelVisible(otherUserOrOtherUserId: UserProfile | string, config: any, myPreferences: { + [x: string]: PreferenceType; +}, channel: Channel, lastPost?: Post | null, isUnread?: boolean, currentChannelId = ''): boolean { const otherUser = typeof otherUserOrOtherUserId === 'object' ? otherUserOrOtherUserId : null; const otherUserId = typeof otherUserOrOtherUserId === 'object' ? otherUserOrOtherUserId.id : otherUserOrOtherUserId; const dm = myPreferences[`${Preferences.CATEGORY_DIRECT_CHANNEL_SHOW}--${otherUserId}`]; @@ -200,7 +208,9 @@ export function isGroupChannel(channel: Channel): boolean { return channel.type === General.GM_CHANNEL; } -export function isGroupChannelVisible(config: Object, myPreferences: {[string]: PreferenceType}, channel: Channel, lastPost?: Post, isUnread?: boolean): boolean { +export function isGroupChannelVisible(config: any, myPreferences: { + [x: string]: PreferenceType; +}, channel: Channel, lastPost?: Post, isUnread?: boolean): boolean { const gm = myPreferences[`${Preferences.CATEGORY_GROUP_CHANNEL_SHOW}--${channel.id}`]; if (!gm || gm.value !== 'true') { return false; @@ -208,7 +218,9 @@ export function isGroupChannelVisible(config: Object, myPreferences: {[string]: return isUnread || !isAutoClosed(config, myPreferences, channel, lastPost ? lastPost.create_at : 0, 0); } -export function isGroupOrDirectChannelVisible(channel: Channel, memberships: RelationOneToOne, config: Object, myPreferences: {[string]: PreferenceType}, currentUserId: string, users: IDMappedObjects, lastPosts: RelationOneToOne): boolean { +export function isGroupOrDirectChannelVisible(channel: Channel, memberships: RelationOneToOne, config: any, myPreferences: { + [x: string]: PreferenceType; +}, currentUserId: string, users: IDMappedObjects, lastPosts: RelationOneToOne): boolean { const lastPost = lastPosts[channel.id]; if (isGroupChannel(channel) && isGroupChannelVisible(config, myPreferences, channel, lastPost, isUnreadChannel(memberships, channel))) { return true; @@ -220,7 +232,7 @@ export function isGroupOrDirectChannelVisible(channel: Channel, memberships: Rel return isDirectChannelVisible(users[otherUserId] || otherUserId, config, myPreferences, channel, lastPost, isUnreadChannel(memberships, channel)); } -export function showCreateOption(state: GlobalState, config: Object, license: Object, teamId: string, channelType: ChannelType, isAdmin: boolean, isSystemAdmin: boolean): boolean { +export function showCreateOption(state: GlobalState, config: any, license: any, teamId: string, channelType: ChannelType, isAdmin: boolean, isSystemAdmin: boolean): boolean { if (hasNewPermissions(state)) { if (channelType === General.OPEN_CHANNEL) { return haveITeamPermission(state, {team: teamId, permission: Permissions.CREATE_PUBLIC_CHANNEL}); @@ -252,7 +264,7 @@ export function showCreateOption(state: GlobalState, config: Object, license: Ob return true; } -export function showManagementOptions(state: GlobalState, config: Object, license: Object, channel: Channel, isAdmin: boolean, isSystemAdmin: boolean, isChannelAdmin: boolean): boolean { +export function showManagementOptions(state: GlobalState, config: any, license: any, channel: Channel, isAdmin: boolean, isSystemAdmin: boolean, isChannelAdmin: boolean): boolean { if (hasNewPermissions(state)) { if (channel.type === General.OPEN_CHANNEL) { return haveIChannelPermission(state, {channel: channel.id, team: channel.team_id, permission: Permissions.MANAGE_PUBLIC_CHANNEL_PROPERTIES}); @@ -292,7 +304,7 @@ export function showManagementOptions(state: GlobalState, config: Object, licens return true; } -export function showDeleteOption(state: GlobalState, config: Object, license: Object, channel: Channel, isAdmin: boolean, isSystemAdmin: boolean, isChannelAdmin: boolean): boolean { +export function showDeleteOption(state: GlobalState, config: any, license: any, channel: Channel, isAdmin: boolean, isSystemAdmin: boolean, isChannelAdmin: boolean): boolean { if (hasNewPermissions(state)) { if (channel.type === General.OPEN_CHANNEL) { return haveIChannelPermission(state, {channel: channel.id, team: channel.team_id, permission: Permissions.DELETE_PUBLIC_CHANNEL}); @@ -333,7 +345,8 @@ export function showDeleteOption(state: GlobalState, config: Object, license: Ob } // Backwards compatibility with pre-advanced permissions config settings. -export function canManageMembersOldPermissions(channel: Channel, user: UserProfile, teamMember: TeamMembership, channelMember: ChannelMembership, config: Object, license: Object): boolean { + +export function canManageMembersOldPermissions(channel: Channel, user: UserProfile, teamMember: TeamMembership, channelMember: ChannelMembership, config: any, license: any): boolean { if (channel.type === General.DM_CHANNEL || channel.type === General.GM_CHANNEL || channel.name === General.DEFAULT_CHANNEL) { @@ -372,11 +385,11 @@ export function getChannelsIdForTeam(state: GlobalState, teamId: string): Array< res.push(channel.id); } return res; - }, []); + }, [] as string[]); } export function getGroupDisplayNameFromUserIds(userIds: Array, profiles: IDMappedObjects, currentUserId: string, teammateNameDisplay: string): string { - const names = []; + const names: string[] = []; userIds.forEach((id) => { if (id !== currentUserId) { names.push(displayUsername(profiles[id], teammateNameDisplay)); @@ -391,7 +404,9 @@ export function getGroupDisplayNameFromUserIds(userIds: Array, profiles: return names.sort(sortUsernames).join(', '); } -export function isFavoriteChannel(myPreferences: {[string]: PreferenceType}, id: string) { +export function isFavoriteChannel(myPreferences: { + [x: string]: PreferenceType; +}, id: string) { const fav = myPreferences[`${Preferences.CATEGORY_FAVORITE_CHANNEL}--${id}`]; return fav ? fav.value === 'true' : false; } @@ -411,7 +426,7 @@ function createFakeChannel(userId: string, otherUserId: string): Channel { extra_update_at: 0, last_post_at: 0, total_msg_count: 0, - type: General.DM_CHANNEL, + type: General.DM_CHANNEL as ChannelType, fake: true, team_id: '', scheme_id: '', @@ -424,11 +439,13 @@ function createFakeChannel(userId: string, otherUserId: string): Channel { }; } -function createFakeChannelCurried(userId: string): (string) => Channel { +function createFakeChannelCurried(userId: string): (a: string) => Channel { return (otherUserId) => createFakeChannel(userId, otherUserId); } -function createMissingDirectChannels(currentUserId: string, allChannels: Array, myPreferences: {[string]: PreferenceType}): Array { +function createMissingDirectChannels(currentUserId: string, allChannels: Array, myPreferences: { + [x: string]: PreferenceType; +}): Array { const directChannelsDisplayPreferences = getPreferencesByCategory(myPreferences, Preferences.CATEGORY_DIRECT_CHANNEL_SHOW); return Array. @@ -451,7 +468,7 @@ function completeDirectGroupInfo(usersState, teammateNameDisplay, channel) { const usernames = gm.display_name.split(', '); const users = Object.keys(profiles).map((key) => profiles[key]); - const userIds = []; + const userIds: string[] = []; usernames.forEach((username: string) => { const u = users.find((p): boolean => p.username === username); if (u) { @@ -586,7 +603,7 @@ export function areChannelMentionsIgnored(channelMemberNotifyProps: ChannelNotif let ignoreChannelMentions = channelMemberNotifyProps && channelMemberNotifyProps.ignore_channel_mentions; if (!ignoreChannelMentions || ignoreChannelMentions === Users.IGNORE_CHANNEL_MENTIONS_DEFAULT) { - ignoreChannelMentions = ignoreChannelMentionsDefault; + ignoreChannelMentions = ignoreChannelMentionsDefault as any; } return ignoreChannelMentions !== Users.IGNORE_CHANNEL_MENTIONS_OFF; @@ -595,20 +612,26 @@ export function areChannelMentionsIgnored(channelMemberNotifyProps: ChannelNotif function buildChannels(usersState: UsersState, channels: Array, missingDirectChannels: Array, teammateNameDisplay: string, locale: string): Array { return channels. concat(missingDirectChannels). - map(completeDirectChannelInfo.bind(null, usersState, teammateNameDisplay)). + map((c) => completeDirectChannelInfo(usersState, teammateNameDisplay, c)). filter(isNotDeletedChannel). sort(sortChannelsByTypeAndDisplayName.bind(null, locale)); } -function buildFavoriteChannels(channels: Array, myPreferences: {[string]: PreferenceType}, locale: string): Array { +function buildFavoriteChannels(channels: Array, myPreferences: { + [x: string]: PreferenceType; +}, locale: string): Array { return channels.filter((channel) => isFavoriteChannel(myPreferences, channel.id)).sort(sortChannelsByDisplayName.bind(null, locale)); } -function buildNotFavoriteChannels(channels: Array, myPreferences: {[string]: PreferenceType}): Array { +function buildNotFavoriteChannels(channels: Array, myPreferences: { + [x: string]: PreferenceType; +}): Array { return channels.filter((channel) => !isFavoriteChannel(myPreferences, channel.id)); } -function buildDirectAndGroupChannels(channels: Array, memberships: RelationOneToOne, config: Object, myPreferences: {[string]: PreferenceType}, currentUserId: string, users: IDMappedObjects, lastPosts: RelationOneToOne): Array { +function buildDirectAndGroupChannels(channels: Array, memberships: RelationOneToOne, config: any, myPreferences: { + [x: string]: PreferenceType; +}, currentUserId: string, users: IDMappedObjects, lastPosts: RelationOneToOne): Array { return channels.filter((channel) => { return isGroupOrDirectChannelVisible(channel, memberships, config, myPreferences, currentUserId, users, lastPosts); }); diff --git a/src/utils/deep_freeze.js b/src/utils/deep_freeze.ts similarity index 88% rename from src/utils/deep_freeze.js rename to src/utils/deep_freeze.ts index 73eaeb026..2fc351cb5 100644 --- a/src/utils/deep_freeze.js +++ b/src/utils/deep_freeze.ts @@ -1,4 +1,3 @@ -// @flow /** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. @@ -8,11 +7,8 @@ * of patent rights can be found in the PATENTS file in the same directory. * */ -/* eslint-disable header/header */ -const disableOnIe11 = - window && window.navigator && window.navigator.userAgent && - window.navigator.userAgent.indexOf('Trident') !== -1; +/* eslint-disable header/header */ /** * If your application is accepting different values for the same field over @@ -31,11 +27,9 @@ const disableOnIe11 = * Freezing the object and adding the throw mechanism is expensive and will * only be used in DEV. */ -export default function deepFreezeAndThrowOnMutation(object: Object): Object { + +export default function deepFreezeAndThrowOnMutation(object: any): any { // Some objects in IE11 don't have a hasOwnProperty method so don't even bother trying to freeze them - if (disableOnIe11) { - return object; - } if (typeof object !== 'object' || object === null || Object.isFrozen(object) || Object.isSealed(object)) { return object; diff --git a/src/utils/delayed_action.js b/src/utils/delayed_action.ts similarity index 91% rename from src/utils/delayed_action.js rename to src/utils/delayed_action.ts index 9556b755b..64a3e3b83 100644 --- a/src/utils/delayed_action.js +++ b/src/utils/delayed_action.ts @@ -1,10 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export default class DelayedAction { - action: Function - timer: TimeoutID | null + action: Function; + timer: NodeJS.Timeout | null; constructor(action: Function) { this.action = action; diff --git a/src/utils/emoji_utils.js b/src/utils/emoji_utils.ts similarity index 88% rename from src/utils/emoji_utils.js rename to src/utils/emoji_utils.ts index cc0fcb70e..b54cf47d4 100644 --- a/src/utils/emoji_utils.js +++ b/src/utils/emoji_utils.ts @@ -1,20 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {Client4} from 'client'; - -import type {Emoji, SystemEmoji, CustomEmoji} from 'types/emojis'; - +import {Emoji, SystemEmoji, CustomEmoji} from 'types/emojis'; export function getEmojiImageUrl(emoji: Emoji): string { if (emoji.id) { return Client4.getEmojiRoute(emoji.id) + '/image'; } - const systemEmoji = ((emoji: any): SystemEmoji); - + const systemEmoji = ((emoji as any) as SystemEmoji); const filename = systemEmoji.filename || systemEmoji.aliases[0]; - return Client4.getSystemEmojiImageUrl(filename); } @@ -24,9 +18,7 @@ export function parseNeededCustomEmojisFromText(text: string, systemEmojis: Map< } const pattern = /:([A-Za-z0-9_-]+):/gi; - - const customEmojis = new Set(); - + const customEmojis = new Set(); let match; while ((match = pattern.exec(text)) !== null) { if (!match) { diff --git a/src/utils/event_emitter.js b/src/utils/event_emitter.ts similarity index 90% rename from src/utils/event_emitter.js rename to src/utils/event_emitter.ts index d19e7001b..171e422da 100644 --- a/src/utils/event_emitter.js +++ b/src/utils/event_emitter.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - function isFunction(obj: any): boolean { return typeof obj === 'function'; } @@ -18,8 +16,7 @@ class EventEmitter { this.listeners.set(label, []); } - // $FlowFixMe - this.listeners.get(label).push(callback); + this.listeners.get(label)!.push(callback); } on(label: string, callback: Function): void { @@ -32,7 +29,7 @@ class EventEmitter { if (listeners && listeners.length) { index = listeners.reduce((i, listener, idx) => { - return (isFunction(listener) && listener === callback) ? idx : i; + return isFunction(listener) && listener === callback ? idx : i; }, -1); if (index > -1) { diff --git a/src/utils/file_utils.js b/src/utils/file_utils.ts similarity index 92% rename from src/utils/file_utils.js rename to src/utils/file_utils.ts index 375d8b6b9..ba74131b5 100644 --- a/src/utils/file_utils.js +++ b/src/utils/file_utils.ts @@ -1,13 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {Files, General} from 'constants'; +import {Files, General} from '../constants'; import {Client4} from 'client'; import mimeDB from 'mime-db'; - -import type {FileInfo} from 'types/files'; - +import {FileInfo} from 'types/files'; export function getFormattedFileSize(file: FileInfo): string { const bytes = file.size; const fileSizes = [ @@ -20,9 +16,11 @@ export function getFormattedFileSize(file: FileInfo): string { const minBytes = unitAndMinBytes[1]; return bytes > minBytes; }); + if (size) { - return `${Math.floor(bytes / size[1])} ${size[0]}`; + return `${Math.floor(bytes / (size[1] as any))} ${size[0]}`; } + return `${bytes} B`; } @@ -68,8 +66,7 @@ export function lookupMimeType(filename: string): string { buildExtToMime(); } - const ext = filename.split('.').pop().toLowerCase(); - + const ext = filename.split('.').pop()!.toLowerCase(); return extToMime[ext] || 'application/octet-stream'; } diff --git a/src/utils/gfycat_sdk.js b/src/utils/gfycat_sdk.ts similarity index 86% rename from src/utils/gfycat_sdk.js rename to src/utils/gfycat_sdk.ts index dc1b8b5b0..64e9ff7a2 100644 --- a/src/utils/gfycat_sdk.js +++ b/src/utils/gfycat_sdk.ts @@ -1,16 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import Gfycat from 'gfycat-sdk'; - const defaultKey = '2_KtH_W5'; const defaultSecret = '3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof'; - -let activeKey = null; -let activeSecret = null; -let instance = null; - +let activeKey: string|null = null; +let activeSecret: string|null = null; +let instance: Gfycat|null = null; export default function(key: string, secret: string): Gfycat { if (instance && activeKey === key && activeSecret === secret) { return instance; diff --git a/src/utils/helpers.js b/src/utils/helpers.ts similarity index 84% rename from src/utils/helpers.js rename to src/utils/helpers.ts index 0c7f8d0ad..68a1f0e90 100644 --- a/src/utils/helpers.js +++ b/src/utils/helpers.ts @@ -1,17 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - import {createSelectorCreator, defaultMemoize} from 'reselect'; import shallowEqual from 'shallow-equals'; +export function memoizeResult(func: F): any { + let lastArgs: IArguments|null = null; + let lastResult = null; // we reference arguments instead of spreading them for performance reasons -export function memoizeResult(func: Function): Function { - let lastArgs = null; - let lastResult = null; - - // we reference arguments instead of spreading them for performance reasons - return function shallowCompare() { - if (!shallowEqual(lastArgs, arguments)) { //eslint-disable-line prefer-rest-params + return function shallowCompare(...args) { + if (!shallowEqual(lastArgs, args)) { + //eslint-disable-line prefer-rest-params // apply arguments instead of spreading for performance. const result = Reflect.apply(func, null, arguments); //eslint-disable-line prefer-rest-params if (!shallowEqual(lastResult, result)) { @@ -36,7 +33,7 @@ export const createShallowSelector = createSelectorCreator(defaultMemoize, shall // versions, and a non-equal minor version will ignore dot version. // currentVersion is a string, e.g '4.6.0' // minMajorVersion, minMinorVersion, minDotVersion are integers -export const isMinimumServerVersion = (currentVersion: string, minMajorVersion: number = 0, minMinorVersion: number = 0, minDotVersion: number = 0): boolean => { +export const isMinimumServerVersion = (currentVersion: string, minMajorVersion = 0, minMinorVersion = 0, minDotVersion = 0): boolean => { if (!currentVersion || typeof currentVersion !== 'string') { return false; } @@ -77,21 +74,20 @@ export const isMinimumServerVersion = (currentVersion: string, minMajorVersion: // Generates a RFC-4122 version 4 compliant globally unique identifier. export function generateId(): string { // implementation taken from http://stackoverflow.com/a/2117523 - var id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'; - + let id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'; id = id.replace(/[xy]/g, (c) => { - var r = Math.floor(Math.random() * 16); + const r = Math.floor(Math.random() * 16); + let v; - var v; if (c === 'x') { v = r; } else { - v = (r & 0x3) | 0x8; + // eslint-disable-next-line no-mixed-operators + v = r & 0x3 | 0x8; } return v.toString(16); }); - return id; } diff --git a/src/utils/i18n_utils.js b/src/utils/i18n_utils.ts similarity index 89% rename from src/utils/i18n_utils.js rename to src/utils/i18n_utils.ts index 9355e1676..e18c803d8 100644 --- a/src/utils/i18n_utils.js +++ b/src/utils/i18n_utils.ts @@ -1,9 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -let localizeFunction = null; - +let localizeFunction: Function|null = null; export function setLocalizeFunction(func: Function) { localizeFunction = func; } diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 000000000..52f502ff8 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,46 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import * as channel_utils from './channel_utils'; +import * as deep_freeze from './deep_freeze'; +import * as delayed_action from './delayed_action'; +import * as emoji_utils from './emoji_utils'; +import * as event_emitter from './event_emitter'; +import * as file_utils from './file_utils'; +import * as gfycat_sdk from './gfycat_sdk'; +import * as helpers from './helpers'; +import * as i18n_utils from './i18n_utils'; +import * as integration_utils from './integration_utils'; +import * as key_mirror from './key_mirror'; +import * as notify_props from './notify_props'; +import * as post_list from './post_list'; +import * as post_utils from './post_utils'; +import * as preference_utils from './preference_utils'; +import * as sentry from './sentry'; +import * as team_utils from './team_utils'; +import * as theme_utils from './theme_utils'; +import * as timezone_utils from './timezone_utils'; +import * as user_utils from './user_utils'; + +export { + channel_utils, + deep_freeze, + delayed_action, + emoji_utils, + event_emitter, + file_utils, + gfycat_sdk, + helpers, + i18n_utils, + integration_utils, + key_mirror, + notify_props, + post_list, + post_utils, + preference_utils, + sentry, + team_utils, + theme_utils, + timezone_utils, + user_utils, +}; diff --git a/src/utils/integration_utils.js b/src/utils/integration_utils.ts similarity index 88% rename from src/utils/integration_utils.js rename to src/utils/integration_utils.ts index c04eea9d2..e255aca81 100644 --- a/src/utils/integration_utils.js +++ b/src/utils/integration_utils.ts @@ -1,16 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow +import {DialogElement} from 'types/integrations'; -import type {DialogElement} from 'types/integrations'; - -type DialogError = {| - id: string, - defaultMessage: string, - values?: Object, -|}; - -export function checkDialogElementForError(elem: DialogElement, value: Object): ?DialogError { +type DialogError = { + id: string; + defaultMessage: string; + values?: any; +}; +export function checkDialogElementForError(elem: DialogElement, value: any): DialogError | undefined | null { if (!value && !elem.optional) { return { id: 'interactive_dialog.error.required', @@ -19,6 +16,7 @@ export function checkDialogElementForError(elem: DialogElement, value: Object): } const type = elem.type; + if (type === 'text' || type === 'textarea') { if (value && value.length < elem.min_length) { return { @@ -56,6 +54,7 @@ export function checkDialogElementForError(elem: DialogElement, value: Object): } } else if (type === 'radio') { const options = elem.options; + if (typeof value !== 'undefined' && Array.isArray(options) && !options.some((e) => e.value === value)) { return { id: 'interactive_dialog.error.invalid_option', @@ -69,7 +68,10 @@ export function checkDialogElementForError(elem: DialogElement, value: Object): // If we're returned errors that don't match any of the elements we have, // ignore them and complete the dialog -export function checkIfErrorsMatchElements(errors: {[string]: DialogError} = {}, elements: Array = []) { + +export function checkIfErrorsMatchElements(errors: { + [x: string]: DialogError; +} = {}, elements: Array = []) { for (const name in errors) { if (!errors.hasOwnProperty(name)) { continue; diff --git a/src/utils/key_mirror.js b/src/utils/key_mirror.ts similarity index 87% rename from src/utils/key_mirror.js rename to src/utils/key_mirror.ts index 65bf58d6a..e8c98b44f 100644 --- a/src/utils/key_mirror.js +++ b/src/utils/key_mirror.ts @@ -1,4 +1,3 @@ -// @flow /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -28,13 +27,12 @@ * @param {object} obj * @return {object} */ -export default function keyMirror(obj: T): $ObjMapi(K) => K> { +export default function keyMirror(obj: T): { [K in keyof T]: K } { if (!(obj instanceof Object && !Array.isArray(obj))) { throw new Error('keyMirror(...): Argument must be an object.'); } - type Out = {[string]: $Keys;} - const ret: Out = {}; + const ret: any = {}; for (const key in obj) { if (!obj.hasOwnProperty(key)) { continue; diff --git a/src/utils/notify_props.test.js b/src/utils/notify_props.test.js index bf2ab7501..75da41b1d 100644 --- a/src/utils/notify_props.test.js +++ b/src/utils/notify_props.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {Preferences} from 'constants'; +import {Preferences} from '../constants'; import {getEmailInterval} from 'utils/notify_props'; describe('user utils', () => { diff --git a/src/utils/notify_props.js b/src/utils/notify_props.ts similarity index 95% rename from src/utils/notify_props.js rename to src/utils/notify_props.ts index 4eadf80bc..b7c020993 100644 --- a/src/utils/notify_props.js +++ b/src/utils/notify_props.ts @@ -1,9 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {Preferences} from 'constants'; - +import {Preferences} from '../constants'; export function getEmailInterval(enableEmailNotification: boolean, enableEmailBatching: number, emailIntervalPreference: number): number { const { INTERVAL_NEVER, diff --git a/src/utils/post_list.js b/src/utils/post_list.ts similarity index 93% rename from src/utils/post_list.js rename to src/utils/post_list.ts index b829ec6fb..7546df586 100644 --- a/src/utils/post_list.js +++ b/src/utils/post_list.ts @@ -1,20 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. - import {createSelector} from 'reselect'; import moment from 'moment-timezone'; - -import {Posts, Preferences} from 'constants'; - +import {Posts, Preferences} from '../constants'; import {makeGetPostsForIds} from 'selectors/entities/posts'; import {getBool} from 'selectors/entities/preferences'; import {isTimezoneEnabled} from 'selectors/entities/timezone'; import {getCurrentUser} from 'selectors/entities/users'; - import {createIdsSelector, memoizeResult} from 'utils/helpers'; import {isUserActivityPost, shouldFilterJoinLeavePost} from 'utils/post_utils'; import {getUserCurrentTimezone} from 'utils/timezone_utils'; - +import {Post} from 'types/posts'; export const COMBINED_USER_ACTIVITY = 'user-activity-'; export const DATE_LINE = 'date-'; export const START_OF_NEW_MESSAGES = 'start-of-new-messages'; @@ -28,11 +24,9 @@ function shouldShowJoinLeaveMessages(state) { export function makePreparePostIdsForPostList() { const filterPostsAndAddSeparators = makeFilterPostsAndAddSeparators(); const combineUserActivityPosts = makeCombineUserActivityPosts(); - return (state, options) => { let postIds = filterPostsAndAddSeparators(state, options); postIds = combineUserActivityPosts(state, postIds); - return postIds; }; } @@ -56,9 +50,8 @@ export function makeFilterPostsAndAddSeparators() { return []; } - const out = []; - - let lastDate = null; + const out: string[] = []; + let lastDate; let addedNewMessagesIndicator = false; // Iterating through the posts from oldest to newest @@ -83,8 +76,11 @@ export function makeFilterPostsAndAddSeparators() { const currentOffset = postDate.getTimezoneOffset() * 60 * 1000; const timezone = getUserCurrentTimezone(currentUser.timezone); if (timezone) { - const timezoneOffset = moment.tz.zone(timezone).utcOffset(post.create_at) * 60 * 1000; - postDate.setTime(post.create_at + (currentOffset - timezoneOffset)); + const zone = moment.tz.zone(timezone); + if (zone) { + const timezoneOffset = zone.utcOffset(post.create_at) * 60 * 1000; + postDate.setTime(post.create_at + (currentOffset - timezoneOffset)); + } } } @@ -123,8 +119,7 @@ export function makeCombineUserActivityPosts() { (postIds, posts) => { let lastPostIsUserActivity = false; let combinedCount = 0; - - const out = []; + const out: string[] = []; let changed = false; for (let i = 0; i < postIds.length; i++) { @@ -316,12 +311,11 @@ export function comparePostTypes(a, b) { return postTypePriority[a.postType] - postTypePriority[b.postType]; } -function extractUserActivityData(userActivities) { - const messageData = []; - const allUserIds = []; - const allUsernames = []; - - Object.entries(userActivities).forEach(([postType, values]) => { +function extractUserActivityData(userActivities: any) { + const messageData: any[] = []; + const allUserIds: string[] = []; + const allUsernames: string[] = []; + Object.entries(userActivities).forEach(([postType, values]: [string, any]) => { if ( postType === Posts.POST_TYPES.ADD_TO_TEAM || postType === Posts.POST_TYPES.ADD_TO_CHANNEL || @@ -367,7 +361,7 @@ function extractUserActivityData(userActivities) { }; } -export function combineUserActivitySystemPost(systemPosts = []) { +export function combineUserActivitySystemPost(systemPosts: Array = []) { if (systemPosts.length === 0) { return null; } @@ -398,7 +392,11 @@ export function combineUserActivitySystemPost(systemPosts = []) { } combinedPostType[post.user_id] = users; } else { - const users = {ids: [], usernames: []}; + const users = { + ids: [] as string[], + usernames: [] as string[], + }; + if (userId) { users.ids.push(userId); } else if (username) { diff --git a/src/utils/post_utils.test.js b/src/utils/post_utils.test.js index e12272180..f23f6cdbb 100644 --- a/src/utils/post_utils.test.js +++ b/src/utils/post_utils.test.js @@ -4,7 +4,7 @@ import assert from 'assert'; import {PostTypes} from 'constants/posts'; -import {Permissions} from 'constants'; +import {Permissions} from '../constants'; import { canEditPost, diff --git a/src/utils/post_utils.js b/src/utils/post_utils.ts similarity index 88% rename from src/utils/post_utils.js rename to src/utils/post_utils.ts index c537ef7fc..a65312885 100644 --- a/src/utils/post_utils.js +++ b/src/utils/post_utils.ts @@ -1,24 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {General, Posts, Preferences, Permissions} from 'constants'; - +import {General, Posts, Preferences, Permissions} from '../constants'; import {hasNewPermissions} from 'selectors/entities/general'; import {haveIChannelPermission} from 'selectors/entities/roles'; -import {getPreferenceKey} from './preference_utils'; - -import type {GlobalState} from 'types/store.js'; -import type {PreferenceType} from 'types/preferences.js'; -import type {Post, PostType} from 'types/posts.js'; -import type {UserProfile} from 'types/users.js'; -import type {Team} from 'types/teams'; -import type {Channel} from 'types/channels'; +import {GlobalState} from 'types/store'; +import {PreferenceType} from 'types/preferences'; +import {Post, PostType} from 'types/posts'; +import {UserProfile} from 'types/users'; +import {Team} from 'types/teams'; +import {Channel} from 'types/channels'; +import {$ID} from 'types/utilities'; -import type {$ID} from 'types/utilities'; +import {getPreferenceKey} from './preference_utils'; -export function isPostFlagged(postId: $ID, myPreferences: {[string]: PreferenceType}): boolean { +export function isPostFlagged(postId: $ID, myPreferences: { + [x: string]: PreferenceType; +}): boolean { const key = getPreferenceKey(Preferences.CATEGORY_FLAGGED_POST, postId); return myPreferences.hasOwnProperty(key); } @@ -55,7 +53,7 @@ export function isEdited(post: Post): boolean { return post.edit_at > 0; } -export function canDeletePost(state: GlobalState, config: Object, license: Object, teamId: $ID, channelId: $ID, userId: $ID, post: Post, isAdmin: boolean, isSystemAdmin: boolean): boolean { +export function canDeletePost(state: GlobalState, config: any, license: any, teamId: $ID, channelId: $ID, userId: $ID, post: Post, isAdmin: boolean, isSystemAdmin: boolean): boolean { if (!post) { return false; } @@ -79,13 +77,12 @@ export function canDeletePost(state: GlobalState, config: Object, license: Objec return isOwner || isAdmin; } -export function canEditPost(state: GlobalState, config: Object, license: Object, teamId: $ID, channelId: $ID, userId: $ID, post: Post): boolean { +export function canEditPost(state: GlobalState, config: any, license: any, teamId: $ID, channelId: $ID, userId: $ID, post: Post): boolean { if (!post || isSystemMessage(post)) { return false; } const isOwner = isPostOwner(userId, post); - let canEdit = true; if (hasNewPermissions(state)) { @@ -194,7 +191,7 @@ export function comparePosts(a: Post, b: Post): number { return 0; } -export function isPostCommentMention({post, currentUser, threadRepliedToByCurrentUser, rootPost}: {post: Post, currentUser: UserProfile, threadRepliedToByCurrentUser: boolean, rootPost: Post}): boolean { +export function isPostCommentMention({post, currentUser, threadRepliedToByCurrentUser, rootPost}: {post: Post; currentUser: UserProfile; threadRepliedToByCurrentUser: boolean; rootPost: Post}): boolean { let commentsNotifyLevel = Preferences.COMMENTS_NEVER; let isCommentMention = false; let threadCreatedByCurrentUser = false; diff --git a/src/utils/preference_utils.js b/src/utils/preference_utils.ts similarity index 81% rename from src/utils/preference_utils.js rename to src/utils/preference_utils.ts index d90e33483..31396390a 100644 --- a/src/utils/preference_utils.js +++ b/src/utils/preference_utils.ts @@ -1,12 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - export function getPreferenceKey(category: string, name: string): string { return `${category}--${name}`; } -export function getPreferencesByCategory(myPreferences: Object, category: string): Map { +export function getPreferencesByCategory(myPreferences: any, category: string): Map { const prefix = `${category}--`; const preferences = new Map(); Object.keys(myPreferences).forEach((key) => { diff --git a/src/utils/sentry.js b/src/utils/sentry.ts similarity index 99% rename from src/utils/sentry.js rename to src/utils/sentry.ts index 95c9a8d3e..c69a29da0 100644 --- a/src/utils/sentry.js +++ b/src/utils/sentry.ts @@ -1,7 +1,5 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - // Given a URL from an API request, return a URL that has any parts removed that are either sensitive or that would // prevent properly grouping the messages in Sentry. export function cleanUrlForLogging(baseUrl: string, apiUrl: string): string { diff --git a/src/utils/team_utils.js b/src/utils/team_utils.ts similarity index 85% rename from src/utils/team_utils.js rename to src/utils/team_utils.ts index a873a1257..f3b031584 100644 --- a/src/utils/team_utils.js +++ b/src/utils/team_utils.ts @@ -1,11 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import type {Team} from 'types/teams'; -import type {IDMappedObjects} from 'types/utilities'; -import {General} from 'constants'; - +import {Team} from 'types/teams'; +import {IDMappedObjects} from 'types/utilities'; +import {General} from '../constants'; export function teamListToMap(teamList: Array): IDMappedObjects { const teams = {}; for (let i = 0; i < teamList.length; i++) { diff --git a/src/utils/theme_utils.js b/src/utils/theme_utils.ts similarity index 89% rename from src/utils/theme_utils.js rename to src/utils/theme_utils.ts index 416c0ef12..4d84f5171 100644 --- a/src/utils/theme_utils.js +++ b/src/utils/theme_utils.ts @@ -1,12 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -export function makeStyleFromTheme(getStyleFromTheme: (Object) => Object): (Object) => Object { - let lastTheme = null; - let style = null; - - return (theme: Object) => { +export function makeStyleFromTheme(getStyleFromTheme: (a: any) => any): (a: any) => any { + let lastTheme; + let style; + return (theme: any) => { if (!style || theme !== lastTheme) { style = getStyleFromTheme(theme); lastTheme = theme; @@ -18,7 +15,7 @@ export function makeStyleFromTheme(getStyleFromTheme: (Object) => Object): (Obje const rgbPattern = /^rgba?\((\d+),(\d+),(\d+)(?:,([\d.]+))?\)$/; -export function getComponents(inColor: string): {red: number, green: number, blue: number, alpha: number} { +export function getComponents(inColor: string): {red: number; green: number; blue: number; alpha: number} { let color = inColor; // RGB color diff --git a/src/utils/timezone_utils.js b/src/utils/timezone_utils.ts similarity index 79% rename from src/utils/timezone_utils.js rename to src/utils/timezone_utils.ts index 54cb795cc..5b70b462d 100644 --- a/src/utils/timezone_utils.js +++ b/src/utils/timezone_utils.ts @@ -1,10 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import type {UserTimezone} from 'types/users'; - -export function getUserCurrentTimezone(userTimezone: UserTimezone): ?string { +import {UserTimezone} from 'types/users'; +export function getUserCurrentTimezone(userTimezone?: UserTimezone): string | undefined | null { if (!userTimezone) { return null; } @@ -29,7 +26,7 @@ export function getTimezoneRegion(timezone: string): string { if (timezone) { const split = timezone.split('/'); if (split.length > 1) { - return split.pop().replace(/_/g, ' '); + return split.pop()!.replace(/_/g, ' '); } } diff --git a/src/utils/user_utils.test.js b/src/utils/user_utils.test.js index 9b7361b02..3f3e246f0 100644 --- a/src/utils/user_utils.test.js +++ b/src/utils/user_utils.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {Preferences} from 'constants'; +import {Preferences} from '../constants'; import { displayUsername, filterProfilesMatchingTerm, diff --git a/src/utils/user_utils.js b/src/utils/user_utils.ts similarity index 94% rename from src/utils/user_utils.js rename to src/utils/user_utils.ts index 2b65703c3..df8bafa1d 100644 --- a/src/utils/user_utils.js +++ b/src/utils/user_utils.ts @@ -1,13 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// @flow - -import {General, Preferences} from 'constants'; +import {General, Preferences} from '../constants'; import {localizeMessage} from 'utils/i18n_utils'; - -import type {UserProfile} from 'types/users'; -import type {IDMappedObjects, $ID} from 'types/utilities'; - +import {UserProfile} from 'types/users'; +import {IDMappedObjects, $ID} from 'types/utilities'; export function getFullName(user: UserProfile): string { if (user.first_name && user.last_name) { return user.first_name + ' ' + user.last_name; @@ -23,7 +19,7 @@ export function getFullName(user: UserProfile): string { export function displayUsername( user: UserProfile, teammateNameDisplay: string, - useFallbackUsername: boolean = true, + useFallbackUsername = true, ): string { let name = useFallbackUsername ? localizeMessage('channel_loader.someone', 'Someone') : ''; @@ -105,8 +101,8 @@ export function removeUserFromList(userId: $ID, list: Array { const splitTerm = term.split(splitStr); const initialSuggestions = splitTerm.map((st, i) => splitTerm.slice(i).join(splitStr)); + let suggestions: string[] = []; - let suggestions = []; if (splitStr === ' ') { suggestions = initialSuggestions; } else { @@ -117,7 +113,7 @@ export function getSuggestionsSplitBy(term: string, splitStr: string): Array { getSuggestionsSplitBy(term, val).forEach((suggestion) => acc.add(suggestion)); return acc; - }, new Set()); + }, new Set()); return [...suggestions]; } @@ -143,7 +139,7 @@ export function filterProfilesMatchingTerm(users: Array, term: stri return false; } - const profileSuggestions = []; + const profileSuggestions: string[] = []; const usernameSuggestions = getSuggestionsSplitByMultiple((user.username || '').toLowerCase(), General.AUTOCOMPLETE_SPLIT_CHARACTERS); profileSuggestions.push(...usernameSuggestions); const first = (user.first_name || '').toLowerCase(); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..400c2ea5a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,53 @@ +{ + "include": ["src"], + "exclude": ["node_modules", "build"], + "typeAcquisition": { + "enable": true + }, + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "lib": ["dom", "esnext"], + "allowJs": false, + "importHelpers": true, + "declaration": true, + "sourceMap": true, + "rootDir": "./src", + "outDir": "./", + "strict": false, + "noEmit": false, + "noImplicitAny": false, + "strictNullChecks": true, + "strictFunctionTypes": false, + "strictPropertyInitialization": true, + "noImplicitThis": false, + "alwaysStrict": true, + "noUnusedLocals": false, + "downlevelIteration": true, + "noUnusedParameters": false, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node", + "baseUrl": "./", + "paths": { + "utils/*": ["src/utils/*"], + "types/*": ["src/types/*"], + "constants/*": ["src/constants/*"], + "client": ["src/client"], + "selectors/*": ["src/selectors/*"], + "store/*": ["src/store/*"], + "action_types": ["src/action_types"], + "actions/*": ["src/action_types/*"], + "test/*": ["test/*"], + "*": ["src/*","node_modules/*"] + }, + "plugins": [ + { + "transform": "@zerollup/ts-transform-paths", + "exclude": ["*"] + } + ], + "jsx": "react", + "esModuleInterop": true + } +} diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 0e3f1b6be..000000000 --- a/webpack.config.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. -const path = require('path'); -const UglifyPlugin = require('uglifyjs-webpack-plugin'); - -module.exports = { - entry: { - client4: './src/client/client4.js', - websocket: './src/client/websocket_client.js', - }, - output: { - path: path.resolve(__dirname, 'lib'), - library: ['Mattermost', '[name]'], - filename: 'mattermost.[name].js', - }, - module: { - rules: [ - { - test: /\.js$/, - exclude: /(node_modules)/, - use: 'babel-loader', - }, - ], - }, - plugins: [ - new UglifyPlugin({sourceMap: true}), - ], - devtool: 'source-map', -};