diff --git a/client/html/index.html b/client/html/index.html index 808c5e679..a166aa46d 100644 --- a/client/html/index.html +++ b/client/html/index.html @@ -16,7 +16,9 @@ + + @@ -55,7 +57,7 @@ - +
@@ -64,4 +66,4 @@ - + \ No newline at end of file diff --git a/client/package-lock.json b/client/package-lock.json index 7ae6f18d7..1dfe69f0f 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1564,18 +1564,20 @@ } }, "@superalgos/strategizer-client": { - "version": "0.0.15", - "resolved": "https://registry.npmjs.org/@superalgos/strategizer-client/-/strategizer-client-0.0.15.tgz", - "integrity": "sha512-wI/V8jsBlH391qLIY07Q05AOmHUPViES2Ow/klLYCslRaadMbWqYrWYJSoT618eH3Fnlr+M57lkQWIbrSLxvbg==", + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@superalgos/strategizer-client/-/strategizer-client-0.0.18.tgz", + "integrity": "sha512-A/FwmTej1Gvxt0v66DyJfzOp3YZKR7vga0VKsMfDmX89lUOaQk2qdb3w8W2eCTw8jAwT2uoY67fXBmxiFiQQQA==", "dev": true, "requires": { "@material-ui/core": "^3.6.2", "@material-ui/icons": "^3.0.1", "apollo-client": "^2.5.1", + "brace": "^0.11.1", "graphql": "^14.0.2", "graphql-tag": "^2.10.0", "lodash": "^4.17.11", "react": "^16.8.4", + "react-ace": "^6.5.0", "react-apollo": "^2.5.2", "react-dom": "^16.8.4", "react-markdown": "^4.0.6", @@ -1583,13 +1585,13 @@ } }, "@superalgos/teams-client": { - "version": "0.0.38", - "resolved": "https://registry.npmjs.org/@superalgos/teams-client/-/teams-client-0.0.38.tgz", - "integrity": "sha512-Mbz0klKWyN9qP8Zds1khpXHx0FEHMWxDh7et5J2Rl/YTF3TqfBILtbgORJ6x6B8toz5FxBhvE6mZjHnvvY05fw==", + "version": "0.0.40", + "resolved": "https://registry.npmjs.org/@superalgos/teams-client/-/teams-client-0.0.40.tgz", + "integrity": "sha512-ss07awABw2V83y6nviWjxQliNykJZgl02UGn2rQcLKQqEmfoPqGnqysAvPBmwhDN/s2CvIGeMuiJrkXMOPrIAg==", "dev": true, "requires": { "@azure/storage-blob": "^10.0.0-preview", - "@superalgos/web-components": "0.0.22", + "@superalgos/web-components": "0.0.23", "apollo-cache-inmemory": "^1.3.5", "apollo-client": "^2.4.2", "apollo-link": "^1.2.3", @@ -1618,9 +1620,9 @@ }, "dependencies": { "graphql": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.2.1.tgz", - "integrity": "sha512-2PL1UbvKeSjy/lUeJqHk+eR9CvuErXoCNwJI4jm3oNFEeY+9ELqHNKO1ZuSxAkasPkpWbmT/iMRMFxd3cEL3tQ==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.3.0.tgz", + "integrity": "sha512-MdfI4v7kSNC3NhB7cF8KNijDsifuWO2XOtzpyququqaclO8wVuChYv+KogexDwgP5sp7nFI9Z6N4QHgoLkfjrg==", "dev": true, "requires": { "iterall": "^1.2.2" @@ -1686,9 +1688,9 @@ } }, "@superalgos/web-components": { - "version": "0.0.22", - "resolved": "https://registry.npmjs.org/@superalgos/web-components/-/web-components-0.0.22.tgz", - "integrity": "sha512-TsPUllSXbZtIX1I4kAdA4vgarmEkVLHOhB6Kq5syAwm2gps6uNkl/pSMOb18h803H8osT/rHjhxA2Uyive4/4Q==", + "version": "0.0.23", + "resolved": "https://registry.npmjs.org/@superalgos/web-components/-/web-components-0.0.23.tgz", + "integrity": "sha512-lychWtU8KZ61yh7OYwt/Gp/0lbRRL6ZP7dzGstq1BDxJLf74c+c5DaMJl9bOv60srlZUs0qU4IR6ZJdR3pWkqQ==", "dev": true, "requires": { "@azure/storage-blob": "^10.3.0", @@ -1704,15 +1706,15 @@ "react": "^16.8.6", "react-apollo": "^2.5.4", "react-dom": "^16.8.6", - "react-dropzone": "^10.1.3", + "react-dropzone": "^10.1.4", "react-helmet": "^5.2.0", "react-router-dom": "^5.0.0" }, "dependencies": { "graphql": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.2.1.tgz", - "integrity": "sha512-2PL1UbvKeSjy/lUeJqHk+eR9CvuErXoCNwJI4jm3oNFEeY+9ELqHNKO1ZuSxAkasPkpWbmT/iMRMFxd3cEL3tQ==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.3.0.tgz", + "integrity": "sha512-MdfI4v7kSNC3NhB7cF8KNijDsifuWO2XOtzpyququqaclO8wVuChYv+KogexDwgP5sp7nFI9Z6N4QHgoLkfjrg==", "dev": true, "requires": { "iterall": "^1.2.2" @@ -1788,9 +1790,9 @@ } }, "ts-invariant": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.1.tgz", - "integrity": "sha512-fdL8AZinDiVKMsOI0cOWHLprS85LWy2p/eVSctVe6fpZF9BAvO59sQYMEWQ37yybBtlKU2zkmILYmy1jrOf6+g==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.2.tgz", + "integrity": "sha512-PTAAn8lJPEdRBJJEs4ig6MVZWfO12yrFzV7YaPslmyhG7+4MA279y4BXT3f72gXeVl0mC1aAWq2rMX4eKTWU/Q==", "dev": true, "requires": { "tslib": "^1.9.3" @@ -2345,7 +2347,7 @@ "dependencies": { "@types/tapable": { "version": "0.2.5", - "resolved": "http://registry.npmjs.org/@types/tapable/-/tapable-0.2.5.tgz", + "resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-0.2.5.tgz", "integrity": "sha512-dEoVvo/I9QFomyhY+4Q6Qk+I+dhG59TYceZgC6Q0mCifVPErx6Y83PNTKGDS5e9h9Eti6q0S2mm16BU6iQK+3w==", "dev": true } @@ -3374,7 +3376,7 @@ }, "axios": { "version": "0.18.0", - "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", "dev": true, "requires": { @@ -3418,7 +3420,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -3554,7 +3556,7 @@ }, "babel-plugin-syntax-flow": { "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", "dev": true }, @@ -4327,6 +4329,12 @@ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, + "brace": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/brace/-/brace-0.11.1.tgz", + "integrity": "sha1-SJb8ydVE7vRfS7dmDbMg07N5/lg=", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -4407,7 +4415,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -4444,7 +4452,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -4497,7 +4505,7 @@ }, "buffer": { "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -4605,7 +4613,7 @@ }, "callsites": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" }, "camel-case": { @@ -5788,7 +5796,7 @@ }, "core-js": { "version": "1.2.7", - "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" }, "core-js-compat": { @@ -5846,7 +5854,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -5859,7 +5867,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -5903,13 +5911,13 @@ "dependencies": { "node-fetch": { "version": "2.1.2", - "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=", "dev": true }, "whatwg-fetch": { "version": "2.0.4", - "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==", "dev": true } @@ -5963,7 +5971,7 @@ }, "css-color-names": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=" }, "css-declaration-sorter": { @@ -6446,7 +6454,7 @@ "dependencies": { "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -6459,7 +6467,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -6551,6 +6559,12 @@ } } }, + "diff-match-patch": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.4.tgz", + "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==", + "dev": true + }, "diff-sequences": { "version": "24.3.0", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", @@ -6559,7 +6573,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -7975,7 +7989,7 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "dev": true, "requires": { @@ -9246,7 +9260,7 @@ }, "http-errors": { "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "dev": true, "requires": { @@ -9756,7 +9770,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" }, "is-path-cwd": { @@ -11910,7 +11924,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -12491,7 +12505,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -15914,52 +15928,6 @@ "read-pkg": "^3.0.0", "shell-quote": "^1.6.1", "string.prototype.padend": "^3.0.0" - }, - "dependencies": { - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - } } }, "npm-run-path": { @@ -16381,9 +16349,9 @@ } }, "parse-entities": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.1.tgz", - "integrity": "sha512-NBWYLQm1KSoDKk7GAHyioLTvCZ5QjdH/ASBBQTD3iLiAWJXS5bg1jEWI8nIJ+vgVvsceBVBcDGRWSo0KVQBvvg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.2.tgz", + "integrity": "sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg==", "dev": true, "requires": { "character-entities": "^1.0.0", @@ -16652,7 +16620,7 @@ "dependencies": { "async": { "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, @@ -17584,7 +17552,7 @@ }, "acorn-jsx": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { @@ -17593,7 +17561,7 @@ "dependencies": { "acorn": { "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } @@ -17651,7 +17619,7 @@ }, "eslint": { "version": "4.19.1", - "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { @@ -17697,7 +17665,7 @@ }, "espree": { "version": "3.5.4", - "resolved": "http://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { @@ -17707,7 +17675,7 @@ }, "external-editor": { "version": "2.2.0", - "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { @@ -17774,7 +17742,7 @@ }, "regexpp": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", "dev": true }, @@ -18466,6 +18434,19 @@ } } }, + "react-ace": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/react-ace/-/react-ace-6.5.0.tgz", + "integrity": "sha512-W8iA6669Tf3sfjCsBg8gKs2pUVMy6BroX6O6GZcgadnLN+MTq7jhs6Q2Rsjq3E3SrWjyA9vZgs1Uzjy8XgWX5w==", + "dev": true, + "requires": { + "brace": "^0.11.1", + "diff-match-patch": "^1.0.4", + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "prop-types": "^15.6.2" + } + }, "react-apollo": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/react-apollo/-/react-apollo-2.5.2.tgz", @@ -18652,15 +18633,21 @@ "warning": "^4.0.1" } }, + "react-fast-compare": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", + "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==", + "dev": true + }, "react-helmet": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-5.2.0.tgz", - "integrity": "sha1-qBgR3yExOm1VxfBYxK66XW89l6c=", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-5.2.1.tgz", + "integrity": "sha512-CnwD822LU8NDBnjCpZ4ySh8L6HYyngViTZLfBBb3NjtrpN8m49clH8hidHouq20I51Y6TpCTISCBbqiY5GamwA==", "dev": true, "requires": { - "deep-equal": "^1.0.1", "object-assign": "^4.1.1", "prop-types": "^15.5.4", + "react-fast-compare": "^2.0.2", "react-side-effect": "^1.1.0" } }, @@ -19389,7 +19376,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -19916,7 +19903,7 @@ "dependencies": { "css-select": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", "dev": true, "requires": { @@ -20082,7 +20069,7 @@ }, "callsites": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, @@ -20809,7 +20796,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -21727,7 +21714,7 @@ }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, @@ -22477,7 +22464,7 @@ }, "acorn-jsx": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { @@ -22486,7 +22473,7 @@ "dependencies": { "acorn": { "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } @@ -22503,7 +22490,7 @@ }, "espree": { "version": "3.5.4", - "resolved": "http://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { @@ -24103,7 +24090,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { @@ -24191,7 +24178,7 @@ }, "xmlbuilder": { "version": "9.0.7", - "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", "dev": true }, diff --git a/client/package.json b/client/package.json index 9fe96de19..dbe04cf22 100644 --- a/client/package.json +++ b/client/package.json @@ -36,10 +36,10 @@ "@superalgos/key-vault-client": "0.0.32", "@superalgos/logs-client": "0.0.1", "@superalgos/operations-client": "0.0.34", - "@superalgos/strategizer-client": "0.0.15", - "@superalgos/teams-client": "0.0.38", - "@superalgos/users-client": "0.0.26", - "@superalgos/web-components": "0.0.22", + "@superalgos/strategizer-client": "0.0.18", + "@superalgos/teams-client": "0.0.40", + "@superalgos/users-client": "0.0.27", + "@superalgos/web-components": "0.0.23", "autoprefixer": "^9.2.0", "babel-loader": "^8.0.4", "babel-preset-flow": "6.23.0", diff --git a/client/src/auth/index.js b/client/src/auth/index.js index 8ef99e1ff..9b35d50bf 100644 --- a/client/src/auth/index.js +++ b/client/src/auth/index.js @@ -2,13 +2,15 @@ import Auth0Lock from 'auth0-lock' import gql from 'graphql-tag' import { getItem, setItem } from '../utils/local-storage' -import { validObject, deleteCookie } from '../utils/js-helpers' +import { validObject, deleteCookie, slugify, isEmpty } from '../utils/js-helpers' import Log from '../utils/log' import { client } from '../graphql/apollo' import { AUTH_CONFIG } from './Auth0' // create by renaming Auth0.sample.js to Auth0.js and setting vars +import { setInitialEcosystem } from '../utils/ecosystem' + const AUTHENTICATE = gql` mutation authenticate($idToken: String!) { users_Authenticate(idToken: $idToken) { @@ -28,6 +30,25 @@ const VERIFY_TEAM_INVITE = gql` } } ` +const GET_TEAMS_BY_OWNER = gql` + query teamsByOwnerQuery { + teams_TeamsByOwner { + id + name + slug + } + } +` + +const CREATE_TEAM = gql` + mutation CreateTeamMutation($name: String!, $slug: String!, $botName: String!, $botSlug: String!) { + teams_CreateTeam(name: $name, slug: $slug, botName: $botName, botSlug: $botSlug) { + id + name + slug + } + } +` export const defaultOptions = { oidcConformant: true, @@ -203,7 +224,34 @@ class Auth { authId: response.data.users_Authenticate.authId, alias: response.data.users_Authenticate.alias } + if (validObject(user, 'alias')) { + Log.info(user.alias) + const existingTeam = await client.query({ + query: GET_TEAMS_BY_OWNER + }) + Log.info(existingTeam) + Log.info(existingTeam.data.teams_TeamsByOwner) + if (validObject(existingTeam.data, 'teams_TeamsByOwner') && isEmpty(existingTeam.data.teams_TeamsByOwner)) { + const slug = slugify(user.alias) + const newTeam = await client.mutate({ + mutation: CREATE_TEAM, + variables: { + name: slug, + slug: slug, + botName: `bot-${slug}`, + botSlug: `bot-${slug}` + } + }) + Log.info(newTeam) + Log.info(newTeam.data.teams_CreateTeam) + if (!validObject(newTeam.data, 'teams_CreateTeam') || isEmpty(newTeam.data.teams_CreateTeam)) { + throw newTeam.data.error + } + Log.info('Team and Bot Creation Success') + } + } setItem('user', JSON.stringify(user)) + window.location.href = '/' return response.data } catch (err) { @@ -213,7 +261,10 @@ class Auth { logout () { // Clear access token and ID token from local storage - window.localStorage.clear() + window.localStorage.removeItem('access_token') + window.localStorage.removeItem('user') + window.localStorage.removeItem('name') + window.localStorage.removeItem('ecosystem') deleteCookie('ajs_anonymous_id') deleteCookie('ajs_user_id') deleteCookie('current_tenant') diff --git a/client/src/graphql/EcosystemQuery.js b/client/src/graphql/EcosystemQuery.js new file mode 100644 index 000000000..5f0ab6ef4 --- /dev/null +++ b/client/src/graphql/EcosystemQuery.js @@ -0,0 +1,121 @@ +import gql from 'graphql-tag' + +export const ECOSYSTEM_QUERY = gql` + query { + web_GetEcosystem { + id + devTeams { + codeName + displayName + host { + url + storage + container + accessKey + } + bots { + codeName + displayName + type + profilePicture + repo + configFile + products{ + codeName + displayName + description + dataSets{ + codeName + type + validPeriods + filePath + fileName + dataRange{ + filePath + fileName + } + } + exchangeList{ + name + } + plotter{ + devTeam + codeName + moduleName + repo + } + } + } + plotters { + codeName + displayName + modules{ + codeName + moduleName + description + profilePicture + panels{ + codeName + moduleName + event + } + } + repo + configFile + } + } + hosts { + codeName + displayName + host { + url + storage + container + accessKey + } + competitions { + codeName + displayName + description + startDatetime + finishDatetime + formula + plotter{ + devTeam + codeName + host{ + url + storage + container + accessKey + } + moduleName + repo + } + rules + prizes + participants + repo + configFile + } + plotters { + codeName + displayName + modules{ + codeName + moduleName + description + profilePicture + panels{ + codeName + moduleName + event + } + } + repo + configFile + } + } + } + } +` diff --git a/client/src/graphql/apollo.js b/client/src/graphql/apollo.js index a07faac41..7a194d4cd 100644 --- a/client/src/graphql/apollo.js +++ b/client/src/graphql/apollo.js @@ -15,7 +15,9 @@ const authRetryLink = onError( // User access token has expired // console.log('authLink: ', graphQLErrors) // check for error message to intercept and resend with Auth0 access token if (graphQLErrors[0].message === 'Context creation failed: jwt expired') { - window.localStorage.clear() + window.localStorage.removeItem('access_token') + window.localStorage.removeItem('user') + window.localStorage.removeItem('name') location.reload() } else if (graphQLErrors[0].message === 'Not logged in') { // We assume we have auth0 access token needed to run the async request @@ -74,7 +76,7 @@ const defaultOptions = { errorPolicy: 'all' }, query: { - fetchPolicy: 'cache-and-network', + fetchPolicy: 'network-only', errorPolicy: 'all' }, mutate: { diff --git a/client/src/utils/ecosystem.js b/client/src/utils/ecosystem.js new file mode 100644 index 000000000..8c7e49780 --- /dev/null +++ b/client/src/utils/ecosystem.js @@ -0,0 +1,12 @@ +import { client } from '../graphql/apollo' +import { ECOSYSTEM_QUERY } from '../graphql/EcosystemQuery' +import Log from './log' + +export async function setInitialEcosystem() { + try { + const ecosystem = await client.query({ query: ECOSYSTEM_QUERY }) + window.localStorage.setItem('ecosystem', JSON.stringify(ecosystem.data.web_GetEcosystem)) + } catch (error) { + Log.error('Error getting the ecosystem: ' + error) + } + } diff --git a/client/src/utils/log.js b/client/src/utils/log.js index d05bebc8a..69263820d 100644 --- a/client/src/utils/log.js +++ b/client/src/utils/log.js @@ -1,6 +1,6 @@ import debug from 'debug' -const BASE = 'advanced-algos' +const BASE = 'superalgos' const COLOURS = { info: 'blue', warn: 'orange', diff --git a/client/src/views/home/index.js b/client/src/views/home/index.js index ee2f78691..ebc655054 100644 --- a/client/src/views/home/index.js +++ b/client/src/views/home/index.js @@ -17,38 +17,17 @@ class Home extends Component { } render () { let user = JSON.parse(this.state.user) - if(this.state.user !== undefined && this.state.user !== null){} + if (this.state.user !== undefined && this.state.user !== null) {} return ( - {this.state.user !== undefined && this.state.user !== null && ( - -
- DEMO OVERVIEW - 1. Create a Team and Fork the Template Bots → - 2. Visit the Strategizer and learn how to build a strategy → - 3. Run a clone instance of your Simulator bot to test the strategy → - 4. View the results of your strategy in the charts → - 5. Now use your strategy with your trading bot by running a backtest clone instance → - 5. (Optional) Add an exchange API key to run your trading bot live → -
-
- )} - {(this.state.user === undefined || this.state.user === null) && ( - - )} +
Welcome to the Superalgos Platform! - TRY OUT THE STRATEGIZER DEMO
Before you begin, please be aware this is an alpha stage deployment. @@ -56,20 +35,12 @@ class Home extends Component { However, you may encounter occasional instability and errors. - At this early stage, the focus of the Superalgos Platform is the Strategizer, a tool directed mostly at traders. To try out the Demo version hosted here you will need to Sign Up / Login. Once you are logged in, you will find basic instructions on how to proceed, at this home page (click the Superalgos logo to return to this home page).
- - If you are a developer, trying out the Strategizer may open your eyes as of what may be achieved with the - Strategizer and the Superalgos Platform in general. - - - The Strategizer is conceived to work with as many indicators and pre programmed strategies as developers are willing to program. - If you wish to set up your own indicators and strategies, please get in touch with us and we'll show you how (give us a shout in the Community Telegram) diff --git a/client/src/views/layout/header/LoggedIn.js b/client/src/views/layout/header/LoggedIn.js index 3c346c9fa..c638639e8 100644 --- a/client/src/views/layout/header/LoggedIn.js +++ b/client/src/views/layout/header/LoggedIn.js @@ -34,6 +34,7 @@ export const LoggedIn = props => { toggleMenuOpen(42, true)}> {displayName}
  • closeAll()}> Your Profile
  • +
  • closeAll()}> Your Team
  • auth.logout()}> Logout
  • Docs
  • Exit Platform
  • diff --git a/client/src/views/layout/header/imports.js b/client/src/views/layout/header/imports.js index 3f2f7aae0..1a8ad21df 100644 --- a/client/src/views/layout/header/imports.js +++ b/client/src/views/layout/header/imports.js @@ -25,6 +25,7 @@ const usersMenus = { ] } +/* const teamsMenus = { title: 'Teams', to: '/teams', @@ -36,6 +37,7 @@ const teamsMenus = { { title: 'Report a Bug', to: 'https://github.com/Superalgos/TeamsModule/issues/new', icon: BugReport, externalLink: true } ] } +*/ const eventsMenus = { title: 'Events', @@ -85,6 +87,7 @@ const cockpitMenus = { ] } +/* const strategizerMenus = { title: 'Strategizer', to: '/strategizer', @@ -92,14 +95,15 @@ const strategizerMenus = { authenticated: true, submenus: [] } +*/ const allMenus = [ usersMenus, - teamsMenus, + // teamsMenus, eventsMenus, keyvaultMenus, operationsMenus, - strategizerMenus, + // strategizerMenus, cockpitMenus ] diff --git a/client/src/views/layout/header/index.js b/client/src/views/layout/header/index.js index 793531d83..39bc0528c 100644 --- a/client/src/views/layout/header/index.js +++ b/client/src/views/layout/header/index.js @@ -76,7 +76,9 @@ class Header extends Component { let { onTop, mobileOpen, openedMenu } = this.state if (window.localStorage.getItem('access_token')) { if (jwtDecode(window.localStorage.getItem('access_token')).exp < new Date().getTime() / 1000) { - window.localStorage.clear() + window.localStorage.removeItem('access_token') + window.localStorage.removeItem('user') + window.localStorage.removeItem('name') window.location.reload() } } @@ -86,7 +88,7 @@ class Header extends Component { if (authenticated && !(this.state.user !== undefined && this.state.user !== null)) { return } - let cssChildren = submenus.length === 0 ? null : 'hasChildren'; + let cssChildren = submenus.length === 0 ? null : 'hasChildren' return (
  • this.toggleMenuOpen(index, bigScreen)} @@ -113,9 +115,6 @@ class Header extends Component {