From fdf0979830fece04208a6b3bb06bb5323a3c149b Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 23 Jun 2021 15:40:45 +0200 Subject: [PATCH 01/50] initial commit, base packages --- backend/.gitignore | 1 + backend/package.json | 17 + backend/yarn.lock | 957 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 975 insertions(+) create mode 100644 backend/.gitignore create mode 100644 backend/package.json create mode 100644 backend/yarn.lock diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 000000000..2ccbe4656 --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1 @@ +/node_modules/ diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 000000000..fc4f73533 --- /dev/null +++ b/backend/package.json @@ -0,0 +1,17 @@ +{ + "name": "gradido-backend", + "version": "0.0.1", + "description": "Gradido unified backend providing an API-Service for Gradido Transactions", + "main": "index.js", + "repository": "https://github.com/gradido/gradido/backend", + "author": "Ulf Gebhardt", + "license": "MIT", + "private": false, + "dependencies": { + "express": "^4.17.1", + "express-graphql": "^0.12.0", + "reflect-metadata": "^0.1.13", + "type-graphql": "^1.1.1", + "typeorm": "^0.2.34" + } +} diff --git a/backend/yarn.lock b/backend/yarn.lock new file mode 100644 index 000000000..d7fc8be9f --- /dev/null +++ b/backend/yarn.lock @@ -0,0 +1,957 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@sqltools/formatter@^1.2.2": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.3.tgz#1185726610acc37317ddab11c3c7f9066966bd20" + integrity sha512-O3uyB/JbkAEMZaP3YqyHH7TMnex7tWyCbCI4EfJdOCoN6HIhqdJBWTM6aCCiWQ/5f5wxjgU735QAIpJbjDvmzg== + +"@types/glob@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" + integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + +"@types/minimatch@*": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" + integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== + +"@types/node@*": + version "15.12.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.4.tgz#e1cf817d70a1e118e81922c4ff6683ce9d422e26" + integrity sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA== + +"@types/node@^14.11.2": + version "14.17.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.4.tgz#218712242446fc868d0e007af29a4408c7765bc0" + integrity sha512-8kQ3+wKGRNN0ghtEn7EGps/B8CzuBz1nXZEIGGLP2GnwbqYn4dbTs7k+VKLTq1HvZLRCIDtN3Snx1Ege8B7L5A== + +"@types/semver@^7.3.3": + version "7.3.6" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.6.tgz#e9831776f4512a7ba6da53e71c26e5fb67882d63" + integrity sha512-0caWDWmpCp0uifxFh+FaqK3CuZ2SkRR/ZRxAV5+zNdC3QVUi6wyOJnefhPvtNt8NQWXB5OA93BUvZsXpWat2Xw== + +"@types/zen-observable@^0.8.2": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" + integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== + +accepts@^1.3.7, accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + +app-root-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.0.0.tgz#210b6f43873227e18a4b810a032283311555d5ad" + integrity sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw== + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +body-parser@1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + +chalk@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" + integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +cli-highlight@^2.1.10: + version "2.1.11" + resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.11.tgz#49736fa452f0aaf4fae580e30acb26828d2dc1bf" + integrity sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg== + dependencies: + chalk "^4.0.0" + highlight.js "^10.7.1" + mz "^2.4.0" + parse5 "^5.1.1" + parse5-htmlparser2-tree-adapter "^6.0.0" + yargs "^16.0.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + +content-type@^1.0.4, content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + +debug@2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + +dotenv@^8.2.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" + integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + +express-graphql@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/express-graphql/-/express-graphql-0.12.0.tgz#58deabc309909ca2c9fe2f83f5fbe94429aa23df" + integrity sha512-DwYaJQy0amdy3pgNtiTDuGGM2BLdj+YO2SgbKoLliCfuHv3VVTt7vNG/ZqK2hRYjtYHE2t2KB705EU94mE64zg== + dependencies: + accepts "^1.3.7" + content-type "^1.0.4" + http-errors "1.8.0" + raw-body "^2.4.1" + +express@^4.17.1: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +figlet@^1.1.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.5.0.tgz#2db4d00a584e5155a96080632db919213c3e003c" + integrity sha512-ZQJM4aifMpz6H19AW1VqvZ7l4pOE9p7i/3LyxgO2kp+PO/VcDYNqIHEMtkccqIhTXMKci4kjueJr/iCQEaT/Ww== + +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +glob@^7.1.6: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graphql-query-complexity@^0.7.0: + version "0.7.2" + resolved "https://registry.yarnpkg.com/graphql-query-complexity/-/graphql-query-complexity-0.7.2.tgz#7fc6bb20930ab1b666ecf3bbfb24b65b6f08ecc4" + integrity sha512-+VgmrfxGEjHI3zuojWOR8bsz7Ycz/BZjNjxnlUieTz5DsB92WoIrYCSZdWG7UWZ3rfcA1Gb2Nf+wB80GsaZWuQ== + dependencies: + lodash.get "^4.4.2" + +graphql-subscriptions@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/graphql-subscriptions/-/graphql-subscriptions-1.2.1.tgz#2142b2d729661ddf967b7388f7cf1dd4cf2e061d" + integrity sha512-95yD/tKi24q8xYa7Q9rhQN16AYj5wPbrb8tmHGM3WRc9EBmWrG/0kkMl+tQG8wcEuE9ibR4zyOM31p5Sdr2v4g== + dependencies: + iterall "^1.3.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +highlight.js@^10.7.1: + version "10.7.3" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" + integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== + +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@1.7.3, http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" + integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +iterall@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" + integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== + +js-yaml@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + +mime-db@1.48.0: + version "1.48.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" + integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== + +mime-types@~2.1.24: + version "2.1.31" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" + integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== + dependencies: + mime-db "1.48.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +mz@^2.4.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +parent-require@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-require/-/parent-require-1.0.0.tgz#746a167638083a860b0eef6732cb27ed46c32977" + integrity sha1-dGoWdjgIOoYLDu9nMssn7UbDKXc= + +parse5-htmlparser2-tree-adapter@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" + integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA== + dependencies: + parse5 "^6.0.1" + +parse5@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" + integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== + +parse5@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + +proxy-addr@~2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + +raw-body@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" + integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== + dependencies: + bytes "3.1.0" + http-errors "1.7.3" + iconv-lite "0.4.24" + unpipe "1.0.0" + +reflect-metadata@^0.1.13: + version "0.1.13" + resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" + integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-buffer@^5.0.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sax@>=0.6.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +semver@^7.3.2: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.11: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +"statuses@>= 1.5.0 < 2", statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + +tslib@^2.0.1, tslib@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" + integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== + +type-graphql@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/type-graphql/-/type-graphql-1.1.1.tgz#dc0710d961713b92d3fee927981fa43bf71667a4" + integrity sha512-iOOWVn0ehCYMukmnXStbkRwFE9dcjt7/oDcBS1JyQZo9CbhlIll4lHHps54HMEk4A4c8bUPd+DjK8w1/ZrxB4A== + dependencies: + "@types/glob" "^7.1.3" + "@types/node" "^14.11.2" + "@types/semver" "^7.3.3" + glob "^7.1.6" + graphql-query-complexity "^0.7.0" + graphql-subscriptions "^1.1.0" + semver "^7.3.2" + tslib "^2.0.1" + +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typeorm@^0.2.34: + version "0.2.34" + resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.2.34.tgz#637b3cec2de54ee7f423012b813a2022c0aacc8b" + integrity sha512-FZAeEGGdSGq7uTH3FWRQq67JjKu0mgANsSZ04j3kvDYNgy9KwBl/6RFgMVgiSgjf7Rqd7NrhC2KxVT7I80qf7w== + dependencies: + "@sqltools/formatter" "^1.2.2" + app-root-path "^3.0.0" + buffer "^6.0.3" + chalk "^4.1.0" + cli-highlight "^2.1.10" + debug "^4.3.1" + dotenv "^8.2.0" + glob "^7.1.6" + js-yaml "^4.0.0" + mkdirp "^1.0.4" + reflect-metadata "^0.1.13" + sha.js "^2.4.11" + tslib "^2.1.0" + xml2js "^0.4.23" + yargonaut "^1.1.4" + yargs "^16.2.0" + zen-observable-ts "^1.0.0" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +xml2js@^0.4.23: + version "0.4.23" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" + integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== + dependencies: + sax ">=0.6.0" + xmlbuilder "~11.0.0" + +xmlbuilder@~11.0.0: + version "11.0.1" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" + integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargonaut@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/yargonaut/-/yargonaut-1.1.4.tgz#c64f56432c7465271221f53f5cc517890c3d6e0c" + integrity sha512-rHgFmbgXAAzl+1nngqOcwEljqHGG9uUZoPjsdZEs1w5JW9RXYzrSvH/u70C1JE5qFi0qjsdhnUX/dJRpWqitSA== + dependencies: + chalk "^1.1.1" + figlet "^1.1.1" + parent-require "^1.0.0" + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs@^16.0.0, yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +zen-observable-ts@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.0.0.tgz#30d1202b81d8ba4c489e3781e8ca09abf0075e70" + integrity sha512-KmWcbz+9kKUeAQ8btY8m1SsEFgBcp7h/Uf3V5quhan7ZWdjGsf0JcGLULQiwOZibbFWnHkYq8Nn2AZbJabovQg== + dependencies: + "@types/zen-observable" "^0.8.2" + zen-observable "^0.8.15" + +zen-observable@^0.8.15: + version "0.8.15" + resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" + integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== From 43f7cf87679713d436a64d569d6af1594a12ee33 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 23 Jun 2021 17:38:00 +0200 Subject: [PATCH 02/50] server stack seems to work. Graphql does not load properly yet --- backend/package.json | 10 + backend/src/graphql/resolvers.ts | 1 + backend/src/index.ts | 65 +++ backend/tsconfig.json | 73 +++ backend/yarn.lock | 829 ++++++++++++++++++++++++++++++- 5 files changed, 975 insertions(+), 3 deletions(-) create mode 100644 backend/src/graphql/resolvers.ts create mode 100644 backend/src/index.ts create mode 100644 backend/tsconfig.json diff --git a/backend/package.json b/backend/package.json index fc4f73533..cf285b70f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -7,11 +7,21 @@ "author": "Ulf Gebhardt", "license": "MIT", "private": false, + "scripts": { + "start": "nodemon -w src --ext ts --exec ts-node src/index.ts" + }, "dependencies": { "express": "^4.17.1", "express-graphql": "^0.12.0", + "graphql": "^15.5.1", "reflect-metadata": "^0.1.13", "type-graphql": "^1.1.1", "typeorm": "^0.2.34" + }, + "devDependencies": { + "@types/express": "^4.17.12", + "nodemon": "^2.0.7", + "ts-node": "^10.0.0", + "typescript": "^4.3.4" } } diff --git a/backend/src/graphql/resolvers.ts b/backend/src/graphql/resolvers.ts new file mode 100644 index 000000000..4ad71d6e3 --- /dev/null +++ b/backend/src/graphql/resolvers.ts @@ -0,0 +1 @@ +export default [] \ No newline at end of file diff --git a/backend/src/index.ts b/backend/src/index.ts new file mode 100644 index 000000000..5c02aeb14 --- /dev/null +++ b/backend/src/index.ts @@ -0,0 +1,65 @@ +import 'reflect-metadata' +import express from 'express' +import { graphqlHTTP } from 'express-graphql' +import { createConnection } from 'typeorm' +import { buildSchema } from 'type-graphql' +// import resolvers from './graphql/resolvers' +const resolvers: [string] = [''] +// import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; + +async function main() { + //const connection = await createConnection() + const schema = await buildSchema({ + resolvers + }) + const server = express(); + + server.use('/api', + graphqlHTTP({ + schema, + graphiql: true, + validationRules: [ + /** + * This provides GraphQL query analysis to reject complex queries to your GraphQL server. + * This can be used to protect your GraphQL servers + * against resource exhaustion and DoS attacks. + * More documentation can be found (here)[https://github.com/ivome/graphql-query-complexity] + */ + /*queryComplexity({ + // The maximum allowed query complexity, queries above this threshold will be rejected + maximumComplexity: 20, + // The query variables. This is needed because the variables are not available + // in the visitor of the graphql-js library + variables: params!.variables!, + // Optional callback function to retrieve the determined query complexity + // Will be invoked weather the query is rejected or not + // This can be used for logging or to implement rate limiting + onComplete: (complexity: number) => { + console.log("Query Complexity:", complexity); + }, + // Add any number of estimators. The estimators are invoked in order, the first + // numeric value that is being returned by an estimator is used as the field complexity. + // If no estimator returns a value, an exception is raised. + estimators: [ + fieldConfigEstimator(), + // Add more estimators here... + // This will assign each field a complexity of 1 if no other estimator + // returned a value. + simpleEstimator({ + defaultComplexity: 1, + }), + ], + }),*/ + ], + }) + ) + + // app.get("/playground", expressPlayground({ endpoint: "/graphql" })); + server.listen(4000, () => { + console.log( + `Server is running, GraphQL Playground available at http://localhost:4000/playground`, + ); + }); +} + +main() \ No newline at end of file diff --git a/backend/tsconfig.json b/backend/tsconfig.json new file mode 100644 index 000000000..64ec9cb7e --- /dev/null +++ b/backend/tsconfig.json @@ -0,0 +1,73 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // TODO: "strictPropertyInitialization": false + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + "skipLibCheck": true, /* Skip type checking of declaration files. */ + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + } +} diff --git a/backend/yarn.lock b/backend/yarn.lock index d7fc8be9f..94320161b 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -2,11 +2,77 @@ # yarn lockfile v1 +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== + "@sqltools/formatter@^1.2.2": version "1.2.3" resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.3.tgz#1185726610acc37317ddab11c3c7f9066966bd20" integrity sha512-O3uyB/JbkAEMZaP3YqyHH7TMnex7tWyCbCI4EfJdOCoN6HIhqdJBWTM6aCCiWQ/5f5wxjgU735QAIpJbjDvmzg== +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + +"@tsconfig/node10@^1.0.7": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" + integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + +"@tsconfig/node12@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" + integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + +"@tsconfig/node14@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" + integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + +"@tsconfig/node16@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.1.tgz#a6ca6a9a0ff366af433f42f5f0e124794ff6b8f1" + integrity sha512-FTgBI767POY/lKNDNbIzgAX6miIDBs6NTCbdlDb8TrWovHsSvaVIZDlTqym29C6UqhzwcJx4CYr+AlrMywA0cA== + +"@types/body-parser@*": + version "1.19.0" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.0.tgz#0685b3c47eb3006ffed117cdd55164b61f80538f" + integrity sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ== + dependencies: + "@types/connect" "*" + "@types/node" "*" + +"@types/connect@*": + version "3.4.34" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.34.tgz#170a40223a6d666006d93ca128af2beb1d9b1901" + integrity sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ== + dependencies: + "@types/node" "*" + +"@types/express-serve-static-core@^4.17.18": + version "4.17.21" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.21.tgz#a427278e106bca77b83ad85221eae709a3414d42" + integrity sha512-gwCiEZqW6f7EoR8TTEfalyEhb1zA5jQJnRngr97+3pzMaO1RKoI1w2bw07TK72renMUVWcWS5mLI6rk1NqN0nA== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@^4.17.12": + version "4.17.12" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.12.tgz#4bc1bf3cd0cfe6d3f6f2853648b40db7d54de350" + integrity sha512-pTYas6FrP15B1Oa0bkN5tQMNqOcVXa9j4FTFtO8DWI9kppKib+6NJtfTOOLcwxuuYvcX2+dVG6et1SxW/Kc17Q== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" + "@types/serve-static" "*" + "@types/glob@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" @@ -15,6 +81,11 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/mime@^1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" + integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + "@types/minimatch@*": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" @@ -30,16 +101,39 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.4.tgz#218712242446fc868d0e007af29a4408c7765bc0" integrity sha512-8kQ3+wKGRNN0ghtEn7EGps/B8CzuBz1nXZEIGGLP2GnwbqYn4dbTs7k+VKLTq1HvZLRCIDtN3Snx1Ege8B7L5A== +"@types/qs@*": + version "6.9.6" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.6.tgz#df9c3c8b31a247ec315e6996566be3171df4b3b1" + integrity sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA== + +"@types/range-parser@*": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" + integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== + "@types/semver@^7.3.3": version "7.3.6" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.6.tgz#e9831776f4512a7ba6da53e71c26e5fb67882d63" integrity sha512-0caWDWmpCp0uifxFh+FaqK3CuZ2SkRR/ZRxAV5+zNdC3QVUi6wyOJnefhPvtNt8NQWXB5OA93BUvZsXpWat2Xw== +"@types/serve-static@*": + version "1.13.9" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.9.tgz#aacf28a85a05ee29a11fb7c3ead935ac56f33e4e" + integrity sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA== + dependencies: + "@types/mime" "^1" + "@types/node" "*" + "@types/zen-observable@^0.8.2": version "0.8.2" resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + accepts@^1.3.7, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -48,11 +142,23 @@ accepts@^1.3.7, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +ansi-align@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" + integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== + dependencies: + string-width "^3.0.0" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + ansi-regex@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" @@ -75,11 +181,24 @@ any-promise@^1.0.0: resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + app-root-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.0.0.tgz#210b6f43873227e18a4b810a032283311555d5ad" integrity sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw== +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -100,6 +219,11 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + body-parser@1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -116,6 +240,20 @@ body-parser@1.19.0: raw-body "2.4.0" type-is "~1.6.17" +boxen@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" + integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^5.3.1" + chalk "^3.0.0" + cli-boxes "^2.2.0" + string-width "^4.1.0" + term-size "^2.1.0" + type-fest "^0.8.1" + widest-line "^3.1.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -124,6 +262,18 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + buffer@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -137,6 +287,24 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + chalk@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -148,6 +316,14 @@ chalk@^1.1.1: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chalk@^4.0.0, chalk@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" @@ -156,6 +332,31 @@ chalk@^4.0.0, chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chokidar@^3.2.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cli-boxes@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + cli-highlight@^2.1.10: version "2.1.11" resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.11.tgz#49736fa452f0aaf4fae580e30acb26828d2dc1bf" @@ -177,6 +378,13 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -194,6 +402,18 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +configstore@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" + integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== + dependencies: + dot-prop "^5.2.0" + graceful-fs "^4.1.2" + make-dir "^3.0.0" + unique-string "^2.0.0" + write-file-atomic "^3.0.0" + xdg-basedir "^4.0.0" + content-disposition@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" @@ -216,13 +436,30 @@ cookie@0.4.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== -debug@2.6.9: +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +crypto-random-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" + integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== + +debug@2.6.9, debug@^2.2.0: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" +debug@^3.2.6: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + debug@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" @@ -230,6 +467,23 @@ debug@^4.3.1: dependencies: ms "2.1.2" +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +defer-to-connect@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" + integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== + depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -240,16 +494,38 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +dot-prop@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" + integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== + dependencies: + is-obj "^2.0.0" + dotenv@^8.2.0: version "8.6.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -260,11 +536,23 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escape-goat@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" + integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -331,6 +619,13 @@ figlet@^1.1.1: resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.5.0.tgz#2db4d00a584e5155a96080632db919213c3e003c" integrity sha512-ZQJM4aifMpz6H19AW1VqvZ7l4pOE9p7i/3LyxgO2kp+PO/VcDYNqIHEMtkccqIhTXMKci4kjueJr/iCQEaT/Ww== +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + finalhandler@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" @@ -359,11 +654,37 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob@^7.1.6: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" @@ -376,6 +697,35 @@ glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" +global-dirs@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.1.0.tgz#e9046a49c806ff04d6c1825e196c8f0091e8df4d" + integrity sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ== + dependencies: + ini "1.3.7" + +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +graceful-fs@^4.1.2: + version "4.2.6" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" + integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + graphql-query-complexity@^0.7.0: version "0.7.2" resolved "https://registry.yarnpkg.com/graphql-query-complexity/-/graphql-query-complexity-0.7.2.tgz#7fc6bb20930ab1b666ecf3bbfb24b65b6f08ecc4" @@ -390,6 +740,11 @@ graphql-subscriptions@^1.1.0: dependencies: iterall "^1.3.0" +graphql@^15.5.1: + version "15.5.1" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" + integrity sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw== + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -397,16 +752,31 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-yarn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" + integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== + highlight.js@^10.7.1: version "10.7.3" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + http-errors@1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" @@ -452,6 +822,21 @@ ieee754@^1.2.1: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== +ignore-by-default@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" + integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= + +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -470,16 +855,95 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +ini@1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" + integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== + +ini@~1.3.0: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-installed-globally@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141" + integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== + dependencies: + global-dirs "^2.0.1" + is-path-inside "^3.0.1" + +is-npm@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" + integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + +is-path-inside@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-typedarray@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-yarn-global@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" + integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== + iterall@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" @@ -492,11 +956,40 @@ js-yaml@^4.0.0: dependencies: argparse "^2.0.1" +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== + dependencies: + json-buffer "3.0.0" + +latest-version@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" + integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== + dependencies: + package-json "^6.3.0" + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -504,6 +997,18 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -536,6 +1041,11 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -543,6 +1053,11 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" +minimist@^1.2.0: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" @@ -563,6 +1078,11 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + mz@^2.4.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" @@ -577,6 +1097,39 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +nodemon@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.7.tgz#6f030a0a0ebe3ea1ba2a38f71bf9bab4841ced32" + integrity sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA== + dependencies: + chokidar "^3.2.2" + debug "^3.2.6" + ignore-by-default "^1.0.1" + minimatch "^3.0.4" + pstree.remy "^1.1.7" + semver "^5.7.1" + supports-color "^5.5.0" + touch "^3.1.0" + undefsafe "^2.0.3" + update-notifier "^4.1.0" + +nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= + dependencies: + abbrev "1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@^4.1.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" + integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== + object-assign@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -589,13 +1142,28 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== + +package-json@^6.3.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" + integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== + dependencies: + got "^9.6.0" + registry-auth-token "^4.0.0" + registry-url "^5.0.0" + semver "^6.2.0" + parent-require@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parent-require/-/parent-require-1.0.0.tgz#746a167638083a860b0eef6732cb27ed46c32977" @@ -633,6 +1201,16 @@ path-to-regexp@0.1.7: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + proxy-addr@~2.0.5: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" @@ -641,6 +1219,26 @@ proxy-addr@~2.0.5: forwarded "0.2.0" ipaddr.js "1.9.1" +pstree.remy@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" + integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pupa@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" + integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== + dependencies: + escape-goat "^2.0.0" + qs@6.7.0: version "6.7.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" @@ -671,16 +1269,54 @@ raw-body@^2.4.1: iconv-lite "0.4.24" unpipe "1.0.0" +rc@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + reflect-metadata@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== +registry-auth-token@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" + integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== + dependencies: + rc "^1.2.8" + +registry-url@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" + integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== + dependencies: + rc "^1.2.8" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + safe-buffer@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -701,6 +1337,23 @@ sax@>=0.6.0: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +semver-diff@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" + integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== + dependencies: + semver "^6.3.0" + +semver@^5.7.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@^7.3.2: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" @@ -755,12 +1408,39 @@ sha.js@^2.4.11: inherits "^2.0.1" safe-buffer "^5.0.1" +signal-exit@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +source-map-support@^0.5.17: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -string-width@^4.1.0, string-width@^4.2.0: +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: version "4.2.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== @@ -776,6 +1456,13 @@ strip-ansi@^3.0.0: dependencies: ansi-regex "^2.0.0" +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" @@ -783,11 +1470,23 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= +supports-color@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -795,6 +1494,11 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +term-size@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" + integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== + thenify-all@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" @@ -809,16 +1513,56 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + toidentifier@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +touch@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" + integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== + dependencies: + nopt "~1.0.10" + +ts-node@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.0.0.tgz#05f10b9a716b0b624129ad44f0ea05dac84ba3be" + integrity sha512-ROWeOIUvfFbPZkoDis0L/55Fk+6gFQNZwwKPLinacRl6tsxstTF1DbAcLKkovwnpKMVvOMHP1TIbnwXwtLg1gg== + dependencies: + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + tslib@^2.0.1, tslib@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + type-graphql@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/type-graphql/-/type-graphql-1.1.1.tgz#dc0710d961713b92d3fee927981fa43bf71667a4" @@ -841,6 +1585,13 @@ type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + typeorm@^0.2.34: version "0.2.34" resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.2.34.tgz#637b3cec2de54ee7f423012b813a2022c0aacc8b" @@ -864,11 +1615,56 @@ typeorm@^0.2.34: yargs "^16.2.0" zen-observable-ts "^1.0.0" +typescript@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" + integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== + +undefsafe@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae" + integrity sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A== + dependencies: + debug "^2.2.0" + +unique-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" + integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== + dependencies: + crypto-random-string "^2.0.0" + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= +update-notifier@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3" + integrity sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A== + dependencies: + boxen "^4.2.0" + chalk "^3.0.0" + configstore "^5.0.1" + has-yarn "^2.1.0" + import-lazy "^2.1.0" + is-ci "^2.0.0" + is-installed-globally "^0.3.1" + is-npm "^4.0.0" + is-yarn-global "^0.3.0" + latest-version "^5.0.0" + pupa "^2.0.1" + semver-diff "^3.1.1" + xdg-basedir "^4.0.0" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -879,6 +1675,13 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -893,6 +1696,21 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + +xdg-basedir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" + integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== + xml2js@^0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" @@ -943,6 +1761,11 @@ yargs@^16.0.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + zen-observable-ts@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.0.0.tgz#30d1202b81d8ba4c489e3781e8ca09abf0075e70" From 4c0667d8701b2b60c5852c7cd5f44db70da4029e Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 23 Jun 2021 17:56:49 +0200 Subject: [PATCH 03/50] book resolvers, working server, example orm config --- backend/ormconfig.json | 6 +++ backend/src/graphql/inputs/CreateBookInput.ts | 10 +++++ backend/src/graphql/inputs/UpdateBookInput.ts | 13 ++++++ backend/src/graphql/models/Book.ts | 22 ++++++++++ backend/src/graphql/resolvers.ts | 1 - backend/src/graphql/resolvers/BookResolver.ts | 41 +++++++++++++++++++ backend/src/index.ts | 11 ++--- backend/tsconfig.json | 3 +- 8 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 backend/ormconfig.json create mode 100644 backend/src/graphql/inputs/CreateBookInput.ts create mode 100644 backend/src/graphql/inputs/UpdateBookInput.ts create mode 100644 backend/src/graphql/models/Book.ts delete mode 100644 backend/src/graphql/resolvers.ts create mode 100644 backend/src/graphql/resolvers/BookResolver.ts diff --git a/backend/ormconfig.json b/backend/ormconfig.json new file mode 100644 index 000000000..36c565344 --- /dev/null +++ b/backend/ormconfig.json @@ -0,0 +1,6 @@ +{ + "type": "sqlite", + "database": "./db.sqlite3", + "entities": ["./src/graphql/models/*.ts"], + "synchronize": true +} \ No newline at end of file diff --git a/backend/src/graphql/inputs/CreateBookInput.ts b/backend/src/graphql/inputs/CreateBookInput.ts new file mode 100644 index 000000000..8b3129a4a --- /dev/null +++ b/backend/src/graphql/inputs/CreateBookInput.ts @@ -0,0 +1,10 @@ +import { InputType, Field } from 'type-graphql' + +@InputType() +export class CreateBookInput { + @Field() + title: string; + + @Field() + author: string; +} diff --git a/backend/src/graphql/inputs/UpdateBookInput.ts b/backend/src/graphql/inputs/UpdateBookInput.ts new file mode 100644 index 000000000..12e11a39e --- /dev/null +++ b/backend/src/graphql/inputs/UpdateBookInput.ts @@ -0,0 +1,13 @@ +import { InputType, Field } from 'type-graphql' + +@InputType() +export class UpdateBookInput { + @Field({ nullable: true }) + title?: string; + + @Field({ nullable: true }) + author?: string; + + @Field({ nullable: true }) + isPublished?: boolean; +} \ No newline at end of file diff --git a/backend/src/graphql/models/Book.ts b/backend/src/graphql/models/Book.ts new file mode 100644 index 000000000..9fb15b001 --- /dev/null +++ b/backend/src/graphql/models/Book.ts @@ -0,0 +1,22 @@ +import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm' +import { ObjectType, Field, ID } from 'type-graphql' + +@Entity() +@ObjectType() +export class Book extends BaseEntity { + @Field(() => ID) + @PrimaryGeneratedColumn() + id: string; + + @Field(() => String) + @Column() + title: string; + + @Field(() => String) + @Column() + author: string; + + @Field(() => Boolean) + @Column({ default: false }) + isPublished: boolean; +} \ No newline at end of file diff --git a/backend/src/graphql/resolvers.ts b/backend/src/graphql/resolvers.ts deleted file mode 100644 index 4ad71d6e3..000000000 --- a/backend/src/graphql/resolvers.ts +++ /dev/null @@ -1 +0,0 @@ -export default [] \ No newline at end of file diff --git a/backend/src/graphql/resolvers/BookResolver.ts b/backend/src/graphql/resolvers/BookResolver.ts new file mode 100644 index 000000000..e301a69a7 --- /dev/null +++ b/backend/src/graphql/resolvers/BookResolver.ts @@ -0,0 +1,41 @@ +import { Resolver, Query, Mutation, Arg } from 'type-graphql' +import { Book } from '../models/Book' +import { CreateBookInput } from '../inputs/CreateBookInput' +import { UpdateBookInput } from '../inputs/UpdateBookInput' + +@Resolver() +export class BookResolver { + @Query(() => [Book]) + books() { + return Book.find(); + } + + @Query(() => Book) + book(@Arg("id") id: string) { + return Book.findOne({ where: { id } }); + } + + @Mutation(() => Book) + async createBook(@Arg("data") data: CreateBookInput) { + const book = Book.create(data); + await book.save(); + return book; + } + + @Mutation(() => Book) + async updateBook(@Arg("id") id: string, @Arg("data") data: UpdateBookInput) { + const book = await Book.findOne({ where: { id } }); + if (!book) throw new Error("Book not found!"); + Object.assign(book, data); + await book.save(); + return book; + } + + @Mutation(() => Boolean) + async deleteBook(@Arg("id") id: string) { + const book = await Book.findOne({ where: { id } }); + if (!book) throw new Error("Book not found!"); + await book.remove(); + return true; + } +} \ No newline at end of file diff --git a/backend/src/index.ts b/backend/src/index.ts index 5c02aeb14..7c265643b 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -3,15 +3,12 @@ import express from 'express' import { graphqlHTTP } from 'express-graphql' import { createConnection } from 'typeorm' import { buildSchema } from 'type-graphql' -// import resolvers from './graphql/resolvers' -const resolvers: [string] = [''] +import { BookResolver } from "./graphql/resolvers/BookResolver" // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; async function main() { - //const connection = await createConnection() - const schema = await buildSchema({ - resolvers - }) + const connection = await createConnection() + const schema = await buildSchema({ resolvers: [BookResolver]}) const server = express(); server.use('/api', @@ -57,7 +54,7 @@ async function main() { // app.get("/playground", expressPlayground({ endpoint: "/graphql" })); server.listen(4000, () => { console.log( - `Server is running, GraphQL Playground available at http://localhost:4000/playground`, + `Server is running, GraphIQL available at http://localhost:4000/api`, ); }); } diff --git a/backend/tsconfig.json b/backend/tsconfig.json index 64ec9cb7e..422ff8e0a 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -30,8 +30,7 @@ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // TODO: "strictPropertyInitialization": false - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + "strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ From 34b30b216b6fafcb5b686d4b023b05f2e9766bdf Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 23 Jun 2021 23:06:53 +0200 Subject: [PATCH 04/50] linting, server is working --- backend/.eslintignore | 3 + backend/.eslintrc.js | 26 + backend/.prettierrc.js | 8 + backend/package.json | 13 +- backend/src/graphql/inputs/CreateBookInput.ts | 4 +- backend/src/graphql/inputs/UpdateBookInput.ts | 8 +- backend/src/graphql/models/Book.ts | 10 +- backend/src/graphql/resolvers/BookResolver.ts | 38 +- backend/src/index.ts | 43 +- backend/yarn.lock | 1287 ++++++++++++++++- 10 files changed, 1374 insertions(+), 66 deletions(-) create mode 100644 backend/.eslintignore create mode 100644 backend/.eslintrc.js create mode 100644 backend/.prettierrc.js diff --git a/backend/.eslintignore b/backend/.eslintignore new file mode 100644 index 000000000..e973d3709 --- /dev/null +++ b/backend/.eslintignore @@ -0,0 +1,3 @@ +node_modules +**/*.min.js +dist \ No newline at end of file diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js new file mode 100644 index 000000000..8fbf554ce --- /dev/null +++ b/backend/.eslintrc.js @@ -0,0 +1,26 @@ +module.exports = { + root: true, + env: { + node: true, + // jest: true, + }, + parser: '@typescript-eslint/parser', + plugins: ['prettier', '@typescript-eslint' /*, 'jest' */], + extends: [ + 'standard', + 'eslint:recommended', + 'plugin:prettier/recommended', + 'plugin:@typescript-eslint/recommended', + ], + // add your custom rules here + rules: { + 'no-console': ['error'], + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'prettier/prettier': [ + 'error', + { + htmlWhitespaceSensitivity: 'ignore', + }, + ], + }, +} diff --git a/backend/.prettierrc.js b/backend/.prettierrc.js new file mode 100644 index 000000000..e88113754 --- /dev/null +++ b/backend/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + semi: false, + printWidth: 100, + singleQuote: true, + trailingComma: "all", + tabWidth: 2, + bracketSpacing: true +}; diff --git a/backend/package.json b/backend/package.json index cf285b70f..c1bc5ad89 100644 --- a/backend/package.json +++ b/backend/package.json @@ -8,7 +8,8 @@ "license": "MIT", "private": false, "scripts": { - "start": "nodemon -w src --ext ts --exec ts-node src/index.ts" + "dev": "nodemon -w src --ext ts --exec ts-node src/index.ts", + "lint": "eslint . --ext .js,.ts" }, "dependencies": { "express": "^4.17.1", @@ -20,7 +21,17 @@ }, "devDependencies": { "@types/express": "^4.17.12", + "@typescript-eslint/eslint-plugin": "^4.28.0", + "@typescript-eslint/parser": "^4.28.0", + "eslint": "^7.29.0", + "eslint-config-prettier": "^8.3.0", + "eslint-config-standard": "^16.0.3", + "eslint-plugin-import": "^2.23.4", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.4.0", + "eslint-plugin-promise": "^5.1.0", "nodemon": "^2.0.7", + "prettier": "^2.3.1", "ts-node": "^10.0.0", "typescript": "^4.3.4" } diff --git a/backend/src/graphql/inputs/CreateBookInput.ts b/backend/src/graphql/inputs/CreateBookInput.ts index 8b3129a4a..ac4108afd 100644 --- a/backend/src/graphql/inputs/CreateBookInput.ts +++ b/backend/src/graphql/inputs/CreateBookInput.ts @@ -3,8 +3,8 @@ import { InputType, Field } from 'type-graphql' @InputType() export class CreateBookInput { @Field() - title: string; + title: string @Field() - author: string; + author: string } diff --git a/backend/src/graphql/inputs/UpdateBookInput.ts b/backend/src/graphql/inputs/UpdateBookInput.ts index 12e11a39e..3f5042ecf 100644 --- a/backend/src/graphql/inputs/UpdateBookInput.ts +++ b/backend/src/graphql/inputs/UpdateBookInput.ts @@ -3,11 +3,11 @@ import { InputType, Field } from 'type-graphql' @InputType() export class UpdateBookInput { @Field({ nullable: true }) - title?: string; + title?: string @Field({ nullable: true }) - author?: string; + author?: string @Field({ nullable: true }) - isPublished?: boolean; -} \ No newline at end of file + isPublished?: boolean +} diff --git a/backend/src/graphql/models/Book.ts b/backend/src/graphql/models/Book.ts index 9fb15b001..fb95979dd 100644 --- a/backend/src/graphql/models/Book.ts +++ b/backend/src/graphql/models/Book.ts @@ -6,17 +6,17 @@ import { ObjectType, Field, ID } from 'type-graphql' export class Book extends BaseEntity { @Field(() => ID) @PrimaryGeneratedColumn() - id: string; + id: string @Field(() => String) @Column() - title: string; + title: string @Field(() => String) @Column() - author: string; + author: string @Field(() => Boolean) @Column({ default: false }) - isPublished: boolean; -} \ No newline at end of file + isPublished: boolean +} diff --git a/backend/src/graphql/resolvers/BookResolver.ts b/backend/src/graphql/resolvers/BookResolver.ts index e301a69a7..9e5b6d1b3 100644 --- a/backend/src/graphql/resolvers/BookResolver.ts +++ b/backend/src/graphql/resolvers/BookResolver.ts @@ -7,35 +7,35 @@ import { UpdateBookInput } from '../inputs/UpdateBookInput' export class BookResolver { @Query(() => [Book]) books() { - return Book.find(); + return Book.find() } @Query(() => Book) - book(@Arg("id") id: string) { - return Book.findOne({ where: { id } }); + book(@Arg('id') id: string) { + return Book.findOne({ where: { id } }) } @Mutation(() => Book) - async createBook(@Arg("data") data: CreateBookInput) { - const book = Book.create(data); - await book.save(); - return book; + async createBook(@Arg('data') data: CreateBookInput) { + const book = Book.create(data) + await book.save() + return book } @Mutation(() => Book) - async updateBook(@Arg("id") id: string, @Arg("data") data: UpdateBookInput) { - const book = await Book.findOne({ where: { id } }); - if (!book) throw new Error("Book not found!"); - Object.assign(book, data); - await book.save(); - return book; + async updateBook(@Arg('id') id: string, @Arg('data') data: UpdateBookInput) { + const book = await Book.findOne({ where: { id } }) + if (!book) throw new Error('Book not found!') + Object.assign(book, data) + await book.save() + return book } @Mutation(() => Boolean) - async deleteBook(@Arg("id") id: string) { - const book = await Book.findOne({ where: { id } }); - if (!book) throw new Error("Book not found!"); - await book.remove(); - return true; + async deleteBook(@Arg('id') id: string) { + const book = await Book.findOne({ where: { id } }) + if (!book) throw new Error('Book not found!') + await book.remove() + return true } -} \ No newline at end of file +} diff --git a/backend/src/index.ts b/backend/src/index.ts index 7c265643b..453a5fdbc 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -1,28 +1,29 @@ import 'reflect-metadata' import express from 'express' import { graphqlHTTP } from 'express-graphql' -import { createConnection } from 'typeorm' +// import { createConnection } from 'typeorm' import { buildSchema } from 'type-graphql' -import { BookResolver } from "./graphql/resolvers/BookResolver" +import { BookResolver } from './graphql/resolvers/BookResolver' // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; async function main() { - const connection = await createConnection() - const schema = await buildSchema({ resolvers: [BookResolver]}) - const server = express(); + // const connection = await createConnection() + const schema = await buildSchema({ resolvers: [BookResolver] }) + const server = express() - server.use('/api', + server.use( + '/api', graphqlHTTP({ schema, graphiql: true, validationRules: [ - /** - * This provides GraphQL query analysis to reject complex queries to your GraphQL server. - * This can be used to protect your GraphQL servers - * against resource exhaustion and DoS attacks. - * More documentation can be found (here)[https://github.com/ivome/graphql-query-complexity] - */ - /*queryComplexity({ + /** + * This provides GraphQL query analysis to reject complex queries to your GraphQL server. + * This can be used to protect your GraphQL servers + * against resource exhaustion and DoS attacks. + * More documentation can be found (here)[https://github.com/ivome/graphql-query-complexity] + */ + /* queryComplexity({ // The maximum allowed query complexity, queries above this threshold will be rejected maximumComplexity: 20, // The query variables. This is needed because the variables are not available @@ -46,17 +47,15 @@ async function main() { defaultComplexity: 1, }), ], - }),*/ - ], - }) + }), */ + ], + }), ) - // app.get("/playground", expressPlayground({ endpoint: "/graphql" })); server.listen(4000, () => { - console.log( - `Server is running, GraphIQL available at http://localhost:4000/api`, - ); - }); + // eslint-disable-next-line no-console + console.log(`Server is running, GraphIQL available at http://localhost:4000/api`) + }) } -main() \ No newline at end of file +main() diff --git a/backend/yarn.lock b/backend/yarn.lock index 94320161b..b4433044e 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -2,6 +2,63 @@ # yarn lockfile v1 +"@babel/code-frame@7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/helper-validator-identifier@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" + integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== + +"@babel/highlight@^7.10.4": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@eslint/eslintrc@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.2.tgz#f63d0ef06f5c0c57d76c4ab5f63d3835c51b0179" + integrity sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.7" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz#94c23db18ee4653e129abd26fb06f870ac9e1ee2" + integrity sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -81,6 +138,16 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/json-schema@^7.0.7": + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + "@types/mime@^1": version "1.3.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -129,6 +196,75 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== +"@typescript-eslint/eslint-plugin@^4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.0.tgz#1a66f03b264844387beb7dc85e1f1d403bd1803f" + integrity sha512-KcF6p3zWhf1f8xO84tuBailV5cN92vhS+VT7UJsPzGBm9VnQqfI9AsiMUFUCYHTYPg1uCCo+HyiDnpDuvkAMfQ== + dependencies: + "@typescript-eslint/experimental-utils" "4.28.0" + "@typescript-eslint/scope-manager" "4.28.0" + debug "^4.3.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.0.tgz#13167ed991320684bdc23588135ae62115b30ee0" + integrity sha512-9XD9s7mt3QWMk82GoyUpc/Ji03vz4T5AYlHF9DcoFNfJ/y3UAclRsfGiE2gLfXtyC+JRA3trR7cR296TEb1oiQ== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.28.0" + "@typescript-eslint/types" "4.28.0" + "@typescript-eslint/typescript-estree" "4.28.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.28.0.tgz#2404c16751a28616ef3abab77c8e51d680a12caa" + integrity sha512-7x4D22oPY8fDaOCvkuXtYYTQ6mTMmkivwEzS+7iml9F9VkHGbbZ3x4fHRwxAb5KeuSkLqfnYjs46tGx2Nour4A== + dependencies: + "@typescript-eslint/scope-manager" "4.28.0" + "@typescript-eslint/types" "4.28.0" + "@typescript-eslint/typescript-estree" "4.28.0" + debug "^4.3.1" + +"@typescript-eslint/scope-manager@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.28.0.tgz#6a3009d2ab64a30fc8a1e257a1a320067f36a0ce" + integrity sha512-eCALCeScs5P/EYjwo6se9bdjtrh8ByWjtHzOkC4Tia6QQWtQr3PHovxh3TdYTuFcurkYI4rmFsRFpucADIkseg== + dependencies: + "@typescript-eslint/types" "4.28.0" + "@typescript-eslint/visitor-keys" "4.28.0" + +"@typescript-eslint/types@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.28.0.tgz#a33504e1ce7ac51fc39035f5fe6f15079d4dafb0" + integrity sha512-p16xMNKKoiJCVZY5PW/AfILw2xe1LfruTcfAKBj3a+wgNYP5I9ZEKNDOItoRt53p4EiPV6iRSICy8EPanG9ZVA== + +"@typescript-eslint/typescript-estree@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.0.tgz#e66d4e5aa2ede66fec8af434898fe61af10c71cf" + integrity sha512-m19UQTRtxMzKAm8QxfKpvh6OwQSXaW1CdZPoCaQuLwAq7VZMNuhJmZR4g5281s2ECt658sldnJfdpSZZaxUGMQ== + dependencies: + "@typescript-eslint/types" "4.28.0" + "@typescript-eslint/visitor-keys" "4.28.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@4.28.0": + version "4.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.0.tgz#255c67c966ec294104169a6939d96f91c8a89434" + integrity sha512-PjJyTWwrlrvM5jazxYF5ZPs/nl0kHDZMVbuIcbpawVXaDPelp3+S9zpOz5RmVUfS/fD5l5+ZXNKnWhNYjPzCvw== + dependencies: + "@typescript-eslint/types" "4.28.0" + eslint-visitor-keys "^2.0.0" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -142,6 +278,36 @@ accepts@^1.3.7, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +acorn-jsx@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + +acorn@^7.4.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^8.0.1: + version "8.6.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.0.tgz#60cc45d9c46a477d80d92c48076d972c342e5720" + integrity sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + ansi-align@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" @@ -149,6 +315,11 @@ ansi-align@^3.0.0: dependencies: string-width "^3.0.0" +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -169,6 +340,13 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -199,6 +377,13 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -209,6 +394,36 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= +array-includes@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" + integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + get-intrinsic "^1.1.1" + is-string "^1.0.5" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array.prototype.flat@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" + integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -262,7 +477,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@~3.0.2: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -300,6 +515,19 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" @@ -316,6 +544,15 @@ chalk@^1.1.1: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" @@ -385,6 +622,13 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -392,6 +636,11 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -441,26 +690,35 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-random-string@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -debug@2.6.9, debug@^2.2.0: +debug@2.6.9, debug@^2.2.0, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@^3.2.6: +debug@^3.2.6, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== dependencies: ms "^2.1.1" -debug@^4.3.1: +debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== @@ -479,11 +737,23 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== +deep-is@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -499,6 +769,27 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dot-prop@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -543,6 +834,51 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +enquirer@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: + version "1.18.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0" + integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.2" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.3" + is-string "^1.0.6" + object-inspect "^1.10.3" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -558,11 +894,215 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@^1.0.2: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-prettier@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" + integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== + +eslint-config-standard@^16.0.3: + version "16.0.3" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz#6c8761e544e96c531ff92642eeb87842b8488516" + integrity sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg== + +eslint-import-resolver-node@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717" + integrity sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA== + dependencies: + debug "^2.6.9" + resolve "^1.13.1" + +eslint-module-utils@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz#b51be1e473dd0de1c5ea638e22429c2490ea8233" + integrity sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A== + dependencies: + debug "^3.2.7" + pkg-dir "^2.0.0" + +eslint-plugin-es@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" + integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== + dependencies: + eslint-utils "^2.0.0" + regexpp "^3.0.0" + +eslint-plugin-import@^2.23.4: + version "2.23.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.23.4.tgz#8dceb1ed6b73e46e50ec9a5bb2411b645e7d3d97" + integrity sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ== + dependencies: + array-includes "^3.1.3" + array.prototype.flat "^1.2.4" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.4" + eslint-module-utils "^2.6.1" + find-up "^2.0.0" + has "^1.0.3" + is-core-module "^2.4.0" + minimatch "^3.0.4" + object.values "^1.1.3" + pkg-up "^2.0.0" + read-pkg-up "^3.0.0" + resolve "^1.20.0" + tsconfig-paths "^3.9.0" + +eslint-plugin-node@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" + integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== + dependencies: + eslint-plugin-es "^3.0.0" + eslint-utils "^2.0.0" + ignore "^5.1.1" + minimatch "^3.0.4" + resolve "^1.10.1" + semver "^6.1.0" + +eslint-plugin-prettier@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7" + integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-plugin-promise@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz#fb2188fb734e4557993733b41aa1a688f46c6f24" + integrity sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng== + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-utils@^2.0.0, eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint@^7.29.0: + version "7.29.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.29.0.tgz#ee2a7648f2e729485e4d0bd6383ec1deabc8b3c0" + integrity sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA== + dependencies: + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.4.2" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.1.2" + globals "^13.6.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.9" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== + dependencies: + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" @@ -614,11 +1154,57 @@ express@^4.17.1: utils-merge "1.0.1" vary "~1.1.2" +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-glob@^3.1.1: + version "3.2.5" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" + integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fastq@^1.6.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" + integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + dependencies: + reusify "^1.0.4" + figlet@^1.1.1: version "1.5.0" resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.5.0.tgz#2db4d00a584e5155a96080632db919213c3e003c" integrity sha512-ZQJM4aifMpz6H19AW1VqvZ7l4pOE9p7i/3LyxgO2kp+PO/VcDYNqIHEMtkccqIhTXMKci4kjueJr/iCQEaT/Ww== +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -639,6 +1225,26 @@ finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" + integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -659,11 +1265,30 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -678,14 +1303,14 @@ get-stream@^5.1.0: dependencies: pump "^3.0.0" -glob-parent@~5.1.2: +glob-parent@^5.1.0, glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob@^7.1.6: +glob@^7.1.3, glob@^7.1.6: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== @@ -704,6 +1329,25 @@ global-dirs@^2.0.1: dependencies: ini "1.3.7" +globals@^13.6.0, globals@^13.9.0: + version "13.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.9.0.tgz#4bf2bf635b334a173fb1daf7c5e6b218ecdc06cb" + integrity sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA== + dependencies: + type-fest "^0.20.2" + +globby@^11.0.3: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -752,6 +1396,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -762,16 +1411,33 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + has-yarn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + highlight.js@^10.7.1: version "10.7.3" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + http-cache-semantics@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" @@ -827,6 +1493,24 @@ ignore-by-default@^1.0.1: resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +ignore@^5.1.1, ignore@^5.1.4: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" @@ -870,6 +1554,16 @@ ipaddr.js@1.9.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-bigint@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" + integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -877,6 +1571,18 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" + integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== + dependencies: + call-bind "^1.0.2" + +is-callable@^1.1.4, is-callable@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" + integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== + is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -884,6 +1590,18 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.2.0, is-core-module@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" + integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" + integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -899,7 +1617,7 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== @@ -914,11 +1632,21 @@ is-installed-globally@^0.3.1: global-dirs "^2.0.1" is-path-inside "^3.0.1" +is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + is-npm@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== +is-number-object@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" + integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -934,6 +1662,26 @@ is-path-inside@^3.0.1: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-regex@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" + integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== + dependencies: + call-bind "^1.0.2" + has-symbols "^1.0.2" + +is-string@^1.0.5, is-string@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" + integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -944,11 +1692,29 @@ is-yarn-global@^0.3.0: resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + iterall@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + js-yaml@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -961,6 +1727,33 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -975,11 +1768,52 @@ latest-version@^5.0.0: dependencies: package-json "^6.3.0" +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= + lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" @@ -1019,11 +1853,24 @@ merge-descriptors@1.0.1: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= +micromatch@^4.0.2: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + mime-db@1.48.0: version "1.48.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" @@ -1092,6 +1939,11 @@ mz@^2.4.0: object-assign "^4.0.1" thenify-all "^1.0.0" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -1120,6 +1972,16 @@ nopt@~1.0.10: dependencies: abbrev "1" +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -1135,6 +1997,35 @@ object-assign@^4.0.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= +object-inspect@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" + integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.values@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" + integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -1149,11 +2040,42 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + p-cancelable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + package-json@^6.3.0: version "6.5.0" resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" @@ -1164,11 +2086,26 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + parent-require@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parent-require/-/parent-require-1.0.0.tgz#746a167638083a860b0eef6732cb27ed46c32977" integrity sha1-dGoWdjgIOoYLDu9nMssn7UbDKXc= +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + parse5-htmlparser2-tree-adapter@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" @@ -1191,26 +2128,94 @@ parseurl@~1.3.3: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= -picomatch@^2.0.4, picomatch@^2.2.1: +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + +pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" + integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= + dependencies: + find-up "^2.1.0" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" + integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + proxy-addr@~2.0.5: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" @@ -1232,6 +2237,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + pupa@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" @@ -1244,6 +2254,11 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" @@ -1279,6 +2294,23 @@ rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-pkg-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -1291,6 +2323,11 @@ reflect-metadata@^0.1.13: resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== +regexpp@^3.0.0, regexpp@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + registry-auth-token@^4.0.0: version "4.2.1" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" @@ -1310,6 +2347,24 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@^1.10.0, resolve@^1.10.1, resolve@^1.13.1, resolve@^1.20.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -1317,6 +2372,25 @@ responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + safe-buffer@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -1344,17 +2418,17 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.0, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.2: +semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -1408,11 +2482,37 @@ sha.js@^2.4.11: inherits "^2.0.1" safe-buffer "^5.0.1" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + source-map-support@^0.5.17: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -1426,6 +2526,37 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz#8a595135def9592bda69709474f1cbeea7c2467f" + integrity sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -1449,6 +2580,22 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -1470,6 +2617,16 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -1480,7 +2637,7 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^5.5.0: +supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== @@ -1494,11 +2651,28 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +table@^6.0.9: + version "6.7.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" + integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== + dependencies: + ajv "^8.0.1" + lodash.clonedeep "^4.5.0" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.0" + strip-ansi "^6.0.0" + term-size@^2.1.0: version "2.2.1" resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + thenify-all@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" @@ -1553,11 +2727,45 @@ ts-node@^10.0.0: source-map-support "^0.5.17" yn "3.1.1" +tsconfig-paths@^3.9.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" + integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tslib@^2.0.1, tslib@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" @@ -1620,6 +2828,16 @@ typescript@^4.3.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== +unbox-primitive@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" + undefsafe@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae" @@ -1658,6 +2876,13 @@ update-notifier@^4.1.0: semver-diff "^3.1.1" xdg-basedir "^4.0.0" +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" @@ -1670,11 +2895,42 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= +v8-compile-cache@^2.0.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + widest-line@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" @@ -1682,6 +2938,11 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" From 9cd14d13040d47c18fec985f4e449b8c5da156b5 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 24 Jun 2021 10:17:09 +0200 Subject: [PATCH 05/50] add User Model and Resolver --- backend/.env.dist | 2 + backend/package.json | 1 + backend/src/config/index.ts | 24 +++++++ .../src/graphql/datasources/login_server.ts | 8 +++ backend/src/graphql/models/User.ts | 62 +++++++++++++++++++ backend/src/graphql/resolvers/UserResolver.ts | 42 +++++++++++++ 6 files changed, 139 insertions(+) create mode 100644 backend/.env.dist create mode 100644 backend/src/config/index.ts create mode 100644 backend/src/graphql/datasources/login_server.ts create mode 100644 backend/src/graphql/models/User.ts create mode 100644 backend/src/graphql/resolvers/UserResolver.ts diff --git a/backend/.env.dist b/backend/.env.dist new file mode 100644 index 000000000..7815be556 --- /dev/null +++ b/backend/.env.dist @@ -0,0 +1,2 @@ +LOGIN_API_URL=http://localhost/login_api/ +COMMUNITY_API_URL=http://localhost/api/ \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index c1bc5ad89..02328230f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -12,6 +12,7 @@ "lint": "eslint . --ext .js,.ts" }, "dependencies": { + "apollo-datasource-rest": "^0.14.0", "express": "^4.17.1", "express-graphql": "^0.12.0", "graphql": "^15.5.1", diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts new file mode 100644 index 000000000..db60d2b84 --- /dev/null +++ b/backend/src/config/index.ts @@ -0,0 +1,24 @@ +// ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env) + +// Load Package Details for some default values +const pkg = require('../../package') + +const environment = { + NODE_ENV: process.env.NODE_ENV, + DEBUG: process.env.NODE_ENV !== 'production' || false, + PRODUCTION: process.env.NODE_ENV === 'production' || false, + ALLOW_REGISTER: process.env.ALLOW_REGISTER !== 'false', +} + +const server = { + LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', + COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', +} + +const CONFIG = { + ...environment, + ...server, + APP_VERSION: pkg.version, +} + +export default CONFIG diff --git a/backend/src/graphql/datasources/login_server.ts b/backend/src/graphql/datasources/login_server.ts new file mode 100644 index 000000000..870c90382 --- /dev/null +++ b/backend/src/graphql/datasources/login_server.ts @@ -0,0 +1,8 @@ +import { RESTDataSource } from 'apollo-datasource-rest' + +export class LoginServerAPI extends RESTDataSource { + constructor() { + super() + this.baseURL = 'https://api.spacexdata.com/v2/' + } +} diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts new file mode 100644 index 000000000..8f3ababf7 --- /dev/null +++ b/backend/src/graphql/models/User.ts @@ -0,0 +1,62 @@ +import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm' +import { ObjectType, Field, ID, GraphQLISODateTime } from 'type-graphql' + +@Entity() +@ObjectType() +export class User extends BaseEntity { + @Field(() => ID) + @PrimaryGeneratedColumn() + id: number + + @Field(() => String) + @Column({ length: 191 }) + email: string + + @Field(() => String) + @Column({ length: 150 }) + firstName: string + + @Field(() => String) + @Column() + lastName: string + + @Field(() => String) + @Column() + username: string + + @Field(() => String) + @Column('text') + description: string + + @Field(() => String) + @Column({ length: 64 }) + pubkey: string + + @Field(() => GraphQLISODateTime) + @Column({ type: 'datetime' }) + created: Date + + @Field(() => Boolean) + @Column({ default: false }) + emailChecked: boolean + + @Field(() => Boolean) + @Column({ default: false }) + passphraseShown: boolean + + @Field(() => String) + @Column({ default: 'de' }) + language: string + + @Field(() => Boolean) + @Column({ default: false }) + disabled: boolean + + @Field(() => ID) + @Column() + groupId: number + + @Field(() => ID) + @Column({ default: 0 }) + publisherId: number +} diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts new file mode 100644 index 000000000..8e0fae982 --- /dev/null +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -0,0 +1,42 @@ +import { Resolver, Query, Mutation, Arg } from 'type-graphql' +import { User } from '../models/User' +// import { CreateBookInput } from '../inputs/CreateBookInput' +// import { UpdateBookInput } from '../inputs/UpdateBookInput' + +@Resolver() +export class UserResolver { + @Query(() => [User]) + users(): Promise { + return User.find() + } + + @Query(() => User) + user(@Arg('id') id: string): Promise { + return User.findOne({ where: { id } }) + } + + /* + @Mutation(() => User) + async createBook(@Arg('data') data: CreateBookInput) { + const book = User.create(data) + await book.save() + return book + } + + @Mutation(() => Book) + async updateBook(@Arg('id') id: string, @Arg('data') data: UpdateBookInput) { + const book = await Book.findOne({ where: { id } }) + if (!book) throw new Error('Book not found!') + Object.assign(book, data) + await book.save() + return book + } +*/ + @Mutation(() => Boolean) + async deleteUser(@Arg('id') id: string): Promise { + const user = await User.findOne({ where: { id } }) + if (!user) throw new Error('User not found!') + await user.remove() + return true + } +} From 2ccdf6431283878dab1d0d2ac277b1553435f632 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 24 Jun 2021 11:15:03 +0200 Subject: [PATCH 06/50] try to get group list from login-server --- backend/src/config/index.ts | 16 +----------- .../src/graphql/datasources/loginServer.ts | 23 ++++++++++++++++ .../src/graphql/datasources/login_server.ts | 8 ------ backend/src/graphql/models/Group.ts | 26 +++++++++++++++++++ .../src/graphql/resolvers/GroupResolver.ts | 17 ++++++++++++ backend/src/index.ts | 2 ++ 6 files changed, 69 insertions(+), 23 deletions(-) create mode 100644 backend/src/graphql/datasources/loginServer.ts delete mode 100644 backend/src/graphql/datasources/login_server.ts create mode 100644 backend/src/graphql/models/Group.ts create mode 100644 backend/src/graphql/resolvers/GroupResolver.ts diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index db60d2b84..edf409104 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -1,24 +1,10 @@ // ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env) -// Load Package Details for some default values -const pkg = require('../../package') - -const environment = { - NODE_ENV: process.env.NODE_ENV, - DEBUG: process.env.NODE_ENV !== 'production' || false, - PRODUCTION: process.env.NODE_ENV === 'production' || false, - ALLOW_REGISTER: process.env.ALLOW_REGISTER !== 'false', -} - const server = { LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', } -const CONFIG = { - ...environment, - ...server, - APP_VERSION: pkg.version, -} +const CONFIG = { ...server } export default CONFIG diff --git a/backend/src/graphql/datasources/loginServer.ts b/backend/src/graphql/datasources/loginServer.ts new file mode 100644 index 000000000..ff802bce8 --- /dev/null +++ b/backend/src/graphql/datasources/loginServer.ts @@ -0,0 +1,23 @@ +import { RESTDataSource } from 'apollo-datasource-rest' +import CONFIG from '../../config' +import { Group } from '../models/Group' + +export class LoginServerAPI extends RESTDataSource { + constructor() { + super() + this.baseURL = CONFIG.LOGIN_API_URL + } + + async getAllGroupAliases(): Promise { + return new Promise(() => { + const response = await this.post('networkInfos', { ask: ['groups'] }) + const groups: Group[] = [] + response.data.forEach((element: string) => { + const group = new Group() + group.alias = element + groups.push(group) + })(groups) + return groups + }) + } +} diff --git a/backend/src/graphql/datasources/login_server.ts b/backend/src/graphql/datasources/login_server.ts deleted file mode 100644 index 870c90382..000000000 --- a/backend/src/graphql/datasources/login_server.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { RESTDataSource } from 'apollo-datasource-rest' - -export class LoginServerAPI extends RESTDataSource { - constructor() { - super() - this.baseURL = 'https://api.spacexdata.com/v2/' - } -} diff --git a/backend/src/graphql/models/Group.ts b/backend/src/graphql/models/Group.ts new file mode 100644 index 000000000..45582225e --- /dev/null +++ b/backend/src/graphql/models/Group.ts @@ -0,0 +1,26 @@ +import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm' +import { ObjectType, Field, ID } from 'type-graphql' + +@Entity() +@ObjectType() +export class Group extends BaseEntity { + @Field(() => ID) + @PrimaryGeneratedColumn() + id: number + + @Field(() => String) + @Column({ length: 190 }) + alias: string + + @Field(() => String) + @Column() + name: string + + @Field(() => String) + @Column('text') + description: string + + @Field(() => String) + @Column() + url: string +} diff --git a/backend/src/graphql/resolvers/GroupResolver.ts b/backend/src/graphql/resolvers/GroupResolver.ts new file mode 100644 index 000000000..b66908470 --- /dev/null +++ b/backend/src/graphql/resolvers/GroupResolver.ts @@ -0,0 +1,17 @@ +import { Resolver, Query, Mutation, Arg } from 'type-graphql' +import { Group } from '../models/Group' +import { LoginServerAPI } from '../datasources/loginServer' +@Resolver() +export class UserResolver { + @Query(() => [Group]) + groups(): Group[] { + const loginServer = new LoginServerAPI() + return loginServer.getAllGroupAliases() + } + + @Query(() => Group) + group(@Arg('id') id: string): Promise { + return Group.findOne({ where: { id } }) + } + +} diff --git a/backend/src/index.ts b/backend/src/index.ts index 453a5fdbc..fdc768410 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -4,6 +4,8 @@ import { graphqlHTTP } from 'express-graphql' // import { createConnection } from 'typeorm' import { buildSchema } from 'type-graphql' import { BookResolver } from './graphql/resolvers/BookResolver' +import { UserResolver } from './graphql/resolvers/UserResolver' +import LoginServerAPI = require('./graphql/datasources/loginServer') // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; async function main() { From 0224cac092a950af46a79f20b668f96d48d84097 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 24 Jun 2021 16:12:39 +0200 Subject: [PATCH 07/50] typescript login server api from frontend --- backend/package.json | 2 +- backend/src/apis/loginAPI.ts | 163 ++++++++++++++++++ .../src/graphql/datasources/loginServer.ts | 23 --- 3 files changed, 164 insertions(+), 24 deletions(-) create mode 100644 backend/src/apis/loginAPI.ts delete mode 100644 backend/src/graphql/datasources/loginServer.ts diff --git a/backend/package.json b/backend/package.json index 02328230f..16b0cdf22 100644 --- a/backend/package.json +++ b/backend/package.json @@ -12,7 +12,7 @@ "lint": "eslint . --ext .js,.ts" }, "dependencies": { - "apollo-datasource-rest": "^0.14.0", + "axios": "^0.21.1", "express": "^4.17.1", "express-graphql": "^0.12.0", "graphql": "^15.5.1", diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts new file mode 100644 index 000000000..7370ee50c --- /dev/null +++ b/backend/src/apis/loginAPI.ts @@ -0,0 +1,163 @@ +import axios from 'axios' +import CONFIG from '../config' +// eslint-disable-next-line no-unused-vars +import regeneratorRuntime from 'regenerator-runtime' + +// control email-text sended with email verification code +const EMAIL_TYPE = { + DEFAULT: 2, // if user has registered directly + ADMIN: 5, // if user was registered by an admin +} + +const apiGet = async (url: string) => { + try { + const result = await axios.get(url) + if (result.status !== 200) { + throw new Error('HTTP Status Error ' + result.status) + } + if (!['success', 'warning'].includes(result.data.state)) { + throw new Error(result.data.msg) + } + return { success: true, result } + } catch (error) { + return { success: false, result: error } + } +} + +const apiPost = async (url: string, payload: string) => { + try { + const result = await axios.post(url, payload) + if (result.status !== 200) { + throw new Error('HTTP Status Error ' + result.status) + } + if (result.data.state === 'warning') { + return { success: true, result: result.error } + } + if (result.data.state !== 'success') { + throw new Error(result.data.msg) + } + return { success: true, result } + } catch (error) { + return { success: false, result: error } + } +} + +const loginAPI = { + login: async (email: string, password: string): Promise => { + const payload: any = { + email, + password, + } + return apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', payload) + }, + logout: async (sessionId: number): Promise => { + const payload: any = { session_id: sessionId } + return apiPost(CONFIG.LOGIN_API_URL + 'logout', payload) + }, + create: async ( + email: string, + firstName: string, + lastName: string, + password: string, + ): Promise => { + const payload: any = { + email, + first_name: firstName, + last_name: lastName, + password, + emailType: EMAIL_TYPE.DEFAULT, + login_after_register: true, + } + return apiPost(CONFIG.LOGIN_API_URL + 'createUser', payload) + }, + sendEmail: async ( + email: string, + email_text = 7, + email_verification_code_type = 'resetPassword', + ): Promise => { + const payload: any = { + email, + email_text, + email_verification_code_type, + } + return apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) + }, + loginViaEmailVerificationCode: async (optin: number): Promise => { + return apiGet( + CONFIG.LOGIN_API_URL + 'loginViaEmailVerificationCode?emailVerificationCode=' + optin, + ) + }, + getUserInfos: async (sessionId: number, email: string): Promise => { + const payload: any = { + session_id: sessionId, + email: email, + ask: ['user.first_name', 'user.last_name'], + } + return apiPost(CONFIG.LOGIN_API_URL + 'getUserInfos', payload) + }, + updateUserInfos: async (sessionId: number, email: string, data: any): Promise => { + const payload: any = { + session_id: sessionId, + email, + update: { + 'User.first_name': data.firstName, + 'User.last_name': data.lastName, + 'User.description': data.description, + }, + } + return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + }, + changePassword: async (sessionId: number, email: string, password: string): Promise => { + const payload: any = { + session_id: sessionId, + email, + password, + } + return apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload) + }, + changePasswordProfile: async ( + sessionId: number, + email: string, + password: string, + passwordNew: string, + ): Promise => { + const payload: any = { + session_id: sessionId, + email, + update: { + 'User.password_old': password, + 'User.password': passwordNew, + }, + } + return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + }, + changeUsernameProfile: async ( + sessionId: number, + email: string, + username: string, + ): Promise => { + const payload: any = { + session_id: sessionId, + email, + update: { + 'User.username': username, + }, + } + return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + }, + updateLanguage: async (sessionId: number, email: string, language: string): Promise => { + const payload: any = { + session_id: sessionId, + email, + update: { + 'User.language': language, + }, + } + return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + }, + checkUsername: async (username: string, groupId = 1): Promise => { + return apiGet(CONFIG.LOGIN_API_URL + `checkUsername?username=${username}&group_id=${groupId}`) + }, +} + +export default loginAPI diff --git a/backend/src/graphql/datasources/loginServer.ts b/backend/src/graphql/datasources/loginServer.ts deleted file mode 100644 index ff802bce8..000000000 --- a/backend/src/graphql/datasources/loginServer.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { RESTDataSource } from 'apollo-datasource-rest' -import CONFIG from '../../config' -import { Group } from '../models/Group' - -export class LoginServerAPI extends RESTDataSource { - constructor() { - super() - this.baseURL = CONFIG.LOGIN_API_URL - } - - async getAllGroupAliases(): Promise { - return new Promise(() => { - const response = await this.post('networkInfos', { ask: ['groups'] }) - const groups: Group[] = [] - response.data.forEach((element: string) => { - const group = new Group() - group.alias = element - groups.push(group) - })(groups) - return groups - }) - } -} From 00639965122b2a0d35ed4fa6b4ad2c6c953325f0 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 24 Jun 2021 17:32:54 +0200 Subject: [PATCH 08/50] get groups from login server, first running api call to login server --- backend/src/apis/loginAPI.ts | 20 ++++++++++++++---- backend/src/config/index.ts | 3 +++ .../src/graphql/resolvers/GroupResolver.ts | 21 +++++++++++++------ backend/src/index.ts | 4 ++-- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index 7370ee50c..eef6ea2d7 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -1,7 +1,7 @@ import axios from 'axios' import CONFIG from '../config' // eslint-disable-next-line no-unused-vars -import regeneratorRuntime from 'regenerator-runtime' +// import regeneratorRuntime from 'regenerator-runtime' // control email-text sended with email verification code const EMAIL_TYPE = { @@ -24,14 +24,14 @@ const apiGet = async (url: string) => { } } -const apiPost = async (url: string, payload: string) => { +const apiPost = async (url: string, payload: any): Promise => { try { const result = await axios.post(url, payload) if (result.status !== 200) { throw new Error('HTTP Status Error ' + result.status) } if (result.data.state === 'warning') { - return { success: true, result: result.error } + return { success: true, result: result.data.errors } } if (result.data.state !== 'success') { throw new Error(result.data.msg) @@ -42,6 +42,15 @@ const apiPost = async (url: string, payload: string) => { } } +interface NetworkInfosResult { + state: string + msg?: string + errors: string[] + data: { + groups?: string[] + } +} + const loginAPI = { login: async (email: string, password: string): Promise => { const payload: any = { @@ -158,6 +167,9 @@ const loginAPI = { checkUsername: async (username: string, groupId = 1): Promise => { return apiGet(CONFIG.LOGIN_API_URL + `checkUsername?username=${username}&group_id=${groupId}`) }, + getNetworkInfos: async (ask: string[]): Promise => { + return (await apiPost(CONFIG.LOGIN_API_URL + `networkInfos`, { ask: ask })).result.data + }, } -export default loginAPI +export { loginAPI, NetworkInfosResult } diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index edf409104..1c922f7f1 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -1,5 +1,8 @@ // ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env) +import dotenv from 'dotenv' +dotenv.config() + const server = { LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', diff --git a/backend/src/graphql/resolvers/GroupResolver.ts b/backend/src/graphql/resolvers/GroupResolver.ts index b66908470..4a4f997f3 100644 --- a/backend/src/graphql/resolvers/GroupResolver.ts +++ b/backend/src/graphql/resolvers/GroupResolver.ts @@ -1,17 +1,26 @@ import { Resolver, Query, Mutation, Arg } from 'type-graphql' import { Group } from '../models/Group' -import { LoginServerAPI } from '../datasources/loginServer' +import { loginAPI, NetworkInfosResult } from '../../apis/loginAPI' @Resolver() -export class UserResolver { +export class GroupResolver { @Query(() => [Group]) - groups(): Group[] { - const loginServer = new LoginServerAPI() - return loginServer.getAllGroupAliases() + async groups(): Promise { + // eslint-disable-next-line no-console + console.log('group resolver') + const result: NetworkInfosResult = await loginAPI.getNetworkInfos(['groups']) + const groups: Group[] = [] + + result.data.groups?.forEach((alias: string) => { + console.log("alias: ", alias) + const group = new Group() + group.alias = alias + groups.push(group) + }) + return groups } @Query(() => Group) group(@Arg('id') id: string): Promise { return Group.findOne({ where: { id } }) } - } diff --git a/backend/src/index.ts b/backend/src/index.ts index fdc768410..0cdadf53a 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -5,12 +5,12 @@ import { graphqlHTTP } from 'express-graphql' import { buildSchema } from 'type-graphql' import { BookResolver } from './graphql/resolvers/BookResolver' import { UserResolver } from './graphql/resolvers/UserResolver' -import LoginServerAPI = require('./graphql/datasources/loginServer') +import { GroupResolver } from './graphql/resolvers/GroupResolver' // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; async function main() { // const connection = await createConnection() - const schema = await buildSchema({ resolvers: [BookResolver] }) + const schema = await buildSchema({ resolvers: [BookResolver, GroupResolver] }) const server = express() server.use( From c2ecd0d64175b04e5a2757b3071f957774d909e6 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 24 Jun 2021 17:34:37 +0200 Subject: [PATCH 09/50] remove debug logging --- backend/src/graphql/resolvers/GroupResolver.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/src/graphql/resolvers/GroupResolver.ts b/backend/src/graphql/resolvers/GroupResolver.ts index 4a4f997f3..8294c09ab 100644 --- a/backend/src/graphql/resolvers/GroupResolver.ts +++ b/backend/src/graphql/resolvers/GroupResolver.ts @@ -5,13 +5,10 @@ import { loginAPI, NetworkInfosResult } from '../../apis/loginAPI' export class GroupResolver { @Query(() => [Group]) async groups(): Promise { - // eslint-disable-next-line no-console - console.log('group resolver') const result: NetworkInfosResult = await loginAPI.getNetworkInfos(['groups']) const groups: Group[] = [] result.data.groups?.forEach((alias: string) => { - console.log("alias: ", alias) const group = new Group() group.alias = alias groups.push(group) From 8e96aa02dfeca8a42a35fa80c154ac2026a1407c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 24 Jun 2021 18:29:30 +0200 Subject: [PATCH 10/50] try to login user --- backend/package.json | 2 ++ backend/src/apis/loginAPI.ts | 23 +++++++++++++------ backend/src/graphql/resolvers/UserResolver.ts | 9 ++++++++ backend/src/index.ts | 2 +- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/backend/package.json b/backend/package.json index 16b0cdf22..4ab300e13 100644 --- a/backend/package.json +++ b/backend/package.json @@ -16,12 +16,14 @@ "express": "^4.17.1", "express-graphql": "^0.12.0", "graphql": "^15.5.1", + "jsonwebtoken": "^8.5.1", "reflect-metadata": "^0.1.13", "type-graphql": "^1.1.1", "typeorm": "^0.2.34" }, "devDependencies": { "@types/express": "^4.17.12", + "@types/jsonwebtoken": "^8.5.2", "@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/parser": "^4.28.0", "eslint": "^7.29.0", diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index eef6ea2d7..8e4b5e040 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -1,5 +1,8 @@ import axios from 'axios' +import { graphql } from 'graphql' import CONFIG from '../config' +import { User } from '../graphql/models/User' +import { LoginUserInput } from '../graphql/inputs/LoginUserInput' // eslint-disable-next-line no-unused-vars // import regeneratorRuntime from 'regenerator-runtime' @@ -51,13 +54,19 @@ interface NetworkInfosResult { } } +interface LoginResult { + state: string + msg?: string + details?: number + info?: string + user?: User + // eslint-disable-next-line camelcase + session_id?: number +} + const loginAPI = { - login: async (email: string, password: string): Promise => { - const payload: any = { - email, - password, - } - return apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', payload) + login: async (login: LoginUserInput): Promise => { + return (await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', login)).result.data }, logout: async (sessionId: number): Promise => { const payload: any = { session_id: sessionId } @@ -172,4 +181,4 @@ const loginAPI = { }, } -export { loginAPI, NetworkInfosResult } +export { loginAPI, NetworkInfosResult, LoginResult } diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 8e0fae982..cfdea954e 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,5 +1,8 @@ import { Resolver, Query, Mutation, Arg } from 'type-graphql' import { User } from '../models/User' +import jwt from 'jsonwebtoken' +import { LoginUserInput } from '../inputs/LoginUserInput' +import { loginAPI, LoginResult } from '../../apis/loginAPI' // import { CreateBookInput } from '../inputs/CreateBookInput' // import { UpdateBookInput } from '../inputs/UpdateBookInput' @@ -15,6 +18,12 @@ export class UserResolver { return User.findOne({ where: { id } }) } + @Mutation(() => User) + async login(@Arg('data') data: LoginUserInput): Promise { + const loginResult: LoginResult = await loginAPI.login(data) + return loginResult.user ? loginResult.user : new User() + } + /* @Mutation(() => User) async createBook(@Arg('data') data: CreateBookInput) { diff --git a/backend/src/index.ts b/backend/src/index.ts index 0cdadf53a..7b7f64c75 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -10,7 +10,7 @@ import { GroupResolver } from './graphql/resolvers/GroupResolver' async function main() { // const connection = await createConnection() - const schema = await buildSchema({ resolvers: [BookResolver, GroupResolver] }) + const schema = await buildSchema({ resolvers: [BookResolver, GroupResolver, UserResolver] }) const server = express() server.use( From 0c029dc76863e8f32c1712b5e287e021023b90cf Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 24 Jun 2021 20:41:24 +0200 Subject: [PATCH 11/50] missing file --- backend/src/graphql/inputs/LoginUserInput.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 backend/src/graphql/inputs/LoginUserInput.ts diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts new file mode 100644 index 000000000..ee6fb1814 --- /dev/null +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -0,0 +1,16 @@ +import { InputType, Field } from 'type-graphql' + +@InputType() +export class LoginUserInput { + @Field({ nullable: true }) + username?: string + + @Field({ nullable: true }) + email?: string + + @Field({ nullable: true }) + pubkey?: string + + @Field() + password: string +} From 05be9a79d5054e2dea1ff3ca2a60db0d0be5604a Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 24 Jun 2021 21:32:32 +0200 Subject: [PATCH 12/50] implement config options for graphiql & port separate graphiql from graphql interface disabled api calls for user & group - we are not yet that far ignore .env, adjust .env.dist accordingly --- backend/.env.dist | 6 +- backend/.gitignore | 1 + .../src/apis/{loginAPI.ts => loginAPI.ts.old} | 0 backend/src/config/index.ts | 6 +- ...oginUserInput.ts => LoginUserInput.ts.old} | 0 .../graphql/models/{Group.ts => Group.ts.old} | 0 .../graphql/models/{User.ts => User.ts.old} | 0 ...{GroupResolver.ts => GroupResolver.ts.old} | 0 .../{UserResolver.ts => UserResolver.ts.old} | 0 backend/src/index.ts | 98 ++++++++++------- backend/yarn.lock | 101 +++++++++++++++++- 11 files changed, 167 insertions(+), 45 deletions(-) rename backend/src/apis/{loginAPI.ts => loginAPI.ts.old} (100%) rename backend/src/graphql/inputs/{LoginUserInput.ts => LoginUserInput.ts.old} (100%) rename backend/src/graphql/models/{Group.ts => Group.ts.old} (100%) rename backend/src/graphql/models/{User.ts => User.ts.old} (100%) rename backend/src/graphql/resolvers/{GroupResolver.ts => GroupResolver.ts.old} (100%) rename backend/src/graphql/resolvers/{UserResolver.ts => UserResolver.ts.old} (100%) diff --git a/backend/.env.dist b/backend/.env.dist index 7815be556..21127b9ed 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -1,2 +1,4 @@ -LOGIN_API_URL=http://localhost/login_api/ -COMMUNITY_API_URL=http://localhost/api/ \ No newline at end of file +PORT=4000 +GRAPHIQL=false +// LOGIN_API_URL=http://localhost/login_api/ +// COMMUNITY_API_URL=http://localhost/api/ \ No newline at end of file diff --git a/backend/.gitignore b/backend/.gitignore index 2ccbe4656..66ee735e1 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1 +1,2 @@ /node_modules/ +/.env diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts.old similarity index 100% rename from backend/src/apis/loginAPI.ts rename to backend/src/apis/loginAPI.ts.old diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 1c922f7f1..341c08f4f 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -4,8 +4,10 @@ import dotenv from 'dotenv' dotenv.config() const server = { - LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', - COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', + PORT: process.env.PORT || 4000, + GRAPHIQL: process.env.GRAPHIQL === 'true' || false, + // LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', + // COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', } const CONFIG = { ...server } diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts.old similarity index 100% rename from backend/src/graphql/inputs/LoginUserInput.ts rename to backend/src/graphql/inputs/LoginUserInput.ts.old diff --git a/backend/src/graphql/models/Group.ts b/backend/src/graphql/models/Group.ts.old similarity index 100% rename from backend/src/graphql/models/Group.ts rename to backend/src/graphql/models/Group.ts.old diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts.old similarity index 100% rename from backend/src/graphql/models/User.ts rename to backend/src/graphql/models/User.ts.old diff --git a/backend/src/graphql/resolvers/GroupResolver.ts b/backend/src/graphql/resolvers/GroupResolver.ts.old similarity index 100% rename from backend/src/graphql/resolvers/GroupResolver.ts rename to backend/src/graphql/resolvers/GroupResolver.ts.old diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts.old similarity index 100% rename from backend/src/graphql/resolvers/UserResolver.ts rename to backend/src/graphql/resolvers/UserResolver.ts.old diff --git a/backend/src/index.ts b/backend/src/index.ts index 7b7f64c75..6dca948a4 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -1,62 +1,80 @@ import 'reflect-metadata' import express from 'express' import { graphqlHTTP } from 'express-graphql' -// import { createConnection } from 'typeorm' import { buildSchema } from 'type-graphql' +// import { createConnection } from 'typeorm' +import CONFIG from './config' + +// TODO move to extern import { BookResolver } from './graphql/resolvers/BookResolver' -import { UserResolver } from './graphql/resolvers/UserResolver' -import { GroupResolver } from './graphql/resolvers/GroupResolver' +// import { UserResolver } from './graphql/resolvers/UserResolver' +// import { GroupResolver } from './graphql/resolvers/GroupResolver' +// TODO implement // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; async function main() { // const connection = await createConnection() - const schema = await buildSchema({ resolvers: [BookResolver, GroupResolver, UserResolver] }) + const schema = await buildSchema({ resolvers: [BookResolver /*, GroupResolver, UserResolver */] }) const server = express() + const validationRules: [] = [ + /** + * This provides GraphQL query analysis to reject complex queries to your GraphQL server. + * This can be used to protect your GraphQL servers + * against resource exhaustion and DoS attacks. + * More documentation can be found (here)[https://github.com/ivome/graphql-query-complexity] + */ + /* queryComplexity({ + // The maximum allowed query complexity, queries above this threshold will be rejected + maximumComplexity: 20, + // The query variables. This is needed because the variables are not available + // in the visitor of the graphql-js library + variables: params!.variables!, + // Optional callback function to retrieve the determined query complexity + // Will be invoked weather the query is rejected or not + // This can be used for logging or to implement rate limiting + onComplete: (complexity: number) => { + console.log("Query Complexity:", complexity); + }, + // Add any number of estimators. The estimators are invoked in order, the first + // numeric value that is being returned by an estimator is used as the field complexity. + // If no estimator returns a value, an exception is raised. + estimators: [ + fieldConfigEstimator(), + // Add more estimators here... + // This will assign each field a complexity of 1 if no other estimator + // returned a value. + simpleEstimator({ + defaultComplexity: 1, + }), + ], + }), */ + ] + // TODO Versioning? server.use( '/api', graphqlHTTP({ schema, - graphiql: true, - validationRules: [ - /** - * This provides GraphQL query analysis to reject complex queries to your GraphQL server. - * This can be used to protect your GraphQL servers - * against resource exhaustion and DoS attacks. - * More documentation can be found (here)[https://github.com/ivome/graphql-query-complexity] - */ - /* queryComplexity({ - // The maximum allowed query complexity, queries above this threshold will be rejected - maximumComplexity: 20, - // The query variables. This is needed because the variables are not available - // in the visitor of the graphql-js library - variables: params!.variables!, - // Optional callback function to retrieve the determined query complexity - // Will be invoked weather the query is rejected or not - // This can be used for logging or to implement rate limiting - onComplete: (complexity: number) => { - console.log("Query Complexity:", complexity); - }, - // Add any number of estimators. The estimators are invoked in order, the first - // numeric value that is being returned by an estimator is used as the field complexity. - // If no estimator returns a value, an exception is raised. - estimators: [ - fieldConfigEstimator(), - // Add more estimators here... - // This will assign each field a complexity of 1 if no other estimator - // returned a value. - simpleEstimator({ - defaultComplexity: 1, - }), - ], - }), */ - ], + graphiql: false, + validationRules, }), ) - server.listen(4000, () => { + // Graphiql interface + if (CONFIG.GRAPHIQL) { + server.use( + '/graphiql', + graphqlHTTP({ + schema, + graphiql: true, + validationRules, + }), + ) + } + + server.listen(CONFIG.PORT, () => { // eslint-disable-next-line no-console - console.log(`Server is running, GraphIQL available at http://localhost:4000/api`) + console.log(`Server is running, GraphIQL available at http://localhost:${CONFIG.PORT}/graphiql`) }) } diff --git a/backend/yarn.lock b/backend/yarn.lock index b4433044e..f5ec125e6 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -148,6 +148,13 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/jsonwebtoken@^8.5.2": + version "8.5.2" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.2.tgz#eb71c717b3b8681bb85fbd2950c9c4c5d4506748" + integrity sha512-X8BOCkp+WJVNYCYIBugREtVZa4Y09Or9HDx6xqRZem5F8jJV8FuJgNessXyMuv9+U8pjnvdezASwU28uw+1scw== + dependencies: + "@types/node" "*" + "@types/mime@^1": version "1.3.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -424,6 +431,13 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +axios@^0.21.1: + version "0.21.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" + integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== + dependencies: + follow-redirects "^1.10.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -484,6 +498,11 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" +buffer-equal-constant-time@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= + buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -807,6 +826,13 @@ duplexer3@^0.1.4: resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= +ecdsa-sig-formatter@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" + integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== + dependencies: + safe-buffer "^5.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -1245,6 +1271,11 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== +follow-redirects@^1.10.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" + integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -1754,6 +1785,39 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" +jsonwebtoken@^8.5.1: + version "8.5.1" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d" + integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w== + dependencies: + jws "^3.2.2" + lodash.includes "^4.3.0" + lodash.isboolean "^3.0.3" + lodash.isinteger "^4.0.4" + lodash.isnumber "^3.0.3" + lodash.isplainobject "^4.0.6" + lodash.isstring "^4.0.1" + lodash.once "^4.0.0" + ms "^2.1.1" + semver "^5.6.0" + +jwa@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" + integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== + dependencies: + buffer-equal-constant-time "1.0.1" + ecdsa-sig-formatter "1.0.11" + safe-buffer "^5.0.1" + +jws@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" + integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== + dependencies: + jwa "^1.4.1" + safe-buffer "^5.0.1" + keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -1804,11 +1868,46 @@ lodash.get@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= +lodash.includes@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" + integrity sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8= + +lodash.isboolean@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" + integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= + +lodash.isinteger@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" + integrity sha1-YZwK89A/iwTDH1iChAt3sRzWg0M= + +lodash.isnumber@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" + integrity sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w= + +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.once@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" + integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= + lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" @@ -2418,7 +2517,7 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== From e510dee7a8acc21e6140e33efc48649b976884fe Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 24 Jun 2021 21:35:34 +0200 Subject: [PATCH 13/50] removed development environment linting exception --- backend/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js index 8fbf554ce..f213be8c6 100644 --- a/backend/.eslintrc.js +++ b/backend/.eslintrc.js @@ -15,7 +15,7 @@ module.exports = { // add your custom rules here rules: { 'no-console': ['error'], - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': 'error', 'prettier/prettier': [ 'error', { From fbf5e783d3531de5038333f6232896904e979529 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 24 Jun 2021 21:53:15 +0200 Subject: [PATCH 14/50] build & start commands dockerfile --- backend/.gitignore | 1 + backend/Dockerfile | 95 +++++++++++++++++++++++++++++++++++++++++++ backend/package.json | 3 ++ backend/tsconfig.json | 2 +- 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 backend/Dockerfile diff --git a/backend/.gitignore b/backend/.gitignore index 66ee735e1..8a3d521fc 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1,2 +1,3 @@ /node_modules/ /.env +/build/ diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 000000000..fc853eb63 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,95 @@ +################################################################################## +# BASE ########################################################################### +################################################################################## +FROM node:12.19.0-alpine3.10 as base + +# ENVs (available in production aswell, can be overwritten by commandline or env file) +## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame +ENV DOCKER_WORKDIR="/app" +## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0 +ENV BUILD_DATE="1970-01-01T00:00:00.00Z" +## We cannot do $(npm run version).${BUILD_NUMBER} here so we default to 0.0.0.0 +ENV BUILD_VERSION="0.0.0.0" +## We cannot do `$(git rev-parse --short HEAD)` here so we default to 0000000 +ENV BUILD_COMMIT="0000000" +## SET NODE_ENV +ENV NODE_ENV="production" +## App relevant Envs +ENV PORT="4000" + +# Labels +LABEL org.label-schema.build-date="${BUILD_DATE}" +LABEL org.label-schema.name="gradido:backend" +LABEL org.label-schema.description="Gradido GraphQL Backend" +LABEL org.label-schema.usage="https://github.com/gradido/gradido/blob/master/README.md" +LABEL org.label-schema.url="https://gradido.net" +LABEL org.label-schema.vcs-url="https://github.com/gradido/gradido/tree/master/backend" +LABEL org.label-schema.vcs-ref="${BUILD_COMMIT}" +LABEL org.label-schema.vendor="Gradido Community" +LABEL org.label-schema.version="${BUILD_VERSION}" +LABEL org.label-schema.schema-version="1.0" +LABEL maintainer="support@gradido.net" + +# Install Additional Software +## install: git +#RUN apk --no-cache add git + +# Settings +## Expose Container Port +EXPOSE ${PORT} + +## Workdir +RUN mkdir -p ${DOCKER_WORKDIR} +WORKDIR ${DOCKER_WORKDIR} + +################################################################################## +# DEVELOPMENT (Connected to the local environment, to reload on demand) ########## +################################################################################## +FROM base as development + +# We don't need to copy or build anything since we gonna bind to the +# local filesystem which will need a rebuild anyway + +# Run command +# (for development we need to execute npm install since the +# node_modules are on another volume and need updating) +CMD /bin/sh -c "yarn install && yarn run dev" + +################################################################################## +# BUILD (Does contain all files and is therefore bloated) ######################## +################################################################################## +FROM base as build + +# Copy everything +COPY . . +# npm install +RUN yarn install --production=false --frozen-lockfile --non-interactive +# npm build +RUN yarn run build + +################################################################################## +# TEST ########################################################################### +################################################################################## +FROM build as test + +# Run command +CMD /bin/sh -c "yarn run dev" + +################################################################################## +# PRODUCTION (Does contain only "binary"- and static-files to reduce image size) # +################################################################################## +FROM base as production + +# Copy "binary"-files from build image +COPY --from=build ${DOCKER_WORKDIR}/build ./build +# We also copy the node_modules express and serve-static for the run script +# COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules +# Copy static files +# COPY --from=build ${DOCKER_WORKDIR}/public ./public +# Copy package.json for script definitions (lock file should not be needed) +COPY --from=build ${DOCKER_WORKDIR}/package.json ./package.json +# Copy run scripts run/ +# COPY --from=build ${DOCKER_WORKDIR}/run ./run + +# Run command +CMD /bin/sh -c "yarn run start" \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index 4ab300e13..2ffef3b58 100644 --- a/backend/package.json +++ b/backend/package.json @@ -8,6 +8,9 @@ "license": "MIT", "private": false, "scripts": { + "build": "tsc --build", + "clean": "tsc --build --clean", + "start": "node build/index.js", "dev": "nodemon -w src --ext ts --exec ts-node src/index.ts", "lint": "eslint . --ext .js,.ts" }, diff --git a/backend/tsconfig.json b/backend/tsconfig.json index 422ff8e0a..d48524ba5 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -14,7 +14,7 @@ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ + "outDir": "./build", /* Redirect output structure to the directory. */ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ From ae3c27ea9e97b0bdffeddf686bd0ee4670374eaa Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 24 Jun 2021 21:54:06 +0200 Subject: [PATCH 15/50] emcas backup ignore file pattern --- backend/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/.gitignore b/backend/.gitignore index 8a3d521fc..d2d2310f8 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1,3 +1,6 @@ /node_modules/ /.env /build/ + +# emacs +*~ \ No newline at end of file From 1c21dc17453e08c410996db564491947c7a205fb Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 24 Jun 2021 21:56:03 +0200 Subject: [PATCH 16/50] missing trailing comma --- backend/.prettierrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/.prettierrc.js b/backend/.prettierrc.js index e88113754..8495e3f20 100644 --- a/backend/.prettierrc.js +++ b/backend/.prettierrc.js @@ -4,5 +4,5 @@ module.exports = { singleQuote: true, trailingComma: "all", tabWidth: 2, - bracketSpacing: true + bracketSpacing: true, }; From 2c5d780db4d651df679d485c1dbbee8662b5b8fa Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 24 Jun 2021 22:23:15 +0200 Subject: [PATCH 17/50] docker-compose github workflows publish & lint --- .github/workflows/publish.yml | 52 +++++++++++++++++++++++++++++++-- .github/workflows/test.yml | 55 +++++++++++++++++++++++++++++++++++ docker-compose.override.yml | 21 ++++++++++++- docker-compose.yml | 26 ++++++++++++++++- 4 files changed, 149 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 66bc2bbf8..8161fb3b4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ on: jobs: ############################################################################## - # JOB: DOCKER BUILD COMMUNITY NEO4J ########################################## + # JOB: DOCKER BUILD PRODUCTION FRONTEND ###################################### ############################################################################## build_production_frontend: name: Docker Build Production - Frontend @@ -43,6 +43,43 @@ jobs: name: docker-frontend-production path: /tmp/frontend.tar + ############################################################################## + # JOB: DOCKER BUILD PRODUCTION BACKEND ####################################### + ############################################################################## + build_production_backend: + name: Docker Build Production - Backend + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # SET ENVS ############################################################### + ########################################################################## + - name: ENV - VERSION + run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV + - name: ENV - BUILD_DATE + run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + - name: ENV - BUILD_VERSION + run: echo "BUILD_VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: ENV - BUILD_COMMIT + run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV + ########################################################################## + # BACKEND ################################################################ + ########################################################################## + - name: Backend | Build `production` image + run: | + docker build --target production -t "gradido/backend:latest" -t "gradido/backend:production" -t "gradido/backend:${VERSION}" -t "gradido/backend:${BUILD_VERSION}" backend/ + docker save "gradido/backend" > /tmp/backend.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-backend-production + path: /tmp/backend.tar + ############################################################################## # JOB: DOCKER BUILD PRODUCTION LOGIN SERVER ################################## ############################################################################## @@ -199,7 +236,7 @@ jobs: upload_to_dockerhub: name: Upload to Dockerhub runs-on: ubuntu-latest - needs: [build_production_frontend, build_production_login_server, build_production_community_server, build_production_mariadb, build_production_nginx] + needs: [build_production_frontend, build_production_backend, build_production_login_server, build_production_community_server, build_production_mariadb, build_production_nginx] env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} @@ -212,13 +249,20 @@ jobs: ########################################################################## # DOWNLOAD DOCKER IMAGES ################################################# ########################################################################## - - name: Download Docker Image (Neo4J) + - name: Download Docker Image (Frontend) uses: actions/download-artifact@v2 with: name: docker-frontend-production path: /tmp - name: Load Docker Image run: docker load < /tmp/frontend.tar + - name: Download Docker Image (Backend) + uses: actions/download-artifact@v2 + with: + name: docker-backend-production + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/backend.tar - name: Download Docker Image (Login Server) uses: actions/download-artifact@v2 with: @@ -254,6 +298,8 @@ jobs: run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin - name: Push frontend run: docker push --all-tags gradido/frontend + - name: Push backend + run: docker push --all-tags gradido/backend - name: Push login_server run: docker push --all-tags gradido/login_server - name: Push community_server diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 002118f5b..8f7c2db05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,32 @@ jobs: name: docker-frontend-test path: /tmp/frontend.tar + ############################################################################## + # JOB: DOCKER BUILD TEST BACKEND ############################################# + ############################################################################## + build_test_backend: + name: Docker Build Test - Backend + runs-on: ubuntu-latest + #needs: [nothing] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # FRONTEND ############################################################### + ########################################################################## + - name: Backend | Build `test` image + run: | + docker build --target test -t "gradido/backend:test" backend/ + docker save "gradido/backend:test" > /tmp/backend.tar + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: docker-backend-test + path: /tmp/backend.tar + ############################################################################## # JOB: DOCKER BUILD TEST LOGIN SERVER ######################################## ############################################################################## @@ -159,6 +185,35 @@ jobs: - name: frontend | Lint run: docker run --rm gradido/frontend:test yarn run lint + ############################################################################## + # JOB: LINT BACKEND ######################################################### + ############################################################################## + lint_backend: + name: Lint - Backend + runs-on: ubuntu-latest + needs: [build_test_backend] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v2 + ########################################################################## + # DOWNLOAD DOCKER IMAGE ################################################## + ########################################################################## + - name: Download Docker Image (Backend) + uses: actions/download-artifact@v2 + with: + name: docker-backend-test + path: /tmp + - name: Load Docker Image + run: docker load < /tmp/backend.tar + ########################################################################## + # LINT FRONTEND ########################################################### + ########################################################################## + - name: backend | Lint + run: docker run --rm gradido/backend:test yarn run lint + ############################################################################## # JOB: UNIT TEST FRONTEND ################################################### ############################################################################## diff --git a/docker-compose.override.yml b/docker-compose.override.yml index cbb041457..092cd9db1 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -21,6 +21,24 @@ services: # bind the local folder to the docker to allow live reload - ./frontend:/app + ######################################################## + # BACKEND ############################################## + ######################################################## + backend: + image: gradido/backend:development + build: + target: development + networks: + - external-net + environment: + - NODE_ENV="development" + volumes: + # This makes sure the docker container has its own node modules. + # Therefore it is possible to have a different node version on the host machine + - backend_node_modules:/app/node_modules + # bind the local folder to the docker to allow live reload + - ./backend:/app + ######################################################### ## LOGIN SERVER ######################################### ######################################################### @@ -99,4 +117,5 @@ services: volumes: frontend_node_modules: - login_build_ubuntu_3.1: + backend_node_modules: + login_build_ubuntu_3.1: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 35e015f4e..7528527e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,7 +47,31 @@ services: ports: - 3306:3306 volumes: - - db_vol:/var/lib/mysql + - db_vol:/var/lib/mysql + + ######################################################## + # BACKEND ############################################## + ######################################################## + backend: + image: gradido/backend:latest + build: + context: ./backend + target: production + networks: + - internal-net + ports: + - 4000:4000 + environment: + # Envs used in Dockerfile + # - DOCKER_WORKDIR="/app" + # - PORT=4000 + - BUILD_DATE + - BUILD_VERSION + - BUILD_COMMIT + - NODE_ENV="production" + # Application only envs + #env_file: + # - ./frontend/.env ######################################################### ## LOGIN SERVER ######################################### From 50a762073a00d08b51d652bd761d559607c576e9 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 24 Jun 2021 22:27:36 +0200 Subject: [PATCH 18/50] corrected .eslintignore --- backend/.eslintignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/.eslintignore b/backend/.eslintignore index e973d3709..f6b255e92 100644 --- a/backend/.eslintignore +++ b/backend/.eslintignore @@ -1,3 +1,3 @@ node_modules **/*.min.js -dist \ No newline at end of file +build \ No newline at end of file From fd54febd24a5bf26a8f9c510148f532d028554e4 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 29 Jun 2021 12:24:45 +0200 Subject: [PATCH 19/50] started login functionality & graphql schema --- backend/src/config/index.ts | 4 +- backend/src/graphql/resolvers/UserResolver.ts | 84 +++++++++++++++++++ .../src/graphql/resolvers/UserResolver.ts.old | 51 ----------- backend/src/index.ts | 8 +- 4 files changed, 92 insertions(+), 55 deletions(-) create mode 100644 backend/src/graphql/resolvers/UserResolver.ts delete mode 100644 backend/src/graphql/resolvers/UserResolver.ts.old diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 341c08f4f..e9c06d6a6 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -5,8 +5,10 @@ dotenv.config() const server = { PORT: process.env.PORT || 4000, + JWT_SECRET: process.env.JWT_SECRET || 'secret123', + JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN || '10m', GRAPHIQL: process.env.GRAPHIQL === 'true' || false, - // LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', + LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', // COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', } diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts new file mode 100644 index 000000000..fbabff7fd --- /dev/null +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -0,0 +1,84 @@ +import jwt from 'jsonwebtoken' +import axios from 'axios' +import { Resolver, Query, /* Mutation, */ Arg } from 'type-graphql' +import CONFIG from '../../config' +// import { User } from '../models/User' +// import { LoginUserInput } from '../inputs/LoginUserInput' +// import { loginAPI, LoginResult } from '../../apis/loginAPI' +// import { CreateBookInput } from '../inputs/CreateBookInput' +// import { UpdateBookInput } from '../inputs/UpdateBookInput' + +const apiPost = async (url: string, payload: any): Promise => { + try { + const result = await axios.post(url, payload) + if (result.status !== 200) { + throw new Error('HTTP Status Error ' + result.status) + } + if (result.data.state === 'warning') { + return { success: true, result: result.data.errors } + } + if (result.data.state !== 'success') { + throw new Error(result.data.msg) + } + return { success: true, result } + } catch (error) { + return { success: false, result: error } + } +} + +@Resolver() +export class UserResolver { + /* @Query(() => [User]) + users(): Promise { + return User.find() + } */ + + /* @Query(() => User) + user(@Arg('id') id: string): Promise { + return User.findOne({ where: { id } }) + } */ + + @Query(() => String) + async login(@Arg('email') email: string, @Arg('password') password: string): Promise { + email = email.trim().toLowerCase() + + const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) + + console.log(result) + // if there is no user, throw an authentication error + if (!result.success) { + throw new Error(result.result) + } + + // create and return the json web token + return jwt.sign({ result }, CONFIG.JWT_SECRET, { expiresIn: CONFIG.JWT_EXPIRES_IN }) + // return (await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', login)).result.data + // const loginResult: LoginResult = await loginAPI.login(data) + // return loginResult.user ? loginResult.user : new User() + } + + /* + @Mutation(() => User) + async createBook(@Arg('data') data: CreateBookInput) { + const book = User.create(data) + await book.save() + return book + } + + @Mutation(() => Book) + async updateBook(@Arg('id') id: string, @Arg('data') data: UpdateBookInput) { + const book = await Book.findOne({ where: { id } }) + if (!book) throw new Error('Book not found!') + Object.assign(book, data) + await book.save() + return book + } +*/ + /* @Mutation(() => Boolean) + async deleteUser(@Arg('id') id: string): Promise { + const user = await User.findOne({ where: { id } }) + if (!user) throw new Error('User not found!') + await user.remove() + return true + } */ +} diff --git a/backend/src/graphql/resolvers/UserResolver.ts.old b/backend/src/graphql/resolvers/UserResolver.ts.old deleted file mode 100644 index cfdea954e..000000000 --- a/backend/src/graphql/resolvers/UserResolver.ts.old +++ /dev/null @@ -1,51 +0,0 @@ -import { Resolver, Query, Mutation, Arg } from 'type-graphql' -import { User } from '../models/User' -import jwt from 'jsonwebtoken' -import { LoginUserInput } from '../inputs/LoginUserInput' -import { loginAPI, LoginResult } from '../../apis/loginAPI' -// import { CreateBookInput } from '../inputs/CreateBookInput' -// import { UpdateBookInput } from '../inputs/UpdateBookInput' - -@Resolver() -export class UserResolver { - @Query(() => [User]) - users(): Promise { - return User.find() - } - - @Query(() => User) - user(@Arg('id') id: string): Promise { - return User.findOne({ where: { id } }) - } - - @Mutation(() => User) - async login(@Arg('data') data: LoginUserInput): Promise { - const loginResult: LoginResult = await loginAPI.login(data) - return loginResult.user ? loginResult.user : new User() - } - - /* - @Mutation(() => User) - async createBook(@Arg('data') data: CreateBookInput) { - const book = User.create(data) - await book.save() - return book - } - - @Mutation(() => Book) - async updateBook(@Arg('id') id: string, @Arg('data') data: UpdateBookInput) { - const book = await Book.findOne({ where: { id } }) - if (!book) throw new Error('Book not found!') - Object.assign(book, data) - await book.save() - return book - } -*/ - @Mutation(() => Boolean) - async deleteUser(@Arg('id') id: string): Promise { - const user = await User.findOne({ where: { id } }) - if (!user) throw new Error('User not found!') - await user.remove() - return true - } -} diff --git a/backend/src/index.ts b/backend/src/index.ts index 6dca948a4..ca161ebf8 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -6,15 +6,17 @@ import { buildSchema } from 'type-graphql' import CONFIG from './config' // TODO move to extern -import { BookResolver } from './graphql/resolvers/BookResolver' -// import { UserResolver } from './graphql/resolvers/UserResolver' +// import { BookResolver } from './graphql/resolvers/BookResolver' +import { UserResolver } from './graphql/resolvers/UserResolver' // import { GroupResolver } from './graphql/resolvers/GroupResolver' // TODO implement // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; async function main() { // const connection = await createConnection() - const schema = await buildSchema({ resolvers: [BookResolver /*, GroupResolver, UserResolver */] }) + const schema = await buildSchema({ + resolvers: [/* BookResolver , GroupResolver, */ UserResolver], + }) const server = express() const validationRules: [] = [ /** From 81afd9d78ff1e01b7c66ad313460f3f0cf9dd726 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 29 Jun 2021 13:07:04 +0200 Subject: [PATCH 20/50] jwt thoughts and fixes --- backend/src/graphql/resolvers/UserResolver.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index fbabff7fd..e5a7725e4 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -51,7 +51,12 @@ export class UserResolver { } // create and return the json web token - return jwt.sign({ result }, CONFIG.JWT_SECRET, { expiresIn: CONFIG.JWT_EXPIRES_IN }) + // The expire doesn't help us here. The client needs to track when the token expires on its own, + // since every action prolongs the time the session is valid. + return jwt.sign( + { result, role: 'todo' }, + CONFIG.JWT_SECRET /* , { expiresIn: CONFIG.JWT_EXPIRES_IN } */, + ) // return (await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', login)).result.data // const loginResult: LoginResult = await loginAPI.login(data) // return loginResult.user ? loginResult.user : new User() From e1596ad78b7d2587253fda4c1a44636958903c40 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 2 Jul 2021 10:49:08 +0200 Subject: [PATCH 21/50] switched to apollo --- backend/package.json | 2 +- backend/src/config/index.ts | 3 + backend/src/graphql/resolvers/UserResolver.ts | 2 +- backend/src/index.ts | 70 +- backend/yarn.lock | 632 ++++++++++++++++-- 5 files changed, 608 insertions(+), 101 deletions(-) diff --git a/backend/package.json b/backend/package.json index 2ffef3b58..822a2e019 100644 --- a/backend/package.json +++ b/backend/package.json @@ -15,9 +15,9 @@ "lint": "eslint . --ext .js,.ts" }, "dependencies": { + "apollo-server-express": "^2.25.2", "axios": "^0.21.1", "express": "^4.17.1", - "express-graphql": "^0.12.0", "graphql": "^15.5.1", "jsonwebtoken": "^8.5.1", "reflect-metadata": "^0.1.13", diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index e9c06d6a6..14e824d19 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -12,6 +12,9 @@ const server = { // COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', } +// This is needed by graphql-directive-auth +process.env.APP_SECRET = server.JWT_SECRET + const CONFIG = { ...server } export default CONFIG diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index e5a7725e4..be03354ca 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -11,6 +11,7 @@ import CONFIG from '../../config' const apiPost = async (url: string, payload: any): Promise => { try { const result = await axios.post(url, payload) + console.log(result) if (result.status !== 200) { throw new Error('HTTP Status Error ' + result.status) } @@ -44,7 +45,6 @@ export class UserResolver { const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) - console.log(result) // if there is no user, throw an authentication error if (!result.success) { throw new Error(result.result) diff --git a/backend/src/index.ts b/backend/src/index.ts index ca161ebf8..0d4bfd3db 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -1,7 +1,7 @@ import 'reflect-metadata' import express from 'express' -import { graphqlHTTP } from 'express-graphql' import { buildSchema } from 'type-graphql' +import { ApolloServer } from 'apollo-server-express' // import { createConnection } from 'typeorm' import CONFIG from './config' @@ -17,66 +17,28 @@ async function main() { const schema = await buildSchema({ resolvers: [/* BookResolver , GroupResolver, */ UserResolver], }) - const server = express() - const validationRules: [] = [ - /** - * This provides GraphQL query analysis to reject complex queries to your GraphQL server. - * This can be used to protect your GraphQL servers - * against resource exhaustion and DoS attacks. - * More documentation can be found (here)[https://github.com/ivome/graphql-query-complexity] - */ - /* queryComplexity({ - // The maximum allowed query complexity, queries above this threshold will be rejected - maximumComplexity: 20, - // The query variables. This is needed because the variables are not available - // in the visitor of the graphql-js library - variables: params!.variables!, - // Optional callback function to retrieve the determined query complexity - // Will be invoked weather the query is rejected or not - // This can be used for logging or to implement rate limiting - onComplete: (complexity: number) => { - console.log("Query Complexity:", complexity); - }, - // Add any number of estimators. The estimators are invoked in order, the first - // numeric value that is being returned by an estimator is used as the field complexity. - // If no estimator returns a value, an exception is raised. - estimators: [ - fieldConfigEstimator(), - // Add more estimators here... - // This will assign each field a complexity of 1 if no other estimator - // returned a value. - simpleEstimator({ - defaultComplexity: 1, - }), - ], - }), */ - ] - - // TODO Versioning? - server.use( - '/api', - graphqlHTTP({ - schema, - graphiql: false, - validationRules, - }), - ) // Graphiql interface + let playground = false if (CONFIG.GRAPHIQL) { - server.use( - '/graphiql', - graphqlHTTP({ - schema, - graphiql: true, - validationRules, - }), - ) + playground = true } + // Express Server + const server = express() + + // Apollo Server + const apollo = new ApolloServer({ schema, playground }) + apollo.applyMiddleware({ app: server }) + + // Start Server server.listen(CONFIG.PORT, () => { // eslint-disable-next-line no-console - console.log(`Server is running, GraphIQL available at http://localhost:${CONFIG.PORT}/graphiql`) + console.log(`Server is running at http://localhost:${CONFIG.PORT}`) + if (CONFIG.GRAPHIQL) { + // eslint-disable-next-line no-console + console.log(`GraphIQL available at http://localhost:${CONFIG.PORT}/graphql`) + } }) } diff --git a/backend/yarn.lock b/backend/yarn.lock index f5ec125e6..9a2dce567 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -2,6 +2,50 @@ # yarn lockfile v1 +"@apollo/protobufjs@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@apollo/protobufjs/-/protobufjs-1.2.2.tgz#4bd92cd7701ccaef6d517cdb75af2755f049f87c" + integrity sha512-vF+zxhPiLtkwxONs6YanSt1EpwpGilThpneExUN5K3tCymuxNnVq2yojTvnpRjv2QfsEIt/n7ozPIIzBLwGIDQ== + dependencies: + "@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" + +"@apollographql/apollo-tools@^0.5.0": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@apollographql/apollo-tools/-/apollo-tools-0.5.1.tgz#f0baef739ff7e2fafcb8b98ad29f6ac817e53e32" + integrity sha512-ZII+/xUFfb9ezDU2gad114+zScxVFMVlZ91f8fGApMzlS1kkqoyLnC4AJaQ1Ya/X+b63I20B4Gd+eCL8QuB4sA== + +"@apollographql/graphql-playground-html@1.6.27": + version "1.6.27" + resolved "https://registry.yarnpkg.com/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.27.tgz#bc9ab60e9445aa2a8813b4e94f152fa72b756335" + integrity sha512-tea2LweZvn6y6xFV11K0KC8ETjmm52mQrW+ezgB2O/aTQf8JGyFmMcRPFgUaQZeHbWdm8iisDC6EjOKsXu0nfw== + dependencies: + xss "^1.0.8" + +"@apollographql/graphql-upload-8-fork@^8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@apollographql/graphql-upload-8-fork/-/graphql-upload-8-fork-8.1.3.tgz#a0d4e0d5cec8e126d78bd915c264d6b90f5784bc" + integrity sha512-ssOPUT7euLqDXcdVv3Qs4LoL4BPtfermW1IOouaqEmj36TpHYDmYDIbKoSQxikd9vtMumFnP87OybH7sC9fJ6g== + dependencies: + "@types/express" "*" + "@types/fs-capacitor" "*" + "@types/koa" "*" + busboy "^0.3.1" + fs-capacitor "^2.0.4" + http-errors "^1.7.3" + object-path "^0.11.4" + "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -38,6 +82,11 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@josephg/resolvable@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@josephg/resolvable/-/resolvable-1.0.1.tgz#69bc4db754d79e1a2f17a650d3466e038d94a5eb" + integrity sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -59,6 +108,59 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -96,7 +198,14 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.1.tgz#a6ca6a9a0ff366af433f42f5f0e124794ff6b8f1" integrity sha512-FTgBI767POY/lKNDNbIzgAX6miIDBs6NTCbdlDb8TrWovHsSvaVIZDlTqym29C6UqhzwcJx4CYr+AlrMywA0cA== -"@types/body-parser@*": +"@types/accepts@*", "@types/accepts@^1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.5.tgz#c34bec115cfc746e04fe5a059df4ce7e7b391575" + integrity sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ== + dependencies: + "@types/node" "*" + +"@types/body-parser@*", "@types/body-parser@1.19.0": version "1.19.0" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.0.tgz#0685b3c47eb3006ffed117cdd55164b61f80538f" integrity sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ== @@ -111,6 +220,26 @@ dependencies: "@types/node" "*" +"@types/content-disposition@*": + version "0.5.3" + resolved "https://registry.yarnpkg.com/@types/content-disposition/-/content-disposition-0.5.3.tgz#0aa116701955c2faa0717fc69cd1596095e49d96" + integrity sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg== + +"@types/cookies@*": + version "0.7.6" + resolved "https://registry.yarnpkg.com/@types/cookies/-/cookies-0.7.6.tgz#71212c5391a976d3bae57d4b09fac20fc6bda504" + integrity sha512-FK4U5Qyn7/Sc5ih233OuHO0qAkOpEcD/eG6584yEiLKizTFRny86qHLe/rej3HFQrkBuUjF4whFliAdODbVN/w== + dependencies: + "@types/connect" "*" + "@types/express" "*" + "@types/keygrip" "*" + "@types/node" "*" + +"@types/cors@2.8.10": + version "2.8.10" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.10.tgz#61cc8469849e5bcdd0c7044122265c39cec10cf4" + integrity sha512-C7srjHiVG3Ey1nR6d511dtDkCEjxuN9W1HWAEjGq8kpcwmNM6JJkpC0xvabM7BXTG2wDq8Eu33iH9aQKa7IvLQ== + "@types/express-serve-static-core@^4.17.18": version "4.17.21" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.21.tgz#a427278e106bca77b83ad85221eae709a3414d42" @@ -120,7 +249,16 @@ "@types/qs" "*" "@types/range-parser" "*" -"@types/express@^4.17.12": +"@types/express-serve-static-core@^4.17.21": + version "4.17.22" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.22.tgz#e011c55de3f17ddf1161f790042a15c5a218744d" + integrity sha512-WdqmrUsRS4ootGha6tVwk/IVHM1iorU8tGehftQD2NWiPniw/sm7xdJOIlXLwqdInL9wBw/p7oO8vaYEF3NDmA== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@*", "@types/express@^4.17.12": version "4.17.12" resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.12.tgz#4bc1bf3cd0cfe6d3f6f2853648b40db7d54de350" integrity sha512-pTYas6FrP15B1Oa0bkN5tQMNqOcVXa9j4FTFtO8DWI9kppKib+6NJtfTOOLcwxuuYvcX2+dVG6et1SxW/Kc17Q== @@ -130,6 +268,13 @@ "@types/qs" "*" "@types/serve-static" "*" +"@types/fs-capacitor@*": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/fs-capacitor/-/fs-capacitor-2.0.0.tgz#17113e25817f584f58100fb7a08eed288b81956e" + integrity sha512-FKVPOCFbhCvZxpVAMhdBdTfVfXUpsh15wFHgqOKxh9N9vzWZVuWCSijZ5T4U34XYNnuj2oduh6xcs1i+LPI+BQ== + dependencies: + "@types/node" "*" + "@types/glob@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" @@ -138,6 +283,16 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/http-assert@*": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@types/http-assert/-/http-assert-1.5.1.tgz#d775e93630c2469c2f980fc27e3143240335db3b" + integrity sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ== + +"@types/http-errors@*": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.8.0.tgz#682477dbbbd07cd032731cb3b0e7eaee3d026b69" + integrity sha512-2aoSC4UUbHDj2uCsCxcG/vRMXey/m17bC7UwitVm5hn22nI8O8Y9iDpA76Orc+DWkQ4zZrOKEshCqR/jSuXAHA== + "@types/json-schema@^7.0.7": version "7.0.7" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" @@ -155,6 +310,37 @@ dependencies: "@types/node" "*" +"@types/keygrip@*": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/keygrip/-/keygrip-1.0.2.tgz#513abfd256d7ad0bf1ee1873606317b33b1b2a72" + integrity sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw== + +"@types/koa-compose@*": + version "3.2.5" + resolved "https://registry.yarnpkg.com/@types/koa-compose/-/koa-compose-3.2.5.tgz#85eb2e80ac50be95f37ccf8c407c09bbe3468e9d" + integrity sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ== + dependencies: + "@types/koa" "*" + +"@types/koa@*": + version "2.13.3" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.3.tgz#5b44c0956d7f7bf41f74ccfb530fec60fbed45ca" + integrity sha512-TaujBV+Dhe/FvmSMZJtCFBms+bqQacgUebk/M2C2tq8iGmHE/DDf4DcW2Hc7NqusVZmy5xzrWOjtdPKNP+fTfw== + dependencies: + "@types/accepts" "*" + "@types/content-disposition" "*" + "@types/cookies" "*" + "@types/http-assert" "*" + "@types/http-errors" "*" + "@types/keygrip" "*" + "@types/koa-compose" "*" + "@types/node" "*" + +"@types/long@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" + integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== + "@types/mime@^1": version "1.3.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -170,6 +356,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.4.tgz#e1cf817d70a1e118e81922c4ff6683ce9d422e26" integrity sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA== +"@types/node@^10.1.0": + version "10.17.60" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" + integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== + "@types/node@^14.11.2": version "14.17.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.4.tgz#218712242446fc868d0e007af29a4408c7765bc0" @@ -198,6 +389,13 @@ "@types/mime" "^1" "@types/node" "*" +"@types/ws@^7.0.0": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.5.tgz#8ff0f7efcd8fea19f51f9dd66cb8b498d172a752" + integrity sha512-8mbDgtc8xpxDDem5Gwj76stBDJX35KQ3YBoayxlqUQcL5BZUthiqP/VQ4PQnLHqM4PmlbyO74t98eJpURO+gPA== + dependencies: + "@types/node" "*" + "@types/zen-observable@^0.8.2": version "0.8.2" resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" @@ -272,12 +470,19 @@ "@typescript-eslint/types" "4.28.0" eslint-visitor-keys "^2.0.0" +"@wry/equality@^0.1.2": + version "0.1.11" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.11.tgz#35cb156e4a96695aa81a9ecc4d03787bc17f1790" + integrity sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA== + dependencies: + tslib "^1.9.3" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -accepts@^1.3.7, accepts@~1.3.7: +accepts@^1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== @@ -374,6 +579,156 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +apollo-cache-control@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/apollo-cache-control/-/apollo-cache-control-0.14.0.tgz#95f20c3e03e7994e0d1bd48c59aeaeb575ed0ce7" + integrity sha512-qN4BCq90egQrgNnTRMUHikLZZAprf3gbm8rC5Vwmc6ZdLolQ7bFsa769Hqi6Tq/lS31KLsXBLTOsRbfPHph12w== + dependencies: + apollo-server-env "^3.1.0" + apollo-server-plugin-base "^0.13.0" + +apollo-datasource@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/apollo-datasource/-/apollo-datasource-0.9.0.tgz#b0b2913257a6103a5f4c03cb56d78a30e9d850db" + integrity sha512-y8H99NExU1Sk4TvcaUxTdzfq2SZo6uSj5dyh75XSQvbpH6gdAXIW9MaBcvlNC7n0cVPsidHmOcHOWxJ/pTXGjA== + dependencies: + apollo-server-caching "^0.7.0" + apollo-server-env "^3.1.0" + +apollo-graphql@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/apollo-graphql/-/apollo-graphql-0.9.3.tgz#1ca6f625322ae10a66f57a39642849a07a7a5dc9" + integrity sha512-rcAl2E841Iko4kSzj4Pt3PRBitmyq1MvoEmpl04TQSpGnoVgl1E/ZXuLBYxMTSnEAm7umn2IsoY+c6Ll9U/10A== + dependencies: + core-js-pure "^3.10.2" + lodash.sortby "^4.7.0" + sha.js "^2.4.11" + +apollo-link@^1.2.14: + version "1.2.14" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.14.tgz#3feda4b47f9ebba7f4160bef8b977ba725b684d9" + integrity sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg== + dependencies: + apollo-utilities "^1.3.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + zen-observable-ts "^0.8.21" + +apollo-reporting-protobuf@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/apollo-reporting-protobuf/-/apollo-reporting-protobuf-0.8.0.tgz#ae9d967934d3d8ed816fc85a0d8068ef45c371b9" + integrity sha512-B3XmnkH6Y458iV6OsA7AhfwvTgeZnFq9nPVjbxmLKnvfkEl8hYADtz724uPa0WeBiD7DSFcnLtqg9yGmCkBohg== + dependencies: + "@apollo/protobufjs" "1.2.2" + +apollo-server-caching@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/apollo-server-caching/-/apollo-server-caching-0.7.0.tgz#e6d1e68e3bb571cba63a61f60b434fb771c6ff39" + integrity sha512-MsVCuf/2FxuTFVhGLK13B+TZH9tBd2qkyoXKKILIiGcZ5CDUEBO14vIV63aNkMkS1xxvK2U4wBcuuNj/VH2Mkw== + dependencies: + lru-cache "^6.0.0" + +apollo-server-core@^2.25.2: + version "2.25.2" + resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.25.2.tgz#ff65da5e512d9b5ca54c8e5e8c78ee28b5987247" + integrity sha512-lrohEjde2TmmDTO7FlOs8x5QQbAS0Sd3/t0TaK2TWaodfzi92QAvIsq321Mol6p6oEqmjm8POIDHW1EuJd7XMA== + dependencies: + "@apollographql/apollo-tools" "^0.5.0" + "@apollographql/graphql-playground-html" "1.6.27" + "@apollographql/graphql-upload-8-fork" "^8.1.3" + "@josephg/resolvable" "^1.0.0" + "@types/ws" "^7.0.0" + apollo-cache-control "^0.14.0" + apollo-datasource "^0.9.0" + apollo-graphql "^0.9.0" + apollo-reporting-protobuf "^0.8.0" + apollo-server-caching "^0.7.0" + apollo-server-env "^3.1.0" + apollo-server-errors "^2.5.0" + apollo-server-plugin-base "^0.13.0" + apollo-server-types "^0.9.0" + apollo-tracing "^0.15.0" + async-retry "^1.2.1" + fast-json-stable-stringify "^2.0.0" + graphql-extensions "^0.15.0" + graphql-tag "^2.11.0" + graphql-tools "^4.0.8" + loglevel "^1.6.7" + lru-cache "^6.0.0" + sha.js "^2.4.11" + subscriptions-transport-ws "^0.9.19" + uuid "^8.0.0" + +apollo-server-env@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/apollo-server-env/-/apollo-server-env-3.1.0.tgz#0733c2ef50aea596cc90cf40a53f6ea2ad402cd0" + integrity sha512-iGdZgEOAuVop3vb0F2J3+kaBVi4caMoxefHosxmgzAbbSpvWehB8Y1QiSyyMeouYC38XNVk5wnZl+jdGSsWsIQ== + dependencies: + node-fetch "^2.6.1" + util.promisify "^1.0.0" + +apollo-server-errors@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.5.0.tgz#5d1024117c7496a2979e3e34908b5685fe112b68" + integrity sha512-lO5oTjgiC3vlVg2RKr3RiXIIQ5pGXBFxYGGUkKDhTud3jMIhs+gel8L8zsEjKaKxkjHhCQAA/bcEfYiKkGQIvA== + +apollo-server-express@^2.25.2: + version "2.25.2" + resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.25.2.tgz#58cd819694ff4c2dec6945a95c5dff6aa2719ef6" + integrity sha512-A2gF2e85vvDugPlajbhr0A14cDFDIGX0mteNOJ8P3Z3cIM0D4hwrWxJidI+SzobefDIyIHu1dynFedJVhV0euQ== + dependencies: + "@apollographql/graphql-playground-html" "1.6.27" + "@types/accepts" "^1.3.5" + "@types/body-parser" "1.19.0" + "@types/cors" "2.8.10" + "@types/express" "^4.17.12" + "@types/express-serve-static-core" "^4.17.21" + accepts "^1.3.5" + apollo-server-core "^2.25.2" + apollo-server-types "^0.9.0" + body-parser "^1.18.3" + cors "^2.8.5" + express "^4.17.1" + graphql-subscriptions "^1.0.0" + graphql-tools "^4.0.8" + parseurl "^1.3.2" + subscriptions-transport-ws "^0.9.19" + type-is "^1.6.16" + +apollo-server-plugin-base@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.13.0.tgz#3f85751a420d3c4625355b6cb3fbdd2acbe71f13" + integrity sha512-L3TMmq2YE6BU6I4Tmgygmd0W55L+6XfD9137k+cWEBFu50vRY4Re+d+fL5WuPkk5xSPKd/PIaqzidu5V/zz8Kg== + dependencies: + apollo-server-types "^0.9.0" + +apollo-server-types@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/apollo-server-types/-/apollo-server-types-0.9.0.tgz#ccf550b33b07c48c72f104fbe2876232b404848b" + integrity sha512-qk9tg4Imwpk732JJHBkhW0jzfG0nFsLqK2DY6UhvJf7jLnRePYsPxWfPiNkxni27pLE2tiNlCwoDFSeWqpZyBg== + dependencies: + apollo-reporting-protobuf "^0.8.0" + apollo-server-caching "^0.7.0" + apollo-server-env "^3.1.0" + +apollo-tracing@^0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/apollo-tracing/-/apollo-tracing-0.15.0.tgz#237fbbbf669aee4370b7e9081b685eabaa8ce84a" + integrity sha512-UP0fztFvaZPHDhIB/J+qGuy6hWO4If069MGC98qVs0I8FICIGu4/8ykpX3X3K6RtaQ56EDAWKykCxFv4ScxMeA== + dependencies: + apollo-server-env "^3.1.0" + apollo-server-plugin-base "^0.13.0" + +apollo-utilities@^1.0.1, apollo-utilities@^1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.4.tgz#6129e438e8be201b6c55b0f13ce49d2c7175c9cf" + integrity sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig== + dependencies: + "@wry/equality" "^0.1.2" + fast-json-stable-stringify "^2.0.0" + ts-invariant "^0.4.0" + tslib "^1.10.0" + app-root-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.0.0.tgz#210b6f43873227e18a4b810a032283311555d5ad" @@ -431,6 +786,13 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async-retry@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.1.tgz#139f31f8ddce50c0870b0ba558a6079684aaed55" + integrity sha512-aiieFW/7h3hY0Bq5d+ktDBejxuwR78vRu9hDUdR8rNhSaQ29VzPL4AoIRG7D/c7tdenwOcKvgPM6tIxB3cB6HA== + dependencies: + retry "0.12.0" + axios@^0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" @@ -438,6 +800,11 @@ axios@^0.21.1: dependencies: follow-redirects "^1.10.0" +backo2@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -453,7 +820,7 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -body-parser@1.19.0: +body-parser@1.19.0, body-parser@^1.18.3: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== @@ -516,6 +883,13 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" +busboy@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.3.1.tgz#170899274c5bf38aae27d5c62b71268cd585fd1b" + integrity sha512-y7tTxhGKXcyBxRKAni+awqx8uqaJKrSFSNFSeRG5CsWNdmy2BIK+6VGWEW7TZnIO/533mtMEA4rOevQV815YJw== + dependencies: + dicer "0.3.0" + bytes@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" @@ -665,6 +1039,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +commander@^2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -689,7 +1068,7 @@ content-disposition@0.5.3: dependencies: safe-buffer "5.1.2" -content-type@^1.0.4, content-type@~1.0.4: +content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== @@ -704,6 +1083,19 @@ cookie@0.4.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== +core-js-pure@^3.10.2: + version "3.15.2" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.15.2.tgz#c8e0874822705f3385d3197af9348f7c9ae2e3ce" + integrity sha512-D42L7RYh1J2grW8ttxoY1+17Y4wXZeKe7uyplAI3FkNQyI5OgBIAjUfFiTPfL1rs0qLpxaabITNbjKl1Sp82tA== + +cors@^2.8.5: + version "2.8.5" + resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" + integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== + dependencies: + object-assign "^4" + vary "^1" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -723,6 +1115,11 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +cssfilter@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/cssfilter/-/cssfilter-0.0.10.tgz#c6d2672632a2e5c83e013e6864a42ce8defd20ae" + integrity sha1-xtJnJjKi5cg+AT5oZKQs6N79IK4= + debug@2.6.9, debug@^2.2.0, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -778,11 +1175,23 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= +deprecated-decorator@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz#00966317b7a12fe92f3cc831f7583af329b86c37" + integrity sha1-AJZjF7ehL+kvPMgx91g68ym4bDc= + destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +dicer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/dicer/-/dicer-0.3.0.tgz#eacd98b3bfbf92e8ab5c2fdb71aaac44bb06b872" + integrity sha512-MdceRRWqltEG2dZqO769g27N/3PXfcKl04VhYnBlo2YhH7zPi88VebsjTKclaOyiuMaGU72hTfw3VkUitGcVCA== + dependencies: + streamsearch "0.1.2" + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -1134,15 +1543,10 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= -express-graphql@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/express-graphql/-/express-graphql-0.12.0.tgz#58deabc309909ca2c9fe2f83f5fbe94429aa23df" - integrity sha512-DwYaJQy0amdy3pgNtiTDuGGM2BLdj+YO2SgbKoLliCfuHv3VVTt7vNG/ZqK2hRYjtYHE2t2KB705EU94mE64zg== - dependencies: - accepts "^1.3.7" - content-type "^1.0.4" - http-errors "1.8.0" - raw-body "^2.4.1" +eventemitter3@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== express@^4.17.1: version "4.17.1" @@ -1276,6 +1680,13 @@ follow-redirects@^1.10.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -1286,6 +1697,11 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= +fs-capacitor@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/fs-capacitor/-/fs-capacitor-2.0.4.tgz#5a22e72d40ae5078b4fe64fe4d08c0d3fc88ad3c" + integrity sha512-8S4f4WsCryNw2mJJchi46YgB6CR5Ze+4L1h8ewl9tEpL4SJ3ZO+c/bS4BWhB8bK+O3TMqhuZarTitd0S0eh2pA== + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1401,6 +1817,15 @@ graceful-fs@^4.1.2: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== +graphql-extensions@^0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.15.0.tgz#3f291f9274876b0c289fa4061909a12678bd9817" + integrity sha512-bVddVO8YFJPwuACn+3pgmrEg6I8iBuYLuwvxiE+lcQQ7POotVZxm2rgGw0PvVYmWWf3DT7nTVDZ5ROh/ALp8mA== + dependencies: + "@apollographql/apollo-tools" "^0.5.0" + apollo-server-env "^3.1.0" + apollo-server-types "^0.9.0" + graphql-query-complexity@^0.7.0: version "0.7.2" resolved "https://registry.yarnpkg.com/graphql-query-complexity/-/graphql-query-complexity-0.7.2.tgz#7fc6bb20930ab1b666ecf3bbfb24b65b6f08ecc4" @@ -1408,13 +1833,31 @@ graphql-query-complexity@^0.7.0: dependencies: lodash.get "^4.4.2" -graphql-subscriptions@^1.1.0: +graphql-subscriptions@^1.0.0, graphql-subscriptions@^1.1.0: version "1.2.1" resolved "https://registry.yarnpkg.com/graphql-subscriptions/-/graphql-subscriptions-1.2.1.tgz#2142b2d729661ddf967b7388f7cf1dd4cf2e061d" integrity sha512-95yD/tKi24q8xYa7Q9rhQN16AYj5wPbrb8tmHGM3WRc9EBmWrG/0kkMl+tQG8wcEuE9ibR4zyOM31p5Sdr2v4g== dependencies: iterall "^1.3.0" +graphql-tag@^2.11.0: + version "2.12.5" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.5.tgz#5cff974a67b417747d05c8d9f5f3cb4495d0db8f" + integrity sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ== + dependencies: + tslib "^2.1.0" + +graphql-tools@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.8.tgz#e7fb9f0d43408fb0878ba66b522ce871bafe9d30" + integrity sha512-MW+ioleBrwhRjalKjYaLQbr+920pHBgy9vM/n47sswtns8+96sRn5M/G+J1eu7IMeKWiN/9p6tmwCHU7552VJg== + dependencies: + apollo-link "^1.2.14" + apollo-utilities "^1.0.1" + deprecated-decorator "^0.1.6" + iterall "^1.1.3" + uuid "^3.1.0" + graphql@^15.5.1: version "15.5.1" resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" @@ -1485,18 +1928,7 @@ http-errors@1.7.2: statuses ">= 1.5.0 < 2" toidentifier "1.0.0" -http-errors@1.7.3, http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@1.8.0: +http-errors@^1.7.3: version "1.8.0" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== @@ -1507,6 +1939,17 @@ http-errors@1.8.0: statuses ">= 1.5.0 < 2" toidentifier "1.0.0" +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -1609,7 +2052,7 @@ is-boolean-object@^1.1.0: dependencies: call-bind "^1.0.2" -is-callable@^1.1.4, is-callable@^1.2.3: +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== @@ -1728,7 +2171,7 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -iterall@^1.3.0: +iterall@^1.1.3, iterall@^1.2.1, iterall@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== @@ -1908,11 +2351,26 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= +loglevel@^1.6.7: + version "1.7.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" + integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== + +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" @@ -2048,6 +2506,11 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + nodemon@^2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.7.tgz#6f030a0a0ebe3ea1ba2a38f71bf9bab4841ced32" @@ -2091,7 +2554,7 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== -object-assign@^4.0.1: +object-assign@^4, object-assign@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -2106,6 +2569,11 @@ object-keys@^1.0.12, object-keys@^1.1.1: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== +object-path@^0.11.4: + version "0.11.5" + resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.5.tgz#d4e3cf19601a5140a55a16ad712019a9c50b577a" + integrity sha512-jgSbThcoR/s+XumvGMTMf81QVBmah+/Q7K7YduKeKVWL7N111unR2d6pZZarSk6kY/caeNxUDyxOvMWyzoU2eg== + object.assign@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" @@ -2116,6 +2584,15 @@ object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" +object.getownpropertydescriptors@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" + integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + object.values@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" @@ -2222,7 +2699,7 @@ parse5@^6.0.1: resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -parseurl@~1.3.3: +parseurl@^1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== @@ -2373,16 +2850,6 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -raw-body@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" - integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== - dependencies: - bytes "3.1.0" - http-errors "1.7.3" - iconv-lite "0.4.24" - unpipe "1.0.0" - rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -2471,6 +2938,11 @@ responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" +retry@0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -2661,6 +3133,11 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= +streamsearch@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a" + integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo= + string-width@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -2731,6 +3208,17 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +subscriptions-transport-ws@^0.9.19: + version "0.9.19" + resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.19.tgz#10ca32f7e291d5ee8eb728b9c02e43c52606cdcf" + integrity sha512-dxdemxFFB0ppCLg10FTtRqH/31FNRL1y1BQv8209MK5I4CwALb7iihQg+7p65lFcIl8MHatINWBLOqpgU4Kyyw== + dependencies: + backo2 "^1.0.2" + eventemitter3 "^3.1.0" + iterall "^1.2.1" + symbol-observable "^1.0.4" + ws "^5.2.0 || ^6.0.0 || ^7.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -2750,6 +3238,11 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +symbol-observable@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== + table@^6.0.9: version "6.7.1" resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" @@ -2810,6 +3303,13 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" +ts-invariant@^0.4.0: + version "0.4.4" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86" + integrity sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA== + dependencies: + tslib "^1.9.3" + ts-node@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.0.0.tgz#05f10b9a716b0b624129ad44f0ea05dac84ba3be" @@ -2836,7 +3336,7 @@ tsconfig-paths@^3.9.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@^1.8.1: +tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== @@ -2884,7 +3384,7 @@ type-graphql@^1.1.1: semver "^7.3.2" tslib "^2.0.1" -type-is@~1.6.17, type-is@~1.6.18: +type-is@^1.6.16, type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -2989,11 +3489,32 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" +util.promisify@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" + integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + for-each "^0.3.3" + has-symbols "^1.0.1" + object.getownpropertydescriptors "^2.1.1" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= +uuid@^3.1.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^8.0.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" @@ -3007,7 +3528,7 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -vary@~1.1.2: +vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= @@ -3066,6 +3587,11 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +"ws@^5.2.0 || ^6.0.0 || ^7.0.0": + version "7.5.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.1.tgz#44fc000d87edb1d9c53e51fbc69a0ac1f6871d66" + integrity sha512-2c6faOUH/nhoQN6abwMloF7Iyl0ZS2E9HGtsiLrWn0zOOMWlhtDmdf/uihDt6jnuCxgtwGBNy6Onsoy2s2O2Ow== + xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" @@ -3084,6 +3610,14 @@ xmlbuilder@~11.0.0: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== +xss@^1.0.8: + version "1.0.9" + resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.9.tgz#3ffd565571ff60d2e40db7f3b80b4677bec770d2" + integrity sha512-2t7FahYnGJys6DpHLhajusId7R0Pm2yTmuL0GV9+mV0ZlaLSnb2toBmppATfg5sWIhZQGlsTLoecSzya+l4EAQ== + dependencies: + commander "^2.20.3" + cssfilter "0.0.10" + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -3126,6 +3660,14 @@ yn@3.1.1: resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== +zen-observable-ts@^0.8.21: + version "0.8.21" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d" + integrity sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg== + dependencies: + tslib "^1.9.3" + zen-observable "^0.8.0" + zen-observable-ts@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.0.0.tgz#30d1202b81d8ba4c489e3781e8ca09abf0075e70" @@ -3134,7 +3676,7 @@ zen-observable-ts@^1.0.0: "@types/zen-observable" "^0.8.2" zen-observable "^0.8.15" -zen-observable@^0.8.15: +zen-observable@^0.8.0, zen-observable@^0.8.15: version "0.8.15" resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== From b7cb158369e4c5a18b0e202b0d8883c2066422de Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Jul 2021 16:26:08 +0200 Subject: [PATCH 22/50] logs for debug --- backend/src/graphql/resolvers/UserResolver.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index be03354ca..f296dc176 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -10,8 +10,9 @@ import CONFIG from '../../config' const apiPost = async (url: string, payload: any): Promise => { try { + console.log(url, payload) const result = await axios.post(url, payload) - console.log(result) + console.log('-----', result) if (result.status !== 200) { throw new Error('HTTP Status Error ' + result.status) } @@ -23,6 +24,7 @@ const apiPost = async (url: string, payload: any): Promise => { } return { success: true, result } } catch (error) { + console.log(error) return { success: false, result: error } } } @@ -42,7 +44,7 @@ export class UserResolver { @Query(() => String) async login(@Arg('email') email: string, @Arg('password') password: string): Promise { email = email.trim().toLowerCase() - + console.log(email, password, CONFIG.LOGIN_API_URL) const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) // if there is no user, throw an authentication error From 8443888e964c70662e1d818df6e0a460a2cd226f Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Jul 2021 18:34:50 +0200 Subject: [PATCH 23/50] login resolver returns data that the frontend could use without major changes --- backend/.env.dist | 2 +- backend/src/graphql/models/User.ts | 85 +++++++++++++++++++ backend/src/graphql/resolvers/BookResolver.ts | 2 + backend/src/graphql/resolvers/UserResolver.ts | 35 +++++--- 4 files changed, 113 insertions(+), 11 deletions(-) create mode 100644 backend/src/graphql/models/User.ts diff --git a/backend/.env.dist b/backend/.env.dist index 21127b9ed..fe9d5e566 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -1,4 +1,4 @@ PORT=4000 GRAPHIQL=false -// LOGIN_API_URL=http://localhost/login_api/ +// LOGIN_API_URL=http://login-server:1201/ // COMMUNITY_API_URL=http://localhost/api/ \ No newline at end of file diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts new file mode 100644 index 000000000..d17a3dacd --- /dev/null +++ b/backend/src/graphql/models/User.ts @@ -0,0 +1,85 @@ +import { Entity, BaseEntity, Column } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class User extends BaseEntity { + /* + @Field(() => ID) + @PrimaryGeneratedColumn() + id: number + */ + + @Field(() => String) + @Column({ length: 191 }) + email: string + + @Field(() => String) + @Column({ length: 150 }) + firstName: string + + @Field(() => String) + @Column() + lastName: string + + @Field(() => String) + @Column() + username: string + + @Field(() => String) + @Column('text') + description: string + + /* + @Field(() => String) + @Column({ length: 64 }) + pubkey: string + + // not sure about the type here. Maybe better to have a string + @Field(() => number) + @Column({ type: 'datetime' }) + created: number + + @Field(() => Boolean) + @Column({ default: false }) + emailChecked: boolean + + @Field(() => Boolean) + @Column({ default: false }) + passphraseShown: boolean + */ + + @Field(() => String) + @Column({ default: 'de' }) + language: string + + /* + @Field(() => Boolean) + @Column({ default: false }) + disabled: boolean + */ + + /* I suggest to have a group as type here + @Field(() => ID) + @Column() + groupId: number + + // what is puvlisherId? + @Field(() => ID) + @Column({ default: 0 }) + publisherId: number + */ +} + +// temporaray solution until we have JWT implemented +@Entity() +@ObjectType() +export class LoginResponse extends BaseEntity { + @Field(() => Number) + @Column() + sessionId: number + + @Field(() => User) + @Column() + user: User +} diff --git a/backend/src/graphql/resolvers/BookResolver.ts b/backend/src/graphql/resolvers/BookResolver.ts index 9e5b6d1b3..df7e553bc 100644 --- a/backend/src/graphql/resolvers/BookResolver.ts +++ b/backend/src/graphql/resolvers/BookResolver.ts @@ -1,3 +1,4 @@ +/* import { Resolver, Query, Mutation, Arg } from 'type-graphql' import { Book } from '../models/Book' import { CreateBookInput } from '../inputs/CreateBookInput' @@ -39,3 +40,4 @@ export class BookResolver { return true } } +*/ diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index f296dc176..959c101e8 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,18 +1,18 @@ -import jwt from 'jsonwebtoken' +// import jwt from 'jsonwebtoken' import axios from 'axios' import { Resolver, Query, /* Mutation, */ Arg } from 'type-graphql' import CONFIG from '../../config' -// import { User } from '../models/User' +import { LoginResponse } from '../models/User' // import { LoginUserInput } from '../inputs/LoginUserInput' // import { loginAPI, LoginResult } from '../../apis/loginAPI' // import { CreateBookInput } from '../inputs/CreateBookInput' // import { UpdateBookInput } from '../inputs/UpdateBookInput' -const apiPost = async (url: string, payload: any): Promise => { +const apiPost = async (url: string, payload: unknown): Promise => { try { - console.log(url, payload) + // console.log(url, payload) const result = await axios.post(url, payload) - console.log('-----', result) + // console.log('-----', result) if (result.status !== 200) { throw new Error('HTTP Status Error ' + result.status) } @@ -24,7 +24,7 @@ const apiPost = async (url: string, payload: any): Promise => { } return { success: true, result } } catch (error) { - console.log(error) + // console.log(error) return { success: false, result: error } } } @@ -41,10 +41,9 @@ export class UserResolver { return User.findOne({ where: { id } }) } */ - @Query(() => String) - async login(@Arg('email') email: string, @Arg('password') password: string): Promise { + @Query(() => LoginResponse) + async login(@Arg('email') email: string, @Arg('password') password: string): Promise { email = email.trim().toLowerCase() - console.log(email, password, CONFIG.LOGIN_API_URL) const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) // if there is no user, throw an authentication error @@ -52,13 +51,29 @@ export class UserResolver { throw new Error(result.result) } + // temporary solution until we have JWT implemented + // console.log(result.result.data) + return { + sessionId: result.result.data.session_id, + user: { + email: result.result.data.user.email, + language: result.result.data.user.language, + username: result.result.data.user.username, + firstName: result.result.data.user.first_name, + lastName: result.result.data.user.last_name, + description: result.result.data.user.description, + }, + } + // create and return the json web token // The expire doesn't help us here. The client needs to track when the token expires on its own, // since every action prolongs the time the session is valid. + /* return jwt.sign( { result, role: 'todo' }, - CONFIG.JWT_SECRET /* , { expiresIn: CONFIG.JWT_EXPIRES_IN } */, + CONFIG.JWT_SECRET, // * , { expiresIn: CONFIG.JWT_EXPIRES_IN } , ) + */ // return (await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', login)).result.data // const loginResult: LoginResult = await loginAPI.login(data) // return loginResult.user ? loginResult.user : new User() From a2f932f040831beda7dfed5edc737bc103e70914 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Jul 2021 18:44:04 +0200 Subject: [PATCH 24/50] fix linting, I need to learn more TS --- backend/src/graphql/resolvers/UserResolver.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 959c101e8..9c9161a80 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -8,7 +8,8 @@ import { LoginResponse } from '../models/User' // import { CreateBookInput } from '../inputs/CreateBookInput' // import { UpdateBookInput } from '../inputs/UpdateBookInput' -const apiPost = async (url: string, payload: unknown): Promise => { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const apiPost = async (url: string, payload: unknown): Promise => { try { // console.log(url, payload) const result = await axios.post(url, payload) @@ -42,7 +43,8 @@ export class UserResolver { } */ @Query(() => LoginResponse) - async login(@Arg('email') email: string, @Arg('password') password: string): Promise { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async login(@Arg('email') email: string, @Arg('password') password: string): Promise { email = email.trim().toLowerCase() const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) From ae4edf46054a48bcdd8aeaafb16c68e546ed58ef Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Jul 2021 19:18:17 +0200 Subject: [PATCH 25/50] clean up, use inputs --- backend/package.json | 1 + backend/src/apis/loginAPI.ts | 20 ++++++ backend/src/graphql/inputs/CreateBookInput.ts | 10 --- ...oginUserInput.ts.old => LoginUserInput.ts} | 13 +++- backend/src/graphql/inputs/UpdateBookInput.ts | 13 ---- backend/src/graphql/models/Book.ts | 22 ------- backend/src/graphql/models/User.ts.old | 62 ------------------- backend/src/graphql/resolvers/BookResolver.ts | 43 ------------- backend/src/graphql/resolvers/UserResolver.ts | 42 ++----------- backend/yarn.lock | 24 +++++++ 10 files changed, 62 insertions(+), 188 deletions(-) create mode 100644 backend/src/apis/loginAPI.ts delete mode 100644 backend/src/graphql/inputs/CreateBookInput.ts rename backend/src/graphql/inputs/{LoginUserInput.ts.old => LoginUserInput.ts} (54%) delete mode 100644 backend/src/graphql/inputs/UpdateBookInput.ts delete mode 100644 backend/src/graphql/models/Book.ts delete mode 100644 backend/src/graphql/models/User.ts.old delete mode 100644 backend/src/graphql/resolvers/BookResolver.ts diff --git a/backend/package.json b/backend/package.json index 822a2e019..ac94d10f3 100644 --- a/backend/package.json +++ b/backend/package.json @@ -17,6 +17,7 @@ "dependencies": { "apollo-server-express": "^2.25.2", "axios": "^0.21.1", + "class-validator": "^0.13.1", "express": "^4.17.1", "graphql": "^15.5.1", "jsonwebtoken": "^8.5.1", diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts new file mode 100644 index 000000000..69f22cf92 --- /dev/null +++ b/backend/src/apis/loginAPI.ts @@ -0,0 +1,20 @@ +import axios from 'axios' + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export const apiPost = async (url: string, payload: unknown): Promise => { + try { + const result = await axios.post(url, payload) + if (result.status !== 200) { + throw new Error('HTTP Status Error ' + result.status) + } + if (result.data.state === 'warning') { + return { success: true, result: result.data.errors } + } + if (result.data.state !== 'success') { + throw new Error(result.data.msg) + } + return { success: true, result } + } catch (error) { + return { success: false, result: error } + } +} diff --git a/backend/src/graphql/inputs/CreateBookInput.ts b/backend/src/graphql/inputs/CreateBookInput.ts deleted file mode 100644 index ac4108afd..000000000 --- a/backend/src/graphql/inputs/CreateBookInput.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { InputType, Field } from 'type-graphql' - -@InputType() -export class CreateBookInput { - @Field() - title: string - - @Field() - author: string -} diff --git a/backend/src/graphql/inputs/LoginUserInput.ts.old b/backend/src/graphql/inputs/LoginUserInput.ts similarity index 54% rename from backend/src/graphql/inputs/LoginUserInput.ts.old rename to backend/src/graphql/inputs/LoginUserInput.ts index ee6fb1814..7edc3089e 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts.old +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -1,5 +1,6 @@ -import { InputType, Field } from 'type-graphql' +import { ArgsType, Field } from 'type-graphql' +/* @InputType() export class LoginUserInput { @Field({ nullable: true }) @@ -14,3 +15,13 @@ export class LoginUserInput { @Field() password: string } +*/ + +@ArgsType() +export class UnsecureLoginArgs { + @Field(() => String) + email: string + + @Field(() => String) + password: string +} diff --git a/backend/src/graphql/inputs/UpdateBookInput.ts b/backend/src/graphql/inputs/UpdateBookInput.ts deleted file mode 100644 index 3f5042ecf..000000000 --- a/backend/src/graphql/inputs/UpdateBookInput.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { InputType, Field } from 'type-graphql' - -@InputType() -export class UpdateBookInput { - @Field({ nullable: true }) - title?: string - - @Field({ nullable: true }) - author?: string - - @Field({ nullable: true }) - isPublished?: boolean -} diff --git a/backend/src/graphql/models/Book.ts b/backend/src/graphql/models/Book.ts deleted file mode 100644 index fb95979dd..000000000 --- a/backend/src/graphql/models/Book.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm' -import { ObjectType, Field, ID } from 'type-graphql' - -@Entity() -@ObjectType() -export class Book extends BaseEntity { - @Field(() => ID) - @PrimaryGeneratedColumn() - id: string - - @Field(() => String) - @Column() - title: string - - @Field(() => String) - @Column() - author: string - - @Field(() => Boolean) - @Column({ default: false }) - isPublished: boolean -} diff --git a/backend/src/graphql/models/User.ts.old b/backend/src/graphql/models/User.ts.old deleted file mode 100644 index 8f3ababf7..000000000 --- a/backend/src/graphql/models/User.ts.old +++ /dev/null @@ -1,62 +0,0 @@ -import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm' -import { ObjectType, Field, ID, GraphQLISODateTime } from 'type-graphql' - -@Entity() -@ObjectType() -export class User extends BaseEntity { - @Field(() => ID) - @PrimaryGeneratedColumn() - id: number - - @Field(() => String) - @Column({ length: 191 }) - email: string - - @Field(() => String) - @Column({ length: 150 }) - firstName: string - - @Field(() => String) - @Column() - lastName: string - - @Field(() => String) - @Column() - username: string - - @Field(() => String) - @Column('text') - description: string - - @Field(() => String) - @Column({ length: 64 }) - pubkey: string - - @Field(() => GraphQLISODateTime) - @Column({ type: 'datetime' }) - created: Date - - @Field(() => Boolean) - @Column({ default: false }) - emailChecked: boolean - - @Field(() => Boolean) - @Column({ default: false }) - passphraseShown: boolean - - @Field(() => String) - @Column({ default: 'de' }) - language: string - - @Field(() => Boolean) - @Column({ default: false }) - disabled: boolean - - @Field(() => ID) - @Column() - groupId: number - - @Field(() => ID) - @Column({ default: 0 }) - publisherId: number -} diff --git a/backend/src/graphql/resolvers/BookResolver.ts b/backend/src/graphql/resolvers/BookResolver.ts deleted file mode 100644 index df7e553bc..000000000 --- a/backend/src/graphql/resolvers/BookResolver.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* -import { Resolver, Query, Mutation, Arg } from 'type-graphql' -import { Book } from '../models/Book' -import { CreateBookInput } from '../inputs/CreateBookInput' -import { UpdateBookInput } from '../inputs/UpdateBookInput' - -@Resolver() -export class BookResolver { - @Query(() => [Book]) - books() { - return Book.find() - } - - @Query(() => Book) - book(@Arg('id') id: string) { - return Book.findOne({ where: { id } }) - } - - @Mutation(() => Book) - async createBook(@Arg('data') data: CreateBookInput) { - const book = Book.create(data) - await book.save() - return book - } - - @Mutation(() => Book) - async updateBook(@Arg('id') id: string, @Arg('data') data: UpdateBookInput) { - const book = await Book.findOne({ where: { id } }) - if (!book) throw new Error('Book not found!') - Object.assign(book, data) - await book.save() - return book - } - - @Mutation(() => Boolean) - async deleteBook(@Arg('id') id: string) { - const book = await Book.findOne({ where: { id } }) - if (!book) throw new Error('Book not found!') - await book.remove() - return true - } -} -*/ diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 9c9161a80..aa83894e4 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,35 +1,12 @@ // import jwt from 'jsonwebtoken' -import axios from 'axios' -import { Resolver, Query, /* Mutation, */ Arg } from 'type-graphql' +import { Resolver, Query, /* Mutation, */ Args } from 'type-graphql' import CONFIG from '../../config' import { LoginResponse } from '../models/User' -// import { LoginUserInput } from '../inputs/LoginUserInput' -// import { loginAPI, LoginResult } from '../../apis/loginAPI' +import { UnsecureLoginArgs } from '../inputs/LoginUserInput' +import { apiPost } from '../../apis/loginAPI' // import { CreateBookInput } from '../inputs/CreateBookInput' // import { UpdateBookInput } from '../inputs/UpdateBookInput' -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const apiPost = async (url: string, payload: unknown): Promise => { - try { - // console.log(url, payload) - const result = await axios.post(url, payload) - // console.log('-----', result) - if (result.status !== 200) { - throw new Error('HTTP Status Error ' + result.status) - } - if (result.data.state === 'warning') { - return { success: true, result: result.data.errors } - } - if (result.data.state !== 'success') { - throw new Error(result.data.msg) - } - return { success: true, result } - } catch (error) { - // console.log(error) - return { success: false, result: error } - } -} - @Resolver() export class UserResolver { /* @Query(() => [User]) @@ -44,7 +21,7 @@ export class UserResolver { @Query(() => LoginResponse) // eslint-disable-next-line @typescript-eslint/no-explicit-any - async login(@Arg('email') email: string, @Arg('password') password: string): Promise { + async login(@Args() { email, password }: UnsecureLoginArgs): Promise { email = email.trim().toLowerCase() const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) @@ -54,7 +31,6 @@ export class UserResolver { } // temporary solution until we have JWT implemented - // console.log(result.result.data) return { sessionId: result.result.data.session_id, user: { @@ -88,16 +64,8 @@ export class UserResolver { await book.save() return book } + */ - @Mutation(() => Book) - async updateBook(@Arg('id') id: string, @Arg('data') data: UpdateBookInput) { - const book = await Book.findOne({ where: { id } }) - if (!book) throw new Error('Book not found!') - Object.assign(book, data) - await book.save() - return book - } -*/ /* @Mutation(() => Boolean) async deleteUser(@Arg('id') id: string): Promise { const user = await User.findOne({ where: { id } }) diff --git a/backend/yarn.lock b/backend/yarn.lock index 9a2dce567..ff8d358dd 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -389,6 +389,11 @@ "@types/mime" "^1" "@types/node" "*" +"@types/validator@^13.1.3": + version "13.6.3" + resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.6.3.tgz#31ca2e997bf13a0fffca30a25747d5b9f7dbb7de" + integrity sha512-fWG42pMJOL4jKsDDZZREnXLjc3UE0R8LOJfARWYg6U966rxDT7TYejYzLnUF5cvSObGg34nd0+H2wHHU5Omdfw== + "@types/ws@^7.0.0": version "7.4.5" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.5.tgz#8ff0f7efcd8fea19f51f9dd66cb8b498d172a752" @@ -982,6 +987,15 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +class-validator@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.13.1.tgz#381b2001ee6b9e05afd133671fbdf760da7dec67" + integrity sha512-zWIeYFhUitvAHBwNhDdCRK09hWx+P0HUwFE8US8/CxFpMVzkUK8RJl7yOIE+BVu2lxyPNgeOaFv78tLE47jBIg== + dependencies: + "@types/validator" "^13.1.3" + libphonenumber-js "^1.9.7" + validator "^13.5.2" + cli-boxes@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" @@ -2283,6 +2297,11 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +libphonenumber-js@^1.9.7: + version "1.9.22" + resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.9.22.tgz#b6b460603dedbd58f2d71f15500f216d70850fad" + integrity sha512-nE0aF0wrNq09ewF36s9FVqRW73hmpw6cobVDlbexmsu1432LEfuN24BCudNuRx4t2rElSeK/N0JbedzRW/TC4A== + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -3528,6 +3547,11 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +validator@^13.5.2: + version "13.6.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.6.0.tgz#1e71899c14cdc7b2068463cb24c1cc16f6ec7059" + integrity sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg== + vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" From 2ab92d1a539235c4df7798a856e20eb6d53bc28b Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 14 Jul 2021 20:22:15 +0200 Subject: [PATCH 26/50] send email for password reset --- backend/src/graphql/resolvers/UserResolver.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index aa83894e4..85571c5ab 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,5 +1,5 @@ // import jwt from 'jsonwebtoken' -import { Resolver, Query, /* Mutation, */ Args } from 'type-graphql' +import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' import CONFIG from '../../config' import { LoginResponse } from '../models/User' import { UnsecureLoginArgs } from '../inputs/LoginUserInput' @@ -43,6 +43,16 @@ export class UserResolver { }, } + // forgot password request + /* + @Query(() => null) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async sendEmail(@Arg() email: String): Promise { + const result = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', { email }) + return + } + */ + // create and return the json web token // The expire doesn't help us here. The client needs to track when the token expires on its own, // since every action prolongs the time the session is valid. From c0ab9283fd36d83edcdfa80129f407d879a53480 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 16 Jul 2021 15:47:20 +0200 Subject: [PATCH 27/50] main to src/main.ts --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index ac94d10f3..7cc0631b2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -2,7 +2,7 @@ "name": "gradido-backend", "version": "0.0.1", "description": "Gradido unified backend providing an API-Service for Gradido Transactions", - "main": "index.js", + "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/backend", "author": "Ulf Gebhardt", "license": "MIT", From 9e155758553f5525dc3e33b0d44e8249ed0909a3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 21 Jul 2021 16:45:59 +0200 Subject: [PATCH 28/50] api calls for sendEmail and loginViaEmailVerificationCode --- backend/src/apis/loginAPI.ts | 16 ++++++ backend/src/graphql/models/User.ts | 12 ++++ backend/src/graphql/resolvers/UserResolver.ts | 57 ++++++++++--------- 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index 69f22cf92..b81316b3f 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -18,3 +18,19 @@ export const apiPost = async (url: string, payload: unknown): Promise => { return { success: false, result: error } } } + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export const apiGet = async (url: string): Promise => { + try { + const result = await axios.get(url) + if (result.status !== 200) { + throw new Error('HTTP Status Error ' + result.status) + } + if (!['success', 'warning'].includes(result.data.state)) { + throw new Error(result.data.msg) + } + return { success: true, result } + } catch (error) { + return { success: false, result: error } + } +} diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts index d17a3dacd..938d0a9f9 100644 --- a/backend/src/graphql/models/User.ts +++ b/backend/src/graphql/models/User.ts @@ -83,3 +83,15 @@ export class LoginResponse extends BaseEntity { @Column() user: User } + +@Entity() +@ObjectType() +export class LoginViaVerificationCode extends BaseEntity { + @Field(() => Number) + @Column() + sessionId: number + + @Field(() => String) + @Column() + email: string +} diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 85571c5ab..34ceae7c7 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,11 +1,9 @@ // import jwt from 'jsonwebtoken' import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' import CONFIG from '../../config' -import { LoginResponse } from '../models/User' +import { LoginResponse, LoginViaVerificationCode } from '../models/User' import { UnsecureLoginArgs } from '../inputs/LoginUserInput' -import { apiPost } from '../../apis/loginAPI' -// import { CreateBookInput } from '../inputs/CreateBookInput' -// import { UpdateBookInput } from '../inputs/UpdateBookInput' +import { apiPost, apiGet } from '../../apis/loginAPI' @Resolver() export class UserResolver { @@ -43,16 +41,6 @@ export class UserResolver { }, } - // forgot password request - /* - @Query(() => null) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - async sendEmail(@Arg() email: String): Promise { - const result = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', { email }) - return - } - */ - // create and return the json web token // The expire doesn't help us here. The client needs to track when the token expires on its own, // since every action prolongs the time the session is valid. @@ -67,20 +55,33 @@ export class UserResolver { // return loginResult.user ? loginResult.user : new User() } - /* - @Mutation(() => User) - async createBook(@Arg('data') data: CreateBookInput) { - const book = User.create(data) - await book.save() - return book + // forgot password request + @Query(() => String) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async sendEmail(@Arg('email') email: string): Promise { + const payload = { + email, + email_text: 7, + email_verification_code_type: 'resetPassword', + } + const result = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) + if (result.success) return result.result.data.state + return result.result } - */ - /* @Mutation(() => Boolean) - async deleteUser(@Arg('id') id: string): Promise { - const user = await User.findOne({ where: { id } }) - if (!user) throw new Error('User not found!') - await user.remove() - return true - } */ + @Query(() => LoginViaVerificationCode) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async loginViaEmailVerificationCode(@Arg('optin') optin: string): Promise { + // I cannot use number as type here. + // The value received is not the same as sent by the query + const result = await apiGet( + CONFIG.LOGIN_API_URL + 'loginViaEmailVerificationCode?emailVerificationCode=' + optin, + ) + if (result.success) + return { + sessionId: result.result.data.session_id, + email: result.result.data.user.email, + } + return result.result + } } From 318e52eac845836716b46103988b01c282f8bb00 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 23 Jul 2021 12:39:15 +0200 Subject: [PATCH 29/50] fix bug, fix lint, fix test --- .../views/Pages/AccountOverview/GddSend/TransactionForm.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.vue b/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.vue index 01fc8a97a..364f54ac7 100644 --- a/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.vue +++ b/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.vue @@ -104,6 +104,7 @@ rows="3" v-model="form.memo" class="pl-3" + style="font-size: large" > @@ -197,4 +198,9 @@ export default { span.errors { color: red; } +#input-1:focus, +#input-2:focus, +#input-3:focus { + font-weight: bold; +} From 7cfae4e6b1eec4a1d1711233d80dc83b7d61ef9e Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 26 Jul 2021 17:45:21 +0200 Subject: [PATCH 30/50] main-content max-width to 1000px --- frontend/src/views/Layout/DashboardLayout_gdd.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index bf0385400..cec65606a 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -23,7 +23,7 @@ > -
+
From 16a55995581ea4b064a259c17448462a36ef4abe Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 26 Jul 2021 17:48:59 +0200 Subject: [PATCH 31/50] fix lint --- frontend/src/views/Layout/DashboardLayout_gdd.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index cec65606a..1bde53e60 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -23,7 +23,7 @@ > -
+
From 9c2b6c5c9e03611693024245beda7b08e93c00a1 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Thu, 29 Jul 2021 07:27:08 +0200 Subject: [PATCH 32/50] Changed the apiGet and apiPost methods so that we use lambda and not plain old try catch & if else block. --- .gitmodules | 3 -- backend/src/apis/loginAPI.ts | 63 +++++++++++++++++------------- login_server/dependencies/protobuf | 1 - 3 files changed, 36 insertions(+), 31 deletions(-) delete mode 160000 login_server/dependencies/protobuf diff --git a/.gitmodules b/.gitmodules index 22790ccc7..70fda6a17 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,6 +31,3 @@ [submodule "login_server/src/proto"] path = login_server/src/proto url = https://github.com/gradido/gradido_protocol.git -[submodule "login_server/dependencies/protobuf"] - path = login_server/dependencies/protobuf - url = https://github.com/protocolbuffers/protobuf.git diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index b81316b3f..609b7bdc4 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -2,35 +2,44 @@ import axios from 'axios' // eslint-disable-next-line @typescript-eslint/no-explicit-any export const apiPost = async (url: string, payload: unknown): Promise => { - try { - const result = await axios.post(url, payload) - if (result.status !== 200) { - throw new Error('HTTP Status Error ' + result.status) - } - if (result.data.state === 'warning') { - return { success: true, result: result.data.errors } - } - if (result.data.state !== 'success') { - throw new Error(result.data.msg) - } - return { success: true, result } - } catch (error) { - return { success: false, result: error } - } + return axios + .post(url, payload) + .then((result) => { + if (result.status !== 200) { + throw new Error('HTTP Status Error ' + result.status) + } + if (result.data.state !== 'success') { + throw new Error(result.data.msg) + } + return { success: true, result } + }) + .catch((error) => { + return { success: false, result: error } + }) } // eslint-disable-next-line @typescript-eslint/no-explicit-any export const apiGet = async (url: string): Promise => { - try { - const result = await axios.get(url) - if (result.status !== 200) { - throw new Error('HTTP Status Error ' + result.status) - } - if (!['success', 'warning'].includes(result.data.state)) { - throw new Error(result.data.msg) - } - return { success: true, result } - } catch (error) { - return { success: false, result: error } - } + return axios + .get(url) + .then((result) => { + if (result.status !== 200) { + // eslint-disable-next-line no-console + console.log('IN status: ' + 'HTTP Status Error ' + result.status) + throw new Error('HTTP Status Error ' + result.status) + } + if (!['success', 'warning'].includes(result.data.state)) { + // eslint-disable-next-line no-console + console.log('IN state: ' + result.data.state + ' message: ' + result.data.msg) + throw new Error(result.data.msg) + } + // eslint-disable-next-line no-console + console.log('IN apiGet.THEN: ' + JSON.stringify({ success: true, result: result })) + return { success: true, result: result } + }) + .catch((error) => { + // eslint-disable-next-line no-console + console.log('IN apiGet.ERROR: ' + JSON.stringify({ success: false, result: error })) + return { success: false, result: error } + }) } diff --git a/login_server/dependencies/protobuf b/login_server/dependencies/protobuf deleted file mode 160000 index 0b8d13a1d..000000000 --- a/login_server/dependencies/protobuf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0b8d13a1d4cd9be16ed8a2230577aa9c296aa1ca From 5c423f6c72f98f0512553bc7b448427670fb6a20 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Thu, 29 Jul 2021 07:27:59 +0200 Subject: [PATCH 33/50] Changed the default config value so that the programm get the right config on localhost. --- backend/src/config/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 14e824d19..3cb239a1d 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -8,8 +8,8 @@ const server = { JWT_SECRET: process.env.JWT_SECRET || 'secret123', JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN || '10m', GRAPHIQL: process.env.GRAPHIQL === 'true' || false, - LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/login_api/', - // COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://localhost/api/', + LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/', // login_api/', + COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://ngninx/api/', } // This is needed by graphql-directive-auth From 68c0e7894d5b6631ba942204ff1ee494bcc68670 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Thu, 29 Jul 2021 07:28:44 +0200 Subject: [PATCH 34/50] Removed the Group Model and Resolver since it is not used. --- backend/src/graphql/models/Group.ts.old | 26 ------------------- .../graphql/resolvers/GroupResolver.ts.old | 23 ---------------- 2 files changed, 49 deletions(-) delete mode 100644 backend/src/graphql/models/Group.ts.old delete mode 100644 backend/src/graphql/resolvers/GroupResolver.ts.old diff --git a/backend/src/graphql/models/Group.ts.old b/backend/src/graphql/models/Group.ts.old deleted file mode 100644 index 45582225e..000000000 --- a/backend/src/graphql/models/Group.ts.old +++ /dev/null @@ -1,26 +0,0 @@ -import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm' -import { ObjectType, Field, ID } from 'type-graphql' - -@Entity() -@ObjectType() -export class Group extends BaseEntity { - @Field(() => ID) - @PrimaryGeneratedColumn() - id: number - - @Field(() => String) - @Column({ length: 190 }) - alias: string - - @Field(() => String) - @Column() - name: string - - @Field(() => String) - @Column('text') - description: string - - @Field(() => String) - @Column() - url: string -} diff --git a/backend/src/graphql/resolvers/GroupResolver.ts.old b/backend/src/graphql/resolvers/GroupResolver.ts.old deleted file mode 100644 index 8294c09ab..000000000 --- a/backend/src/graphql/resolvers/GroupResolver.ts.old +++ /dev/null @@ -1,23 +0,0 @@ -import { Resolver, Query, Mutation, Arg } from 'type-graphql' -import { Group } from '../models/Group' -import { loginAPI, NetworkInfosResult } from '../../apis/loginAPI' -@Resolver() -export class GroupResolver { - @Query(() => [Group]) - async groups(): Promise { - const result: NetworkInfosResult = await loginAPI.getNetworkInfos(['groups']) - const groups: Group[] = [] - - result.data.groups?.forEach((alias: string) => { - const group = new Group() - group.alias = alias - groups.push(group) - }) - return groups - } - - @Query(() => Group) - group(@Arg('id') id: string): Promise { - return Group.findOne({ where: { id } }) - } -} From 36c97b90895ae45fa397220de100cf8e92bacb0e Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Thu, 29 Jul 2021 07:30:00 +0200 Subject: [PATCH 35/50] Added the Resolver that takes care about the Transactions in a Community. --- .../src/graphql/inputs/TransactionInput.ts | 50 +++++++++++++++++ backend/src/graphql/models/Transaction.ts | 10 ++++ .../resolvers/CommunityTransactionResolver.ts | 55 +++++++++++++++++++ backend/src/index.ts | 3 +- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 backend/src/graphql/inputs/TransactionInput.ts create mode 100644 backend/src/graphql/models/Transaction.ts create mode 100644 backend/src/graphql/resolvers/CommunityTransactionResolver.ts diff --git a/backend/src/graphql/inputs/TransactionInput.ts b/backend/src/graphql/inputs/TransactionInput.ts new file mode 100644 index 000000000..279e09dd6 --- /dev/null +++ b/backend/src/graphql/inputs/TransactionInput.ts @@ -0,0 +1,50 @@ +import { ObjectType, ArgsType, Field, Int, Float } from 'type-graphql' +import { Entity, BaseEntity, Column, Double } from 'typeorm' + +@ArgsType() +export class TransactionInput { + @Field(() => Number) + sessionId: number + + @Field(() => Number) + firstPage: number + + @Field(() => Number) + items: number + + @Field(() => String) + order: string +} + +@ArgsType() +export class TransactionSendArgs { + @Field(() => Number) + sessionId: number + + @Field(() => String) + email: string + + @Field(() => Number) + amount: number + + @Field(() => String) + memo: string +} + +@ArgsType() +export class TransactionCreateArgs { + @Field(() => Number) + sessionId: number + + @Field(() => String) + email: string + + @Field(() => Number) + amount: number + + @Field(() => String) + memo: string + + @Field(() => Date) + targetDate: Date +} diff --git a/backend/src/graphql/models/Transaction.ts b/backend/src/graphql/models/Transaction.ts new file mode 100644 index 000000000..b638e797e --- /dev/null +++ b/backend/src/graphql/models/Transaction.ts @@ -0,0 +1,10 @@ +import { Entity, BaseEntity, Column } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class Transaction extends BaseEntity { + @Field(() => String) + @Column({ length: 191 }) + email: string +} diff --git a/backend/src/graphql/resolvers/CommunityTransactionResolver.ts b/backend/src/graphql/resolvers/CommunityTransactionResolver.ts new file mode 100644 index 000000000..1578f61e2 --- /dev/null +++ b/backend/src/graphql/resolvers/CommunityTransactionResolver.ts @@ -0,0 +1,55 @@ +import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' +import CONFIG from '../../config' +import {} from '../models/Transaction' +import { + TransactionCreateArgs, + TransactionInput, + TransactionSendArgs, +} from '../inputs/TransactionInput' +import { apiPost, apiGet } from '../../apis/loginAPI' + +@Resolver() +export class CommunityTransactionResolver { + @Query(() => String) + async balance(@Arg('sessionId') sessionId: number): Promise { + // eslint-disable-next-line no-console + console.log('IN BALANCE: URL: ' + CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) + return apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) + } + + @Query(() => String) + async transactions( + @Args() { sessionId, firstPage = 1, items = 5, order = 'DESC' }: TransactionInput, + ): Promise { + return apiGet( + `${CONFIG.COMMUNITY_API_URL}listTransactions/${firstPage}/${items}/${order}/${sessionId}`, + ) + } + + @Query(() => String) + async send(@Args() { sessionId, email, amount, memo }: TransactionSendArgs): Promise { + const payload = { + session_id: sessionId, + auto_sign: true, + email: email, + amount: amount, + memo: memo, + } + return apiPost(CONFIG.COMMUNITY_API_URL + 'sendCoins/', payload) + } + + @Query(() => String) + async create( + @Args() { sessionId, email, amount, memo, targetDate = new Date() }: TransactionCreateArgs, + ): Promise { + const payload = { + sessionId, + email, + amount, + targetDate, + memo, + auto_sign: true, + } + return apiPost(CONFIG.COMMUNITY_API_URL + 'createCoins/', payload) + } +} diff --git a/backend/src/index.ts b/backend/src/index.ts index 0d4bfd3db..b6e19f56d 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -8,6 +8,7 @@ import CONFIG from './config' // TODO move to extern // import { BookResolver } from './graphql/resolvers/BookResolver' import { UserResolver } from './graphql/resolvers/UserResolver' +import { CommunityTransactionResolver } from './graphql/resolvers/CommunityTransactionResolver' // import { GroupResolver } from './graphql/resolvers/GroupResolver' // TODO implement // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; @@ -15,7 +16,7 @@ import { UserResolver } from './graphql/resolvers/UserResolver' async function main() { // const connection = await createConnection() const schema = await buildSchema({ - resolvers: [/* BookResolver , GroupResolver, */ UserResolver], + resolvers: [/* BookResolver , GroupResolver, */ UserResolver, CommunityTransactionResolver], }) // Graphiql interface From b018ae894bee0365839df1246a280f5da0c4458a Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 29 Jul 2021 11:33:31 +0200 Subject: [PATCH 36/50] try with nginx, add Balance Model --- backend/.env.dist | 2 +- backend/src/config/index.ts | 2 +- backend/src/graphql/models/Balance.ts | 26 +++++++++++++++++++ .../resolvers/CommunityTransactionResolver.ts | 8 +++--- docker-compose.override.yml | 1 + 5 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 backend/src/graphql/models/Balance.ts diff --git a/backend/.env.dist b/backend/.env.dist index fe9d5e566..f5308a4fa 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -1,4 +1,4 @@ PORT=4000 GRAPHIQL=false // LOGIN_API_URL=http://login-server:1201/ -// COMMUNITY_API_URL=http://localhost/api/ \ No newline at end of file +// COMMUNITY_API_URL=http://nginx/api/ \ No newline at end of file diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 3cb239a1d..685ff698e 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -8,7 +8,7 @@ const server = { JWT_SECRET: process.env.JWT_SECRET || 'secret123', JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN || '10m', GRAPHIQL: process.env.GRAPHIQL === 'true' || false, - LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://localhost/', // login_api/', + LOGIN_API_URL: process.env.LOGIN_API_URL || 'http://login-server:1201/', COMMUNITY_API_URL: process.env.COMMUNITY_API_URL || 'http://ngninx/api/', } diff --git a/backend/src/graphql/models/Balance.ts b/backend/src/graphql/models/Balance.ts new file mode 100644 index 000000000..2ba34ec75 --- /dev/null +++ b/backend/src/graphql/models/Balance.ts @@ -0,0 +1,26 @@ +import { Entity, BaseEntity, Column } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class Balance extends BaseEntity { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(json: any) { + super() + this.balance = json.balance + this.decay = json.decay + this.decayDate = json.decay_date + } + + @Field(() => Number) + @Column() + balance: number + + @Field(() => Number) + @Column() + decay: number + + @Field(() => String) + @Column() + decayDate: string +} diff --git a/backend/src/graphql/resolvers/CommunityTransactionResolver.ts b/backend/src/graphql/resolvers/CommunityTransactionResolver.ts index 1578f61e2..7eb7a9921 100644 --- a/backend/src/graphql/resolvers/CommunityTransactionResolver.ts +++ b/backend/src/graphql/resolvers/CommunityTransactionResolver.ts @@ -1,6 +1,7 @@ import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' import CONFIG from '../../config' import {} from '../models/Transaction' +import { Balance } from '../models/Balance' import { TransactionCreateArgs, TransactionInput, @@ -10,11 +11,12 @@ import { apiPost, apiGet } from '../../apis/loginAPI' @Resolver() export class CommunityTransactionResolver { - @Query(() => String) - async balance(@Arg('sessionId') sessionId: number): Promise { + @Query(() => Balance) + async balance(@Arg('sessionId') sessionId: number): Promise { // eslint-disable-next-line no-console console.log('IN BALANCE: URL: ' + CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) - return apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) + const result = await apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) + return new Balance(result.result.data) } @Query(() => String) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 092cd9db1..8a0295d61 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -30,6 +30,7 @@ services: target: development networks: - external-net + - internal-net environment: - NODE_ENV="development" volumes: From 32eeda69b2fdc5849e9dc57f2b5593036757b116 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 29 Jul 2021 12:29:33 +0200 Subject: [PATCH 37/50] try with application/json --- backend/src/apis/loginAPI.ts | 5 +++-- community_server/src/Controller/AppRequestsController.php | 6 ++++++ community_server/src/Template/AppRequests/get_balance.ctp | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index 609b7bdc4..e99c9c729 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -23,6 +23,9 @@ export const apiGet = async (url: string): Promise => { return axios .get(url) .then((result) => { + // eslint-disable-next-line no-console + console.log('IN apiGet.THEN: ' + JSON.stringify({ success: true, result: result })) + if (result.status !== 200) { // eslint-disable-next-line no-console console.log('IN status: ' + 'HTTP Status Error ' + result.status) @@ -33,8 +36,6 @@ export const apiGet = async (url: string): Promise => { console.log('IN state: ' + result.data.state + ' message: ' + result.data.msg) throw new Error(result.data.msg) } - // eslint-disable-next-line no-console - console.log('IN apiGet.THEN: ' + JSON.stringify({ success: true, result: result })) return { success: true, result: result } }) .catch((error) => { diff --git a/community_server/src/Controller/AppRequestsController.php b/community_server/src/Controller/AppRequestsController.php index 271265257..12dd8aa6e 100644 --- a/community_server/src/Controller/AppRequestsController.php +++ b/community_server/src/Controller/AppRequestsController.php @@ -271,6 +271,8 @@ class AppRequestsController extends AppController public function getBalance($session_id = 0) { $this->viewBuilder()->setLayout('ajax'); + $this->response = $this->response->withType('application/json'); + $login_result = $this->requestLogin($session_id, false); if($login_result !== true) { $this->set('body', $login_result); @@ -301,12 +303,16 @@ class AppRequestsController extends AppController } $body['decay_date'] = $now; + $this->addAdminError("AppRequests", "getBalance", $body, $user['id']); $this->set('body', $body); } public function listTransactions($page = 1, $count = 25, $orderDirection = 'ASC', $session_id = 0) { + $this->viewBuilder()->setLayout('ajax'); + $this->response = $this->response->withType('application/json'); + $startTime = microtime(true); $login_result = $this->requestLogin($session_id, false); diff --git a/community_server/src/Template/AppRequests/get_balance.ctp b/community_server/src/Template/AppRequests/get_balance.ctp index 618ec4c2e..7dd4d6025 100644 --- a/community_server/src/Template/AppRequests/get_balance.ctp +++ b/community_server/src/Template/AppRequests/get_balance.ctp @@ -6,6 +6,10 @@ * and open the template in the editor. */ -$body['balance'] = $this->element('centToFloat', ['cent' => $body['balance'], 'precision' => 4]); -$body['decay'] = $this->element('centToFloat', ['cent' => $body['decay'], 'precision' => 4]); +if(isset($body['balance'])) { + $body['balance'] = $this->element('centToFloat', ['cent' => $body['balance'], 'precision' => 4]); +} +if(isset($body['decay'])) { + $body['decay'] = $this->element('centToFloat', ['cent' => $body['decay'], 'precision' => 4]); +} ?> \ No newline at end of file From bb5b70d5f66edfb87eec403db5607f91d89f2dad Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Thu, 29 Jul 2021 17:34:07 +0200 Subject: [PATCH 38/50] Implementation of the Arguments and the Response classes for the loginAPIs. Implementation of the used API calls in Apollo. --- backend/src/apis/loginAPI.ts | 5 +- backend/src/graphql/inputs/LoginUserInput.ts | 84 +++++++++++ backend/src/graphql/models/User.ts | 101 +++++++++++++ backend/src/graphql/resolvers/UserResolver.ts | 134 ++++++++++++++---- 4 files changed, 294 insertions(+), 30 deletions(-) diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index e99c9c729..d4f4e278e 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -23,9 +23,6 @@ export const apiGet = async (url: string): Promise => { return axios .get(url) .then((result) => { - // eslint-disable-next-line no-console - console.log('IN apiGet.THEN: ' + JSON.stringify({ success: true, result: result })) - if (result.status !== 200) { // eslint-disable-next-line no-console console.log('IN status: ' + 'HTTP Status Error ' + result.status) @@ -33,7 +30,7 @@ export const apiGet = async (url: string): Promise => { } if (!['success', 'warning'].includes(result.data.state)) { // eslint-disable-next-line no-console - console.log('IN state: ' + result.data.state + ' message: ' + result.data.msg) + console.log('IN state: ' + result.data.state + ' message: ' + JSON.stringify(result)) throw new Error(result.data.msg) } return { success: true, result: result } diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 7edc3089e..8ae0552de 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -25,3 +25,87 @@ export class UnsecureLoginArgs { @Field(() => String) password: string } + +@ArgsType() +export class CreateUserArgs { + @Field(() => String) + email: string + + @Field(() => String) + firstName: string + + @Field(() => String) + lastName: string + + @Field(() => String) + password: string +} + +@ArgsType() +export class SendEmailArgs { + @Field(() => String) + email: string + + @Field(() => Number) + emailText: number + + @Field(() => String) + emailVerificationCodeType: string +} + +@ArgsType() +export class GetUserInfoArgs { + @Field(() => Number) + sessionId: number + + @Field(() => String) + email: string +} + +@ArgsType() +export class ChangePasswordArgs { + @Field(() => Number) + sessionId: number + + @Field(() => String) + email: string + + @Field(() => String) + password: string +} + +@ArgsType() +export class UpdateUserInfosArgs { + @Field(() => Number) + sessionId!: number + + @Field(() => String) + email!: string + + @Field(() => String) + firstName?: string + + @Field(() => String) + lastName?: string + + @Field(() => String) + username?: string + + @Field(() => String) + language?: string + + @Field(() => String) + password?: string + + @Field(() => String) + passwordNew?: string +} + +@ArgsType() +export class CheckUsernameArgs { + @Field(() => String) + username: string + + @Field(() => Number) + groupId?: number +} \ No newline at end of file diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts index 938d0a9f9..394d6d3f4 100644 --- a/backend/src/graphql/models/User.ts +++ b/backend/src/graphql/models/User.ts @@ -95,3 +95,104 @@ export class LoginViaVerificationCode extends BaseEntity { @Column() email: string } + +@Entity() +@ObjectType() +export class LogoutResponse extends BaseEntity { + @Field(() => String) + state: string +} + +@Entity() +@ObjectType() +export class CreateResponse extends BaseEntity { + @Field(() => String) + state: string +} + +@Entity() +@ObjectType() +export class SendEmailResponse extends BaseEntity { + @Field(() => String) + state: string + + @Field(() => String) + msg?: string +} + +@Entity() +@ObjectType() +export class Server extends BaseEntity { + @Field(() => String) + loginServerPath: string +} + +@Entity() +@ObjectType() +export class ErrorData extends BaseEntity { + @Field(() => String) + messages: string +} + +@Entity() +@ObjectType() +export class GetUserInfoResponse extends BaseEntity { + /* "state": "success", + "userData": { + "EmailVerificationCode.Register": "2718271129122", + "pubkeyhex": "131c7f68dd94b2be4c913400ff7ff4cdc03ac2bda99c2d29edcacb3b065c67e6", + "first_name": "Max", + "last_name": "Musterman", + "disabled": 0, + "email_checked": 1 + }, + "server": { + "loginServer.path": "http://localhost/account" + }, + "errors": [] + */ + @Field(() => String) + state: string + + @Field(() => User) + userData: User + + @Field(() => Server) + server: Server + + @Field(() => [ErrorData]) + errors: [ErrorData] +} + +@Entity() +@ObjectType() +export class ChangePasswordResponse extends BaseEntity { + @Field(() => String) + state: string +} + +@Entity() +@ObjectType() +export class UpdateUserInfosResponse extends BaseEntity { + @Field(() => String) + state: string + + @Field(() => Number) + validValues: number + + @Field(() => [ErrorData]) + errors: [ErrorData] +} + +@Entity() +@ObjectType() +export class CheckUsernameResponse extends BaseEntity { + @Field(() => String) + state: string + + @Field(() => String) + msg?: string + + @Field(() => Number) + groupId?: number +} diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 34ceae7c7..31e983f99 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,22 +1,30 @@ // import jwt from 'jsonwebtoken' import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' import CONFIG from '../../config' -import { LoginResponse, LoginViaVerificationCode } from '../models/User' -import { UnsecureLoginArgs } from '../inputs/LoginUserInput' +import { + ChangePasswordResponse, + CheckUsernameResponse, + CreateResponse, + GetUserInfoResponse, + LoginResponse, + LoginViaVerificationCode, + LogoutResponse, + SendEmailResponse, + UpdateUserInfosResponse, +} from '../models/User' +import { + ChangePasswordArgs, + CheckUsernameArgs, + CreateUserArgs, + GetUserInfoArgs, + SendEmailArgs, + UnsecureLoginArgs, + UpdateUserInfosArgs, +} from '../inputs/LoginUserInput' import { apiPost, apiGet } from '../../apis/loginAPI' @Resolver() export class UserResolver { - /* @Query(() => [User]) - users(): Promise { - return User.find() - } */ - - /* @Query(() => User) - user(@Arg('id') id: string): Promise { - return User.findOne({ where: { id } }) - } */ - @Query(() => LoginResponse) // eslint-disable-next-line @typescript-eslint/no-explicit-any async login(@Args() { email, password }: UnsecureLoginArgs): Promise { @@ -55,20 +63,6 @@ export class UserResolver { // return loginResult.user ? loginResult.user : new User() } - // forgot password request - @Query(() => String) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - async sendEmail(@Arg('email') email: string): Promise { - const payload = { - email, - email_text: 7, - email_verification_code_type: 'resetPassword', - } - const result = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) - if (result.success) return result.result.data.state - return result.result - } - @Query(() => LoginViaVerificationCode) // eslint-disable-next-line @typescript-eslint/no-explicit-any async loginViaEmailVerificationCode(@Arg('optin') optin: string): Promise { @@ -84,4 +78,92 @@ export class UserResolver { } return result.result } + + @Query(() => LogoutResponse) + async logout(@Arg('sessionId') sessionId: number): Promise { + const payload = { session_id: sessionId } + const result = apiPost(CONFIG.LOGIN_API_URL + 'logout', payload); + return result + } + + @Query(() => CreateResponse) + async create(@Args() { email, firstName, lastName, password }: CreateUserArgs): Promise { + const payload = { + email, + first_name: firstName, + last_name: lastName, + password, + emailType: 2, + login_after_register: true, + } + return apiPost(CONFIG.LOGIN_API_URL + 'createUser', payload) + } + + @Query(() => SendEmailResponse) + async sendEmail( + @Args() + { email, emailText = 7, emailVerificationCodeType = 'resetPassword' }: SendEmailArgs, + ): Promise { + const payload = { + email, + email_text: emailText, + email_verification_code_type: emailVerificationCodeType, + } + return apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) + } + + @Query(() => GetUserInfoResponse) + async getUserInfos(@Args() { sessionId, email }: GetUserInfoArgs): Promise { + const payload = { + session_id: sessionId, + email: email, + ask: ['user.first_name', 'user.last_name'], + } + return apiPost(CONFIG.LOGIN_API_URL + 'getUserInfos', payload) + } + + @Query(() => ChangePasswordResponse) + async changePassword(@Args() { sessionId, email, password }: ChangePasswordArgs): Promise { + const payload = { + session_id: sessionId, + email, + password, + } + return apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload) + } + + @Query(() => UpdateUserInfosResponse) + async updateUserInfos( + @Args() + { + sessionId, + email, + firstName, + lastName, + username, + language, + password, + passwordNew, + }: UpdateUserInfosArgs, + ): Promise { + const payload = { + session_id: sessionId, + email, + update: { + 'User.first_name': firstName, + 'User.last_name': lastName, + // 'User.description': data.description, + 'User.username': username, + 'User.language': language, + 'User.password_old': password, + 'User.password': passwordNew, + }, + } + return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + } + + @Query(() => CheckUsernameResponse) + async checkUsername(@Args() { username, groupId = 1 }: CheckUsernameArgs): Promise { + return apiGet(CONFIG.LOGIN_API_URL + `checkUsername?username=${username}&group_id=${groupId}`) + } } From 8639f15aa102b2e73a28166c180f48362a36aa00 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Thu, 29 Jul 2021 17:36:39 +0200 Subject: [PATCH 39/50] Withdrew the debuging log entries. --- backend/src/apis/loginAPI.ts | 4 ---- backend/src/graphql/models/User.ts | 14 -------------- 2 files changed, 18 deletions(-) diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index d4f4e278e..1aa6cace1 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -24,13 +24,9 @@ export const apiGet = async (url: string): Promise => { .get(url) .then((result) => { if (result.status !== 200) { - // eslint-disable-next-line no-console - console.log('IN status: ' + 'HTTP Status Error ' + result.status) throw new Error('HTTP Status Error ' + result.status) } if (!['success', 'warning'].includes(result.data.state)) { - // eslint-disable-next-line no-console - console.log('IN state: ' + result.data.state + ' message: ' + JSON.stringify(result)) throw new Error(result.data.msg) } return { success: true, result: result } diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts index 394d6d3f4..b935871d1 100644 --- a/backend/src/graphql/models/User.ts +++ b/backend/src/graphql/models/User.ts @@ -137,20 +137,6 @@ export class ErrorData extends BaseEntity { @Entity() @ObjectType() export class GetUserInfoResponse extends BaseEntity { - /* "state": "success", - "userData": { - "EmailVerificationCode.Register": "2718271129122", - "pubkeyhex": "131c7f68dd94b2be4c913400ff7ff4cdc03ac2bda99c2d29edcacb3b065c67e6", - "first_name": "Max", - "last_name": "Musterman", - "disabled": 0, - "email_checked": 1 - }, - "server": { - "loginServer.path": "http://localhost/account" - }, - "errors": [] - */ @Field(() => String) state: string From 2a258319e7d6ed2e1b17adda82ca8ea996c049c3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 2 Aug 2021 14:13:49 +0200 Subject: [PATCH 40/50] changePAssword query --- backend/src/graphql/inputs/LoginUserInput.ts | 12 ++++++++++++ backend/src/graphql/resolvers/UserResolver.ts | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 7edc3089e..c93b934b6 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -25,3 +25,15 @@ export class UnsecureLoginArgs { @Field(() => String) password: string } + +@ArgsType() +export class ChangePasswordArgs { + @Field(() => Number) + sessionId: number + + @Field(() => String) + email: string + + @Field(() => String) + password: string +} diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 34ceae7c7..f22d9c9b9 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -2,7 +2,7 @@ import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' import CONFIG from '../../config' import { LoginResponse, LoginViaVerificationCode } from '../models/User' -import { UnsecureLoginArgs } from '../inputs/LoginUserInput' +import { UnsecureLoginArgs, ChangePasswordArgs } from '../inputs/LoginUserInput' import { apiPost, apiGet } from '../../apis/loginAPI' @Resolver() @@ -84,4 +84,18 @@ export class UserResolver { } return result.result } + + @Query(() => String) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async changePassword(@Args() { sessionId, email, password }: ChangePasswordArgs): Promise { + const payload = { + session_id: sessionId, + email, + password, + } + const result = await apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload) + console.log(result) + if (result.success) return result.result.data.state + return result.result + } } From aa22d9154d9a7adfc58256ccd284f7ff680d53db Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Mon, 2 Aug 2021 16:03:33 +0200 Subject: [PATCH 41/50] Changed structure of the models, now they are not all in one file. --- backend/src/apis/loginAPI.ts | 8 +- .../src/graphql/inputs/TransactionInput.ts | 3 +- backend/src/graphql/models/Balance.ts | 3 +- backend/src/graphql/models/BaseResponse.ts | 9 ++ .../graphql/models/ChangePasswordResponse.ts | 9 ++ .../graphql/models/CheckUsernameResponse.ts | 15 +++ backend/src/graphql/models/CreateResponse.ts | 14 ++ backend/src/graphql/models/LoginResponse.ts | 25 ++++ .../models/LoginViaVerificationCode.ts | 22 ++++ .../src/graphql/models/SendEmailResponse.ts | 18 +++ backend/src/graphql/models/Server.ts | 14 ++ .../graphql/models/UpdateUserInfosResponse.ts | 15 +++ backend/src/graphql/models/User.ts | 123 ++---------------- backend/src/graphql/models/UserInfoData.ts | 38 ++++++ .../resolvers/CommunityTransactionResolver.ts | 2 +- backend/src/graphql/resolvers/UserResolver.ts | 73 +++++------ .../helpers/MapVariableToColumnName.ts | 0 17 files changed, 233 insertions(+), 158 deletions(-) create mode 100644 backend/src/graphql/models/BaseResponse.ts create mode 100644 backend/src/graphql/models/ChangePasswordResponse.ts create mode 100644 backend/src/graphql/models/CheckUsernameResponse.ts create mode 100644 backend/src/graphql/models/CreateResponse.ts create mode 100644 backend/src/graphql/models/LoginResponse.ts create mode 100644 backend/src/graphql/models/LoginViaVerificationCode.ts create mode 100644 backend/src/graphql/models/SendEmailResponse.ts create mode 100644 backend/src/graphql/models/Server.ts create mode 100644 backend/src/graphql/models/UpdateUserInfosResponse.ts create mode 100644 backend/src/graphql/models/UserInfoData.ts create mode 100644 backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index 1aa6cace1..7160db68c 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -11,10 +11,10 @@ export const apiPost = async (url: string, payload: unknown): Promise => { if (result.data.state !== 'success') { throw new Error(result.data.msg) } - return { success: true, result } + return { success: true, data: result.data } }) .catch((error) => { - return { success: false, result: error } + return { success: false, data: error.message } }) } @@ -29,11 +29,11 @@ export const apiGet = async (url: string): Promise => { if (!['success', 'warning'].includes(result.data.state)) { throw new Error(result.data.msg) } - return { success: true, result: result } + return { success: true, data: result.data } }) .catch((error) => { // eslint-disable-next-line no-console console.log('IN apiGet.ERROR: ' + JSON.stringify({ success: false, result: error })) - return { success: false, result: error } + return { success: false, data: error.message } }) } diff --git a/backend/src/graphql/inputs/TransactionInput.ts b/backend/src/graphql/inputs/TransactionInput.ts index 279e09dd6..db010390a 100644 --- a/backend/src/graphql/inputs/TransactionInput.ts +++ b/backend/src/graphql/inputs/TransactionInput.ts @@ -1,5 +1,4 @@ -import { ObjectType, ArgsType, Field, Int, Float } from 'type-graphql' -import { Entity, BaseEntity, Column, Double } from 'typeorm' +import { ArgsType, Field } from 'type-graphql' @ArgsType() export class TransactionInput { diff --git a/backend/src/graphql/models/Balance.ts b/backend/src/graphql/models/Balance.ts index 2ba34ec75..ceb479b9c 100644 --- a/backend/src/graphql/models/Balance.ts +++ b/backend/src/graphql/models/Balance.ts @@ -1,10 +1,11 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' @Entity() @ObjectType() export class Balance extends BaseEntity { - // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(json: any) { super() this.balance = json.balance diff --git a/backend/src/graphql/models/BaseResponse.ts b/backend/src/graphql/models/BaseResponse.ts new file mode 100644 index 000000000..712660bd3 --- /dev/null +++ b/backend/src/graphql/models/BaseResponse.ts @@ -0,0 +1,9 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class BaseResponse extends BaseEntity { + @Field(() => Boolean) + success: boolean +} diff --git a/backend/src/graphql/models/ChangePasswordResponse.ts b/backend/src/graphql/models/ChangePasswordResponse.ts new file mode 100644 index 000000000..1ba3247cd --- /dev/null +++ b/backend/src/graphql/models/ChangePasswordResponse.ts @@ -0,0 +1,9 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class ChangePasswordResponse extends BaseEntity { + @Field(() => String) + state: string +} diff --git a/backend/src/graphql/models/CheckUsernameResponse.ts b/backend/src/graphql/models/CheckUsernameResponse.ts new file mode 100644 index 000000000..ac51b64e1 --- /dev/null +++ b/backend/src/graphql/models/CheckUsernameResponse.ts @@ -0,0 +1,15 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class CheckUsernameResponse extends BaseEntity { + @Field(() => String) + state: string + + @Field(() => String) + msg?: string + + @Field(() => Number) + groupId?: number +} diff --git a/backend/src/graphql/models/CreateResponse.ts b/backend/src/graphql/models/CreateResponse.ts new file mode 100644 index 000000000..54276b031 --- /dev/null +++ b/backend/src/graphql/models/CreateResponse.ts @@ -0,0 +1,14 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class CreateResponse extends BaseEntity { + constructor(json: any) { + super() + this.state = json.state + } + + @Field(() => String) + state: string +} diff --git a/backend/src/graphql/models/LoginResponse.ts b/backend/src/graphql/models/LoginResponse.ts new file mode 100644 index 000000000..2abe1ef96 --- /dev/null +++ b/backend/src/graphql/models/LoginResponse.ts @@ -0,0 +1,25 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +import { Entity, BaseEntity, Column } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' +import { User } from './User' + +// temporaray solution until we have JWT implemented + +@Entity() +@ObjectType() +export class LoginResponse extends BaseEntity { + constructor(json: any) { + super() + this.sessionId = json.session_id + this.user = new User(json.user) + } + + @Field(() => Number) + @Column() + sessionId: number + + @Field(() => User) + @Column() + user: User +} diff --git a/backend/src/graphql/models/LoginViaVerificationCode.ts b/backend/src/graphql/models/LoginViaVerificationCode.ts new file mode 100644 index 000000000..bd0d66781 --- /dev/null +++ b/backend/src/graphql/models/LoginViaVerificationCode.ts @@ -0,0 +1,22 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +import { Entity, BaseEntity, Column } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class LoginViaVerificationCode extends BaseEntity { + constructor(json: any) { + super() + this.sessionId = json.session_id + this.email = json.user.email + } + + @Field(() => Number) + @Column() + sessionId: number + + @Field(() => String) + @Column() + email: string +} diff --git a/backend/src/graphql/models/SendEmailResponse.ts b/backend/src/graphql/models/SendEmailResponse.ts new file mode 100644 index 000000000..d8e163478 --- /dev/null +++ b/backend/src/graphql/models/SendEmailResponse.ts @@ -0,0 +1,18 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class SendEmailResponse extends BaseEntity { + constructor(json: any) { + super() + this.state = json.state + this.msg = json.msg + } + + @Field(() => String) + state: string + + @Field(() => String) + msg?: string +} diff --git a/backend/src/graphql/models/Server.ts b/backend/src/graphql/models/Server.ts new file mode 100644 index 000000000..e722a2c97 --- /dev/null +++ b/backend/src/graphql/models/Server.ts @@ -0,0 +1,14 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class Server extends BaseEntity { + constructor(json: any) { + super() + this.loginServerPath = json.login_server_path + } + + @Field(() => String) + loginServerPath: string +} diff --git a/backend/src/graphql/models/UpdateUserInfosResponse.ts b/backend/src/graphql/models/UpdateUserInfosResponse.ts new file mode 100644 index 000000000..14f834932 --- /dev/null +++ b/backend/src/graphql/models/UpdateUserInfosResponse.ts @@ -0,0 +1,15 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class UpdateUserInfosResponse extends BaseEntity { + @Field(() => String) + state: string + + @Field(() => Number) + validValues: number + + @Field(() => [String]) + errors: [string] +} diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts index b935871d1..68543bf09 100644 --- a/backend/src/graphql/models/User.ts +++ b/backend/src/graphql/models/User.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' @@ -9,6 +11,15 @@ export class User extends BaseEntity { @PrimaryGeneratedColumn() id: number */ + constructor(json: any) { + super() + this.email = json.email + this.firstName = json.first_name + this.lastName = json.last_name + this.username = json.username + this.description = json.description + this.language = json.language + } @Field(() => String) @Column({ length: 191 }) @@ -70,115 +81,3 @@ export class User extends BaseEntity { publisherId: number */ } - -// temporaray solution until we have JWT implemented -@Entity() -@ObjectType() -export class LoginResponse extends BaseEntity { - @Field(() => Number) - @Column() - sessionId: number - - @Field(() => User) - @Column() - user: User -} - -@Entity() -@ObjectType() -export class LoginViaVerificationCode extends BaseEntity { - @Field(() => Number) - @Column() - sessionId: number - - @Field(() => String) - @Column() - email: string -} - -@Entity() -@ObjectType() -export class LogoutResponse extends BaseEntity { - @Field(() => String) - state: string -} - -@Entity() -@ObjectType() -export class CreateResponse extends BaseEntity { - @Field(() => String) - state: string -} - -@Entity() -@ObjectType() -export class SendEmailResponse extends BaseEntity { - @Field(() => String) - state: string - - @Field(() => String) - msg?: string -} - -@Entity() -@ObjectType() -export class Server extends BaseEntity { - @Field(() => String) - loginServerPath: string -} - -@Entity() -@ObjectType() -export class ErrorData extends BaseEntity { - @Field(() => String) - messages: string -} - -@Entity() -@ObjectType() -export class GetUserInfoResponse extends BaseEntity { - @Field(() => String) - state: string - - @Field(() => User) - userData: User - - @Field(() => Server) - server: Server - - @Field(() => [ErrorData]) - errors: [ErrorData] -} - -@Entity() -@ObjectType() -export class ChangePasswordResponse extends BaseEntity { - @Field(() => String) - state: string -} - -@Entity() -@ObjectType() -export class UpdateUserInfosResponse extends BaseEntity { - @Field(() => String) - state: string - - @Field(() => Number) - validValues: number - - @Field(() => [ErrorData]) - errors: [ErrorData] -} - -@Entity() -@ObjectType() -export class CheckUsernameResponse extends BaseEntity { - @Field(() => String) - state: string - - @Field(() => String) - msg?: string - - @Field(() => Number) - groupId?: number -} diff --git a/backend/src/graphql/models/UserInfoData.ts b/backend/src/graphql/models/UserInfoData.ts new file mode 100644 index 000000000..46b336d5e --- /dev/null +++ b/backend/src/graphql/models/UserInfoData.ts @@ -0,0 +1,38 @@ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' +import { Server } from './Server' +import { User } from './User' + +@Entity() +@ObjectType() +export class UserInfoData extends BaseEntity { + constructor(json: any) { + super() + this.state = json.state + this.userData = new User(json.user_data) + this.server = new Server(json.server) + this.errors = json.errors + } + + @Field(() => String) + state: string + + @Field(() => User) + userData: User + + @Field(() => Server) + server: Server + + @Field(() => [String]) + errors: [string] +} + +@Entity() +@ObjectType() +export class GetUserInfoResponse extends BaseEntity { + @Field(() => Boolean) + success: boolean + + @Field(() => UserInfoData) + data: UserInfoData +} diff --git a/backend/src/graphql/resolvers/CommunityTransactionResolver.ts b/backend/src/graphql/resolvers/CommunityTransactionResolver.ts index 7eb7a9921..1fcc214e7 100644 --- a/backend/src/graphql/resolvers/CommunityTransactionResolver.ts +++ b/backend/src/graphql/resolvers/CommunityTransactionResolver.ts @@ -41,7 +41,7 @@ export class CommunityTransactionResolver { } @Query(() => String) - async create( + async createCoins( @Args() { sessionId, email, amount, memo, targetDate = new Date() }: TransactionCreateArgs, ): Promise { const payload = { diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 723f7539e..d22dd49ac 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,17 +1,14 @@ // import jwt from 'jsonwebtoken' import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' import CONFIG from '../../config' -import { - ChangePasswordResponse, - CheckUsernameResponse, - CreateResponse, - GetUserInfoResponse, - LoginResponse, - LoginViaVerificationCode, - LogoutResponse, - SendEmailResponse, - UpdateUserInfosResponse, -} from '../models/User' +import { ChangePasswordResponse } from '../models/ChangePasswordResponse' +import { CheckUsernameResponse } from '../models/CheckUsernameResponse' +import { CreateResponse } from '../models/CreateResponse' +import { GetUserInfoResponse } from '../models/UserInfoData' +import { LoginResponse } from '../models/LoginResponse' +import { LoginViaVerificationCode } from '../models/LoginViaVerificationCode' +import { SendEmailResponse } from '../models/SendEmailResponse' +import { UpdateUserInfosResponse } from '../models/UpdateUserInfosResponse' import { ChangePasswordArgs, CheckUsernameArgs, @@ -27,27 +24,17 @@ import { apiPost, apiGet } from '../../apis/loginAPI' export class UserResolver { @Query(() => LoginResponse) // eslint-disable-next-line @typescript-eslint/no-explicit-any - async login(@Args() { email, password }: UnsecureLoginArgs): Promise { + async login(@Args() { email, password }: UnsecureLoginArgs): Promise { email = email.trim().toLowerCase() const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) // if there is no user, throw an authentication error if (!result.success) { - throw new Error(result.result) + throw new Error(result.data) } // temporary solution until we have JWT implemented - return { - sessionId: result.result.data.session_id, - user: { - email: result.result.data.user.email, - language: result.result.data.user.language, - username: result.result.data.user.username, - firstName: result.result.data.user.first_name, - lastName: result.result.data.user.last_name, - description: result.result.data.user.description, - }, - } + return new LoginResponse(result.data) // create and return the json web token // The expire doesn't help us here. The client needs to track when the token expires on its own, @@ -65,29 +52,35 @@ export class UserResolver { @Query(() => LoginViaVerificationCode) // eslint-disable-next-line @typescript-eslint/no-explicit-any - async loginViaEmailVerificationCode(@Arg('optin') optin: string): Promise { + async loginViaEmailVerificationCode( + @Arg('optin') optin: string, + ): Promise { // I cannot use number as type here. // The value received is not the same as sent by the query const result = await apiGet( CONFIG.LOGIN_API_URL + 'loginViaEmailVerificationCode?emailVerificationCode=' + optin, ) - if (result.success) - return { - sessionId: result.result.data.session_id, - email: result.result.data.user.email, - } - return result.result + if (!result.success) { + throw new Error(result.data) + } + return new LoginViaVerificationCode(result.data) } - @Query(() => LogoutResponse) - async logout(@Arg('sessionId') sessionId: number): Promise { + /* @Query(() => LogoutResponse) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + async logout(@Arg('sessionId') sessionId: number): Promise { const payload = { session_id: sessionId } - const result = apiPost(CONFIG.LOGIN_API_URL + 'logout', payload); - return result + const result = apiPost(CONFIG.LOGIN_API_URL + 'logout', payload) + if (!result.success) { + throw new Error(result.data) + } + return result.data } - +*/ @Query(() => CreateResponse) - async create(@Args() { email, firstName, lastName, password }: CreateUserArgs): Promise { + async create( + @Args() { email, firstName, lastName, password }: CreateUserArgs, + ): Promise { const payload = { email, first_name: firstName, @@ -96,7 +89,11 @@ export class UserResolver { emailType: 2, login_after_register: true, } - return apiPost(CONFIG.LOGIN_API_URL + 'createUser', payload) + const result = await apiPost(CONFIG.LOGIN_API_URL + 'createUser', payload) + if (!result.success) { + throw new Error(result.data) + } + return new CreateResponse(result.data) } @Query(() => SendEmailResponse) diff --git a/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts b/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts new file mode 100644 index 000000000..e69de29bb From 99a37ddb0aea0ec55854565adcd507fa6d24d2b4 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Tue, 3 Aug 2021 10:28:49 +0200 Subject: [PATCH 42/50] Implementation of the Response classes, and logic for the update user prozess. --- backend/src/graphql/inputs/LoginUserInput.ts | 12 +-- backend/src/graphql/models/BaseResponse.ts | 9 --- .../graphql/models/ChangePasswordResponse.ts | 9 --- .../graphql/models/CheckUsernameResponse.ts | 9 +++ backend/src/graphql/models/CreateResponse.ts | 2 + .../graphql/models/ResetPasswordResponse.ts | 16 ++++ ...e.ts => SendPasswordResetEmailResponse.ts} | 4 +- backend/src/graphql/models/Server.ts | 2 + .../graphql/models/UpdateUserInfosResponse.ts | 9 +++ backend/src/graphql/models/UserInfoData.ts | 2 + backend/src/graphql/resolvers/UserResolver.ts | 81 +++++++++++-------- .../helpers/MapVariableToColumnName.ts | 3 + 12 files changed, 99 insertions(+), 59 deletions(-) delete mode 100644 backend/src/graphql/models/BaseResponse.ts delete mode 100644 backend/src/graphql/models/ChangePasswordResponse.ts create mode 100644 backend/src/graphql/models/ResetPasswordResponse.ts rename backend/src/graphql/models/{SendEmailResponse.ts => SendPasswordResetEmailResponse.ts} (60%) diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 68ddad628..1f786702f 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -82,22 +82,22 @@ export class UpdateUserInfosArgs { @Field(() => String) email!: string - @Field(() => String) + @Field({ nullable: true }) firstName?: string - @Field(() => String) + @Field({ nullable: true }) lastName?: string - @Field(() => String) + @Field({ nullable: true }) username?: string - @Field(() => String) + @Field({ nullable: true }) language?: string - @Field(() => String) + @Field({ nullable: true }) password?: string - @Field(() => String) + @Field({ nullable: true }) passwordNew?: string } diff --git a/backend/src/graphql/models/BaseResponse.ts b/backend/src/graphql/models/BaseResponse.ts deleted file mode 100644 index 712660bd3..000000000 --- a/backend/src/graphql/models/BaseResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Entity, BaseEntity } from 'typeorm' -import { ObjectType, Field } from 'type-graphql' - -@Entity() -@ObjectType() -export class BaseResponse extends BaseEntity { - @Field(() => Boolean) - success: boolean -} diff --git a/backend/src/graphql/models/ChangePasswordResponse.ts b/backend/src/graphql/models/ChangePasswordResponse.ts deleted file mode 100644 index 1ba3247cd..000000000 --- a/backend/src/graphql/models/ChangePasswordResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Entity, BaseEntity } from 'typeorm' -import { ObjectType, Field } from 'type-graphql' - -@Entity() -@ObjectType() -export class ChangePasswordResponse extends BaseEntity { - @Field(() => String) - state: string -} diff --git a/backend/src/graphql/models/CheckUsernameResponse.ts b/backend/src/graphql/models/CheckUsernameResponse.ts index ac51b64e1..de5724c8d 100644 --- a/backend/src/graphql/models/CheckUsernameResponse.ts +++ b/backend/src/graphql/models/CheckUsernameResponse.ts @@ -1,9 +1,18 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' @Entity() @ObjectType() export class CheckUsernameResponse extends BaseEntity { + constructor(json: any) { + super() + this.state = json.state + this.msg = json.msg + this.groupId = json.group_id + } + @Field(() => String) state: string diff --git a/backend/src/graphql/models/CreateResponse.ts b/backend/src/graphql/models/CreateResponse.ts index 54276b031..144d6456c 100644 --- a/backend/src/graphql/models/CreateResponse.ts +++ b/backend/src/graphql/models/CreateResponse.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' diff --git a/backend/src/graphql/models/ResetPasswordResponse.ts b/backend/src/graphql/models/ResetPasswordResponse.ts new file mode 100644 index 000000000..aae209059 --- /dev/null +++ b/backend/src/graphql/models/ResetPasswordResponse.ts @@ -0,0 +1,16 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +import { Entity, BaseEntity } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class ResetPasswordResponse extends BaseEntity { + constructor(json: any) { + super() + this.state = json.state + } + + @Field(() => String) + state: string +} diff --git a/backend/src/graphql/models/SendEmailResponse.ts b/backend/src/graphql/models/SendPasswordResetEmailResponse.ts similarity index 60% rename from backend/src/graphql/models/SendEmailResponse.ts rename to backend/src/graphql/models/SendPasswordResetEmailResponse.ts index d8e163478..f426d5245 100644 --- a/backend/src/graphql/models/SendEmailResponse.ts +++ b/backend/src/graphql/models/SendPasswordResetEmailResponse.ts @@ -1,9 +1,11 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' @Entity() @ObjectType() -export class SendEmailResponse extends BaseEntity { +export class SendPasswordResetEmailResponse extends BaseEntity { constructor(json: any) { super() this.state = json.state diff --git a/backend/src/graphql/models/Server.ts b/backend/src/graphql/models/Server.ts index e722a2c97..1b6f01627 100644 --- a/backend/src/graphql/models/Server.ts +++ b/backend/src/graphql/models/Server.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' diff --git a/backend/src/graphql/models/UpdateUserInfosResponse.ts b/backend/src/graphql/models/UpdateUserInfosResponse.ts index 14f834932..820ee0011 100644 --- a/backend/src/graphql/models/UpdateUserInfosResponse.ts +++ b/backend/src/graphql/models/UpdateUserInfosResponse.ts @@ -1,9 +1,18 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' @Entity() @ObjectType() export class UpdateUserInfosResponse extends BaseEntity { + constructor(json: any) { + super() + this.state = json.state + this.validValues = json.valid_values + this.errors = json.errors + } + @Field(() => String) state: string diff --git a/backend/src/graphql/models/UserInfoData.ts b/backend/src/graphql/models/UserInfoData.ts index 46b336d5e..2e65aca82 100644 --- a/backend/src/graphql/models/UserInfoData.ts +++ b/backend/src/graphql/models/UserInfoData.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' import { Server } from './Server' diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index d22dd49ac..5dc93f7bd 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,13 +1,13 @@ // import jwt from 'jsonwebtoken' -import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' +import { Resolver, Query, /* Mutation, */ Args, Arg, Field } from 'type-graphql' import CONFIG from '../../config' -import { ChangePasswordResponse } from '../models/ChangePasswordResponse' +import { ResetPasswordResponse } from '../models/ResetPasswordResponse' import { CheckUsernameResponse } from '../models/CheckUsernameResponse' import { CreateResponse } from '../models/CreateResponse' import { GetUserInfoResponse } from '../models/UserInfoData' import { LoginResponse } from '../models/LoginResponse' import { LoginViaVerificationCode } from '../models/LoginViaVerificationCode' -import { SendEmailResponse } from '../models/SendEmailResponse' +import { SendPasswordResetEmailResponse } from '../models/SendPasswordResetEmailResponse' import { UpdateUserInfosResponse } from '../models/UpdateUserInfosResponse' import { ChangePasswordArgs, @@ -66,17 +66,16 @@ export class UserResolver { return new LoginViaVerificationCode(result.data) } - /* @Query(() => LogoutResponse) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - async logout(@Arg('sessionId') sessionId: number): Promise { + @Query(() => String) + async logout(@Arg('sessionId') sessionId: number): Promise { const payload = { session_id: sessionId } - const result = apiPost(CONFIG.LOGIN_API_URL + 'logout', payload) + const result = await apiPost(CONFIG.LOGIN_API_URL + 'logout', payload) if (!result.success) { throw new Error(result.data) } - return result.data + return 'success' } -*/ + @Query(() => CreateResponse) async create( @Args() { email, firstName, lastName, password }: CreateUserArgs, @@ -96,17 +95,20 @@ export class UserResolver { return new CreateResponse(result.data) } - @Query(() => SendEmailResponse) - async sendEmail( + // TODO + @Query(() => SendPasswordResetEmailResponse) + async sendResetPasswordEmail( @Args() { email, emailText = 7, emailVerificationCodeType = 'resetPassword' }: SendEmailArgs, - ): Promise { + ): Promise { const payload = { email, email_text: emailText, email_verification_code_type: emailVerificationCodeType, } - return apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) + const response = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) + if (!response.success) throw new Error(response.data) + return new SendPasswordResetEmailResponse(response.data) } @Query(() => GetUserInfoResponse) @@ -119,16 +121,19 @@ export class UserResolver { return apiPost(CONFIG.LOGIN_API_URL + 'getUserInfos', payload) } - @Query(() => ChangePasswordResponse) - async changePassword(@Args() { sessionId, email, password }: ChangePasswordArgs): Promise { + @Query(() => ResetPasswordResponse) + async resetPassword( + @Args() + { sessionId, email, password }: ChangePasswordArgs, + ): Promise { const payload = { session_id: sessionId, email, password, } const result = await apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload) - if (result.success) return result.result.data.state - return result.result + if (!result.success) throw new Error(result.data) + return new ResetPasswordResponse(result.data) } @Query(() => UpdateUserInfosResponse) @@ -137,32 +142,40 @@ export class UserResolver { { sessionId, email, - firstName, - lastName, - username, - language, - password, - passwordNew, + firstName = '', + lastName = '', + username = '', + language = '', + password = '', + passwordNew = '', }: UpdateUserInfosArgs, - ): Promise { + ): Promise { const payload = { session_id: sessionId, email, update: { - 'User.first_name': firstName, - 'User.last_name': lastName, - // 'User.description': data.description, - 'User.username': username, - 'User.language': language, - 'User.password_old': password, - 'User.password': passwordNew, + 'User.first_name': firstName.length > 0 ? firstName : undefined, + 'User.last_name': lastName.length > 0 ? lastName : undefined, + 'User.username': username.length > 0 ? username : undefined, + 'User.language': language.length > 0 ? language : undefined, + 'User.password': passwordNew.length > 0 ? passwordNew : undefined, + 'User.password_old': password.length > 0 ? password : undefined, }, } - return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) + if (!result.success) throw new Error(result.data) + return new UpdateUserInfosResponse(result.data) } + // TODO @Query(() => CheckUsernameResponse) - async checkUsername(@Args() { username, groupId = 1 }: CheckUsernameArgs): Promise { - return apiGet(CONFIG.LOGIN_API_URL + `checkUsername?username=${username}&group_id=${groupId}`) + async checkUsername( + @Args() { username, groupId = 1 }: CheckUsernameArgs, + ): Promise { + const response = await apiGet( + CONFIG.LOGIN_API_URL + `checkUsername?username=${username}&group_id=${groupId}`, + ) + if (!response.success) throw new Error(response.data) + return new CheckUsernameResponse(response.data) } } diff --git a/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts b/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts index e69de29bb..361b35d9d 100644 --- a/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts +++ b/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts @@ -0,0 +1,3 @@ +export const MapVariableToColumnName = (object) => { + return null +} From f757cd2b76e4baaeac7011074b8995dfd4e2d089 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Tue, 3 Aug 2021 10:47:21 +0200 Subject: [PATCH 43/50] Withdrew state and errors from the UpdateUserInfosResponse object. --- backend/src/graphql/inputs/LoginUserInput.ts | 12 ++++----- .../graphql/models/UpdateUserInfosResponse.ts | 8 ------ backend/src/graphql/resolvers/UserResolver.ts | 27 +++++++++---------- .../helpers/MapVariableToColumnName.ts | 3 --- 4 files changed, 19 insertions(+), 31 deletions(-) delete mode 100644 backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 1f786702f..66f35980f 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -83,22 +83,22 @@ export class UpdateUserInfosArgs { email!: string @Field({ nullable: true }) - firstName?: string + firstName?: string | null @Field({ nullable: true }) - lastName?: string + lastName?: string | null @Field({ nullable: true }) - username?: string + username?: string | null @Field({ nullable: true }) - language?: string + language?: string | null @Field({ nullable: true }) - password?: string + password?: string | null @Field({ nullable: true }) - passwordNew?: string + passwordNew?: string | null } @ArgsType() diff --git a/backend/src/graphql/models/UpdateUserInfosResponse.ts b/backend/src/graphql/models/UpdateUserInfosResponse.ts index 820ee0011..765da5208 100644 --- a/backend/src/graphql/models/UpdateUserInfosResponse.ts +++ b/backend/src/graphql/models/UpdateUserInfosResponse.ts @@ -8,17 +8,9 @@ import { ObjectType, Field } from 'type-graphql' export class UpdateUserInfosResponse extends BaseEntity { constructor(json: any) { super() - this.state = json.state this.validValues = json.valid_values - this.errors = json.errors } - @Field(() => String) - state: string - @Field(() => Number) validValues: number - - @Field(() => [String]) - errors: [string] } diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 5dc93f7bd..43d83938c 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,5 +1,5 @@ // import jwt from 'jsonwebtoken' -import { Resolver, Query, /* Mutation, */ Args, Arg, Field } from 'type-graphql' +import { Resolver, Query, Args, Arg } from 'type-graphql' import CONFIG from '../../config' import { ResetPasswordResponse } from '../models/ResetPasswordResponse' import { CheckUsernameResponse } from '../models/CheckUsernameResponse' @@ -142,24 +142,24 @@ export class UserResolver { { sessionId, email, - firstName = '', - lastName = '', - username = '', - language = '', - password = '', - passwordNew = '', + firstName = null, + lastName = null, + username = null, + language = null, + password = null, + passwordNew = null, }: UpdateUserInfosArgs, ): Promise { const payload = { session_id: sessionId, email, update: { - 'User.first_name': firstName.length > 0 ? firstName : undefined, - 'User.last_name': lastName.length > 0 ? lastName : undefined, - 'User.username': username.length > 0 ? username : undefined, - 'User.language': language.length > 0 ? language : undefined, - 'User.password': passwordNew.length > 0 ? passwordNew : undefined, - 'User.password_old': password.length > 0 ? password : undefined, + 'User.first_name': firstName !== null ? firstName : undefined, + 'User.last_name': lastName !== null ? lastName : undefined, + 'User.username': username !== null ? username : undefined, + 'User.language': language !== null ? language : undefined, + 'User.password': passwordNew !== null ? passwordNew : undefined, + 'User.password_old': password !== null ? password : undefined, }, } const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) @@ -167,7 +167,6 @@ export class UserResolver { return new UpdateUserInfosResponse(result.data) } - // TODO @Query(() => CheckUsernameResponse) async checkUsername( @Args() { username, groupId = 1 }: CheckUsernameArgs, diff --git a/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts b/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts deleted file mode 100644 index 361b35d9d..000000000 --- a/backend/src/graphql/resolvers/helpers/MapVariableToColumnName.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const MapVariableToColumnName = (object) => { - return null -} From 873996487d7b5417fd5aa7ede40a32afe9be3380 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 3 Aug 2021 10:55:43 +0200 Subject: [PATCH 44/50] Model for transactions and decay --- backend/src/apis/loginAPI.ts | 2 +- backend/src/graphql/models/Balance.ts | 6 +- backend/src/graphql/models/Decay.ts | 30 ++++++ backend/src/graphql/models/Transaction.ts | 98 ++++++++++++++++++- .../src/graphql/resolvers/BalanceResolver.ts | 16 +++ backend/src/index.ts | 4 +- 6 files changed, 146 insertions(+), 10 deletions(-) create mode 100644 backend/src/graphql/models/Decay.ts create mode 100644 backend/src/graphql/resolvers/BalanceResolver.ts diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index 7160db68c..965b1ccfc 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -33,7 +33,7 @@ export const apiGet = async (url: string): Promise => { }) .catch((error) => { // eslint-disable-next-line no-console - console.log('IN apiGet.ERROR: ' + JSON.stringify({ success: false, result: error })) + console.log('IN apiGet.ERROR: ', { success: false, result: error }) return { success: false, data: error.message } }) } diff --git a/backend/src/graphql/models/Balance.ts b/backend/src/graphql/models/Balance.ts index ceb479b9c..e54bb3478 100644 --- a/backend/src/graphql/models/Balance.ts +++ b/backend/src/graphql/models/Balance.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' @@ -8,8 +6,8 @@ import { ObjectType, Field } from 'type-graphql' export class Balance extends BaseEntity { constructor(json: any) { super() - this.balance = json.balance - this.decay = json.decay + this.balance = Number(json.balance) + this.decay = Number(json.decay) this.decayDate = json.decay_date } diff --git a/backend/src/graphql/models/Decay.ts b/backend/src/graphql/models/Decay.ts new file mode 100644 index 000000000..af13ac193 --- /dev/null +++ b/backend/src/graphql/models/Decay.ts @@ -0,0 +1,30 @@ +import { Entity, BaseEntity, Column } from 'typeorm' +import { ObjectType, Field } from 'type-graphql' + +@Entity() +@ObjectType() +export class Decay extends BaseEntity { + constructor(json: any) { + super() + this.balance = Number(json.balance) + this.decayStart = json.decay_start + this.decayEnd = json.decay_end + this.decayDuration = json.decay_duration + } + + @Field(() => Number) + @Column() + balance: number + + @Field(() => Number) + @Column() + decayStart: number + + @Field(() => Number) + @Column() + decayEnd: number + + @Field(() => String) + @Column() + decayDuration: string +} diff --git a/backend/src/graphql/models/Transaction.ts b/backend/src/graphql/models/Transaction.ts index b638e797e..732dd9ec4 100644 --- a/backend/src/graphql/models/Transaction.ts +++ b/backend/src/graphql/models/Transaction.ts @@ -3,8 +3,100 @@ import { ObjectType, Field } from 'type-graphql' @Entity() @ObjectType() -export class Transaction extends BaseEntity { +export class TransactionList extends BaseEntity { + constructor(json: any) { + super() + this.gdtSum = Number(json.gdtSum) + this.count = json.count + this.balance = Number(json.balance) + this.decay = Number(json.decay) + this.decayDate = json.decay_date + this.transactions = json.transactions + } + + @Field(() => Number) + @Column() + gdtSum: number + + @Field(() => Number) + @Column() + count: number + + @Field(() => Number) + @Column() + balance: number + + @Field(() => Number) + @Column() + decay: number + @Field(() => String) - @Column({ length: 191 }) - email: string + @Column() + decayDate: string + + @Field(() => [Transaction]) + transactions: Transaction[] +} + +@Entity() +@ObjectType() +export class Transaction extends BaseEntity { + constructor(json: any) { + super() + this.type = json.type + this.balance = Number(json.balance) + this.decayStart = json.decay_start + this.decayEnd = json.decay_end + this.decayDuration = json.decay_duration + this.meno = json.memo + this.transactionId = json.transaction_id + this.name = json.name + this.email = json.email + this.date = json.date + this.decay = json.decay + } + + @Field(() => String) + @Column() + type: string + + @Field(() => Number) + @Column() + balance: number + + @Field(() => Number) + @Column() + decayStart: number + + @Field(() => Number) + @Column() + decayEnd: number + + @Field(() => String) + @Column() + decayDuration: string + + @Field(() => String) + @Column() + memo: string + + @Field(() => Number) + @Column() + transactionId: number + + @Field(() => String) + @Column() + name: string + + @Field(() => String) + @Column() + email: string + + @Field(() => String) + @Column() + date: string + + @Field(() => Decay) + @Column() + decay: Decay } diff --git a/backend/src/graphql/resolvers/BalanceResolver.ts b/backend/src/graphql/resolvers/BalanceResolver.ts new file mode 100644 index 000000000..31bed076c --- /dev/null +++ b/backend/src/graphql/resolvers/BalanceResolver.ts @@ -0,0 +1,16 @@ +import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' +import CONFIG from '../../config' +import { Balance } from '../models/Balance' +import { apiGet } from '../../apis/loginAPI' + +@Resolver() +export class BalanceResolver { + @Query(() => Balance) + async balance(@Arg('sessionId') sessionId: number): Promise { + const result = await apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) + console.log(result) + if (!result.success) + throw new Error(result.data) + return new Balance(result.data) + } +} diff --git a/backend/src/index.ts b/backend/src/index.ts index b6e19f56d..d9a35fa40 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -8,7 +8,7 @@ import CONFIG from './config' // TODO move to extern // import { BookResolver } from './graphql/resolvers/BookResolver' import { UserResolver } from './graphql/resolvers/UserResolver' -import { CommunityTransactionResolver } from './graphql/resolvers/CommunityTransactionResolver' +import { BalanceResolver } from './graphql/resolvers/BalanceResolver' // import { GroupResolver } from './graphql/resolvers/GroupResolver' // TODO implement // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; @@ -16,7 +16,7 @@ import { CommunityTransactionResolver } from './graphql/resolvers/CommunityTrans async function main() { // const connection = await createConnection() const schema = await buildSchema({ - resolvers: [/* BookResolver , GroupResolver, */ UserResolver, CommunityTransactionResolver], + resolvers: [UserResolver, BalanceResolver], }) // Graphiql interface From 68d46edcf607d8241992a8284764447e0163b8e2 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 3 Aug 2021 13:16:29 +0200 Subject: [PATCH 45/50] transaction lists are working --- backend/src/graphql/inputs/LoginUserInput.ts | 24 ++-- .../src/graphql/inputs/TransactionInput.ts | 2 +- backend/src/graphql/models/Balance.ts | 2 + backend/src/graphql/models/Decay.ts | 19 +-- backend/src/graphql/models/Transaction.ts | 131 ++++++++---------- .../src/graphql/resolvers/BalanceResolver.ts | 6 +- .../resolvers/CommunityTransactionResolver.ts | 57 -------- .../graphql/resolvers/TransactionResolver.ts | 19 +++ backend/src/graphql/resolvers/UserResolver.ts | 27 ++-- backend/src/index.ts | 5 +- 10 files changed, 118 insertions(+), 174 deletions(-) delete mode 100644 backend/src/graphql/resolvers/CommunityTransactionResolver.ts create mode 100644 backend/src/graphql/resolvers/TransactionResolver.ts diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 66f35980f..68ddad628 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -82,23 +82,23 @@ export class UpdateUserInfosArgs { @Field(() => String) email!: string - @Field({ nullable: true }) - firstName?: string | null + @Field(() => String) + firstName?: string - @Field({ nullable: true }) - lastName?: string | null + @Field(() => String) + lastName?: string - @Field({ nullable: true }) - username?: string | null + @Field(() => String) + username?: string - @Field({ nullable: true }) - language?: string | null + @Field(() => String) + language?: string - @Field({ nullable: true }) - password?: string | null + @Field(() => String) + password?: string - @Field({ nullable: true }) - passwordNew?: string | null + @Field(() => String) + passwordNew?: string } @ArgsType() diff --git a/backend/src/graphql/inputs/TransactionInput.ts b/backend/src/graphql/inputs/TransactionInput.ts index db010390a..049a9b2a9 100644 --- a/backend/src/graphql/inputs/TransactionInput.ts +++ b/backend/src/graphql/inputs/TransactionInput.ts @@ -1,7 +1,7 @@ import { ArgsType, Field } from 'type-graphql' @ArgsType() -export class TransactionInput { +export class TransactionListInput { @Field(() => Number) sessionId: number diff --git a/backend/src/graphql/models/Balance.ts b/backend/src/graphql/models/Balance.ts index e54bb3478..4897f3265 100644 --- a/backend/src/graphql/models/Balance.ts +++ b/backend/src/graphql/models/Balance.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' diff --git a/backend/src/graphql/models/Decay.ts b/backend/src/graphql/models/Decay.ts index af13ac193..3d918ce7a 100644 --- a/backend/src/graphql/models/Decay.ts +++ b/backend/src/graphql/models/Decay.ts @@ -1,11 +1,10 @@ -import { Entity, BaseEntity, Column } from 'typeorm' +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { ObjectType, Field } from 'type-graphql' -@Entity() @ObjectType() -export class Decay extends BaseEntity { +export class Decay { constructor(json: any) { - super() this.balance = Number(json.balance) this.decayStart = json.decay_start this.decayEnd = json.decay_end @@ -13,18 +12,14 @@ export class Decay extends BaseEntity { } @Field(() => Number) - @Column() balance: number - @Field(() => Number) - @Column() - decayStart: number + @Field({ nullable: true }) + decayStart?: number - @Field(() => Number) - @Column() - decayEnd: number + @Field({ nullable: true }) + decayEnd?: number @Field(() => String) - @Column() decayDuration: string } diff --git a/backend/src/graphql/models/Transaction.ts b/backend/src/graphql/models/Transaction.ts index 732dd9ec4..61670b06a 100644 --- a/backend/src/graphql/models/Transaction.ts +++ b/backend/src/graphql/models/Transaction.ts @@ -1,11 +1,66 @@ -import { Entity, BaseEntity, Column } from 'typeorm' +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { ObjectType, Field } from 'type-graphql' +import { Decay } from './Decay' + +// we need a better solution for the decay block: +// the first transaction on the first page shows the decay since the last transaction +// the format is actually a Decay and not a Transaction. +// Therefore we have a lot of nullable fields, which should be always present -@Entity() @ObjectType() -export class TransactionList extends BaseEntity { +export class Transaction { + constructor(json: any) { + this.type = json.type + this.balance = Number(json.balance) + this.decayStart = json.decay_start + this.decayEnd = json.decay_end + this.decayDuration = json.decay_duration + this.memo = json.memo + this.transactionId = json.transaction_id + this.name = json.name + this.email = json.email + this.date = json.date + this.decay = json.decay + } + + @Field(() => String) + type: string + + @Field(() => Number) + balance: number + + @Field({ nullable: true }) + decayStart?: number + + @Field({ nullable: true }) + decayEnd?: number + + @Field({ nullable: true }) + decayDuration?: string + + @Field(() => String) + memo: string + + @Field(() => Number) + transactionId: number + + @Field({ nullable: true }) + name?: string + + @Field({ nullable: true }) + email?: string + + @Field({ nullable: true }) + date?: string + + @Field({ nullable: true }) + decay?: Decay +} + +@ObjectType() +export class TransactionList { constructor(json: any) { - super() this.gdtSum = Number(json.gdtSum) this.count = json.count this.balance = Number(json.balance) @@ -15,88 +70,20 @@ export class TransactionList extends BaseEntity { } @Field(() => Number) - @Column() gdtSum: number @Field(() => Number) - @Column() count: number @Field(() => Number) - @Column() balance: number @Field(() => Number) - @Column() decay: number @Field(() => String) - @Column() decayDate: string @Field(() => [Transaction]) transactions: Transaction[] } - -@Entity() -@ObjectType() -export class Transaction extends BaseEntity { - constructor(json: any) { - super() - this.type = json.type - this.balance = Number(json.balance) - this.decayStart = json.decay_start - this.decayEnd = json.decay_end - this.decayDuration = json.decay_duration - this.meno = json.memo - this.transactionId = json.transaction_id - this.name = json.name - this.email = json.email - this.date = json.date - this.decay = json.decay - } - - @Field(() => String) - @Column() - type: string - - @Field(() => Number) - @Column() - balance: number - - @Field(() => Number) - @Column() - decayStart: number - - @Field(() => Number) - @Column() - decayEnd: number - - @Field(() => String) - @Column() - decayDuration: string - - @Field(() => String) - @Column() - memo: string - - @Field(() => Number) - @Column() - transactionId: number - - @Field(() => String) - @Column() - name: string - - @Field(() => String) - @Column() - email: string - - @Field(() => String) - @Column() - date: string - - @Field(() => Decay) - @Column() - decay: Decay -} diff --git a/backend/src/graphql/resolvers/BalanceResolver.ts b/backend/src/graphql/resolvers/BalanceResolver.ts index 31bed076c..c483ad5c9 100644 --- a/backend/src/graphql/resolvers/BalanceResolver.ts +++ b/backend/src/graphql/resolvers/BalanceResolver.ts @@ -1,4 +1,4 @@ -import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' +import { Resolver, Query, /* Mutation, */ Arg } from 'type-graphql' import CONFIG from '../../config' import { Balance } from '../models/Balance' import { apiGet } from '../../apis/loginAPI' @@ -8,9 +8,7 @@ export class BalanceResolver { @Query(() => Balance) async balance(@Arg('sessionId') sessionId: number): Promise { const result = await apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) - console.log(result) - if (!result.success) - throw new Error(result.data) + if (!result.success) throw new Error(result.data) return new Balance(result.data) } } diff --git a/backend/src/graphql/resolvers/CommunityTransactionResolver.ts b/backend/src/graphql/resolvers/CommunityTransactionResolver.ts deleted file mode 100644 index 1fcc214e7..000000000 --- a/backend/src/graphql/resolvers/CommunityTransactionResolver.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Resolver, Query, /* Mutation, */ Args, Arg } from 'type-graphql' -import CONFIG from '../../config' -import {} from '../models/Transaction' -import { Balance } from '../models/Balance' -import { - TransactionCreateArgs, - TransactionInput, - TransactionSendArgs, -} from '../inputs/TransactionInput' -import { apiPost, apiGet } from '../../apis/loginAPI' - -@Resolver() -export class CommunityTransactionResolver { - @Query(() => Balance) - async balance(@Arg('sessionId') sessionId: number): Promise { - // eslint-disable-next-line no-console - console.log('IN BALANCE: URL: ' + CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) - const result = await apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId) - return new Balance(result.result.data) - } - - @Query(() => String) - async transactions( - @Args() { sessionId, firstPage = 1, items = 5, order = 'DESC' }: TransactionInput, - ): Promise { - return apiGet( - `${CONFIG.COMMUNITY_API_URL}listTransactions/${firstPage}/${items}/${order}/${sessionId}`, - ) - } - - @Query(() => String) - async send(@Args() { sessionId, email, amount, memo }: TransactionSendArgs): Promise { - const payload = { - session_id: sessionId, - auto_sign: true, - email: email, - amount: amount, - memo: memo, - } - return apiPost(CONFIG.COMMUNITY_API_URL + 'sendCoins/', payload) - } - - @Query(() => String) - async createCoins( - @Args() { sessionId, email, amount, memo, targetDate = new Date() }: TransactionCreateArgs, - ): Promise { - const payload = { - sessionId, - email, - amount, - targetDate, - memo, - auto_sign: true, - } - return apiPost(CONFIG.COMMUNITY_API_URL + 'createCoins/', payload) - } -} diff --git a/backend/src/graphql/resolvers/TransactionResolver.ts b/backend/src/graphql/resolvers/TransactionResolver.ts new file mode 100644 index 000000000..9834b62f8 --- /dev/null +++ b/backend/src/graphql/resolvers/TransactionResolver.ts @@ -0,0 +1,19 @@ +import { Resolver, Query, /* Mutation, */ Args } from 'type-graphql' +import CONFIG from '../../config' +import { TransactionList } from '../models/Transaction' +import { TransactionListInput } from '../inputs/TransactionInput' +import { apiGet } from '../../apis/loginAPI' + +@Resolver() +export class TransactionResolver { + @Query(() => TransactionList) + async transactionList( + @Args() { sessionId, firstPage = 1, items = 25, order = 'DESC' }: TransactionListInput, + ): Promise { + const result = await apiGet( + `${CONFIG.COMMUNITY_API_URL}listTransactions/${firstPage}/${items}/${order}/${sessionId}`, + ) + if (!result.success) throw new Error(result.data) + return new TransactionList(result.data) + } +} diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 43d83938c..5791ccd15 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -23,7 +23,6 @@ import { apiPost, apiGet } from '../../apis/loginAPI' @Resolver() export class UserResolver { @Query(() => LoginResponse) - // eslint-disable-next-line @typescript-eslint/no-explicit-any async login(@Args() { email, password }: UnsecureLoginArgs): Promise { email = email.trim().toLowerCase() const result = await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', { email, password }) @@ -51,7 +50,6 @@ export class UserResolver { } @Query(() => LoginViaVerificationCode) - // eslint-disable-next-line @typescript-eslint/no-explicit-any async loginViaEmailVerificationCode( @Arg('optin') optin: string, ): Promise { @@ -112,6 +110,7 @@ export class UserResolver { } @Query(() => GetUserInfoResponse) + // eslint-disable-next-line @typescript-eslint/no-explicit-any async getUserInfos(@Args() { sessionId, email }: GetUserInfoArgs): Promise { const payload = { session_id: sessionId, @@ -142,24 +141,24 @@ export class UserResolver { { sessionId, email, - firstName = null, - lastName = null, - username = null, - language = null, - password = null, - passwordNew = null, + firstName = '', + lastName = '', + username = '', + language = '', + password = '', + passwordNew = '', }: UpdateUserInfosArgs, ): Promise { const payload = { session_id: sessionId, email, update: { - 'User.first_name': firstName !== null ? firstName : undefined, - 'User.last_name': lastName !== null ? lastName : undefined, - 'User.username': username !== null ? username : undefined, - 'User.language': language !== null ? language : undefined, - 'User.password': passwordNew !== null ? passwordNew : undefined, - 'User.password_old': password !== null ? password : undefined, + 'User.first_name': firstName !== '' ? firstName : undefined, + 'User.last_name': lastName !== '' ? lastName : undefined, + 'User.username': username !== '' ? username : undefined, + 'User.language': language !== '' ? language : undefined, + 'User.password': passwordNew !== '' ? passwordNew : undefined, + 'User.password_old': password !== '' ? password : undefined, }, } const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) diff --git a/backend/src/index.ts b/backend/src/index.ts index d9a35fa40..8bf6dbebc 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -9,14 +9,15 @@ import CONFIG from './config' // import { BookResolver } from './graphql/resolvers/BookResolver' import { UserResolver } from './graphql/resolvers/UserResolver' import { BalanceResolver } from './graphql/resolvers/BalanceResolver' -// import { GroupResolver } from './graphql/resolvers/GroupResolver' +import { TransactionResolver } from './graphql/resolvers/TransactionResolver' + // TODO implement // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; async function main() { // const connection = await createConnection() const schema = await buildSchema({ - resolvers: [UserResolver, BalanceResolver], + resolvers: [UserResolver, BalanceResolver, TransactionResolver], }) // Graphiql interface From 628f0a541f0e473364b6c5390b8a7d0045046ac6 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 3 Aug 2021 13:35:44 +0200 Subject: [PATCH 46/50] sendCoins implemented --- .../graphql/resolvers/TransactionResolver.ts | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/backend/src/graphql/resolvers/TransactionResolver.ts b/backend/src/graphql/resolvers/TransactionResolver.ts index 9834b62f8..a2853f08a 100644 --- a/backend/src/graphql/resolvers/TransactionResolver.ts +++ b/backend/src/graphql/resolvers/TransactionResolver.ts @@ -1,8 +1,8 @@ import { Resolver, Query, /* Mutation, */ Args } from 'type-graphql' import CONFIG from '../../config' import { TransactionList } from '../models/Transaction' -import { TransactionListInput } from '../inputs/TransactionInput' -import { apiGet } from '../../apis/loginAPI' +import { TransactionListInput, TransactionSendArgs } from '../inputs/TransactionInput' +import { apiGet, apiPost } from '../../apis/loginAPI' @Resolver() export class TransactionResolver { @@ -16,4 +16,22 @@ export class TransactionResolver { if (!result.success) throw new Error(result.data) return new TransactionList(result.data) } + + @Query(() => String) + async sendCoins( + @Args() { sessionId, email, amount, memo }: TransactionSendArgs, + ): Promise { + const payload = { + session_id: sessionId, + email, + amount, + memo, + auto_sign: true, + } + const result = await apiPost(CONFIG.COMMUNITY_API_URL + 'sendCoins', payload) + if (!result.success) { + throw new Error(result.data) + } + return 'success' + } } From 800e4e04fd42feae17815c1119f448bd3b4b5ff7 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 3 Aug 2021 13:59:22 +0200 Subject: [PATCH 47/50] remove eom directives --- backend/src/apis/loginAPI.ts.old | 184 ------------------ backend/src/graphql/models/Balance.ts | 8 +- .../graphql/models/CheckUsernameResponse.ts | 5 +- backend/src/graphql/models/CreateResponse.ts | 16 -- backend/src/graphql/models/LoginResponse.ts | 7 +- .../models/LoginViaVerificationCode.ts | 7 +- .../graphql/models/ResetPasswordResponse.ts | 16 -- .../models/SendPasswordResetEmailResponse.ts | 5 +- .../graphql/models/UpdateUserInfosResponse.ts | 5 +- backend/src/graphql/models/User.ts | 18 +- backend/src/graphql/resolvers/UserResolver.ts | 16 +- 11 files changed, 13 insertions(+), 274 deletions(-) delete mode 100644 backend/src/apis/loginAPI.ts.old delete mode 100644 backend/src/graphql/models/CreateResponse.ts delete mode 100644 backend/src/graphql/models/ResetPasswordResponse.ts diff --git a/backend/src/apis/loginAPI.ts.old b/backend/src/apis/loginAPI.ts.old deleted file mode 100644 index 8e4b5e040..000000000 --- a/backend/src/apis/loginAPI.ts.old +++ /dev/null @@ -1,184 +0,0 @@ -import axios from 'axios' -import { graphql } from 'graphql' -import CONFIG from '../config' -import { User } from '../graphql/models/User' -import { LoginUserInput } from '../graphql/inputs/LoginUserInput' -// eslint-disable-next-line no-unused-vars -// import regeneratorRuntime from 'regenerator-runtime' - -// control email-text sended with email verification code -const EMAIL_TYPE = { - DEFAULT: 2, // if user has registered directly - ADMIN: 5, // if user was registered by an admin -} - -const apiGet = async (url: string) => { - try { - const result = await axios.get(url) - if (result.status !== 200) { - throw new Error('HTTP Status Error ' + result.status) - } - if (!['success', 'warning'].includes(result.data.state)) { - throw new Error(result.data.msg) - } - return { success: true, result } - } catch (error) { - return { success: false, result: error } - } -} - -const apiPost = async (url: string, payload: any): Promise => { - try { - const result = await axios.post(url, payload) - if (result.status !== 200) { - throw new Error('HTTP Status Error ' + result.status) - } - if (result.data.state === 'warning') { - return { success: true, result: result.data.errors } - } - if (result.data.state !== 'success') { - throw new Error(result.data.msg) - } - return { success: true, result } - } catch (error) { - return { success: false, result: error } - } -} - -interface NetworkInfosResult { - state: string - msg?: string - errors: string[] - data: { - groups?: string[] - } -} - -interface LoginResult { - state: string - msg?: string - details?: number - info?: string - user?: User - // eslint-disable-next-line camelcase - session_id?: number -} - -const loginAPI = { - login: async (login: LoginUserInput): Promise => { - return (await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', login)).result.data - }, - logout: async (sessionId: number): Promise => { - const payload: any = { session_id: sessionId } - return apiPost(CONFIG.LOGIN_API_URL + 'logout', payload) - }, - create: async ( - email: string, - firstName: string, - lastName: string, - password: string, - ): Promise => { - const payload: any = { - email, - first_name: firstName, - last_name: lastName, - password, - emailType: EMAIL_TYPE.DEFAULT, - login_after_register: true, - } - return apiPost(CONFIG.LOGIN_API_URL + 'createUser', payload) - }, - sendEmail: async ( - email: string, - email_text = 7, - email_verification_code_type = 'resetPassword', - ): Promise => { - const payload: any = { - email, - email_text, - email_verification_code_type, - } - return apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) - }, - loginViaEmailVerificationCode: async (optin: number): Promise => { - return apiGet( - CONFIG.LOGIN_API_URL + 'loginViaEmailVerificationCode?emailVerificationCode=' + optin, - ) - }, - getUserInfos: async (sessionId: number, email: string): Promise => { - const payload: any = { - session_id: sessionId, - email: email, - ask: ['user.first_name', 'user.last_name'], - } - return apiPost(CONFIG.LOGIN_API_URL + 'getUserInfos', payload) - }, - updateUserInfos: async (sessionId: number, email: string, data: any): Promise => { - const payload: any = { - session_id: sessionId, - email, - update: { - 'User.first_name': data.firstName, - 'User.last_name': data.lastName, - 'User.description': data.description, - }, - } - return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) - }, - changePassword: async (sessionId: number, email: string, password: string): Promise => { - const payload: any = { - session_id: sessionId, - email, - password, - } - return apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload) - }, - changePasswordProfile: async ( - sessionId: number, - email: string, - password: string, - passwordNew: string, - ): Promise => { - const payload: any = { - session_id: sessionId, - email, - update: { - 'User.password_old': password, - 'User.password': passwordNew, - }, - } - return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) - }, - changeUsernameProfile: async ( - sessionId: number, - email: string, - username: string, - ): Promise => { - const payload: any = { - session_id: sessionId, - email, - update: { - 'User.username': username, - }, - } - return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) - }, - updateLanguage: async (sessionId: number, email: string, language: string): Promise => { - const payload: any = { - session_id: sessionId, - email, - update: { - 'User.language': language, - }, - } - return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) - }, - checkUsername: async (username: string, groupId = 1): Promise => { - return apiGet(CONFIG.LOGIN_API_URL + `checkUsername?username=${username}&group_id=${groupId}`) - }, - getNetworkInfos: async (ask: string[]): Promise => { - return (await apiPost(CONFIG.LOGIN_API_URL + `networkInfos`, { ask: ask })).result.data - }, -} - -export { loginAPI, NetworkInfosResult, LoginResult } diff --git a/backend/src/graphql/models/Balance.ts b/backend/src/graphql/models/Balance.ts index 4897f3265..93d497e0c 100644 --- a/backend/src/graphql/models/Balance.ts +++ b/backend/src/graphql/models/Balance.ts @@ -1,27 +1,21 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' -@Entity() @ObjectType() -export class Balance extends BaseEntity { +export class Balance { constructor(json: any) { - super() this.balance = Number(json.balance) this.decay = Number(json.decay) this.decayDate = json.decay_date } @Field(() => Number) - @Column() balance: number @Field(() => Number) - @Column() decay: number @Field(() => String) - @Column() decayDate: string } diff --git a/backend/src/graphql/models/CheckUsernameResponse.ts b/backend/src/graphql/models/CheckUsernameResponse.ts index de5724c8d..b3186ffcf 100644 --- a/backend/src/graphql/models/CheckUsernameResponse.ts +++ b/backend/src/graphql/models/CheckUsernameResponse.ts @@ -1,13 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' -@Entity() @ObjectType() -export class CheckUsernameResponse extends BaseEntity { +export class CheckUsernameResponse { constructor(json: any) { - super() this.state = json.state this.msg = json.msg this.groupId = json.group_id diff --git a/backend/src/graphql/models/CreateResponse.ts b/backend/src/graphql/models/CreateResponse.ts deleted file mode 100644 index 144d6456c..000000000 --- a/backend/src/graphql/models/CreateResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity } from 'typeorm' -import { ObjectType, Field } from 'type-graphql' - -@Entity() -@ObjectType() -export class CreateResponse extends BaseEntity { - constructor(json: any) { - super() - this.state = json.state - } - - @Field(() => String) - state: string -} diff --git a/backend/src/graphql/models/LoginResponse.ts b/backend/src/graphql/models/LoginResponse.ts index 2abe1ef96..258784b75 100644 --- a/backend/src/graphql/models/LoginResponse.ts +++ b/backend/src/graphql/models/LoginResponse.ts @@ -1,25 +1,20 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' import { User } from './User' // temporaray solution until we have JWT implemented -@Entity() @ObjectType() -export class LoginResponse extends BaseEntity { +export class LoginResponse { constructor(json: any) { - super() this.sessionId = json.session_id this.user = new User(json.user) } @Field(() => Number) - @Column() sessionId: number @Field(() => User) - @Column() user: User } diff --git a/backend/src/graphql/models/LoginViaVerificationCode.ts b/backend/src/graphql/models/LoginViaVerificationCode.ts index bd0d66781..61286ca0e 100644 --- a/backend/src/graphql/models/LoginViaVerificationCode.ts +++ b/backend/src/graphql/models/LoginViaVerificationCode.ts @@ -1,22 +1,17 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' -@Entity() @ObjectType() -export class LoginViaVerificationCode extends BaseEntity { +export class LoginViaVerificationCode { constructor(json: any) { - super() this.sessionId = json.session_id this.email = json.user.email } @Field(() => Number) - @Column() sessionId: number @Field(() => String) - @Column() email: string } diff --git a/backend/src/graphql/models/ResetPasswordResponse.ts b/backend/src/graphql/models/ResetPasswordResponse.ts deleted file mode 100644 index aae209059..000000000 --- a/backend/src/graphql/models/ResetPasswordResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity } from 'typeorm' -import { ObjectType, Field } from 'type-graphql' - -@Entity() -@ObjectType() -export class ResetPasswordResponse extends BaseEntity { - constructor(json: any) { - super() - this.state = json.state - } - - @Field(() => String) - state: string -} diff --git a/backend/src/graphql/models/SendPasswordResetEmailResponse.ts b/backend/src/graphql/models/SendPasswordResetEmailResponse.ts index f426d5245..d387efede 100644 --- a/backend/src/graphql/models/SendPasswordResetEmailResponse.ts +++ b/backend/src/graphql/models/SendPasswordResetEmailResponse.ts @@ -1,13 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' -@Entity() @ObjectType() -export class SendPasswordResetEmailResponse extends BaseEntity { +export class SendPasswordResetEmailResponse { constructor(json: any) { - super() this.state = json.state this.msg = json.msg } diff --git a/backend/src/graphql/models/UpdateUserInfosResponse.ts b/backend/src/graphql/models/UpdateUserInfosResponse.ts index 765da5208..0e41f21cb 100644 --- a/backend/src/graphql/models/UpdateUserInfosResponse.ts +++ b/backend/src/graphql/models/UpdateUserInfosResponse.ts @@ -1,13 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity } from 'typeorm' import { ObjectType, Field } from 'type-graphql' -@Entity() @ObjectType() -export class UpdateUserInfosResponse extends BaseEntity { +export class UpdateUserInfosResponse { constructor(json: any) { - super() this.validValues = json.valid_values } diff --git a/backend/src/graphql/models/User.ts b/backend/src/graphql/models/User.ts index 68543bf09..47037d483 100644 --- a/backend/src/graphql/models/User.ts +++ b/backend/src/graphql/models/User.ts @@ -1,18 +1,15 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity, Column } from 'typeorm' import { ObjectType, Field } from 'type-graphql' -@Entity() @ObjectType() -export class User extends BaseEntity { +export class User { /* @Field(() => ID) @PrimaryGeneratedColumn() id: number */ constructor(json: any) { - super() this.email = json.email this.firstName = json.first_name this.lastName = json.last_name @@ -22,62 +19,49 @@ export class User extends BaseEntity { } @Field(() => String) - @Column({ length: 191 }) email: string @Field(() => String) - @Column({ length: 150 }) firstName: string @Field(() => String) - @Column() lastName: string @Field(() => String) - @Column() username: string @Field(() => String) - @Column('text') description: string /* @Field(() => String) - @Column({ length: 64 }) pubkey: string // not sure about the type here. Maybe better to have a string @Field(() => number) - @Column({ type: 'datetime' }) created: number @Field(() => Boolean) - @Column({ default: false }) emailChecked: boolean @Field(() => Boolean) - @Column({ default: false }) passphraseShown: boolean */ @Field(() => String) - @Column({ default: 'de' }) language: string /* @Field(() => Boolean) - @Column({ default: false }) disabled: boolean */ /* I suggest to have a group as type here @Field(() => ID) - @Column() groupId: number // what is puvlisherId? @Field(() => ID) - @Column({ default: 0 }) publisherId: number */ } diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 5791ccd15..4361bd0ed 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -1,9 +1,7 @@ // import jwt from 'jsonwebtoken' import { Resolver, Query, Args, Arg } from 'type-graphql' import CONFIG from '../../config' -import { ResetPasswordResponse } from '../models/ResetPasswordResponse' import { CheckUsernameResponse } from '../models/CheckUsernameResponse' -import { CreateResponse } from '../models/CreateResponse' import { GetUserInfoResponse } from '../models/UserInfoData' import { LoginResponse } from '../models/LoginResponse' import { LoginViaVerificationCode } from '../models/LoginViaVerificationCode' @@ -74,10 +72,8 @@ export class UserResolver { return 'success' } - @Query(() => CreateResponse) - async create( - @Args() { email, firstName, lastName, password }: CreateUserArgs, - ): Promise { + @Query(() => String) + async create(@Args() { email, firstName, lastName, password }: CreateUserArgs): Promise { const payload = { email, first_name: firstName, @@ -90,7 +86,7 @@ export class UserResolver { if (!result.success) { throw new Error(result.data) } - return new CreateResponse(result.data) + return 'success' } // TODO @@ -120,11 +116,11 @@ export class UserResolver { return apiPost(CONFIG.LOGIN_API_URL + 'getUserInfos', payload) } - @Query(() => ResetPasswordResponse) + @Query(() => String) async resetPassword( @Args() { sessionId, email, password }: ChangePasswordArgs, - ): Promise { + ): Promise { const payload = { session_id: sessionId, email, @@ -132,7 +128,7 @@ export class UserResolver { } const result = await apiPost(CONFIG.LOGIN_API_URL + 'resetPassword', payload) if (!result.success) throw new Error(result.data) - return new ResetPasswordResponse(result.data) + return 'sucess' } @Query(() => UpdateUserInfosResponse) From 729aa02035b567c02da8200743a68042377cba79 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 3 Aug 2021 18:54:31 +0200 Subject: [PATCH 48/50] fix update user infos --- backend/src/graphql/inputs/LoginUserInput.ts | 15 ++++++----- backend/src/graphql/resolvers/UserResolver.ts | 26 ++++++++++--------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 68ddad628..1668c5191 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -82,22 +82,25 @@ export class UpdateUserInfosArgs { @Field(() => String) email!: string - @Field(() => String) + @Field({ nullable: true }) firstName?: string - @Field(() => String) + @Field({ nullable: true }) lastName?: string - @Field(() => String) + @Field({ nullable: true }) + description?: string + + @Field({ nullable: true }) username?: string - @Field(() => String) + @Field({ nullable: true }) language?: string - @Field(() => String) + @Field({ nullable: true }) password?: string - @Field(() => String) + @Field({ nullable: true }) passwordNew?: string } diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index 4361bd0ed..c50b8d9f0 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -137,24 +137,26 @@ export class UserResolver { { sessionId, email, - firstName = '', - lastName = '', - username = '', - language = '', - password = '', - passwordNew = '', + firstName, + lastName, + description, + username, + language, + password, + passwordNew, }: UpdateUserInfosArgs, ): Promise { const payload = { session_id: sessionId, email, update: { - 'User.first_name': firstName !== '' ? firstName : undefined, - 'User.last_name': lastName !== '' ? lastName : undefined, - 'User.username': username !== '' ? username : undefined, - 'User.language': language !== '' ? language : undefined, - 'User.password': passwordNew !== '' ? passwordNew : undefined, - 'User.password_old': password !== '' ? password : undefined, + 'User.first_name': firstName || undefined, + 'User.last_name': lastName || undefined, + 'User.description': description || undefined, + 'User.username': username || undefined, + 'User.language': language || undefined, + 'User.password': passwordNew || undefined, + 'User.password_old': password || undefined, }, } const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload) From 403826a6d9ad5e512ce29b1b2f2cb4ac43c3caa8 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 4 Aug 2021 11:51:50 +0200 Subject: [PATCH 49/50] final changes before merge --- backend/src/apis/loginAPI.ts | 2 - backend/src/graphql/inputs/LoginUserInput.ts | 31 +------------- .../src/graphql/inputs/TransactionInput.ts | 24 ++--------- backend/src/graphql/models/Decay.ts | 10 ++--- backend/src/graphql/models/Server.ts | 16 -------- backend/src/graphql/models/Transaction.ts | 7 +++- backend/src/graphql/models/UserInfoData.ts | 40 ------------------- backend/src/graphql/resolvers/UserResolver.ts | 9 ++--- 8 files changed, 17 insertions(+), 122 deletions(-) delete mode 100644 backend/src/graphql/models/Server.ts delete mode 100644 backend/src/graphql/models/UserInfoData.ts diff --git a/backend/src/apis/loginAPI.ts b/backend/src/apis/loginAPI.ts index 965b1ccfc..c1f99dc46 100644 --- a/backend/src/apis/loginAPI.ts +++ b/backend/src/apis/loginAPI.ts @@ -32,8 +32,6 @@ export const apiGet = async (url: string): Promise => { return { success: true, data: result.data } }) .catch((error) => { - // eslint-disable-next-line no-console - console.log('IN apiGet.ERROR: ', { success: false, result: error }) return { success: false, data: error.message } }) } diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 1668c5191..3d5299d84 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -1,22 +1,5 @@ import { ArgsType, Field } from 'type-graphql' -/* -@InputType() -export class LoginUserInput { - @Field({ nullable: true }) - username?: string - - @Field({ nullable: true }) - email?: string - - @Field({ nullable: true }) - pubkey?: string - - @Field() - password: string -} -*/ - @ArgsType() export class UnsecureLoginArgs { @Field(() => String) @@ -41,18 +24,6 @@ export class CreateUserArgs { password: string } -@ArgsType() -export class SendEmailArgs { - @Field(() => String) - email: string - - @Field(() => Number) - emailText: number - - @Field(() => String) - emailVerificationCodeType: string -} - @ArgsType() export class GetUserInfoArgs { @Field(() => Number) @@ -109,6 +80,6 @@ export class CheckUsernameArgs { @Field(() => String) username: string - @Field(() => Number) + @Field(() => Number, { nullable: true }) groupId?: number } diff --git a/backend/src/graphql/inputs/TransactionInput.ts b/backend/src/graphql/inputs/TransactionInput.ts index 049a9b2a9..7f83cd82d 100644 --- a/backend/src/graphql/inputs/TransactionInput.ts +++ b/backend/src/graphql/inputs/TransactionInput.ts @@ -1,14 +1,14 @@ -import { ArgsType, Field } from 'type-graphql' +import { ArgsType, Field, Int } from 'type-graphql' @ArgsType() export class TransactionListInput { @Field(() => Number) sessionId: number - @Field(() => Number) + @Field(() => Int) firstPage: number - @Field(() => Number) + @Field(() => Int) items: number @Field(() => String) @@ -29,21 +29,3 @@ export class TransactionSendArgs { @Field(() => String) memo: string } - -@ArgsType() -export class TransactionCreateArgs { - @Field(() => Number) - sessionId: number - - @Field(() => String) - email: string - - @Field(() => Number) - amount: number - - @Field(() => String) - memo: string - - @Field(() => Date) - targetDate: Date -} diff --git a/backend/src/graphql/models/Decay.ts b/backend/src/graphql/models/Decay.ts index 3d918ce7a..c6ce85548 100644 --- a/backend/src/graphql/models/Decay.ts +++ b/backend/src/graphql/models/Decay.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { ObjectType, Field } from 'type-graphql' +import { ObjectType, Field, Int } from 'type-graphql' @ObjectType() export class Decay { @@ -14,12 +14,12 @@ export class Decay { @Field(() => Number) balance: number - @Field({ nullable: true }) + @Field(() => Int, { nullable: true }) decayStart?: number - @Field({ nullable: true }) + @Field(() => Int, { nullable: true }) decayEnd?: number - @Field(() => String) - decayDuration: string + @Field(() => String, { nullable: true }) + decayDuration?: string } diff --git a/backend/src/graphql/models/Server.ts b/backend/src/graphql/models/Server.ts deleted file mode 100644 index 1b6f01627..000000000 --- a/backend/src/graphql/models/Server.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity } from 'typeorm' -import { ObjectType, Field } from 'type-graphql' - -@Entity() -@ObjectType() -export class Server extends BaseEntity { - constructor(json: any) { - super() - this.loginServerPath = json.login_server_path - } - - @Field(() => String) - loginServerPath: string -} diff --git a/backend/src/graphql/models/Transaction.ts b/backend/src/graphql/models/Transaction.ts index 61670b06a..fb17866c4 100644 --- a/backend/src/graphql/models/Transaction.ts +++ b/backend/src/graphql/models/Transaction.ts @@ -11,6 +11,7 @@ import { Decay } from './Decay' @ObjectType() export class Transaction { constructor(json: any) { + // console.log('Transaction constructor', json) this.type = json.type this.balance = Number(json.balance) this.decayStart = json.decay_start @@ -21,7 +22,7 @@ export class Transaction { this.name = json.name this.email = json.email this.date = json.date - this.decay = json.decay + this.decay = json.decay ? new Decay(json.decay) : undefined } @Field(() => String) @@ -66,7 +67,9 @@ export class TransactionList { this.balance = Number(json.balance) this.decay = Number(json.decay) this.decayDate = json.decay_date - this.transactions = json.transactions + this.transactions = json.transactions.map((el: any) => { + return new Transaction(el) + }) } @Field(() => Number) diff --git a/backend/src/graphql/models/UserInfoData.ts b/backend/src/graphql/models/UserInfoData.ts deleted file mode 100644 index 2e65aca82..000000000 --- a/backend/src/graphql/models/UserInfoData.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { Entity, BaseEntity } from 'typeorm' -import { ObjectType, Field } from 'type-graphql' -import { Server } from './Server' -import { User } from './User' - -@Entity() -@ObjectType() -export class UserInfoData extends BaseEntity { - constructor(json: any) { - super() - this.state = json.state - this.userData = new User(json.user_data) - this.server = new Server(json.server) - this.errors = json.errors - } - - @Field(() => String) - state: string - - @Field(() => User) - userData: User - - @Field(() => Server) - server: Server - - @Field(() => [String]) - errors: [string] -} - -@Entity() -@ObjectType() -export class GetUserInfoResponse extends BaseEntity { - @Field(() => Boolean) - success: boolean - - @Field(() => UserInfoData) - data: UserInfoData -} diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index c50b8d9f0..acd70ab5c 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -12,7 +12,6 @@ import { CheckUsernameArgs, CreateUserArgs, GetUserInfoArgs, - SendEmailArgs, UnsecureLoginArgs, UpdateUserInfosArgs, } from '../inputs/LoginUserInput' @@ -89,16 +88,14 @@ export class UserResolver { return 'success' } - // TODO @Query(() => SendPasswordResetEmailResponse) async sendResetPasswordEmail( - @Args() - { email, emailText = 7, emailVerificationCodeType = 'resetPassword' }: SendEmailArgs, + @Arg('email') email: string, ): Promise { const payload = { email, - email_text: emailText, - email_verification_code_type: emailVerificationCodeType, + email_text: 7, + email_verification_code_type: 'resetPassword', } const response = await apiPost(CONFIG.LOGIN_API_URL + 'sendEmail', payload) if (!response.success) throw new Error(response.data) From 8ad64d85a06b630a69cb9240de637d35c3c757d8 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 4 Aug 2021 11:58:15 +0200 Subject: [PATCH 50/50] remove remains of GetUserInfo --- backend/src/graphql/inputs/LoginUserInput.ts | 9 --------- backend/src/graphql/resolvers/UserResolver.ts | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/backend/src/graphql/inputs/LoginUserInput.ts b/backend/src/graphql/inputs/LoginUserInput.ts index 3d5299d84..19326689e 100644 --- a/backend/src/graphql/inputs/LoginUserInput.ts +++ b/backend/src/graphql/inputs/LoginUserInput.ts @@ -24,15 +24,6 @@ export class CreateUserArgs { password: string } -@ArgsType() -export class GetUserInfoArgs { - @Field(() => Number) - sessionId: number - - @Field(() => String) - email: string -} - @ArgsType() export class ChangePasswordArgs { @Field(() => Number) diff --git a/backend/src/graphql/resolvers/UserResolver.ts b/backend/src/graphql/resolvers/UserResolver.ts index acd70ab5c..cad1642f1 100644 --- a/backend/src/graphql/resolvers/UserResolver.ts +++ b/backend/src/graphql/resolvers/UserResolver.ts @@ -2,7 +2,6 @@ import { Resolver, Query, Args, Arg } from 'type-graphql' import CONFIG from '../../config' import { CheckUsernameResponse } from '../models/CheckUsernameResponse' -import { GetUserInfoResponse } from '../models/UserInfoData' import { LoginResponse } from '../models/LoginResponse' import { LoginViaVerificationCode } from '../models/LoginViaVerificationCode' import { SendPasswordResetEmailResponse } from '../models/SendPasswordResetEmailResponse' @@ -11,7 +10,6 @@ import { ChangePasswordArgs, CheckUsernameArgs, CreateUserArgs, - GetUserInfoArgs, UnsecureLoginArgs, UpdateUserInfosArgs, } from '../inputs/LoginUserInput' @@ -102,17 +100,6 @@ export class UserResolver { return new SendPasswordResetEmailResponse(response.data) } - @Query(() => GetUserInfoResponse) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - async getUserInfos(@Args() { sessionId, email }: GetUserInfoArgs): Promise { - const payload = { - session_id: sessionId, - email: email, - ask: ['user.first_name', 'user.last_name'], - } - return apiPost(CONFIG.LOGIN_API_URL + 'getUserInfos', payload) - } - @Query(() => String) async resetPassword( @Args()