diff --git a/client/.eslintrc.js b/client/.eslintrc.js new file mode 100644 index 000000000..bdd833da9 --- /dev/null +++ b/client/.eslintrc.js @@ -0,0 +1,23 @@ +module.exports = { + parser: 'babel-eslint', + extends: [ + 'airbnb-base', + 'plugin:react/recommended', + ], + rules: { + 'max-len': ['error', 140, 2], + 'no-underscore-dangle': 'off', + 'no-param-reassign': 'off', + 'react/prop-types': 0, + 'react/jsx-indent': ['error', 2], + }, + settings: { + 'react': { + 'pragma': 'React', + 'version': '16.5', + }, + }, + env: { + 'browser': true, + }, +}; diff --git a/client/package-lock.json b/client/package-lock.json index 9ebb00764..a0e36fd6a 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -227,9 +227,9 @@ "integrity": "sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg==" }, "acorn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", - "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", "dev": true }, "acorn-jsx": { @@ -239,9 +239,9 @@ "dev": true }, "ajv": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", - "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -263,9 +263,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": { @@ -381,6 +381,12 @@ "js-tokens": "^3.0.2" }, "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 + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -437,6 +443,27 @@ "eslint-visitor-keys": "^1.0.0" } }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -496,9 +523,9 @@ "integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU=" }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "circular-json": { @@ -730,16 +757,16 @@ "dev": true }, "eslint": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz", - "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", + "integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==", "dev": true, "requires": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", - "debug": "^3.1.0", + "debug": "^4.0.1", "doctrine": "^2.1.0", "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", @@ -751,11 +778,11 @@ "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", - "ignore": "^4.0.2", + "ignore": "^4.0.6", "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", + "inquirer": "^6.1.0", "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", + "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", "lodash": "^4.17.5", @@ -766,15 +793,24 @@ "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^2.0.0", + "regexpp": "^2.0.1", "require-uncached": "^1.0.3", - "semver": "^5.5.0", + "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^4.0.3", + "table": "^5.0.2", "text-table": "^0.2.0" }, "dependencies": { + "debug": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, "eslint-scope": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", @@ -787,6 +823,17 @@ } } }, + "eslint-config-airbnb-base": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz", + "integrity": "sha512-XWwQtf3U3zIoKO1BbHh6aUhJZQweOwSt4c2JrPDg9FP3Ltv3+YfEv7jIDB8275tVnO/qOHbfuYg3kzw6Je7uWw==", + "dev": true, + "requires": { + "eslint-restricted-globals": "^0.1.1", + "object.assign": "^4.1.0", + "object.entries": "^1.0.4" + } + }, "eslint-config-standard": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", @@ -953,6 +1000,12 @@ "integrity": "sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA==", "dev": true }, + "eslint-restricted-globals": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz", + "integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=", + "dev": true + }, "eslint-scope": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", @@ -1023,13 +1076,13 @@ "dev": true }, "external-editor": { - "version": "2.2.0", - "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, @@ -1219,6 +1272,14 @@ "dev": true, "requires": { "ansi-regex": "^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 + } } }, "has-flag": { @@ -1316,21 +1377,21 @@ "dev": true }, "inquirer": { - "version": "5.2.0", - "resolved": "http://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", + "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.1.0", + "external-editor": "^3.0.0", "figures": "^2.0.0", - "lodash": "^4.3.0", + "lodash": "^4.17.10", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rxjs": "^5.5.2", + "rxjs": "^6.1.0", "string-width": "^2.1.0", "strip-ansi": "^4.0.0", "through": "^2.3.6" @@ -1788,6 +1849,30 @@ "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", "dev": true }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.entries": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz", + "integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.6.1", + "function-bind": "^1.1.0", + "has": "^1.0.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2187,6 +2272,16 @@ "warning": "^4.0.1" } }, + "react-sortable-hoc": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/react-sortable-hoc/-/react-sortable-hoc-0.8.3.tgz", + "integrity": "sha512-vt2qQ9DnPLjGZ9osM2jBULdi7WfFXtYVuHvjHX8o2em7Rcla9FXIG60aWFbvvpFC1iXyATw5PWZX0B57EUOYfQ==", + "requires": { + "babel-runtime": "^6.11.6", + "invariant": "^2.2.1", + "prop-types": "^15.5.7" + } + }, "react-text-mask": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/react-text-mask/-/react-text-mask-5.4.1.tgz", @@ -2327,20 +2422,12 @@ "dev": true }, "rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", "dev": true, "requires": { - "symbol-observable": "1.0.1" - }, - "dependencies": { - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", - "dev": true - } + "tslib": "^1.9.0" } }, "safer-buffer": { @@ -2463,6 +2550,131 @@ "eslint-plugin-react": "~7.11.1", "eslint-plugin-standard": "~4.0.0", "standard-engine": "~9.0.0" + }, + "dependencies": { + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "eslint": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz", + "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==", + "dev": true, + "requires": { + "ajv": "^6.5.0", + "babel-code-frame": "^6.26.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.2", + "imurmurhash": "^0.1.4", + "inquirer": "^5.2.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.11.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.0", + "require-uncached": "^1.0.3", + "semver": "^5.5.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^4.0.3", + "text-table": "^0.2.0" + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "inquirer": { + "version": "5.2.0", + "resolved": "http://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", + "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.1.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^5.5.2", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "rxjs": { + "version": "5.5.12", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", + "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "dev": true, + "requires": { + "symbol-observable": "1.0.1" + } + }, + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", + "dev": true + }, + "table": { + "version": "4.0.3", + "resolved": "http://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" + } + } } }, "standard-engine": { @@ -2502,14 +2714,6 @@ "dev": true, "requires": { "ansi-regex": "^3.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-bom": { @@ -2539,15 +2743,13 @@ "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=" }, "table": { - "version": "4.0.3", - "resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", + "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", "dev": true, "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", + "ajv": "^6.5.3", + "lodash": "^4.17.10", "slice-ansi": "1.0.0", "string-width": "^2.1.1" } diff --git a/client/package.json b/client/package.json index 96d0f6959..2f3803efb 100644 --- a/client/package.json +++ b/client/package.json @@ -13,6 +13,10 @@ }, "devDependencies": { "babel-eslint": "^10.0.1", + "eslint": "^5.8.0", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-plugin-import": "^2.14.0", + "eslint-plugin-react": "^7.11.1", "react-hot-loader": "^4.3.11", "standard": "^12.0.1" }, @@ -28,6 +32,7 @@ "react": "^16.5.2", "react-apollo": "^2.2.4", "react-dom": "^16.6.0", - "react-router-dom": "^4.3.1" + "react-router-dom": "^4.3.1", + "react-sortable-hoc": "^0.8.3" } } diff --git a/client/src/Components/Event/Create/Tabs/Basic.js b/client/src/Components/Event/Create/Tabs/Basic.js new file mode 100644 index 000000000..b5e6e4353 --- /dev/null +++ b/client/src/Components/Event/Create/Tabs/Basic.js @@ -0,0 +1,109 @@ +import React from 'react'; +import { + TextField, + Button, + FormGroup, + Typography, + Grid, +} from '@material-ui/core'; +import { + ChevronLeft, + ChevronRight, +} from '@material-ui/icons'; +import { DateTimePicker } from 'material-ui-pickers'; + + +import { withStyles } from '@material-ui/core/styles'; +import styles from '../styles'; + + +class Basic extends React.Component { + render() { + const { classes, event, edit } = this.props; + return ( + + + These are the basic information you need to input in order to create an event. + There might be some heavy changes in the near future as the application is still at a very early stage. + + + + + edit('name', newVal.target.value)} + /> + edit('description', newVal.target.value)} + /> + + + The dates are purely indicative, as it is important for you to make sure everything is + ready before manually triggering the beginning and end of the event. + If you are confident use the scheduler to start it for you(incoming). + + + + + + } + rightArrowIcon={} + value={event.startDatetime} + helperText='Competition start date' + onChange={newVal => edit('startDatetime', newVal)} + /> + + + } + rightArrowIcon={} + value={event.finishDatetime} + helperText='Competition finishing date' + onChange={newVal => edit('finishDatetime', newVal)} + /> + + + + + + + + + + + ); + } +} + +export default withStyles(styles)(Basic); diff --git a/client/src/Components/Event/Create/Tabs/PresentationPage.js b/client/src/Components/Event/Create/Tabs/PresentationPage.js new file mode 100644 index 000000000..1c674ddcc --- /dev/null +++ b/client/src/Components/Event/Create/Tabs/PresentationPage.js @@ -0,0 +1,27 @@ +import React from 'react'; +import { Typography } from '@material-ui/core'; + +import { withStyles } from '@material-ui/core/styles'; +import styles from '../styles'; + + +class PresentationPage extends React.Component { + render() { + const { classes } = this.props; + return ( + + + PresentationPage + + + ); + } +} + +export default withStyles(styles)(PresentationPage); diff --git a/client/src/Components/Event/Create/Tabs/TeamsServer.js b/client/src/Components/Event/Create/Tabs/TeamsServer.js new file mode 100644 index 000000000..874c72d6f --- /dev/null +++ b/client/src/Components/Event/Create/Tabs/TeamsServer.js @@ -0,0 +1,27 @@ +import React from 'react'; +import { Typography } from '@material-ui/core'; + +import { withStyles } from '@material-ui/core/styles'; +import styles from '../styles'; + + +class TeamsServer extends React.Component { + render() { + const { classes } = this.props; + return ( + + + TeamsServer + + + ); + } +} + +export default withStyles(styles)(TeamsServer); diff --git a/client/src/Components/Event/Create/Tabs/Technical/NewFormula.js b/client/src/Components/Event/Create/Tabs/Technical/NewFormula.js new file mode 100644 index 000000000..11ef9356b --- /dev/null +++ b/client/src/Components/Event/Create/Tabs/Technical/NewFormula.js @@ -0,0 +1,80 @@ +import React from 'react'; +import { + Dialog, + DialogTitle, + DialogContent, + DialogContentText, + Button, + TextField, +} from '@material-ui/core'; + +import { Mutation } from 'react-apollo'; +import { getOptionsCalls } from '../../../../../GraphQL/Calls/index'; + +class NewFormula extends React.Component { + constructor() { + super(); + this.state = { name: '' }; + } + + render() { + const { name } = this.state; + return ( + this.props.closeDialogs()} + aria-labelledby='createFormula-dialog-title' + > + + Create a new formula + + + + At least for now, all the formulas are publically available, creating it here will let you select it in the select element. + + + { + const { events_Formulas: formulas } = store.readQuery({ + query: getOptionsCalls.EVENTS_FORMULAS, + }); + store.writeQuery({ + query: getOptionsCalls.EVENTS_FORMULAS, + data: { events_Formulas: formulas.concat([data.events_CreateFormula]) }, + }); + this.props.closeDialogs(); + } + } + > + {createFormula => ( +
+
{ + e.preventDefault(); + createFormula({ + variables: { + formula: { name }, + }, + }); + }} + > + this.setState({ name: e.target.value })} + fullWidth + /> + + +
+ )} +
+ + +
+
+ ); + } +} + +export default NewFormula; diff --git a/client/src/Components/Event/Create/Tabs/Technical/NewPlotter.js b/client/src/Components/Event/Create/Tabs/Technical/NewPlotter.js new file mode 100644 index 000000000..2aeeb50b5 --- /dev/null +++ b/client/src/Components/Event/Create/Tabs/Technical/NewPlotter.js @@ -0,0 +1,110 @@ +import React from 'react'; +import { + Dialog, + DialogTitle, + DialogContent, + DialogContentText, + Button, + TextField, +} from '@material-ui/core'; + +import { Mutation } from 'react-apollo'; +import { getOptionsCalls } from '../../../../../GraphQL/Calls/index'; + +class NewPlotter extends React.Component { + constructor() { + super(); + this.state = { + name: '', + host: '', + repo: '', + moduleName: '', + }; + } + + render() { + const { + name, host, repo, moduleName, + } = this.state; + return ( + this.props.closeDialogs()} + aria-labelledby='createPlotter-dialog-title' + > + + Create a new plotter + + + + At least for now, all the plotters are publically available, creating it here will let you select it in the select element. + + + { + const { events_Plotters: plotters } = store.readQuery({ + query: getOptionsCalls.EVENTS_PLOTTERS, + }); + store.writeQuery({ + query: getOptionsCalls.EVENTS_PLOTTERS, + data: { events_Plotters: plotters.concat([data.events_CreatePlotter]) }, + }); + this.props.closeDialogs(); + } + } + > + {createPlotter => ( +
+
{ + e.preventDefault(); + createPlotter({ + variables: { + plotter: { + name, + host, + repo, + moduleName, + }, + }, + }); + }} + > + this.setState({ name: e.target.value })} + fullWidth + /> + this.setState({ host: e.target.value })} + fullWidth + /> + this.setState({ repo: e.target.value })} + fullWidth + /> + this.setState({ moduleName: e.target.value })} + fullWidth + /> + + +
+ )} +
+ + +
+
+ ); + } +} + +export default NewPlotter; diff --git a/client/src/Components/Event/Create/Tabs/Technical/index.js b/client/src/Components/Event/Create/Tabs/Technical/index.js new file mode 100644 index 000000000..438ad27f9 --- /dev/null +++ b/client/src/Components/Event/Create/Tabs/Technical/index.js @@ -0,0 +1,142 @@ +import React from 'react'; +import { Query } from 'react-apollo'; + +import { + Typography, + FormControl, + InputLabel, + Input, + Select, + FormHelperText, + MenuItem, + Grid, + Button, +} from '@material-ui/core'; +import { withStyles } from '@material-ui/core/styles'; +import styles from '../../styles'; + +import { getOptionsCalls } from '../../../../../GraphQL/Calls/index'; + +import NewPlotter from './NewPlotter'; +import NewFormula from './NewFormula'; + +class Technical extends React.Component { + constructor(props) { + super(props); + this.state = { + isNewFormulaOpen: false, + isNewPlotterOpen: false, + }; + } + + closeDialogs = () => { + this.setState({ isNewFormulaOpen: false, isNewPlotterOpen: false }); + } + + render() { + const { classes, event, edit } = this.props; + const { isNewPlotterOpen, isNewFormulaOpen } = this.state; + return ( + + + Select the formula and the plotter you want to use, you can also create your own with the corresponding button. + + + + Select the formula + + + {({ loading, error, data }) => { + if (loading) { + return ( + + ); + } + if (error) return `Error! ${error.message}`; + const selects = data.events_Formulas.map((formula, index) => ( + {formula.name} + )); + return ( + + + { isNewFormulaOpen ? this.closeDialogs()} /> : ''} + + ); + }} + + { this.setState({ isNewFormulaOpen: true }); }}> + To create a new formula, click here + + + + + Select the Plotter + + + {({ loading, error, data }) => { + if (loading) { + return ( + + ); + } + if (error) return `Error! ${error.message}`; + const selects = data.events_Plotters.map((plotter, index) => ( + {plotter.name} + )); + return ( + + + { isNewPlotterOpen ? this.closeDialogs()} /> : ''} + + ); + }} + + { this.setState({ isNewPlotterOpen: true }); }} > + To create a new plotter, click here + + + + + + + + + ); + } +} + +export default withStyles(styles)(Technical); diff --git a/client/src/Components/Event/Create/Tabs/index.js b/client/src/Components/Event/Create/Tabs/index.js new file mode 100644 index 000000000..feecaaf55 --- /dev/null +++ b/client/src/Components/Event/Create/Tabs/index.js @@ -0,0 +1,11 @@ +import Basic from './Basic'; +import PresentationPage from './PresentationPage'; +import TeamsServer from './TeamsServer'; +import Technical from './Technical'; + +export { + Basic, + PresentationPage, + TeamsServer, + Technical, +}; diff --git a/client/src/Components/Event/Create/index.js b/client/src/Components/Event/Create/index.js new file mode 100644 index 000000000..f281854c0 --- /dev/null +++ b/client/src/Components/Event/Create/index.js @@ -0,0 +1,165 @@ +import React from 'react'; +import { Mutation } from 'react-apollo'; +import { DateTime } from 'luxon'; + +import { + Paper, + Typography, + AppBar, + Tabs, + Tab, +} from '@material-ui/core'; +import { + Face as BasicIcon, + Alarm as TechnicalIcon, + Group as TeamAndServerIcon, + PresentToAll as PresentationIcon, +} from '@material-ui/icons'; +import { withStyles } from '@material-ui/core/styles'; +import styles from './styles'; + +import { + Basic, + PresentationPage, + TeamsServer, + Technical, +} from './Tabs'; + +import { hostedEventsCalls } from '../../../GraphQL/Calls'; + +function TabContainer(props) { + return ( + + {props.children} + + ); +} + +class Create extends React.Component { + constructor(props) { + super(props); + this.state = { + value: 0, + name: '', + description: '', + startDatetime: DateTime.local().plus({ days: 1 }).startOf('day'), + finishDatetime: DateTime.local().plus({ days: 8 }).startOf('day'), + formulaId: '', + plotterId: '', + }; + } + + handleTabChange = (event, value) => { + this.setState({ value }); + } + + handleEventChange = (newType, newVal) => { + this.setState({ [newType]: newVal }); + } + + render() { + const { + name, + description, + startDatetime, + finishDatetime, + value, + formulaId, + plotterId, + } = this.state; + const { classes } = this.props; + return ( + { + this.props.history.push(`/events/edit/${data.events_CreateEvent.id}`); + } + } + > + {hostEvent => ( +
+ + + } + /> + } + /> + } + disabled + /> + } + disabled + /> + + + + + Create a new event + +
{ + e.preventDefault(); + hostEvent({ + variables: { + event: { + name, + description, + startDatetime: startDatetime.valueOf() / 1000, + finishDatetime: finishDatetime.valueOf() / 1000, + formulaId, + plotterId, + }, + }, + }); + }} + > + {value === 0 && + this.handleEventChange(newType, newVal)} + /> + } + {value === 1 && + this.handleEventChange(newType, newVal)} + /> + } + {value === 2 && } + {value === 3 && } +
+
+
+ )} +
+ ); + } +} + +export default withStyles(styles)(Create); diff --git a/client/src/Components/Event/Create/styles.js b/client/src/Components/Event/Create/styles.js new file mode 100644 index 000000000..9d5460326 --- /dev/null +++ b/client/src/Components/Event/Create/styles.js @@ -0,0 +1,60 @@ +const styles = theme => ({ + root: { + flexGrow: 1, + width: '100%', + backgroundColor: theme.palette.background.paper, + padding: 0, + margin: 0, + }, + tabTitle: { + width: '25%', + maxWidth: 'none', + }, + clickable: { + cursor: 'pointer', + }, + card: { + flexGrow: 1, + padding: 20, + marginTop: 20, + marginBottom: 20, + marginLeft: 400, + marginRight: 400, + }, + buttonList: { + margin: theme.spacing.unit, + float: 'right', + }, + buttonGrid: { + marginTop: -20, + }, + title: { + marginTop: 20, + }, + paperRoot: { + width: '50%', + flexGrow: 1, + padding: 10, + marginLeft: '25%', + marginTop: '2%', + }, + inputField: { + width: '80%', + marginLeft: '10%', + marginTop: 25, + }, + typography: { + width: '80%', + marginLeft: '10%', + marginTop: 40, + }, + selectEmpty: { + marginTop: theme.spacing.unit * 2, + }, + bottomButton: { + padding: 15, + margin: 20, + }, +}); + +export default styles; diff --git a/client/src/Components/Event/Edit/index.js b/client/src/Components/Event/Edit/index.js index 1a17154bb..f63874df6 100644 --- a/client/src/Components/Event/Edit/index.js +++ b/client/src/Components/Event/Edit/index.js @@ -1,15 +1,15 @@ -import React from 'react' -import { Query } from 'react-apollo' +import React from 'react'; +import { Query } from 'react-apollo'; -import Typography from '@material-ui/core/Typography' -import { withStyles } from '@material-ui/core/styles' +import Typography from '@material-ui/core/Typography'; +import { withStyles } from '@material-ui/core/styles'; -import styles from './styles' +import styles from './styles'; -import { showEventCalls } from '../../../GraphQL/Calls/index' +import { showEventCalls } from '../../../GraphQL/Calls/index'; class Edit extends React.Component { - render () { + render() { return ( {({ loading, error, data }) => { - if (loading) return 'Loading...' - if (error) return `Error! ${error.message}` + if (loading) return 'Loading...'; + if (error) return `Error! ${error.message}`; return (

{data.events_Event.description}

- ) + ); }}
- ) + ); } } -export default withStyles(styles)(Edit) +export default withStyles(styles)(Edit); diff --git a/client/src/Components/Event/Edit/styles.js b/client/src/Components/Event/Edit/styles.js index 175dc52e5..12fd82051 100644 --- a/client/src/Components/Event/Edit/styles.js +++ b/client/src/Components/Event/Edit/styles.js @@ -1,4 +1,4 @@ -const styles = theme => ({ -}) +const styles = () => ({ +}); -export default styles +export default styles; diff --git a/client/src/Components/Event/Show/index.js b/client/src/Components/Event/Show/index.js index aaf59fb06..4c83b98bd 100644 --- a/client/src/Components/Event/Show/index.js +++ b/client/src/Components/Event/Show/index.js @@ -1,15 +1,15 @@ -import React from 'react' -import { Query } from 'react-apollo' +import React from 'react'; +import { Query } from 'react-apollo'; -import Typography from '@material-ui/core/Typography' -import { withStyles } from '@material-ui/core/styles' +import Typography from '@material-ui/core/Typography'; +import { withStyles } from '@material-ui/core/styles'; -import styles from './styles' +import styles from './styles'; -import { showEventCalls } from '../../../GraphQL/Calls/index' +import { showEventCalls } from '../../../GraphQL/Calls/index'; class Show extends React.Component { - render () { + render() { return ( {({ loading, error, data }) => { - if (loading) return 'Loading...' - if (error) return `Error! ${error.message}` + if (loading) return 'Loading...'; + if (error) return `Error! ${error.message}`; return (

{data.events_Event.description}

- ) + ); }}
- ) + ); } } -export default withStyles(styles)(Show) +export default withStyles(styles)(Show); diff --git a/client/src/Components/Event/Show/styles.js b/client/src/Components/Event/Show/styles.js index 175dc52e5..12fd82051 100644 --- a/client/src/Components/Event/Show/styles.js +++ b/client/src/Components/Event/Show/styles.js @@ -1,4 +1,4 @@ -const styles = theme => ({ -}) +const styles = () => ({ +}); -export default styles +export default styles; diff --git a/client/src/Components/Events/index.js b/client/src/Components/Events/index.js index 96d83a55d..dde254d73 100644 --- a/client/src/Components/Events/index.js +++ b/client/src/Components/Events/index.js @@ -1,9 +1,5 @@ -import React from 'react' +import React from 'react'; -class Index extends React.Component { - render () { - return

Here will come a list the competitions you applied for

- } -} +const Index = () =>

Here will come a list the competitions you applied for

; -export default Index +export default Index; diff --git a/client/src/Components/HostedEvents/Event.js b/client/src/Components/HostedEvents/Event.js index 47ad49c54..bab987a59 100644 --- a/client/src/Components/HostedEvents/Event.js +++ b/client/src/Components/HostedEvents/Event.js @@ -1,27 +1,27 @@ -import React from 'react' -import { Link } from 'react-router-dom' +import React from 'react'; +import { Link } from 'react-router-dom'; import { Grid, Paper, Typography, - Button -} from '@material-ui/core' -import { withStyles } from '@material-ui/core/styles' -import styles from './styles' + Button, +} from '@material-ui/core'; +import { withStyles } from '@material-ui/core/styles'; +import styles from './styles'; -import { toLocalTime } from '../../utils' +import { toLocalTime } from '../../utils'; class Event extends React.Component { - render () { - const classes = this.props.classes + render() { + const { classes } = this.props; const { + id, name, - designator, startDatetime, finishDatetime, host, - description - } = this.props.event + description, + } = this.props.event; return ( @@ -31,7 +31,9 @@ class Event extends React.Component { To : {toLocalTime(finishDatetime)} - Hosted by: {host.alias} ({host.lastName} {host.firstName}) + + Hosted by: {host.alias} ({host.lastName} {host.firstName}) + Formula: First prize: @@ -48,7 +50,7 @@ class Event extends React.Component { color='primary' size='small' component={Link} - to={`/edit/${designator}`} + to={`/events/edit/${id}`} > Edit @@ -58,7 +60,7 @@ class Event extends React.Component { color='primary' size='small' component={Link} - to={'/show/' + designator} + to={`/events/show/${id}`} > Show @@ -67,8 +69,8 @@ class Event extends React.Component { - ) + ); } } -export default withStyles(styles)(Event) +export default withStyles(styles)(Event); diff --git a/client/src/Components/HostedEvents/New.js b/client/src/Components/HostedEvents/New.js deleted file mode 100644 index 61b4d72ff..000000000 --- a/client/src/Components/HostedEvents/New.js +++ /dev/null @@ -1,98 +0,0 @@ -import React from 'react' -import { Mutation } from 'react-apollo' -import { hostedEventsCalls } from '../../GraphQL/Calls/index' -import { DateTime } from 'luxon' - -import { - Button, - TextField -} from '@material-ui/core' -import { ChevronLeft, ChevronRight } from '@material-ui/icons' -import { DateTimePicker } from 'material-ui-pickers' - -class New extends React.Component { - constructor (props) { - super(props) - this.state = { - name: '', - description: '', - startDatetime: DateTime.local().plus({ days: 1 }).startOf('day'), - finishDatetime: DateTime.local().plus({ days: 8 }).startOf('day') - } - } - - render () { - const { name, description, startDatetime, finishDatetime } = this.state - return ( - { - const { events_EventsByHost: hostedEvents } = store.readQuery({ query: hostedEventsCalls.EVENTS_EVENTSBYHOST }) - store.writeQuery({ - query: hostedEventsCalls.EVENTS_EVENTSBYHOST, - data: { events_EventsByHost: hostedEvents.concat([data.events_HostEvent]) } - }) - this.props.handleNewEvent(data.events_HostEvent) - } - } - > - {(hostEvent, { data }) => ( -
-
{ - e.preventDefault() - hostEvent({ variables: { - name: name, - description: description, - startDatetime: startDatetime.valueOf() / 1000, - finishDatetime: startDatetime.valueOf() / 1000 - } }) - }} - > - this.setState({ name: e.target.value })} - fullWidth - /> - this.setState({ description: e.target.value })} - fullWidth - /> - } - rightArrowIcon={} - value={startDatetime} - onChange={(date) => this.setState({ startDatetime: date })} - helperText='Competition start date' - /> - } - rightArrowIcon={} - value={finishDatetime} - onChange={(date) => this.setState({ finishDatetime: date })} - helperText='Competition finishing date' - /> - - -
this.clearTempStates()} /> -
- )} - - ) - } -} - -export default New diff --git a/client/src/Components/HostedEvents/index.js b/client/src/Components/HostedEvents/index.js index 248d0d929..32989e655 100644 --- a/client/src/Components/HostedEvents/index.js +++ b/client/src/Components/HostedEvents/index.js @@ -1,81 +1,30 @@ -import React from 'react' -import { Query } from 'react-apollo' +import React from 'react'; +import { Query } from 'react-apollo'; -import { - Button, - Dialog, - DialogContent, - DialogContentText, - DialogTitle -} from '@material-ui/core' +import { hostedEventsCalls } from '../../GraphQL/Calls/index'; -import { withStyles } from '@material-ui/core/styles' -import styles from './styles' +import Event from './Event'; -import { hostedEventsCalls } from '../../GraphQL/Calls/index' +const HostedEvent = () => ( + + + {({ loading, error, data }) => { + if (loading) return 'Loading...'; + if (error) return `Error! ${error.message}`; + const list = data.events_EventsByHost.map((event, index) => ( + + )); + return ( + + { list } + + ); + }} + + +); -import New from './New' -import Event from './Event' -class HostedEvent extends React.Component { - constructor (props) { - super(props) - this.state = { - isNewEventOpen: false - } - } - - handleNewEvent = (event) => { - this.props.history.push(`/edit/${event.designator}`) - }; - - render () { - const { classes } = this.props - return ( - - - - - {({ loading, error, data }) => { - if (loading) return 'Loading...' - if (error) return `Error! ${error.message}` - const list = data.events_EventsByHost.map((event, index) => { - return ( - - ) - }) - return ( - - { list } - - ) - }} - - - { this.setState({ isNewEventOpen: false }) }} - aria-labelledby='addEvent-dialog-title' - > - - Host an event - - - - Here you will add just the minimal information, will be settable in the edit page of your event. - - - - - - ) - } -} - -export default withStyles(styles)(HostedEvent) +export default HostedEvent; diff --git a/client/src/Components/HostedEvents/styles.js b/client/src/Components/HostedEvents/styles.js index e867e8174..866f1e2fc 100644 --- a/client/src/Components/HostedEvents/styles.js +++ b/client/src/Components/HostedEvents/styles.js @@ -5,22 +5,15 @@ const styles = theme => ({ marginTop: 20, marginBottom: 20, marginLeft: 400, - marginRight: 400 + marginRight: 400, }, buttonList: { margin: theme.spacing.unit, - float: 'right' + float: 'right', }, buttonGrid: { - marginTop: -20 + marginTop: -20, }, - addButton: { - display: 'block', - padding: 20, - marginTop: 20, - marginRight: 20, - marginLeft: 'auto' - } -}) +}); -export default styles +export default styles; diff --git a/client/src/Components/Search/Event.js b/client/src/Components/Search/Event.js index 8a3579416..1736098ee 100644 --- a/client/src/Components/Search/Event.js +++ b/client/src/Components/Search/Event.js @@ -1,27 +1,27 @@ -import React from 'react' -import { Link } from 'react-router-dom' +import React from 'react'; +import { Link } from 'react-router-dom'; import { Grid, Paper, Typography, - Button -} from '@material-ui/core' -import { withStyles } from '@material-ui/core/styles' -import styles from './styles' + Button, +} from '@material-ui/core'; +import { withStyles } from '@material-ui/core/styles'; +import styles from './styles'; -import { toLocalTime } from '../../utils' +import { toLocalTime } from '../../utils'; class Event extends React.Component { - render () { - const classes = this.props.classes + render() { + const { classes } = this.props; const { + id, name, - designator, startDatetime, finishDatetime, host, - description - } = this.props.event + description, + } = this.props.event; return ( @@ -31,7 +31,9 @@ class Event extends React.Component { To : {toLocalTime(finishDatetime)} - Hosted by: {host.alias} ({host.lastName} {host.firstName}) + + Hosted by: {host.alias} ({host.lastName} {host.firstName}) + Formula: First prize: @@ -48,7 +50,7 @@ class Event extends React.Component { color='primary' size='small' component={Link} - to={'/show/' + designator} + to={`/events/show/${id}`} > Show @@ -57,8 +59,8 @@ class Event extends React.Component { - ) + ); } } -export default withStyles(styles)(Event) +export default withStyles(styles)(Event); diff --git a/client/src/Components/Search/Tabs/Future.js b/client/src/Components/Search/Tabs/Future.js index 2a46f4995..d5dbfc089 100644 --- a/client/src/Components/Search/Tabs/Future.js +++ b/client/src/Components/Search/Tabs/Future.js @@ -1,21 +1,19 @@ -import React from 'react' -import { Typography } from '@material-ui/core' +import React from 'react'; +import { Typography } from '@material-ui/core'; -import { withStyles } from '@material-ui/core/styles' -import styles from '../styles' +import { withStyles } from '@material-ui/core/styles'; +import styles from '../styles'; -import Event from '../Event' +import Event from '../Event'; class Future extends React.Component { - render () { - const classes = this.props.classes - const { FutureEvents } = this.props + render() { + const { classes } = this.props; + const { FutureEvents } = this.props; - const futureEvents = FutureEvents.map((event, index) => { - return ( - - ) - }) + const futureEvents = FutureEvents.map((event, index) => ( + + )); return ( {futureEvents} - ) + ); } } -export default withStyles(styles)(Future) +export default withStyles(styles)(Future); diff --git a/client/src/Components/Search/Tabs/History.js b/client/src/Components/Search/Tabs/History.js index 0db046e5c..21d848289 100644 --- a/client/src/Components/Search/Tabs/History.js +++ b/client/src/Components/Search/Tabs/History.js @@ -1,12 +1,12 @@ -import React from 'react' -import { Typography } from '@material-ui/core' +import React from 'react'; +import { Typography } from '@material-ui/core'; -import { withStyles } from '@material-ui/core/styles' -import styles from '../styles' +import { withStyles } from '@material-ui/core/styles'; +import styles from '../styles'; class History extends React.Component { - render () { - const classes = this.props.classes + render() { + const { classes } = this.props; return ( Your old events (maybe here, maybe not, who knows) - ) + ); } } -export default withStyles(styles)(History) +export default withStyles(styles)(History); diff --git a/client/src/Components/Search/Tabs/Incoming.js b/client/src/Components/Search/Tabs/Incoming.js index 3956aa6d7..ab6b070dc 100644 --- a/client/src/Components/Search/Tabs/Incoming.js +++ b/client/src/Components/Search/Tabs/Incoming.js @@ -1,26 +1,22 @@ -import React from 'react' -import { Typography } from '@material-ui/core' +import React from 'react'; +import { Typography } from '@material-ui/core'; -import { withStyles } from '@material-ui/core/styles' -import styles from '../styles' +import { withStyles } from '@material-ui/core/styles'; +import styles from '../styles'; -import Event from '../Event' +import Event from '../Event'; class Incoming extends React.Component { - render () { - const classes = this.props.classes - const { IncomingEvents, OngoingEvents } = this.props + render() { + const { classes } = this.props; + const { IncomingEvents, OngoingEvents } = this.props; - const incomingEvents = IncomingEvents.map((event, index) => { - return ( - - ) - }) - const ongoingEvents = OngoingEvents.map((event, index) => { - return ( - - ) - }) + const incomingEvents = IncomingEvents.map((event, index) => ( + + )); + const ongoingEvents = OngoingEvents.map((event, index) => ( + + )); return ( {incomingEvents} - ) + ); } } -export default withStyles(styles)(Incoming) +export default withStyles(styles)(Incoming); diff --git a/client/src/Components/Search/Tabs/Past.js b/client/src/Components/Search/Tabs/Past.js index 60a6bc5aa..b01cb0684 100644 --- a/client/src/Components/Search/Tabs/Past.js +++ b/client/src/Components/Search/Tabs/Past.js @@ -1,21 +1,19 @@ -import React from 'react' -import { Typography } from '@material-ui/core' +import React from 'react'; +import { Typography } from '@material-ui/core'; -import { withStyles } from '@material-ui/core/styles' -import styles from '../styles' +import { withStyles } from '@material-ui/core/styles'; +import styles from '../styles'; -import Event from '../Event' +import Event from '../Event'; class Past extends React.Component { - render () { - const classes = this.props.classes - const { PastEvents } = this.props + render() { + const { classes } = this.props; + const { PastEvents } = this.props; - const pastEvents = PastEvents.map((event, index) => { - return ( - - ) - }) + const pastEvents = PastEvents.map((event, index) => ( + + )); return ( {pastEvents} - ) + ); } } -export default withStyles(styles)(Past) +export default withStyles(styles)(Past); diff --git a/client/src/Components/Search/Tabs/index.js b/client/src/Components/Search/Tabs/index.js index a4077c1ac..d15abeb9c 100644 --- a/client/src/Components/Search/Tabs/index.js +++ b/client/src/Components/Search/Tabs/index.js @@ -1,11 +1,11 @@ -import Future from './Future' -import History from './History' -import Incoming from './Incoming' -import Past from './Past' +import Future from './Future'; +import History from './History'; +import Incoming from './Incoming'; +import Past from './Past'; export { Future, History, Incoming, - Past -} + Past, +}; diff --git a/client/src/Components/Search/index.js b/client/src/Components/Search/index.js index 0d50b2f86..d1799aa7f 100644 --- a/client/src/Components/Search/index.js +++ b/client/src/Components/Search/index.js @@ -1,68 +1,70 @@ -import React from 'react' -import { Query } from 'react-apollo' -import { DateTime } from 'luxon' +import React from 'react'; +import { Query } from 'react-apollo'; +import { DateTime } from 'luxon'; import { Typography, AppBar, Tabs, - Tab -} from '@material-ui/core' + Tab, +} from '@material-ui/core'; import { GetApp as IncomingIcon, AlarmAdd as FutureIcon, - History as HistoryIcon -} from '@material-ui/icons' + History as HistoryIcon, +} from '@material-ui/icons'; -import { withStyles } from '@material-ui/core/styles' -import styles from './styles' +import { withStyles } from '@material-ui/core/styles'; +import styles from './styles'; -import { listEventsCalls } from '../../GraphQL/Calls/index' +import { listEventsCalls } from '../../GraphQL/Calls/index'; import { Future, History, Incoming, - Past -} from './Tabs' + Past, +} from './Tabs'; -function TabContainer (props) { +function TabContainer(props) { return ( {props.children} - ) + ); } class Search extends React.Component { - constructor (props) { - super(props) + constructor(props) { + super(props); this.state = { - value: 0 - } + value: 0, + }; } handleChange = (event, value) => { - this.setState({ value }) + this.setState({ value }); } - render () { - const classes = this.props.classes - const { value } = this.state + render() { + const { classes } = this.props; + const { value } = this.state; return ( {({ loading, error, data }) => { - if (loading) return 'Loading...' - if (error) return `Error! ${error.message}` - const now = ~~(DateTime.local().valueOf() / 1000) - const inTwoWeeks = ~~(DateTime.local().plus({ weeks: 2 }).valueOf() / 1000) + if (loading) return 'Loading...'; + if (error) return `Error! ${error.message}`; + const now = Math.floor(DateTime.local().valueOf() / 1000); + const inTwoWeeks = Math.floor(DateTime.local().plus({ weeks: 2 }).valueOf() / 1000); - const IncomingEvents = data.events_Events.filter(event => event.startDatetime > now && event.startDatetime < inTwoWeeks) - const OngoingEvents = data.events_Events.filter(event => event.finishDatetime > now && event.startDatetime < now) - const FutureEvents = data.events_Events.filter(event => event.startDatetime > now) - const PastEvents = data.events_Events.filter(event => event.finishDatetime < now) + const IncomingEvents = data.events_Events.filter(event => event.startDatetime > now + && event.startDatetime < inTwoWeeks); + const OngoingEvents = data.events_Events.filter(event => event.finishDatetime > now + && event.startDatetime < now); + const FutureEvents = data.events_Events.filter(event => event.startDatetime > now); + const PastEvents = data.events_Events.filter(event => event.finishDatetime < now); return ( @@ -98,17 +100,19 @@ class Search extends React.Component { /> - {value === 0 && } + {value === 0 && + + } {value === 1 && } {value === 2 && } {value === 3 && }
- ) + ); }} - ) + ); } } -export default withStyles(styles)(Search) +export default withStyles(styles)(Search); diff --git a/client/src/Components/Search/styles.js b/client/src/Components/Search/styles.js index 9981d904a..139e732cb 100644 --- a/client/src/Components/Search/styles.js +++ b/client/src/Components/Search/styles.js @@ -4,11 +4,11 @@ const styles = theme => ({ width: '100%', backgroundColor: theme.palette.background.paper, padding: 0, - margin: 0 + margin: 0, }, tabTitle: { width: '25%', - maxWidth: 'none' + maxWidth: 'none', }, card: { flexGrow: 1, @@ -16,18 +16,18 @@ const styles = theme => ({ marginTop: 20, marginBottom: 20, marginLeft: 400, - marginRight: 400 + marginRight: 400, }, buttonList: { margin: theme.spacing.unit, - float: 'right' + float: 'right', }, buttonGrid: { - marginTop: -20 + marginTop: -20, }, title: { - marginTop: 20 - } -}) + marginTop: 20, + }, +}); -export default styles +export default styles; diff --git a/client/src/Components/TopBar/data.js b/client/src/Components/TopBar/data.js index 8726e606d..89c775f60 100644 --- a/client/src/Components/TopBar/data.js +++ b/client/src/Components/TopBar/data.js @@ -1,11 +1,23 @@ -import GamesIcon from '@material-ui/icons/Games' -import SearchIcon from '@material-ui/icons/Search' -import LibraryAddIcon from '@material-ui/icons/LibraryAdd' +import { + Search, + GamepadRounded, + AccessibilityNew, + LibraryAdd, +} from '@material-ui/icons'; const data = [ - { title: 'Look for an event', to: '/', icon: SearchIcon, text: '' }, - { title: 'Events you are enrolled in', to: '/my', icon: GamesIcon, text: '' }, - { title: 'Host your own competition', to: '/host', icon: LibraryAddIcon, text: '' } -] + { + title: 'Look for an event', to: '/events/', icon: Search, text: '', + }, + { + title: 'Events you are enrolled in', to: '/events/my', icon: GamepadRounded, text: '', + }, + { + title: 'Your hosted competition', to: '/events/host', icon: AccessibilityNew, text: '', + }, + { + title: 'Host a new competition', to: '/events/create', icon: LibraryAdd, text: '', + }, +]; -export default data +export default data; diff --git a/client/src/Components/TopBar/index.js b/client/src/Components/TopBar/index.js index 06fe761f6..c3ac67581 100644 --- a/client/src/Components/TopBar/index.js +++ b/client/src/Components/TopBar/index.js @@ -1,16 +1,18 @@ -import React from 'react' -import { Link } from 'react-router-dom' -import classNames from 'classnames' +import React from 'react'; +import { Link } from 'react-router-dom'; +import classNames from 'classnames'; -import { AppBar, Toolbar, Typography, Button } from '@material-ui/core' -import { withStyles } from '@material-ui/core/styles' +import { + AppBar, Toolbar, Typography, Button, +} from '@material-ui/core'; +import { withStyles } from '@material-ui/core/styles'; -import datas from './data' -import styles from './styles' +import datas from './data'; +import styles from './styles'; -const TopBar = ({ classes, user, match }) => { +const TopBar = ({ classes }) => { const buttons = datas.map((data, index) => { - const Icon = data.icon + const Icon = data.icon; return ( ) - } - ) + ); + }); return (
@@ -36,7 +37,7 @@ const TopBar = ({ classes, user, match }) => {
- ) -} + ); +}; -export default withStyles(styles)(TopBar) +export default withStyles(styles)(TopBar); diff --git a/client/src/Components/TopBar/styles.js b/client/src/Components/TopBar/styles.js index 25cf9ab3b..675c55cab 100644 --- a/client/src/Components/TopBar/styles.js +++ b/client/src/Components/TopBar/styles.js @@ -1,37 +1,27 @@ const styles = theme => ({ root: { - flexGrow: 1 + flexGrow: 1, }, flex: { flexGrow: 1, - marginLeft: 30 - }, - menuButton: { - marginLeft: -12, - marginRight: 20 + marginLeft: 30, }, cssRoot: { color: '#FFFFFF', backgroundColor: theme.palette.secondary, '&:hover': { - backgroundColor: theme.palette.dark + backgroundColor: theme.palette.dark, }, whiteSpace: 'nowrap', paddingRight: 2 * theme.spacing.unit, - paddingLeft: 2 * theme.spacing.unit - }, - button: { - margin: theme.spacing.unit + paddingLeft: 2 * theme.spacing.unit, }, leftIcon: { - marginRight: theme.spacing.unit - }, - rightIcon: { - marginLeft: theme.spacing.unit + marginRight: theme.spacing.unit, }, iconSmall: { - fontSize: 20 - } -}) + fontSize: 20, + }, +}); -export default styles +export default styles; diff --git a/client/src/GraphQL/Calls/getOptions.js b/client/src/GraphQL/Calls/getOptions.js new file mode 100644 index 000000000..979ab6d2b --- /dev/null +++ b/client/src/GraphQL/Calls/getOptions.js @@ -0,0 +1,45 @@ +import gql from 'graphql-tag'; +import { formulaInfo, plotterInfo } from '../Fragments'; + +const EVENTS_FORMULAS = gql` + query Events_Formulas{ + events_Formulas { + ...FormulaInfo + } + } + ${formulaInfo} +`; + +const EVENTS_PLOTTERS = gql` + query Events_Plotters{ + events_Plotters { + ...PlotterInfo + } + } + ${plotterInfo} +`; + +const EVENTS_CREATEFORMULA = gql` + mutation Events_CreateFormula($formula: events_FormulaInput!) { + events_CreateFormula(formula: $formula) { + ...FormulaInfo + } + } + ${formulaInfo} +`; + +const EVENTS_CREATEPLOTTER = gql` + mutation Events_CreatePlotter($plotter: events_PlotterInput!) { + events_CreatePlotter(plotter: $plotter) { + ...PlotterInfo + } + } + ${plotterInfo} +`; + +export default { + EVENTS_PLOTTERS, + EVENTS_FORMULAS, + EVENTS_CREATEFORMULA, + EVENTS_CREATEPLOTTER, +}; diff --git a/client/src/GraphQL/Calls/hostedEvents.js b/client/src/GraphQL/Calls/hostedEvents.js index 05b3f77f2..563a9db2b 100644 --- a/client/src/GraphQL/Calls/hostedEvents.js +++ b/client/src/GraphQL/Calls/hostedEvents.js @@ -1,23 +1,23 @@ -import gql from 'graphql-tag' -import { eventMinimalInfo } from '../Fragments' +import gql from 'graphql-tag'; +import { eventMinimalInfo } from '../Fragments'; -const EVENTS_HOSTEVENT = gql` - mutation Hosts_HostEvent($name: String!, $description: String!, $startDatetime: Int!, $finishDatetime: Int!) { - events_HostEvent(name: $name, description: $description, startDatetime: $startDatetime, finishDatetime: $finishDatetime) { +const EVENTS_CREATEEVENT = gql` + mutation Events_CreateEvent($event: events_EventInput!) { + events_CreateEvent(event: $event) { ...EventMinimalInfo } } ${eventMinimalInfo} -` +`; const EVENTS_EVENTSBYHOST = gql` - query Hosts_EventsByHost{ + query Events_EventsByHost{ events_EventsByHost { ...EventMinimalInfo } } ${eventMinimalInfo} -` +`; export default { - EVENTS_HOSTEVENT, - EVENTS_EVENTSBYHOST -} + EVENTS_CREATEEVENT, + EVENTS_EVENTSBYHOST, +}; diff --git a/client/src/GraphQL/Calls/index.js b/client/src/GraphQL/Calls/index.js index d3fe57c6d..b8225b64b 100644 --- a/client/src/GraphQL/Calls/index.js +++ b/client/src/GraphQL/Calls/index.js @@ -1,9 +1,11 @@ -import hostedEventsCalls from './hostedEvents' -import listEventsCalls from './listEvents' -import showEventCalls from './showEvent' +import hostedEventsCalls from './hostedEvents'; +import listEventsCalls from './listEvents'; +import showEventCalls from './showEvent'; +import getOptionsCalls from './getOptions'; export { hostedEventsCalls, listEventsCalls, - showEventCalls -} + showEventCalls, + getOptionsCalls, +}; diff --git a/client/src/GraphQL/Calls/listEvents.js b/client/src/GraphQL/Calls/listEvents.js index c115eb746..6941002fc 100644 --- a/client/src/GraphQL/Calls/listEvents.js +++ b/client/src/GraphQL/Calls/listEvents.js @@ -1,14 +1,14 @@ -import gql from 'graphql-tag' -import { eventMinimalInfo } from '../Fragments' +import gql from 'graphql-tag'; +import { eventMinimalInfo } from '../Fragments'; const EVENTS_EVENTS = gql` - query Hosts_Events{ + query Events_Events{ events_Events { ...EventMinimalInfo } } ${eventMinimalInfo} -` +`; export default { - EVENTS_EVENTS -} + EVENTS_EVENTS, +}; diff --git a/client/src/GraphQL/Calls/showEvent.js b/client/src/GraphQL/Calls/showEvent.js index b26b0e0dc..855c9b510 100644 --- a/client/src/GraphQL/Calls/showEvent.js +++ b/client/src/GraphQL/Calls/showEvent.js @@ -1,15 +1,15 @@ -import gql from 'graphql-tag' -import { eventFullInfo } from '../Fragments' +import gql from 'graphql-tag'; +import { eventFullInfo } from '../Fragments'; const EVENTS_EVENT = gql` - query Hosts_Event($designator: ID!) { - events_Event(designator: $designator) { + query Events_Event($eventId: ID!) { + events_Event(eventId: $eventId) { ...EventFullInfo } } ${eventFullInfo} -` +`; export default { - EVENTS_EVENT -} + EVENTS_EVENT, +}; diff --git a/client/src/GraphQL/Fragments/event.js b/client/src/GraphQL/Fragments/event.js index 9fd7a4610..96be79f08 100644 --- a/client/src/GraphQL/Fragments/event.js +++ b/client/src/GraphQL/Fragments/event.js @@ -1,9 +1,10 @@ -import gql from 'graphql-tag' +import gql from 'graphql-tag'; export const eventMinimalInfo = gql` fragment EventMinimalInfo on events_Event { + id + state name - designator startDatetime finishDatetime host { @@ -13,11 +14,12 @@ export const eventMinimalInfo = gql` } description } -` +`; export const eventFullInfo = gql` fragment EventFullInfo on events_Event { - designator + id + state name host{ alias @@ -58,4 +60,4 @@ export const eventFullInfo = gql` } } } -` +`; diff --git a/client/src/GraphQL/Fragments/index.js b/client/src/GraphQL/Fragments/index.js index 93d8f9971..a28f9ce7c 100644 --- a/client/src/GraphQL/Fragments/index.js +++ b/client/src/GraphQL/Fragments/index.js @@ -1,9 +1,15 @@ import { eventMinimalInfo, - eventFullInfo -} from './event' + eventFullInfo, +} from './event'; +import { + formulaInfo, + plotterInfo, +} from './options'; export { eventMinimalInfo, - eventFullInfo -} + eventFullInfo, + formulaInfo, + plotterInfo, +}; diff --git a/client/src/GraphQL/Fragments/options.js b/client/src/GraphQL/Fragments/options.js new file mode 100644 index 000000000..c25a82d08 --- /dev/null +++ b/client/src/GraphQL/Fragments/options.js @@ -0,0 +1,22 @@ +import gql from 'graphql-tag'; + +export const plotterInfo = gql` + fragment PlotterInfo on events_Plotter { + id + ownerId + isTemplate + name + host + repo + moduleName + } +`; + +export const formulaInfo = gql` + fragment FormulaInfo on events_Formula { + id + ownerId + isTemplate + name + } +`; diff --git a/client/src/index.js b/client/src/index.js index 6989c8551..778b76313 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -1,58 +1,56 @@ -import React, { Component } from 'react' -import { Route, BrowserRouter, Switch } from 'react-router-dom' +import React, { Component } from 'react'; +import { Route, Switch } from 'react-router-dom'; -import { MuiPickersUtilsProvider } from 'material-ui-pickers' -import LuxonUtils from 'material-ui-pickers/utils/luxon-utils' +import { MuiPickersUtilsProvider } from 'material-ui-pickers'; +import LuxonUtils from 'material-ui-pickers/utils/luxon-utils'; -import { getItem } from './utils/local-storage' +import { getItem } from './utils/local-storage'; -import TopBar from './Components/TopBar' -import Search from './Components/Search' -import Events from './Components/Events' -import HostedEvents from './Components/HostedEvents' -import EditEvent from './Components/Event/Edit' +import TopBar from './Components/TopBar'; +import Search from './Components/Search'; +import Events from './Components/Events'; +import HostedEvents from './Components/HostedEvents'; +import EditEvent from './Components/Event/Edit'; +import CreateEvent from './Components/Event/Create'; class App extends Component { - constructor (props) { - super(props) + constructor(props) { + super(props); this.state = { - user: null - } + user: null, + }; } - async componentDidMount () { - let user = await getItem('user') + async componentDidMount() { + let user = await getItem('user'); if (user !== null && user !== undefined && user !== 'undefined') { - user = JSON.parse(user) - this.setState({ user }) + user = JSON.parse(user); + this.setState({ user }); } } - render () { - let loggedIn + render() { + let loggedIn; if (this.state.user !== null) { - loggedIn = () + loggedIn = (); } else { - loggedIn = '' + loggedIn = ''; } return ( - -
- {loggedIn} - - - - - - - -
-
+ {loggedIn} + + + + + + + +
- ) + ); } } -export default App +export default App; diff --git a/client/src/utils/index.js b/client/src/utils/index.js index 36ed3a467..2d2a69e07 100644 --- a/client/src/utils/index.js +++ b/client/src/utils/index.js @@ -1,10 +1,12 @@ export const toLocalTime = (epoch) => { - let localDate = new Date(0) - localDate.setUTCSeconds(epoch) - var options = { year: 'numeric', month: 'long', day: '2-digit' } + const localDate = new Date(0); + localDate.setUTCSeconds(epoch); + const options = { year: 'numeric', month: 'long', day: '2-digit' }; return ( - localDate.toLocaleDateString(options) + - ' at ' + - localDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' }) - ) -} + `${localDate.toLocaleDateString(options) + } at ${ + localDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })}` + ); +}; + +export const temporaryFunction = input => input; diff --git a/client/src/utils/local-storage.js b/client/src/utils/local-storage.js index 963ba0f36..9da53f424 100644 --- a/client/src/utils/local-storage.js +++ b/client/src/utils/local-storage.js @@ -1,9 +1,9 @@ -const getItem = async name => window.localStorage.getItem(name) -const setItem = async (name, value) => window.localStorage.setItem(name, value) -const removeItem = async name => window.localStorage.removeItem(name) +const getItem = async name => window.localStorage.getItem(name); +const setItem = async (name, value) => window.localStorage.setItem(name, value); +const removeItem = async name => window.localStorage.removeItem(name); export { getItem, setItem, - removeItem -} + removeItem, +}; diff --git a/server/.env.example b/server/.env.example index a96aeb926..25c16847a 100644 --- a/server/.env.example +++ b/server/.env.example @@ -1,3 +1,5 @@ +PRESHARED_GATEWAY_KEY=SECRET_STUFF + PORT=3000 DB_USERNAME=example_name DB_PASSWORD=example_password @@ -5,4 +7,4 @@ DB_DOMAIN=example.com:1234/example_name SENTRY_DNS=https://some-val@sentry.io/some-id -TEAMS_ENDPOINT=https://teams-api.advancedalgos.net/graphql/ +GATEWAY_ENDPOINT=https://app-api.advancedalgos.net/graphql/ diff --git a/server/.eslintrc.js b/server/.eslintrc.js index b41dc444e..c06bffbce 100644 --- a/server/.eslintrc.js +++ b/server/.eslintrc.js @@ -2,7 +2,8 @@ module.exports = { parser: 'babel-eslint', extends: 'airbnb-base', rules: { + 'max-len': ['error', 140, 2], 'no-underscore-dangle': 'off', - 'no-param-reassign': 'off' + 'no-param-reassign': 'off', } }; diff --git a/server/package-lock.json b/server/package-lock.json index c44492725..c73da79d8 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -4,6 +4,21 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@apollographql/apollo-upload-server": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-upload-server/-/apollo-upload-server-5.0.3.tgz", + "integrity": "sha512-tGAp3ULNyoA8b5o9LsU2Lq6SwgVPUOKAqKywu2liEtTvrFSGPrObwanhYwArq3GPeOqp2bi+JknSJCIU3oQN1Q==", + "requires": { + "@babel/runtime-corejs2": "^7.0.0-rc.1", + "busboy": "^0.2.14", + "object-path": "^0.11.4" + } + }, + "@apollographql/graphql-playground-html": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.4.tgz", + "integrity": "sha512-gwvaQO6/Hv4DEwhDLmmu2tzCU9oPjC5Xl9Kk8Yd0IxyKhYLlLalmkMMjsZLzU5H3fGaalLD96OYfxHL0ClVUDQ==" + }, "@babel/code-frame": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", @@ -117,6 +132,15 @@ "integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==", "dev": true }, + "@babel/runtime-corejs2": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.1.2.tgz", + "integrity": "sha512-drxaPByExlcRDKW4ZLubUO4ZkI8/8ax9k9wve1aEthdLKFzjB7XRkOQ0xoTIWGxqdDnWDElkjYq77bt7yrcYJQ==", + "requires": { + "core-js": "^2.5.7", + "regenerator-runtime": "^0.12.0" + } + }, "@babel/template": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz", @@ -187,44 +211,98 @@ } } }, - "@sentry/core": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.1.1.tgz", - "integrity": "sha512-QJExTxZ1ZA5P/To5gOwd3sowukXW0N/Q9nfu8biRDNa+YURn6ElLjO0fD6eIBqX1f3npo/kTiWZwFBc7LXEzSg==", + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", "requires": { - "@sentry/hub": "4.1.1", - "@sentry/minimal": "4.1.1", - "@sentry/types": "4.1.0", - "@sentry/utils": "4.1.1" + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@sentry/core": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-4.2.4.tgz", + "integrity": "sha512-Oqn6dQduKBIJ8DNTyA6Hp5Nj3sOH/P0buT02wIv9InIHmxBVJ0zj/b4zRmOOuz77ikglOf5WL3cavdWF/2l2PA==", + "requires": { + "@sentry/hub": "4.2.4", + "@sentry/minimal": "4.2.4", + "@sentry/types": "4.2.4", + "@sentry/utils": "4.2.4" } }, "@sentry/hub": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.1.1.tgz", - "integrity": "sha512-VmcZOgcbFjJzK1oQNwcFP/wgfoWQr24dFv1C0uwdXldNXx3mwyUVkomvklBHz90HwiahsI/gCc+ZmbC3ECQk2Q==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-4.2.4.tgz", + "integrity": "sha512-9X77HAGk/XT7k5OD4F+SUO3PIeLV1uMuzvGgw9cxxl/gSv70MO35bP6mJIVrA0U4NGtvmtYTTWsWB9moRCiE1g==", "requires": { - "@sentry/types": "4.1.0", - "@sentry/utils": "4.1.1" + "@sentry/types": "4.2.4", + "@sentry/utils": "4.2.4" } }, "@sentry/minimal": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.1.1.tgz", - "integrity": "sha512-xRKWA46OGnZinJyTljDUel53emPP9mb/XNi/kF6SBaVDOUXl7HAB8kP7Bn7eLBwOanxN8PbYoAzh/lIQXWTmDg==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-4.2.4.tgz", + "integrity": "sha512-IKzva0leEoP1ZOBh6NgIwqsvO2DM+GAKtCuNi0dfKYp1Qt6PLXHZQXaPim6kC0h/bKHe3+m/d4NXrpJdDrD7BQ==", "requires": { - "@sentry/hub": "4.1.1", - "@sentry/types": "4.1.0" + "@sentry/hub": "4.2.4", + "@sentry/types": "4.2.4" } }, "@sentry/node": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-4.1.1.tgz", - "integrity": "sha512-wbo8F2IqZW+exlOyQzQ7+bPNPXIYmG2g73ZgHFh0x3MHVOTSKgfiO3BzCqmFyUDhxqkEL23PQqLhM07GEtH3Bw==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-4.2.4.tgz", + "integrity": "sha512-82wPAOGqBhw1KvCkeeZXvCsWurOaZfEm3d7hfHXj5nnVbUr0Xb2HcRTNzBYPtMYXFZ9N0UNIn5nfGk7zmvpUuA==", "requires": { - "@sentry/core": "4.1.1", - "@sentry/hub": "4.1.1", - "@sentry/types": "4.1.0", - "@sentry/utils": "4.1.1", + "@sentry/core": "4.2.4", + "@sentry/hub": "4.2.4", + "@sentry/types": "4.2.4", + "@sentry/utils": "4.2.4", "cookie": "0.3.1", "lsmod": "1.0.0", "md5": "2.2.1", @@ -232,16 +310,112 @@ } }, "@sentry/types": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.1.0.tgz", - "integrity": "sha512-KY7B9wYs1NACHlYzG4OuP6k4uQJkyDPJppftjj3NJYShfwdDTO1I2Swkhhb5dJMEMMMpBJGxXmiqZ2mX5ErISQ==" + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-4.2.4.tgz", + "integrity": "sha512-oMtNVx1R4gMl2cECn8bNthSgEHBknES3yVZftyPbecOp3TwPb6MSbWdIWjxgVai1jXi9a/ZCuE/Zoypy33CBrA==" }, "@sentry/utils": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.1.1.tgz", - "integrity": "sha512-XMvGqAWATBrRkOF0lkt0Ij8of2mRmp4WeFTUAgiKzCekxfUBLBaTb4wTaFXz1cnnnjVTwcAq72qBRMhHwQ0IIg==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-4.2.4.tgz", + "integrity": "sha512-S8wZM6X642AhaUejhbYu1neU8IxtFhgc7JeVM5BmNivzXOW/hrTIDpDiDvYZLq1KhdSpH8+Z8WnntmGWhW4PFg==", "requires": { - "@sentry/types": "4.1.0" + "@sentry/types": "4.2.4" + } + }, + "@types/accepts": { + "version": "1.3.5", + "resolved": "http://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/body-parser": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", + "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.32", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", + "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", + "requires": { + "@types/node": "*" + } + }, + "@types/cors": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.4.tgz", + "integrity": "sha512-ipZjBVsm2tF/n8qFGOuGBkUij9X9ZswVi9G3bx/6dz7POpVa6gVHcj1wsX/LVEn9MMF41fxK/PnZPPoTD1UFPw==", + "requires": { + "@types/express": "*" + } + }, + "@types/events": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", + "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" + }, + "@types/express": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.0.tgz", + "integrity": "sha512-TtPEYumsmSTtTetAPXlJVf3kEqb6wZK0bZojpJQrnD/djV4q1oB6QQ8aKvKqwNPACoe02GNiy5zDzcYivR5Z2w==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.0.tgz", + "integrity": "sha512-lTeoCu5NxJU4OD9moCgm0ESZzweAx0YqsAcab6OB0EB3+As1OaHtKnaGJvcngQxYsi9UNv0abn4/DRavrRxt4w==", + "requires": { + "@types/events": "*", + "@types/node": "*", + "@types/range-parser": "*" + } + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/mime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", + "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==" + }, + "@types/node": { + "version": "10.12.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz", + "integrity": "sha512-53ElVDSnZeFUUFIYzI8WLQ25IhWzb6vbddNp8UHlXQyU0ET2RhV5zg0NfubzU7iNMh5bBXb0htCzfvrSVNgzaQ==" + }, + "@types/range-parser": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.2.tgz", + "integrity": "sha512-HtKGu+qG1NPvYe1z7ezLsyIaXYyi8SoAVqWDZgDQ8dLrsZvSzUNCwZyfX33uhWxL/SU0ZDQZ3nwZ0nimt507Kw==" + }, + "@types/serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", + "requires": { + "@types/express-serve-static-core": "*", + "@types/mime": "*" + } + }, + "@types/ws": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-5.1.2.tgz", + "integrity": "sha512-NkTXUKTYdXdnPE2aUUbGOXE1XfMK527SCvU/9bj86kyFF6kZ9ZnOQ3mK5jADn98Y2vEUD/7wKDgZa7Qst2wYOg==", + "requires": { + "@types/events": "*", + "@types/node": "*" } }, "abbrev": { @@ -260,9 +434,9 @@ } }, "acorn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", - "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", "dev": true }, "acorn-jsx": { @@ -272,9 +446,9 @@ "dev": true }, "ajv": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", - "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -294,7 +468,7 @@ }, "ansi-escapes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, @@ -321,10 +495,141 @@ "normalize-path": "^2.0.0" } }, + "apollo-cache-control": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/apollo-cache-control/-/apollo-cache-control-0.2.5.tgz", + "integrity": "sha512-xEDrUvo3U2mQKSzA8NzQmgeqK4ytwFnTGl2YKGKPfG0+r8fZdswKp6CDBue29KLO8KkSuqW/hntveWrAdK51FQ==", + "requires": { + "apollo-server-env": "^2.0.3", + "graphql-extensions": "^0.2.1" + } + }, + "apollo-datasource": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-0.1.3.tgz", + "integrity": "sha512-yEGEe5Cjzqqu5ml1VV3O8+C+thzdknZri9Ny0P3daTGNO+45J3vBOMcmaANeeI2+OOeWxdqUNa5aPOx/35kniw==", + "requires": { + "apollo-server-caching": "0.1.2", + "apollo-server-env": "2.0.3" + } + }, + "apollo-engine-reporting": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/apollo-engine-reporting/-/apollo-engine-reporting-0.0.6.tgz", + "integrity": "sha512-JmfNJ9v3QEJQ8ZhLfCKEDiww53n5kj5HarP85p8LreoYNojbvcWN8Qm6RgvSG5N/ZJrAYHeTRQbSxm1vWwGubw==", + "requires": { + "apollo-engine-reporting-protobuf": "^0.0.1", + "apollo-server-env": "^2.0.3", + "async-retry": "^1.2.1", + "graphql-extensions": "^0.2.1", + "lodash": "^4.17.10" + } + }, + "apollo-engine-reporting-protobuf": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.0.1.tgz", + "integrity": "sha512-AySoDgog2p1Nph44FyyqaU4AfRZOXx8XZxRsVHvYY4dHlrMmDDhhjfF3Jswa7Wr8X/ivvx3xA0jimRn6rsG8Ew==", + "requires": { + "protobufjs": "^6.8.6" + } + }, + "apollo-link": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.3.tgz", + "integrity": "sha512-iL9yS2OfxYhigme5bpTbmRyC+Htt6tyo2fRMHT3K1XRL/C5IQDDz37OjpPy4ndx7WInSvfSZaaOTKFja9VWqSw==", + "requires": { + "apollo-utilities": "^1.0.0", + "zen-observable-ts": "^0.8.10" + } + }, + "apollo-server-caching": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/apollo-server-caching/-/apollo-server-caching-0.1.2.tgz", + "integrity": "sha512-jBRnsTgXN0m8yVpumoelaUq9mXR7YpJ3EE+y/alI7zgXY+0qFDqksRApU8dEfg3q6qUnO7rFxRhdG5eyc0+1ig==", + "requires": { + "lru-cache": "^4.1.3" + } + }, + "apollo-server-core": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.1.0.tgz", + "integrity": "sha512-D1Tw0o3NzCQ2KGM8EWh9AHELHmn/SE361dtlqJxkbelxXqAkCIGIFywF30h+0ezhMbgbO7eqBBJfvRilF/oJHA==", + "requires": { + "@apollographql/apollo-upload-server": "^5.0.3", + "@types/ws": "^5.1.2", + "apollo-cache-control": "^0.2.5", + "apollo-datasource": "^0.1.3", + "apollo-engine-reporting": "^0.0.6", + "apollo-server-caching": "^0.1.2", + "apollo-server-env": "^2.0.3", + "apollo-server-errors": "^2.0.2", + "apollo-tracing": "^0.2.5", + "graphql-extensions": "^0.2.1", + "graphql-subscriptions": "^0.5.8", + "graphql-tag": "^2.9.2", + "graphql-tools": "^3.0.4", + "hash.js": "^1.1.3", + "lodash": "^4.17.10", + "subscriptions-transport-ws": "^0.9.11", + "ws": "^5.2.0" + } + }, + "apollo-server-env": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-2.0.3.tgz", + "integrity": "sha512-uIfKFH8n8xKO0eLb9Fa79+s2DdMuVethgznvW6SrOYq5VzgkIIobqKEuZPKa5wObw9CkCyju/+Sr7b7WWMFxUQ==", + "requires": { + "node-fetch": "^2.1.2", + "util.promisify": "^1.0.0" + } + }, + "apollo-server-errors": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-2.0.2.tgz", + "integrity": "sha512-zyWDqAVDCkj9espVsoUpZr9PwDznM8UW6fBfhV+i1br//s2AQb07N6ektZ9pRIEvkhykDZW+8tQbDwAO0vUROg==" + }, + "apollo-server-express": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.1.0.tgz", + "integrity": "sha512-jLFIz1VLduMA/rme4OAy3IPeoaMEZOPoQXpio8AhfjIqCijRPPfoWJ2QMqz56C/g3vas7rZtgcVOrHpjBKudjw==", + "requires": { + "@apollographql/apollo-upload-server": "^5.0.3", + "@apollographql/graphql-playground-html": "^1.6.0", + "@types/accepts": "^1.3.5", + "@types/body-parser": "1.17.0", + "@types/cors": "^2.8.4", + "@types/express": "4.16.0", + "accepts": "^1.3.5", + "apollo-server-core": "^2.1.0", + "body-parser": "^1.18.3", + "cors": "^2.8.4", + "graphql-subscriptions": "^0.5.8", + "graphql-tools": "^3.0.4", + "type-is": "^1.6.16" + } + }, + "apollo-tracing": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/apollo-tracing/-/apollo-tracing-0.2.5.tgz", + "integrity": "sha512-DZO7pfL5LATHeJdVFoTZ/N3HwA+IMf1YnIt5K+uMQW+/MrRgYOtTszUv5tYX2cUIqHYHcbdDaBQUuIXwSpaV2Q==", + "requires": { + "apollo-server-env": "^2.0.3", + "graphql-extensions": "^0.2.1" + } + }, + "apollo-utilities": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.0.25.tgz", + "integrity": "sha512-AXvqkhni3Ir1ffm4SA1QzXn8k8I5BBl4PVKEyak734i4jFdp+xgfUyi2VCqF64TJlFTA/B73TRDUvO2D+tKtZg==", + "requires": { + "fast-json-stable-stringify": "^2.0.0" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -390,12 +695,33 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "requires": { + "lodash": "^4.17.10" + } + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", "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==" + }, + "async-retry": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.2.3.tgz", + "integrity": "sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q==", + "requires": { + "retry": "0.12.0" + } + }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -484,18 +810,6 @@ "@babel/types": "^7.0.0", "eslint-scope": "3.7.1", "eslint-visitor-keys": "^1.0.0" - }, - "dependencies": { - "eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - } } }, "babel-generator": { @@ -1166,6 +1480,14 @@ "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } } }, "babel-template": { @@ -1216,10 +1538,16 @@ "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -1366,6 +1694,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1394,9 +1723,9 @@ } }, "bson": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz", - "integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz", + "integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA==" }, "builtin-modules": { "version": "1.1.1", @@ -1404,6 +1733,15 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, + "busboy": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", + "integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=", + "requires": { + "dicer": "0.2.5", + "readable-stream": "1.1.x" + } + }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -1456,9 +1794,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30000892", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000892.tgz", - "integrity": "sha512-X9rxMaWZNbJB5qjkDqPtNv/yfViTeUL6ILk0QJNxLV3OhKC5Acn5vxsuUvllR6B48mog8lmS+whwHq/QIYSL9w==", + "version": "1.0.30000905", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000905.tgz", + "integrity": "sha512-cR6ICguvhRrkAjFfBoe54vJQMVOEz7vFmqrV6oor1a7GRg6DdswI40lkiV/QQvAMb4txzTkjSaLaJaiAtSuQzA==", "dev": true }, "capture-stack-trace": { @@ -1611,7 +1949,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "configstore": { "version": "3.1.2", @@ -1671,19 +2010,17 @@ "core-js": { "version": "2.5.7", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", - "dev": true + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" }, "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 + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cors": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", - "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "requires": { "object-assign": "^4", "vary": "^1" @@ -1698,22 +2035,15 @@ "capture-stack-trace": "^1.0.0" } }, - "cross-fetch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.2.tgz", - "integrity": "sha1-pH/09/xxLauo9qaVoRyUhEDUVyM=", - "requires": { - "node-fetch": "2.1.2", - "whatwg-fetch": "2.0.4" - } - }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } @@ -1759,7 +2089,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -1830,14 +2159,6 @@ "pify": "^2.0.0", "pinkie-promise": "^2.0.0", "rimraf": "^2.2.8" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } } }, "depd": { @@ -1845,6 +2166,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "deprecated-decorator": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz", + "integrity": "sha1-AJZjF7ehL+kvPMgx91g68ym4bDc=" + }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -1859,6 +2185,15 @@ "repeating": "^2.0.0" } }, + "dicer": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", + "integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=", + "requires": { + "readable-stream": "1.1.x", + "streamsearch": "0.1.2" + } + }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -1900,9 +2235,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.79", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.79.tgz", - "integrity": "sha512-LQdY3j4PxuUl6xfxiFruTSlCniTrTrzAd8/HfsLEMi0PUpaQ0Iy+Pr4N4VllDYjs0Hyu2lkTbvzqlG+PX9NsNw==", + "version": "1.3.83", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.83.tgz", + "integrity": "sha512-DqJoDarxq50dcHsOOlMLNoy+qQitlMNbYb6wwbE0oUw2veHdRkpNrhmngiUYKMErdJ8SJ48rpJsZTQgy5SoEAA==", "dev": true }, "encodeurl": { @@ -1923,7 +2258,6 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, "requires": { "es-to-primitive": "^1.1.1", "function-bind": "^1.1.1", @@ -1936,7 +2270,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -2026,19 +2359,6 @@ "supports-color": "^5.3.0" } }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "debug": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", @@ -2048,6 +2368,16 @@ "ms": "^2.1.1" } }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, "globals": { "version": "11.8.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", @@ -2138,6 +2468,12 @@ "esutils": "^2.0.2", "isarray": "^1.0.0" } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true } } }, @@ -2148,9 +2484,9 @@ "dev": true }, "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -2183,7 +2519,8 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true }, "esquery": { "version": "1.0.1", @@ -2236,6 +2573,11 @@ "through": "^2.3.8" } }, + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" + }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", @@ -2249,6 +2591,19 @@ "p-finally": "^1.0.0", "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } } }, "expand-brackets": { @@ -2306,17 +2661,13 @@ "type-is": "~1.6.16", "utils-merge": "1.0.1", "vary": "~1.1.2" - } - }, - "express-graphql": { - "version": "0.6.12", - "resolved": "http://registry.npmjs.org/express-graphql/-/express-graphql-0.6.12.tgz", - "integrity": "sha512-ouLWV0hRw4hnaLtXzzwhdC79ewxKbY2PRvm05mPc/zOH5W5WVCHDQ1SmNxEPBQdUeeSNh29aIqW9zEQkA3kMuA==", - "requires": { - "accepts": "^1.3.0", - "content-type": "^1.0.4", - "http-errors": "^1.3.0", - "raw-body": "^2.3.2" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } } }, "extend-shallow": { @@ -2381,8 +2732,7 @@ "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, "fast-levenshtein": { "version": "2.0.6", @@ -2442,6 +2792,13 @@ "parseurl": "~1.3.2", "statuses": "~1.4.0", "unpipe": "~1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } } }, "find-up": { @@ -3075,8 +3432,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -3157,14 +3513,6 @@ "object-assign": "^4.0.1", "pify": "^2.0.0", "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } } }, "got": { @@ -3187,9 +3535,9 @@ } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "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 }, "graphql": { @@ -3200,63 +3548,43 @@ "iterall": "^1.2.2" } }, - "graphql-config": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/graphql-config/-/graphql-config-2.2.1.tgz", - "integrity": "sha512-U8+1IAhw9m6WkZRRcyj8ZarK96R6lQBQ0an4lp76Ps9FyhOXENC5YQOxOFGm5CxPrX2rD0g3Je4zG5xdNJjwzQ==", + "graphql-extensions": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/graphql-extensions/-/graphql-extensions-0.2.1.tgz", + "integrity": "sha512-/1FTPSWSffDjlRyMAV2UwQhojLmca9aQD0ieo1IYiqT5SE+uOWi4r83QF1CoER0sREIsH3s+nTmdH3cvQVG3MA==", "requires": { - "graphql-import": "^0.7.1", - "graphql-request": "^1.5.0", - "js-yaml": "^3.10.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.4" + "apollo-server-env": "^2.0.3" } }, - "graphql-import": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/graphql-import/-/graphql-import-0.7.1.tgz", - "integrity": "sha512-YpwpaPjRUVlw2SN3OPljpWbVRWAhMAyfSba5U47qGMOSsPLi2gYeJtngGpymjm9nk57RFWEpjqwh4+dpYuFAPw==", + "graphql-subscriptions": { + "version": "0.5.8", + "resolved": "http://registry.npmjs.org/graphql-subscriptions/-/graphql-subscriptions-0.5.8.tgz", + "integrity": "sha512-0CaZnXKBw2pwnIbvmVckby5Ge5e2ecmjofhYCdyeACbCly2j3WXDP/pl+s+Dqd2GQFC7y99NB+53jrt55CKxYQ==", "requires": { - "lodash": "^4.17.4", - "resolve-from": "^4.0.0" - }, - "dependencies": { - "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==" - } + "iterall": "^1.2.1" } }, - "graphql-playground-html": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/graphql-playground-html/-/graphql-playground-html-1.6.4.tgz", - "integrity": "sha512-mnpAVYSR3TesYsJ5OLJVJMA0muTCw4npsCI1cKMtW35lbA6KljZkLkz3ZWXhEIYPnHKIeUHEtbn1ZGkEXtAxLg==", - "requires": { - "graphql-config": "2.2.1" - } + "graphql-tag": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.0.tgz", + "integrity": "sha512-9FD6cw976TLLf9WYIUPCaaTpniawIjHWZSwIRZSjrfufJamcXbVVYfN2TWvJYbw0Xf2JjYbl1/f2+wDnBVw3/w==" }, - "graphql-playground-middleware-express": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/graphql-playground-middleware-express/-/graphql-playground-middleware-express-1.7.6.tgz", - "integrity": "sha512-fICPxYGIdhCxtFlwCnP3uZ2uRWeQ9wj7OkcWUiHNwaFma2TbRD5nNKaPA2u21YWha9xv26qIDxxcdW27F/lcbQ==", + "graphql-tools": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/graphql-tools/-/graphql-tools-3.1.1.tgz", + "integrity": "sha512-yHvPkweUB0+Q/GWH5wIG60bpt8CTwBklCSzQdEHmRUgAdEQKxw+9B7zB3dG7wB3Ym7M7lfrS4Ej+jtDZfA2UXg==", "requires": { - "graphql-playground-html": "1.6.4" - } - }, - "graphql-request": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-1.8.2.tgz", - "integrity": "sha512-dDX2M+VMsxXFCmUX0Vo0TopIZIX4ggzOtiCsThgtrKR4niiaagsGTDIHj3fsOMFETpa064vzovI+4YV4QnMbcg==", - "requires": { - "cross-fetch": "2.2.2" + "apollo-link": "^1.2.2", + "apollo-utilities": "^1.0.1", + "deprecated-decorator": "^0.1.6", + "iterall": "^1.1.3", + "uuid": "^3.1.0" } }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -3279,8 +3607,7 @@ "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 + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" }, "has-value": { "version": "1.0.0", @@ -3342,6 +3669,15 @@ } } }, + "hash.js": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", + "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -3544,8 +3880,7 @@ "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" }, "is-ci": { "version": "1.2.1", @@ -3568,8 +3903,7 @@ "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, "is-descriptor": { "version": "0.1.6", @@ -3746,7 +4080,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, "requires": { "has": "^1.0.1" } @@ -3773,7 +4106,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, "requires": { "has-symbols": "^1.0.0" } @@ -3785,10 +4117,9 @@ "dev": true }, "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, "isexe": { "version": "2.0.0", @@ -3804,6 +4135,15 @@ "optional": true, "requires": { "isarray": "1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + } } }, "iterall": { @@ -3821,6 +4161,7 @@ "version": "3.12.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -3893,14 +4234,6 @@ "parse-json": "^2.2.0", "pify": "^2.0.0", "strip-bom": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } } }, "locate-path": { @@ -3937,6 +4270,11 @@ "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -3953,13 +4291,12 @@ "dev": true }, "lru-cache": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", - "dev": true, + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "requires": { - "pseudomap": "^1.0.1", - "yallist": "^2.0.0" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "lsmod": { @@ -3974,6 +4311,14 @@ "dev": true, "requires": { "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "map-cache": { @@ -4063,16 +4408,16 @@ "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==" + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" }, "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", "requires": { - "mime-db": "~1.36.0" + "mime-db": "~1.37.0" } }, "mimic-fn": { @@ -4081,10 +4426,16 @@ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "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==" + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4126,43 +4477,36 @@ } }, "mongodb": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.6.tgz", - "integrity": "sha512-E5QJuXQoMlT7KyCYqNNMfAkhfQD79AT4F8Xd+6x37OX+8BL17GyXyWvfm6wuyx4wnzCCPoCSLeMeUN2S7dU9yw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.8.tgz", + "integrity": "sha512-yNKwYxQ6m00NV6+pMoWoheFTHSQVv1KkSrfOhRDYMILGWDYtUtQRqHrFqU75rmPIY8hMozVft8zdC4KYMWaM3Q==", "requires": { - "mongodb-core": "3.1.5", + "mongodb-core": "3.1.7", "safe-buffer": "^5.1.2" } }, "mongodb-core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.5.tgz", - "integrity": "sha512-emT/tM4ZBinqd6RZok+EzDdtN4LjYJIckv71qQVOEFmvXgT5cperZegVmTgox/1cx4XQu6LJ5ZuIwipP/eKdQg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.7.tgz", + "integrity": "sha512-YffpSrLmgFNmrvkGx+yX00KyBNk64C0BalfEn6vHHkXtcMUGXw8nxrMmhq5eXPLLlYeBpD/CsgNxE2Chf0o4zQ==", "requires": { "bson": "^1.1.0", "require_optional": "^1.0.1", "safe-buffer": "^5.1.2", "saslprep": "^1.0.0" - }, - "dependencies": { - "bson": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz", - "integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA==" - } } }, "mongoose": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.3.4.tgz", - "integrity": "sha512-DIUWOyYgZv2zGi/BoFEaFiaCVuDonnzGhW3cnc3JFjBScYn6z24tS2j3VB0dtMoX8FFjxmmMVnlmHPEIbV4PKA==", + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.3.9.tgz", + "integrity": "sha512-FbCW2qCptfPW/ltRwgqKpPCK113WTIhZDnn+0L0hO2XoX9Yp4LuIP0Nab7eBK+TsiIXWZAvzKhnnUKElTbl5ow==", "requires": { "async": "2.6.1", - "bson": "~1.0.5", + "bson": "~1.1.0", "kareem": "2.3.0", "lodash.get": "4.4.2", - "mongodb": "3.1.6", - "mongodb-core": "3.1.5", + "mongodb": "3.1.8", + "mongodb-core": "3.1.7", "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.5.1", "mquery": "3.2.0", @@ -4170,16 +4514,6 @@ "regexp-clone": "0.0.1", "safe-buffer": "5.1.2", "sliced": "1.0.1" - }, - "dependencies": { - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "requires": { - "lodash": "^4.17.10" - } - } } }, "mongoose-legacy-pluralize": { @@ -4289,17 +4623,17 @@ "dev": true }, "node-fetch": { - "version": "2.1.2", - "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", - "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.2.1.tgz", + "integrity": "sha512-ObXBpNCD3A/vYQiQtEWl7DuqjAXjfptYFuGHLdPl5U19/6kJuZV+8uMHLrkj3wJrJoyfg4nhgyFixZdaZoAiEQ==" }, "nodemon": { - "version": "1.18.4", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.4.tgz", - "integrity": "sha512-hyK6vl65IPnky/ee+D3IWvVGgJa/m3No2/Xc/3wanS6Ce1MWjCzH6NnhPJ/vZM+6JFym16jtHx51lmCMB9HDtg==", + "version": "1.18.6", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.6.tgz", + "integrity": "sha512-4pHQNYEZun+IkIC2jCaXEhkZnfA7rQe73i8RkdRyDJls/K+WxR7IpI5uNUsAvQ0zWvYcCDNGD+XVtw2ZG86/uQ==", "dev": true, "requires": { - "chokidar": "^2.0.2", + "chokidar": "^2.0.4", "debug": "^3.1.0", "ignore-by-default": "^1.0.1", "minimatch": "^3.0.4", @@ -4764,8 +5098,12 @@ "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" + }, + "object-path": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.4.tgz", + "integrity": "sha1-NwrnUvvzfePqcKhhwju6iRVpGUk=" }, "object-visit": { "version": "1.0.1", @@ -4808,6 +5146,15 @@ "has": "^1.0.1" } }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -5025,14 +5372,6 @@ "dev": true, "requires": { "pify": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } } }, "pause-stream": { @@ -5045,9 +5384,9 @@ } }, "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { @@ -5123,6 +5462,26 @@ "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", "dev": true }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + } + }, "proxy-addr": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", @@ -5144,8 +5503,7 @@ "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, "pstree.remy": { "version": "1.1.0", @@ -5168,9 +5526,9 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "randomatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", - "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", "dev": true, "optional": true, "requires": { @@ -5264,18 +5622,14 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, + "version": "1.1.14", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "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" + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" } }, "readdirp": { @@ -5530,6 +5884,12 @@ } } }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -5562,6 +5922,30 @@ "snapdragon": "^0.8.1", "to-regex": "^3.0.2" } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://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" + } + }, + "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==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } } } }, @@ -5572,10 +5956,9 @@ "dev": true }, "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" }, "regenerator-transform": { "version": "0.10.1", @@ -5762,6 +6145,11 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" + }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", @@ -5849,6 +6237,13 @@ "on-finished": "~2.3.0", "range-parser": "~1.2.0", "statuses": "~1.4.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } } }, "serve-static": { @@ -6135,7 +6530,8 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "stack-trace": { "version": "0.0.10", @@ -6164,9 +6560,9 @@ } }, "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, "stream-combiner": { "version": "0.2.2", @@ -6178,6 +6574,11 @@ "through": "~2.3.4" } }, + "streamsearch": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", + "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -6206,13 +6607,9 @@ } }, "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==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, "strip-ansi": { "version": "3.0.1", @@ -6241,12 +6638,29 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, + "subscriptions-transport-ws": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.15.tgz", + "integrity": "sha512-f9eBfWdHsePQV67QIX+VRhf++dn1adyC/PZHP6XI5AfKnZ4n0FW+v5omxwdHVpd4xq2ZijaHEcmlQrhBY79ZWQ==", + "requires": { + "backo2": "^1.0.2", + "eventemitter3": "^3.1.0", + "iterall": "^1.2.1", + "symbol-observable": "^1.0.4", + "ws": "^5.2.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" + }, "table": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", @@ -6478,6 +6892,12 @@ "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -6589,11 +7009,25 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, "v8flags": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", @@ -6618,11 +7052,6 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, - "whatwg-fetch": { - "version": "2.0.4", - "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -6673,6 +7102,14 @@ "signal-exit": "^3.0.2" } }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "requires": { + "async-limiter": "~1.0.0" + } + }, "xdg-basedir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", @@ -6682,8 +7119,20 @@ "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "zen-observable": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.11.tgz", + "integrity": "sha512-N3xXQVr4L61rZvGMpWe8XoCGX8vhU35dPyQ4fm5CY/KDlG0F75un14hjbckPXTDuKUY6V0dqR2giT6xN8Y4GEQ==" + }, + "zen-observable-ts": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.10.tgz", + "integrity": "sha512-5vqMtRggU/2GhePC9OU4sYEWOdvmayp2k3gjPf4F0mXwB3CSbbNznfDUvDJx9O2ZTa1EIXdJhPchQveFKwNXPQ==", + "requires": { + "zen-observable": "^0.8.0" + } } } } diff --git a/server/package.json b/server/package.json index 73c601f30..bc2983b27 100644 --- a/server/package.json +++ b/server/package.json @@ -26,13 +26,11 @@ }, "dependencies": { "@sentry/node": "^4.1.1", + "apollo-server-express": "^2.1.0", "axios": "^0.18.0", - "cors": "^2.8.4", "dotenv": "^6.0.0", "express": "^4.16.3", - "express-graphql": "^0.6.12", "graphql": "^14.0.0", - "graphql-playground-middleware-express": "^1.7.6", "mongoose": "^5.3.4" } } diff --git a/server/src/app.js b/server/src/app.js index b36f54aef..5dfc2d97c 100644 --- a/server/src/app.js +++ b/server/src/app.js @@ -1,10 +1,9 @@ import 'dotenv/config'; import express from 'express'; -import cors from 'cors'; -import graphqlHTTP from 'express-graphql'; -import expressPlayground from 'graphql-playground-middleware-express'; +import { ApolloServer } from 'apollo-server-express'; import * as Sentry from '@sentry/node'; import schema from './schema'; +import wrongPreshared from './errors/notAllowed.json'; const app = express(); @@ -12,27 +11,39 @@ const app = express(); Sentry.init({ dsn: process.env.SENTRY_DNS }); app.use(Sentry.Handlers.requestHandler()); -// authorising CORS -app.use(cors()); +app.post('/graphql', (req, res, next) => { + if (req.headers.preshared === process.env.PRESHARED_GATEWAY_KEY) { + next(); + } else { + res.send(wrongPreshared); + } +}); + // Starting the graphql server -app.use('/graphql', graphqlHTTP(req => ({ +const server = new ApolloServer({ schema, - context: { + playground: { + settings: { + 'editor.theme': 'dark', + 'editor.cursorShape': 'line', + }, + }, + context: ({ req }) => ({ userId: req.headers.userid, authorization: req.headers.authorization, - }, - formatError(err) { - return { - message: err.message, - code: err.originalError && err.originalError.code, - path: err.path, - }; - }, -}))); + }), + formatError: error => ({ + code: error.extensions.exception.code, + message: error.message, + path: error.path, + }), +}); -// Starting the graphql server -app.get('/playground', expressPlayground({ endpoint: '/graphql' })); +server.applyMiddleware({ + app, + cors: true, +}); // Sentry error handling middleware if anything pass through app.use(Sentry.Handlers.errorHandler()); diff --git a/server/src/db.js b/server/src/db.js index 4492e884f..4ed47a0c2 100644 --- a/server/src/db.js +++ b/server/src/db.js @@ -2,6 +2,8 @@ import 'dotenv/config'; import mongoose from 'mongoose'; mongoose.connect(`mongodb://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${process.env.DB_DOMAIN}`, { useNewUrlParser: true }); +mongoose.set('useCreateIndex', true); +mongoose.set('useFindAndModify', false); mongoose.Promise = global.Promise; const db = mongoose.connection; diff --git a/server/src/enums/EventStatus.js b/server/src/enums/EventState.js similarity index 73% rename from server/src/enums/EventStatus.js rename to server/src/enums/EventState.js index 50a4bc53e..4541a47ef 100644 --- a/server/src/enums/EventStatus.js +++ b/server/src/enums/EventState.js @@ -4,14 +4,16 @@ export const CANCELLED = 'CANCELLED'; export const RUNNING = 'RUNNING'; export const INTERRUPTED = 'INTERRUPTED'; export const FINISHED = 'FINISHED'; +export const ARCHIVED = 'ARCHIVED'; -export const EventStatusEnum = [ +export const EventStateEnum = [ UNPUBLISHED, PUBLISHED, CANCELLED, RUNNING, INTERRUPTED, FINISHED, + ARCHIVED, ]; -export default EventStatusEnum; +export default EventStateEnum; diff --git a/server/src/errors/notAllowed.json b/server/src/errors/notAllowed.json new file mode 100644 index 000000000..b76604aa2 --- /dev/null +++ b/server/src/errors/notAllowed.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "code": 401, + "message": "Wait, you're not supposed to be here, go through the gate as everyone else" + } + ] +} diff --git a/server/src/models/event.js b/server/src/models/event.js index c72ce3187..c95ef5744 100644 --- a/server/src/models/event.js +++ b/server/src/models/event.js @@ -3,45 +3,98 @@ import Plotter from './plotter'; import Formula from './formula'; import { UNPUBLISHED, - EventStatusEnum, -} from '../enums/EventStatus'; + EventStateEnum, +} from '../enums/EventState'; + +const { ObjectId } = Schema.Types; const eventSchema = new Schema({ - designator: { type: String, required: true }, - status: { type: String, enum: EventStatusEnum, default: UNPUBLISHED }, - name: { type: String, required: true }, - hostId: { type: String, required: true }, - description: String, - startDatetime: { type: Number, required: true }, - finishDatetime: { type: Number, required: true }, - formula: { type: Schema.Types.ObjectId, ref: Formula.modelName }, - plotter: { type: Schema.Types.ObjectId, ref: Plotter.modelName }, + state: { + type: String, + enum: EventStateEnum, + default: UNPUBLISHED, + }, + name: { + type: String, + required: true, + }, + hostId: { + type: String, + required: true, + }, + description: { + type: String, + }, + startDatetime: { + type: Number, + required: true, + }, + finishDatetime: { + type: Number, + required: true, + }, + formulaId: { + type: ObjectId, + ref: Formula.modelName, + }, + plotterId: { + type: ObjectId, + ref: Plotter.modelName, + }, rules: [{ - position: { type: Number, required: true }, - title: { type: String, required: true }, - description: String, + position: { + type: Number, + required: true, + }, + title: { + type: String, + required: true, + }, + description: { + type: String, + }, }], prizes: [{ - rank: { type: Number, required: true }, - amount: { type: Number, required: true }, + rank: { + type: Number, + required: true, + }, + amount: { + type: Number, + required: true, + }, additional: [{ condition: String, - amount: { type: Number, required: true }, - asset: { type: String, required: true }, + amount: { + type: Number, + required: true, + }, + asset: { + type: String, + required: true, + }, }], }], participants: [{ - teamId: { type: String, required: true }, + teamId: { + type: String, + required: true, + }, botId: String, releaseId: String, }], }); eventSchema.pre('find', function populate() { - this.populate('formula').populate('plotter'); + this.populate('formulaId').populate('plotterId'); }); eventSchema.post('save', (doc, next) => { - doc.populate('formula').populate('plotter').execPopulate().then(() => { + doc.populate('formulaId').populate('plotterId').execPopulate().then(() => { + next(); + }); +}); +eventSchema.post('findOneAndUpdate', (doc, next) => { + doc.populate('formulaId').populate('plotterId').execPopulate().then(() => { next(); }); }); diff --git a/server/src/models/formula.js b/server/src/models/formula.js index 43132bbf2..ccc774334 100644 --- a/server/src/models/formula.js +++ b/server/src/models/formula.js @@ -1,9 +1,18 @@ import mongoose, { Schema } from 'mongoose'; const formulaSchema = new Schema({ - ownerId: { type: String, required: true }, - isTemplate: { type: Boolean, default: false }, - name: { type: String, required: true }, + ownerId: { + type: String, + required: true, + }, + isTemplate: { + type: Boolean, + default: false, + }, + name: { + type: String, + required: true, + }, }); const Formula = mongoose.model('Formula', formulaSchema); diff --git a/server/src/models/plotter.js b/server/src/models/plotter.js index 77f274206..a9a7feb92 100644 --- a/server/src/models/plotter.js +++ b/server/src/models/plotter.js @@ -1,12 +1,30 @@ import mongoose, { Schema } from 'mongoose'; const plotterSchema = new Schema({ - ownerId: { type: String, required: true }, - isTemplate: { type: Boolean, default: false }, - name: { type: String, required: true }, - host: { type: String, required: true }, - repo: { type: String, required: true }, - moduleName: { type: String, required: true }, + ownerId: { + type: String, + required: true, + }, + isTemplate: { + type: Boolean, + default: false, + }, + name: { + type: String, + required: true, + }, + host: { + type: String, + required: true, + }, + repo: { + type: String, + required: true, + }, + moduleName: { + type: String, + required: true, + }, }); const Plotter = mongoose.model('Plotter', plotterSchema); diff --git a/server/src/schema/mutations/AddPrize.js b/server/src/schema/mutations/AddPrize.js deleted file mode 100644 index ff22e69ab..000000000 --- a/server/src/schema/mutations/AddPrize.js +++ /dev/null @@ -1,62 +0,0 @@ -import { - GraphQLNonNull, - GraphQLID, - GraphQLInt, -} from 'graphql'; -import { - AuthentificationError, - DatabaseError, - WrongArgumentsError, -} from '../../errors'; -import { EventType } from '../types'; -import { Event } from '../../models'; - -const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLID) }, - rank: { type: new GraphQLNonNull(GraphQLInt) }, - amount: { type: new GraphQLNonNull(GraphQLInt) }, -}; - -const resolve = (parent, { eventDesignator, rank, amount }, context) => { - const hostId = context.userId; - if (!hostId) { - throw new AuthentificationError(); - } - return new Promise((res, rej) => { - Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => { - if (err) { - rej(err); - return; - } - if (!event) { - rej(new DatabaseError('None of the events you own respond to that designator')); - return; - } - if (event.prizes.some(prize => prize.rank === rank)) { - rej(new WrongArgumentsError('A prize for that rank already exists')); - return; - } - event.prizes.push({ - rank, - amount, - }); - event.save((error) => { - if (error) { - rej(error); - return; - } - res(event); - }); - }); - }); -}; - -const mutation = { - addPrize: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/AddRule.js b/server/src/schema/mutations/AddRule.js deleted file mode 100644 index c7b43cdb5..000000000 --- a/server/src/schema/mutations/AddRule.js +++ /dev/null @@ -1,70 +0,0 @@ -import { - GraphQLNonNull, - GraphQLID, - GraphQLString, -} from 'graphql'; -import { - AuthentificationError, - DatabaseError, - WrongArgumentsError, -} from '../../errors'; -import { EventType } from '../types'; -import { Event } from '../../models'; - -const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLID) }, - title: { type: new GraphQLNonNull(GraphQLString) }, - description: { type: new GraphQLNonNull(GraphQLString) }, -}; - -const resolve = (parent, { eventDesignator, title, description }, context) => { - const hostId = context.userId; - if (!hostId) { - throw new AuthentificationError(); - } - return new Promise((res, rej) => { - Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => { - if (err) { - rej(err); - return; - } - if (!event) { - rej(new DatabaseError('None of the events you own respond to that designator')); - return; - } - if (event.rules.some(rule => rule.title === title)) { - rej(new WrongArgumentsError('A prize for that rank already exists')); - return; - } - const isFree = pos => event.rules.some(rule => rule.pos === pos); - let position = 1; - let shouldGrow = isFree(position); - while (shouldGrow) { - position += 1; - shouldGrow = isFree(position); - } - event.rules.push({ - position, - title, - description, - }); - event.save((error) => { - if (error) { - rej(error); - return; - } - res(event); - }); - }); - }); -}; - -const mutation = { - addRule: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/ChangeEventState.js b/server/src/schema/mutations/ChangeEventState.js new file mode 100644 index 000000000..ada9367b8 --- /dev/null +++ b/server/src/schema/mutations/ChangeEventState.js @@ -0,0 +1,39 @@ +import { + GraphQLNonNull, + GraphQLID, +} from 'graphql'; +import { AuthentificationError } from '../../errors'; +import { EventType } from '../types'; +import { Event } from '../../models'; +import EventStateEnum from '../types/enum/EventState'; + +const args = { + eventId: { type: new GraphQLNonNull(GraphQLID) }, + state: { type: EventStateEnum }, +}; + +const resolve = (parent, { eventId: _id, state }, { userId: hostId }) => { + if (!hostId) { + throw new AuthentificationError(); + } + + return new Promise((res, rej) => { + Event.findOneAndUpdate({ _id, hostId }, { state }, { new: true }, (err, modifiedEvent) => { + if (err) { + rej(err); + return; + } + res(modifiedEvent); + }); + }); +}; + +const mutation = { + changeEventState: { + type: EventType, + args, + resolve, + }, +}; + +export default mutation; diff --git a/server/src/schema/mutations/CreateAndSetFormula.js b/server/src/schema/mutations/CreateAndSetFormula.js deleted file mode 100644 index d1d45970f..000000000 --- a/server/src/schema/mutations/CreateAndSetFormula.js +++ /dev/null @@ -1,56 +0,0 @@ -import { - GraphQLNonNull, - GraphQLString, -} from 'graphql'; -import { AuthentificationError, DatabaseError } from '../../errors'; -import { EventType } from '../types'; -import { Event, Formula } from '../../models'; - -const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLString) }, - name: { type: new GraphQLNonNull(GraphQLString) }, -}; - -const resolve = (parent, { name, eventDesignator }, context) => { - const ownerId = context.userId; - if (!ownerId) { - throw new AuthentificationError(); - } - const newFormula = new Formula({ name, ownerId }); - return new Promise((res, reject) => { - Event.findOne({ designator: eventDesignator, hostId: ownerId }).exec((err, event) => { - if (err) { - reject(err); - return; - } - if (!event) { - reject(new DatabaseError('None of the events you own respond to that designator')); - return; - } - newFormula.save((error) => { - if (error) { - reject(error); - return; - } - event.formula = newFormula._id; - event.save((eventError) => { - if (eventError) { - reject(eventError); - return; - } - res(event); - }); - }); - }); - }); -}; - -const mutation = { - createAndSetFormula: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/CreateAndSetPlotter.js b/server/src/schema/mutations/CreateAndSetPlotter.js deleted file mode 100644 index 11cbfe846..000000000 --- a/server/src/schema/mutations/CreateAndSetPlotter.js +++ /dev/null @@ -1,65 +0,0 @@ -import { - GraphQLNonNull, - GraphQLString, -} from 'graphql'; -import { AuthentificationError, DatabaseError } from '../../errors'; -import { EventType } from '../types'; -import { Event, Plotter } from '../../models'; - -const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLString) }, - name: { type: new GraphQLNonNull(GraphQLString) }, - host: { type: new GraphQLNonNull(GraphQLString) }, - repo: { type: new GraphQLNonNull(GraphQLString) }, - moduleName: { type: new GraphQLNonNull(GraphQLString) }, -}; - -const resolve = (parent, { - name, host, repo, moduleName, eventDesignator, -}, context) => { - const ownerId = context.userId; - if (!ownerId) { - throw new AuthentificationError(); - } - const newPlotter = new Plotter({ - name, host, repo, moduleName, ownerId, - }); - return new Promise((res, rej) => { - Event.findOne({ designator: eventDesignator, hostId: ownerId }).exec((err, event) => { - if (err) { - rej(err); - return; - } - if (!event) { - rej(new DatabaseError('None of the events you own respond to that designator')); - return; - } - - newPlotter.save((error) => { - if (error) { - rej(error); - return; - } - - event.plotter = newPlotter._id; - event.save((eventError) => { - if (eventError) { - rej(eventError); - return; - } - res(event); - }); - }); - }); - }); -}; - -const mutation = { - createAndSetPlotter: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/CreateEvent.js b/server/src/schema/mutations/CreateEvent.js new file mode 100644 index 000000000..2704f53e7 --- /dev/null +++ b/server/src/schema/mutations/CreateEvent.js @@ -0,0 +1,37 @@ +import { AuthentificationError } from '../../errors'; +import { EventType } from '../types'; +import { Event } from '../../models'; +import { EventInputType } from '../types/input'; + +export const args = { + event: { type: EventInputType }, +}; + +const resolve = (parent, { event }, { userId: hostId }) => { + if (!hostId) { + throw new AuthentificationError(); + } + + event.hostId = hostId; + const newEvent = new Event(event); + + return new Promise((res, rej) => { + newEvent.save((err) => { + if (err) { + rej(err); + return; + } + res(newEvent); + }); + }); +}; + +const mutation = { + createEvent: { + type: EventType, + args, + resolve, + }, +}; + +export default mutation; diff --git a/server/src/schema/mutations/CreateFormula.js b/server/src/schema/mutations/CreateFormula.js index 4ff97b8c1..198c1fd0e 100644 --- a/server/src/schema/mutations/CreateFormula.js +++ b/server/src/schema/mutations/CreateFormula.js @@ -1,21 +1,20 @@ -import { - GraphQLNonNull, - GraphQLString, -} from 'graphql'; import { AuthentificationError } from '../../errors'; import { FormulaType } from '../types'; import { Formula } from '../../models'; +import { FormulaInputType } from '../types/input'; const args = { - name: { type: new GraphQLNonNull(GraphQLString) }, + formula: { type: FormulaInputType }, }; -const resolve = (parent, { name }, context) => { - const ownerId = context.userId; +const resolve = (parent, { formula }, { userId: ownerId }) => { if (!ownerId) { throw new AuthentificationError(); } - const newFormula = new Formula({ name, ownerId }); + + formula.ownerId = ownerId; + const newFormula = new Formula(formula); + return new Promise((res, rej) => { newFormula.save((err) => { if (err) { diff --git a/server/src/schema/mutations/CreatePlotter.js b/server/src/schema/mutations/CreatePlotter.js index a4fcdf26a..6cf060fbf 100644 --- a/server/src/schema/mutations/CreatePlotter.js +++ b/server/src/schema/mutations/CreatePlotter.js @@ -1,28 +1,20 @@ -import { - GraphQLNonNull, - GraphQLString, -} from 'graphql'; import { AuthentificationError } from '../../errors'; import { PlotterType } from '../types'; import { Plotter } from '../../models'; +import { PlotterInputType } from '../types/input'; const args = { - name: { type: new GraphQLNonNull(GraphQLString) }, - host: { type: new GraphQLNonNull(GraphQLString) }, - repo: { type: new GraphQLNonNull(GraphQLString) }, - moduleName: { type: new GraphQLNonNull(GraphQLString) }, + plotter: { type: PlotterInputType }, }; -const resolve = (parent, { - name, host, repo, moduleName, -}, context) => { - const ownerId = context.userId; +const resolve = (parent, { plotter }, { userId: ownerId }) => { if (!ownerId) { throw new AuthentificationError(); } - const newPlotter = new Plotter({ - name, host, repo, moduleName, ownerId, - }); + + plotter.ownerId = ownerId; + const newPlotter = new Plotter(plotter); + return new Promise((res, reject) => { newPlotter.save((err) => { if (err) { diff --git a/server/src/schema/mutations/EditEvent.js b/server/src/schema/mutations/EditEvent.js index e60cf6cbd..093376207 100644 --- a/server/src/schema/mutations/EditEvent.js +++ b/server/src/schema/mutations/EditEvent.js @@ -1,54 +1,29 @@ import { GraphQLNonNull, GraphQLID, - GraphQLInt, - GraphQLString, } from 'graphql'; -import { AuthentificationError, DatabaseError } from '../../errors'; +import { AuthentificationError } from '../../errors'; import { EventType } from '../types'; import { Event } from '../../models'; +import { EventInputType } from '../types/input'; const args = { - designator: { type: new GraphQLNonNull(GraphQLID) }, - name: { type: GraphQLString }, - description: { type: GraphQLString }, - startDatetime: { type: GraphQLInt }, - finishDatetime: { type: GraphQLInt }, - formulaId: { type: GraphQLString }, - plotterId: { type: GraphQLString }, + eventId: { type: new GraphQLNonNull(GraphQLID) }, + event: { type: EventInputType }, }; -const resolve = (parent, { - designator, name, description, startDatetime, finishDatetime, formulaId, plotterId, -}, context) => { - const hostId = context.userId; +const resolve = (parent, { eventId: _id, event }, { userId: hostId }) => { if (!hostId) { throw new AuthentificationError(); } + return new Promise((res, rej) => { - Event.findOne({ designator, hostId }).exec((err, event) => { + Event.findOneAndUpdate({ _id, hostId }, event, { new: true }, (err, modifiedEvent) => { if (err) { rej(err); return; } - if (!event) { - rej(new DatabaseError('None of the events you own respond to that designator')); - return; - } - event.name = name || event.name; - event.description = description || event.description; - event.startDatetime = startDatetime || event.startDatetime; - event.finishDatetime = finishDatetime || event.finishDatetime; - event.formula = formulaId || event.formula; - event.plotter = plotterId || event.plotter; - - event.save((error) => { - if (error) { - rej(error); - return; - } - res(event); - }); + res(modifiedEvent); }); }); }; diff --git a/server/src/schema/mutations/EditParticipant.js b/server/src/schema/mutations/EditParticipant.js index 0abb8db32..a241f34b4 100644 --- a/server/src/schema/mutations/EditParticipant.js +++ b/server/src/schema/mutations/EditParticipant.js @@ -1,7 +1,6 @@ import { GraphQLNonNull, GraphQLID, - GraphQLString, } from 'graphql'; import axios from 'axios'; import { @@ -11,45 +10,40 @@ import { } from '../../errors'; import { EventType } from '../types'; import { Event } from '../../models'; +import { ParticipantInputType } from '../types/input'; const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLID) }, - teamId: { type: new GraphQLNonNull(GraphQLString) }, - botId: { type: GraphQLString }, - releaseId: { type: GraphQLString }, + eventId: { type: new GraphQLNonNull(GraphQLID) }, + participant: { type: ParticipantInputType }, }; -const resolve = (parent, { - eventDesignator, teamId, botId, releaseId, -}, context) => { - const userid = context.userId; - if (!userid) { +const resolve = (parent, + { eventId: _id, participant: { teamId, botId, releaseId } }, + { userId, authorization }) => { + if (!userId) { throw new AuthentificationError(); } return new Promise((res, rej) => { axios({ - url: process.env.TEAMS_ENDPOINT, + url: process.env.GATEWAY_ENDPOINT, method: 'post', data: { query: ` { - teamsByRole{ + teams_TeamsByRole{ id } } `, }, - headers: { - userid, - authorization: context.authorization, - }, + headers: { authorization }, }).then( (result) => { if (!result.data.data.teamsByRole.some(team => team.id === teamId)) { - rej(new WrongArgumentsError('You are not eligible to register this team')); + rej(new WrongArgumentsError('You are not eligible to edit this team')); return; } - Event.findOne({ designator: eventDesignator }).exec((err, event) => { + Event.findOne({ _id }).exec((err, event) => { if (err) { rej(err); return; diff --git a/server/src/schema/mutations/EditPrize.js b/server/src/schema/mutations/EditPrize.js deleted file mode 100644 index 279733d85..000000000 --- a/server/src/schema/mutations/EditPrize.js +++ /dev/null @@ -1,56 +0,0 @@ -import { - GraphQLNonNull, - GraphQLID, - GraphQLInt, -} from 'graphql'; -import { AuthentificationError, DatabaseError } from '../../errors'; -import { EventType } from '../types'; -import { Event } from '../../models'; - -const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLID) }, - rank: { type: new GraphQLNonNull(GraphQLInt) }, - amount: { type: GraphQLInt }, -}; - -const resolve = (parent, { eventDesignator, rank, amount }, context) => { - const hostId = context.userId; - if (!hostId) { - throw new AuthentificationError(); - } - return new Promise((res, rej) => { - Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => { - if (err) { - rej(err); - return; - } - if (!event) { - rej(new DatabaseError('None of the events you own respond to that designator')); - return; - } - const prizeIndex = event.prizes.findIndex(prize => prize.rank === rank); - if (!prizeIndex) { - rej(new DatabaseError('There is no prize for that index')); - return; - } - event.prizes[prizeIndex].amount = amount || event.prizes[prizeIndex].amount; - event.save((error) => { - if (error) { - rej(error); - return; - } - res(event); - }); - }); - }); -}; - -const mutation = { - editPrize: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/EditRule.js b/server/src/schema/mutations/EditRule.js deleted file mode 100644 index c931151ce..000000000 --- a/server/src/schema/mutations/EditRule.js +++ /dev/null @@ -1,64 +0,0 @@ -import { - GraphQLNonNull, - GraphQLID, - GraphQLString, -} from 'graphql'; -import { AuthentificationError, DatabaseError, WrongArgumentsError } from '../../errors'; -import { EventType } from '../types'; -import { Event } from '../../models'; - -const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLID) }, - title: { type: new GraphQLNonNull(GraphQLString) }, - newtitle: { type: GraphQLString }, - description: { type: GraphQLString }, -}; - -const resolve = (parent, { - eventDesignator, title, newtitle, description, -}, context) => { - const hostId = context.userId; - if (!hostId) { - throw new AuthentificationError(); - } - return new Promise((res, rej) => { - Event.findOne({ designator: eventDesignator, hostId }).exec((err, event) => { - if (err) { - rej(err); - return; - } - if (!event) { - rej(new DatabaseError('None of the events you own respond to that designator')); - return; - } - const ruleIndex = event.rules.findIndex(rule => rule.title === title); - if (!ruleIndex) { - rej(new DatabaseError('There is no rule with that title')); - return; - } - event.rules[ruleIndex].description = description || event.rules[ruleIndex].description; - if (event.rules.some(rule => rule.title === newtitle)) { - rej(new WrongArgumentsError('There is already a rule using your new title')); - return; - } - event.rules[ruleIndex].title = newtitle || event.rules[ruleIndex].title; - event.save((error) => { - if (error) { - rej(error); - return; - } - res(event); - }); - }); - }); -}; - -const mutation = { - editRule: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/HostEvent.js b/server/src/schema/mutations/HostEvent.js deleted file mode 100644 index 13fd6b494..000000000 --- a/server/src/schema/mutations/HostEvent.js +++ /dev/null @@ -1,52 +0,0 @@ -import { - GraphQLNonNull, - GraphQLInt, - GraphQLString, -} from 'graphql'; -import { AuthentificationError } from '../../errors'; -import { EventType } from '../types'; -import { Event } from '../../models'; -import { slugify } from '../../utils/functions'; - -const args = { - name: { type: new GraphQLNonNull(GraphQLString) }, - description: { type: new GraphQLNonNull(GraphQLString) }, - startDatetime: { type: new GraphQLNonNull(GraphQLInt) }, - finishDatetime: { type: new GraphQLNonNull(GraphQLInt) }, -}; - -const resolve = (parent, { - name, description, startDatetime, finishDatetime, -}, context) => { - const hostId = context.userId; - if (!hostId) { - throw new AuthentificationError(); - } - const newEvent = new Event({ - hostId, - name, - description, - startDatetime, - finishDatetime, - }); - newEvent.designator = `${slugify(newEvent.name)}-${newEvent._id}`; - return new Promise((res, rej) => { - newEvent.save((err) => { - if (err) { - rej(err); - return; - } - res(newEvent); - }); - }); -}; - -const mutation = { - hostEvent: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/RegisterToEvent.js b/server/src/schema/mutations/RegisterToEvent.js index 7b3ee5050..445e26628 100644 --- a/server/src/schema/mutations/RegisterToEvent.js +++ b/server/src/schema/mutations/RegisterToEvent.js @@ -2,7 +2,6 @@ import 'dotenv/config'; import { GraphQLNonNull, GraphQLID, - GraphQLString, } from 'graphql'; import axios from 'axios'; import { @@ -12,45 +11,40 @@ import { } from '../../errors'; import { EventType } from '../types'; import { Event } from '../../models'; +import { ParticipantInputType } from '../types/input'; const args = { - designator: { type: new GraphQLNonNull(GraphQLID) }, - teamId: { type: new GraphQLNonNull(GraphQLString) }, - botId: { type: GraphQLString }, - releaseId: { type: GraphQLString }, + eventId: { type: new GraphQLNonNull(GraphQLID) }, + participant: { type: ParticipantInputType }, }; -const resolve = (parent, { - designator, teamId, botId, releaseId, -}, context) => { - const userid = context.userId; - if (!userid) { +const resolve = (parent, + { eventId: _id, participant: { teamId, botId, releaseId } }, + { userId, authorization }) => { + if (!userId) { throw new AuthentificationError(); } return new Promise((res, rej) => { axios({ - url: process.env.TEAMS_ENDPOINT, + url: process.env.GATEWAY_ENDPOINT, method: 'post', data: { query: ` { - teamsByRole{ + teams_TeamsByRole{ id } } `, }, - headers: { - userid, - authorization: context.authorization, - }, + headers: { authorization }, }).then( (result) => { if (!result.data.data.teamsByRole.some(team => team.id === teamId)) { rej(new WrongArgumentsError('You are not eligible to register this team')); return; } - Event.findOne({ designator }).exec((err, event) => { + Event.findOne({ _id }).exec((err, event) => { if (err) { rej(err); return; diff --git a/server/src/schema/mutations/ReorderRules.js b/server/src/schema/mutations/ReorderRules.js deleted file mode 100644 index 8f16546aa..000000000 --- a/server/src/schema/mutations/ReorderRules.js +++ /dev/null @@ -1,60 +0,0 @@ -import { - GraphQLNonNull, - GraphQLID, - GraphQLInt, -} from 'graphql'; -import { AuthentificationError, DatabaseError } from '../../errors'; -import { isBetween } from '../../utils/functions'; -import { EventType } from '../types'; -import { Event } from '../../models'; - -const args = { - eventDesignator: { type: new GraphQLNonNull(GraphQLID) }, - fromPosition: { type: new GraphQLNonNull(GraphQLInt) }, - toPosition: { type: new GraphQLNonNull(GraphQLInt) }, -}; - -const resolve = (parent, { eventDesignator, fromPosition, toPosition }, context) => { - const hostId = context.userId; - if (!hostId) { - throw new AuthentificationError(); - } - return new Promise((res, rej) => { - Event.findOne({ designator: eventDesignator, hostId: context.userId }).exec((err, event) => { - if (err) { - rej(err); - return; - } - if (!event) { - rej(new DatabaseError('None of the events you own respond to that designator')); - return; - } - const delta = fromPosition > toPosition ? 1 : -1; - event.rules.forEach((part) => { - if (part.position === fromPosition) { - part.position = toPosition; - } else if (isBetween(part.position, fromPosition, toPosition)) { - part.position += delta; - } - }); - - event.save((error) => { - if (error) { - rej(error); - return; - } - res(event); - }); - }); - }); -}; - -const mutation = { - reorderRules: { - type: EventType, - args, - resolve, - }, -}; - -export default mutation; diff --git a/server/src/schema/mutations/index.js b/server/src/schema/mutations/index.js index ffefe7dcf..2bd29dc34 100644 --- a/server/src/schema/mutations/index.js +++ b/server/src/schema/mutations/index.js @@ -2,36 +2,24 @@ import { GraphQLObjectType, } from 'graphql'; -import HostEventMutation from './HostEvent'; +import CreateEventMutation from './CreateEvent'; import EditEventMutation from './EditEvent'; import RegisterToEventMutation from './RegisterToEvent'; import EditParticipantMutation from './EditParticipant'; -import AddRuleMutation from './AddRule'; -import EditRuleMutation from './EditRule'; -import ReorderRulesMutation from './ReorderRules'; -import AddPrizeMutation from './AddPrize'; -import EditPrizeMutation from './EditPrize'; import CreateFormulaMutation from './CreateFormula'; -import CreateAndSetFormulaMutation from './CreateAndSetFormula'; import CreatePlotterMutation from './CreatePlotter'; -import CreateAndSetPlotterMutation from './CreateAndSetPlotter'; +import ChangeEventStateMutation from './ChangeEventState'; const Mutation = new GraphQLObjectType({ name: 'Mutation', fields: Object.assign( - HostEventMutation, + CreateEventMutation, EditEventMutation, RegisterToEventMutation, EditParticipantMutation, - AddRuleMutation, - EditRuleMutation, - ReorderRulesMutation, - AddPrizeMutation, - EditPrizeMutation, CreateFormulaMutation, - CreateAndSetFormulaMutation, CreatePlotterMutation, - CreateAndSetPlotterMutation, + ChangeEventStateMutation, ), }); diff --git a/server/src/schema/queries/Event.js b/server/src/schema/queries/Event.js index c35d48f47..590aac259 100644 --- a/server/src/schema/queries/Event.js +++ b/server/src/schema/queries/Event.js @@ -7,17 +7,17 @@ import { EventType } from '../types'; import { Event } from '../../models'; const args = { - designator: { type: new GraphQLNonNull(GraphQLID) }, + eventId: { type: new GraphQLNonNull(GraphQLID) }, }; -const resolve = (parent, { designator }) => new Promise((res, rej) => { - Event.findOne({ designator }).exec((err, event) => { +const resolve = (parent, { eventId: _id }) => new Promise((res, rej) => { + Event.findOne({ _id }).exec((err, event) => { if (err) { rej(err); return; } if (!event) { - rej(new DatabaseError('None of the events respond to that designator')); + rej(new DatabaseError('None of the events respond to that id')); return; } res(event); diff --git a/server/src/schema/queries/Events.js b/server/src/schema/queries/Events.js index c5b1b5e9f..fae289a5b 100644 --- a/server/src/schema/queries/Events.js +++ b/server/src/schema/queries/Events.js @@ -4,6 +4,7 @@ import { } from 'graphql'; import { EventType } from '../types'; import { Event } from '../../models'; +import { UNPUBLISHED, ARCHIVED } from '../../enums/EventState'; const args = { minDate: { type: GraphQLInt }, @@ -12,6 +13,7 @@ const args = { const resolve = (parent, { minDate, maxDate }) => Event.find( Object.assign( + { state: { $nin: [UNPUBLISHED, ARCHIVED] } }, minDate || maxDate ? { startDatetime: diff --git a/server/src/schema/queries/EventsByHost.js b/server/src/schema/queries/EventsByHost.js index ac4975f40..6941570d4 100644 --- a/server/src/schema/queries/EventsByHost.js +++ b/server/src/schema/queries/EventsByHost.js @@ -5,6 +5,7 @@ import { } from 'graphql'; import { EventType } from '../types'; import { Event } from '../../models'; +import { UNPUBLISHED, ARCHIVED } from '../../enums/EventState'; const args = { hostId: { type: GraphQLString }, @@ -14,7 +15,7 @@ const args = { const resolve = (parent, { hostId, minDate, maxDate }, context) => Event.find( Object.assign( - hostId ? { hostId } : { hostId: context.userId }, + hostId ? { hostId, state: { $nin: [UNPUBLISHED, ARCHIVED] } } : { hostId: context.userId }, minDate || maxDate ? { startDatetime: diff --git a/server/src/schema/queries/EventsByTeam.js b/server/src/schema/queries/EventsByTeam.js index 10a914288..e9147e9b9 100644 --- a/server/src/schema/queries/EventsByTeam.js +++ b/server/src/schema/queries/EventsByTeam.js @@ -6,6 +6,7 @@ import { } from 'graphql'; import { EventType } from '../types'; import { Event } from '../../models'; +import { UNPUBLISHED, ARCHIVED } from '../../enums/EventState'; const args = { teamId: { type: new GraphQLNonNull(GraphQLString) }, @@ -15,7 +16,11 @@ const args = { const resolve = (parent, { teamId, minDate, maxDate }) => Event.find( Object.assign( - { participants: { $elemMatch: { teamId } } }, + { + participants: { $elemMatch: { teamId } }, + state: { $nin: [UNPUBLISHED, ARCHIVED] }, + }, + minDate || maxDate ? { startDatetime: diff --git a/server/src/schema/types/AdditionalPrize.js b/server/src/schema/types/AdditionalPrize.js index ee3a791ff..1c888b687 100644 --- a/server/src/schema/types/AdditionalPrize.js +++ b/server/src/schema/types/AdditionalPrize.js @@ -1,15 +1,17 @@ import { GraphQLObjectType, + GraphQLNonNull, GraphQLString, GraphQLInt, } from 'graphql'; const AdditionalPrizeType = new GraphQLObjectType({ - name: 'OtherPrize', + name: 'AdditionalPrize', + description: 'Non algo complementary prize', fields: () => ({ condition: { type: GraphQLString }, - amount: { type: GraphQLInt }, - asset: { type: GraphQLString }, + amount: { type: new GraphQLNonNull(GraphQLInt) }, + asset: { type: new GraphQLNonNull(GraphQLString) }, }), }); diff --git a/server/src/schema/types/Event.js b/server/src/schema/types/Event.js index 7917e3032..e4582e346 100644 --- a/server/src/schema/types/Event.js +++ b/server/src/schema/types/Event.js @@ -12,11 +12,14 @@ import { ParticipantType, PrizeType, } from './index'; +import EventStateEnumType from './enum/EventState'; const EventType = new GraphQLObjectType({ name: 'Event', + description: 'Everything you need to know about an event', fields: () => ({ - designator: { type: GraphQLID }, + id: { type: GraphQLID }, + state: { type: EventStateEnumType }, name: { type: GraphQLString }, hostId: { type: GraphQLString }, description: { type: GraphQLString }, @@ -25,13 +28,13 @@ const EventType = new GraphQLObjectType({ formula: { type: FormulaType, resolve(parent) { - return parent.formula; + return parent.formulaId; }, }, plotter: { type: PlotterType, resolve(parent) { - return parent.plotter; + return parent.plotterId; }, }, rules: { diff --git a/server/src/schema/types/Formula.js b/server/src/schema/types/Formula.js index f5d312327..934cbcd60 100644 --- a/server/src/schema/types/Formula.js +++ b/server/src/schema/types/Formula.js @@ -6,6 +6,7 @@ import { const FormulaType = new GraphQLObjectType({ name: 'Formula', + description: 'For now it\'s simplay a named field', fields: () => ({ id: { type: GraphQLString }, ownerId: { type: GraphQLString }, diff --git a/server/src/schema/types/Participant.js b/server/src/schema/types/Participant.js index f3afb7745..28c2833df 100644 --- a/server/src/schema/types/Participant.js +++ b/server/src/schema/types/Participant.js @@ -5,6 +5,7 @@ import { const ParticipantType = new GraphQLObjectType({ name: 'Participant', + description: 'Informations about the participant of an event', fields: () => ({ teamId: { type: GraphQLString }, botId: { type: GraphQLString }, diff --git a/server/src/schema/types/Plotter.js b/server/src/schema/types/Plotter.js index 9e86390a5..798d197af 100644 --- a/server/src/schema/types/Plotter.js +++ b/server/src/schema/types/Plotter.js @@ -6,6 +6,7 @@ import { const PlotterType = new GraphQLObjectType({ name: 'Plotter', + description: 'Will soon change in order to use contained plotter objects', fields: () => ({ id: { type: GraphQLString }, ownerId: { type: GraphQLString }, diff --git a/server/src/schema/types/Prize.js b/server/src/schema/types/Prize.js index 4b2fc8aba..7a81a702a 100644 --- a/server/src/schema/types/Prize.js +++ b/server/src/schema/types/Prize.js @@ -2,14 +2,16 @@ import { GraphQLObjectType, GraphQLList, GraphQLInt, + GraphQLNonNull, } from 'graphql'; import { AdditionalPrizeType } from './index'; const PrizeType = new GraphQLObjectType({ name: 'Prize', + description: 'Prize, by default in algos', fields: () => ({ - rank: { type: GraphQLInt }, - amount: { type: GraphQLInt }, + rank: { type: new GraphQLNonNull(GraphQLInt) }, + amount: { type: new GraphQLNonNull(GraphQLInt) }, additional: { type: new GraphQLList(AdditionalPrizeType), resolve(parent) { diff --git a/server/src/schema/types/Rule.js b/server/src/schema/types/Rule.js index e39a877fc..46358242d 100644 --- a/server/src/schema/types/Rule.js +++ b/server/src/schema/types/Rule.js @@ -6,6 +6,7 @@ import { const RuleType = new GraphQLObjectType({ name: 'Rule', + description: 'Textual rules of an event', fields: () => ({ position: { type: GraphQLInt }, title: { type: GraphQLString }, diff --git a/server/src/schema/types/enum/EventState.js b/server/src/schema/types/enum/EventState.js new file mode 100644 index 000000000..d4ef1304f --- /dev/null +++ b/server/src/schema/types/enum/EventState.js @@ -0,0 +1,19 @@ +import { + GraphQLEnumType, +} from 'graphql'; + +import { EventStateEnum } from '../../../enums/EventState'; + +const values = {}; +EventStateEnum.forEach((EventState) => { + values[EventState] = { value: EventState }; +}); + +const EventStateEnumType = new GraphQLEnumType({ + name: 'EventStateEnum', + values, +}); + +export { + EventStateEnumType as default, +}; diff --git a/server/src/schema/types/input/AdditionalPrize.js b/server/src/schema/types/input/AdditionalPrize.js new file mode 100644 index 000000000..0fe28c2f0 --- /dev/null +++ b/server/src/schema/types/input/AdditionalPrize.js @@ -0,0 +1,18 @@ +import { + GraphQLInputObjectType, + GraphQLNonNull, + GraphQLString, + GraphQLInt, +} from 'graphql'; + +const Type = new GraphQLInputObjectType({ + name: 'AdditionalPrizeInput', + description: 'Payload for formula input', + fields: () => ({ + condition: { type: GraphQLString }, + amount: { type: new GraphQLNonNull(GraphQLInt) }, + asset: { type: new GraphQLNonNull(GraphQLString) }, + }), +}); + +export default Type; diff --git a/server/src/schema/types/input/Event.js b/server/src/schema/types/input/Event.js new file mode 100644 index 000000000..eb34c274f --- /dev/null +++ b/server/src/schema/types/input/Event.js @@ -0,0 +1,25 @@ +import { + GraphQLString, + GraphQLInt, + GraphQLInputObjectType, + GraphQLList, +} from 'graphql'; +import InputPrizeType from './Prize'; +import InputRuleType from './Rule'; + +const Type = new GraphQLInputObjectType({ + name: 'EventInput', + description: 'Payload for event input', + fields: () => ({ + name: { type: GraphQLString }, + description: { type: GraphQLString }, + startDatetime: { type: GraphQLInt }, + finishDatetime: { type: GraphQLInt }, + formulaId: { type: GraphQLString }, + plotterId: { type: GraphQLString }, + prizes: { type: new GraphQLList(InputPrizeType) }, + rules: { type: new GraphQLList(InputRuleType) }, + }), +}); + +export default Type; diff --git a/server/src/schema/types/input/Formula.js b/server/src/schema/types/input/Formula.js new file mode 100644 index 000000000..bd9d070f1 --- /dev/null +++ b/server/src/schema/types/input/Formula.js @@ -0,0 +1,15 @@ +import { + GraphQLNonNull, + GraphQLString, + GraphQLInputObjectType, +} from 'graphql'; + +const Type = new GraphQLInputObjectType({ + name: 'FormulaInput', + description: 'Payload for formula input', + fields: () => ({ + name: { type: new GraphQLNonNull(GraphQLString) }, + }), +}); + +export default Type; diff --git a/server/src/schema/types/input/Participant.js b/server/src/schema/types/input/Participant.js new file mode 100644 index 000000000..c3853df83 --- /dev/null +++ b/server/src/schema/types/input/Participant.js @@ -0,0 +1,17 @@ +import { + GraphQLInputObjectType, + GraphQLString, + GraphQLNonNull, +} from 'graphql'; + +const Type = new GraphQLInputObjectType({ + name: 'ParticipantInput', + description: 'Payload for formula input', + fields: () => ({ + teamId: { type: new GraphQLNonNull(GraphQLString) }, + botId: { type: GraphQLString }, + releaseId: { type: GraphQLString }, + }), +}); + +export default Type; diff --git a/server/src/schema/types/input/Plotter.js b/server/src/schema/types/input/Plotter.js new file mode 100644 index 000000000..1368aecf9 --- /dev/null +++ b/server/src/schema/types/input/Plotter.js @@ -0,0 +1,18 @@ +import { + GraphQLNonNull, + GraphQLString, + GraphQLInputObjectType, +} from 'graphql'; + +const Type = new GraphQLInputObjectType({ + name: 'PlotterInput', + description: 'Payload for plotter input', + fields: () => ({ + name: { type: new GraphQLNonNull(GraphQLString) }, + host: { type: GraphQLString }, + repo: { type: GraphQLString }, + moduleName: { type: GraphQLString }, + }), +}); + +export default Type; diff --git a/server/src/schema/types/input/Prize.js b/server/src/schema/types/input/Prize.js new file mode 100644 index 000000000..5be06f0f2 --- /dev/null +++ b/server/src/schema/types/input/Prize.js @@ -0,0 +1,21 @@ +import { + GraphQLInputObjectType, + GraphQLList, + GraphQLInt, + GraphQLNonNull, +} from 'graphql'; +import InputAdditionalPrizeType from './AdditionalPrize'; + +const Type = new GraphQLInputObjectType({ + name: 'PrizeInput', + description: 'Payload for formula input', + fields: () => ({ + rank: { type: new GraphQLNonNull(GraphQLInt) }, + amount: { type: new GraphQLNonNull(GraphQLInt) }, + additional: { + type: new GraphQLList(InputAdditionalPrizeType), + }, + }), +}); + +export default Type; diff --git a/server/src/schema/types/input/Rule.js b/server/src/schema/types/input/Rule.js new file mode 100644 index 000000000..220b99412 --- /dev/null +++ b/server/src/schema/types/input/Rule.js @@ -0,0 +1,18 @@ +import { + GraphQLNonNull, + GraphQLString, + GraphQLInt, + GraphQLInputObjectType, +} from 'graphql'; + +const Type = new GraphQLInputObjectType({ + name: 'RuleInput', + description: 'Payload for rule input', + fields: () => ({ + position: { type: GraphQLInt }, + title: { type: new GraphQLNonNull(GraphQLString) }, + description: { type: GraphQLString }, + }), +}); + +export default Type; diff --git a/server/src/schema/types/input/index.js b/server/src/schema/types/input/index.js new file mode 100644 index 000000000..5bab6702a --- /dev/null +++ b/server/src/schema/types/input/index.js @@ -0,0 +1,17 @@ +import PlotterInputType from './Plotter'; +import RuleInputType from './Rule'; +import PrizeInputType from './Prize'; +import FormulaInputType from './Formula'; +import EventInputType from './Event'; +import AdditionalPrizeInputType from './AdditionalPrize'; +import ParticipantInputType from './Participant'; + +export { + PlotterInputType, + RuleInputType, + PrizeInputType, + FormulaInputType, + EventInputType, + AdditionalPrizeInputType, + ParticipantInputType, +};