diff --git a/client/package-lock.json b/client/package-lock.json index 2dba35e..840bb2c 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1951,6 +1951,88 @@ } } }, + "@popperjs/core": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==" + }, + "@react-aria/ssr": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.1.2.tgz", + "integrity": "sha512-amXY11ImpokvkTMeKRHjsSsG7v1yzzs6yeqArCyBIk60J3Yhgxwx9Cah+Uu/804ATFwqzN22AXIo7SdtIaMP+g==", + "requires": { + "@babel/runtime": "^7.6.2" + } + }, + "@react-navigation/core": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-6.1.1.tgz", + "integrity": "sha512-njysuiqztgvR1Z9Noxk2OGJfYtFGFDRyji5Vmm1jHzlql0m+q0wh1dUiyaIEtTyrhFXr/YNgdrKuiPaU9Jp8OA==", + "requires": { + "@react-navigation/routers": "^6.1.0", + "escape-string-regexp": "^4.0.0", + "nanoid": "^3.1.23", + "query-string": "^7.0.0", + "react-is": "^16.13.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + } + } + }, + "@react-navigation/native": { + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-6.0.8.tgz", + "integrity": "sha512-6022M3+Btok3xJC/49B88er3SRrlDAZ4FdmGndhEVvBcGSHWmscU2qKCwFd0RY6A0AGCVmdIlXudrfdcdRAkpQ==", + "requires": { + "@react-navigation/core": "^6.1.1", + "escape-string-regexp": "^4.0.0", + "fast-deep-equal": "^3.1.3", + "nanoid": "^3.1.23" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + } + } + }, + "@react-navigation/routers": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@react-navigation/routers/-/routers-6.1.0.tgz", + "integrity": "sha512-8xJL+djIzpFdRW/sGlKojQ06fWgFk1c5jER9501HYJ12LF5DIJFr/tqBI2TJ6bk+y+QFu0nbNyeRC80OjRlmkA==", + "requires": { + "nanoid": "^3.1.23" + } + }, + "@restart/hooks": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.6.tgz", + "integrity": "sha512-FzpEzy6QeLB3OpUrC9OQD/lWCluQmilLfRGa/DqbB6OmV05AEt/0Lgn3Jf6l27UIJMK0qFmNcps6p8DNLXa6Pw==", + "requires": { + "dequal": "^2.0.2" + } + }, + "@restart/ui": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.2.0.tgz", + "integrity": "sha512-oIh2t3tG8drZtZ9SlaV5CY6wGsUViHk8ZajjhcI+74IQHyWy+AnxDv8rJR5wVgsgcgrPBUvGNkC1AEdcGNPaLQ==", + "requires": { + "@babel/runtime": "^7.13.16", + "@popperjs/core": "^2.10.1", + "@react-aria/ssr": "^3.0.1", + "@restart/hooks": "^0.4.0", + "@types/warning": "^3.0.0", + "dequal": "^2.0.2", + "dom-helpers": "^5.2.0", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -2440,6 +2522,11 @@ "@types/node": "*" } }, + "@types/invariant": { + "version": "2.2.35", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", + "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==" + }, "@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -2538,6 +2625,14 @@ "@types/react": "*" } }, + "@types/react-transition-group": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz", + "integrity": "sha512-7gAPz7anVK5xzbeQW9wFBDg7G++aPLAFY0QaSMOou9rJZpbuI58WAuJrgu+qR92l61grlnCUe7AFX8KGahAgug==", + "requires": { + "@types/react": "*" + } + }, "@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -2599,6 +2694,11 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==" }, + "@types/warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", + "integrity": "sha1-DSUBJorY+ZYrdA04fEZU9fjiPlI=" + }, "@types/ws": { "version": "8.5.2", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.2.tgz", @@ -3076,6 +3176,11 @@ "@babel/runtime-corejs3": "^7.10.2" } }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" + }, "array-flatten": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", @@ -3519,6 +3624,11 @@ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, + "bootstrap": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", + "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -3712,6 +3822,11 @@ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==" }, + "classnames": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz", + "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==" + }, "clean-css": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.4.tgz", @@ -3951,6 +4066,23 @@ "yaml": "^1.10.0" } }, + "create-react-class": { + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.7.0.tgz", + "integrity": "sha512-QZv4sFWG9S5RUvkTYWbflxeZX+JG7Cz0Tn33rQBJ+WFQTqTfUTjMjiv9tnfXazjsO5r0KhPs+AqCjyrQX6h2ng==", + "requires": { + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" + } + }, + "cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "requires": { + "node-fetch": "2.6.7" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -4017,6 +4149,15 @@ "postcss-selector-parser": "^6.0.9" } }, + "css-in-js-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz", + "integrity": "sha512-PJF0SpJT+WdbVVt0AOYp9C8GnuruRlL/UFW7932nLWmFLQTaWEzTBQEx7/hn4BuV+WON75iAViSUJLiU3PKbpA==", + "requires": { + "hyphenate-style-name": "^1.0.2", + "isobject": "^3.0.1" + } + }, "css-loader": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.7.1.tgz", @@ -4371,6 +4512,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "dequal": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", + "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==" + }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -4486,6 +4632,15 @@ "utila": "~0.4" } }, + "dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "requires": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -5374,6 +5529,35 @@ "bser": "2.1.1" } }, + "fbjs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-3.0.4.tgz", + "integrity": "sha512-ucV0tDODnGV3JCnnkmoszb5lf4bNpzjv80K41wd4k798Etq+UYD0y0TIfalLjZoKgjive6/adkRnszwapiDgBQ==", + "requires": { + "cross-fetch": "^3.1.5", + "fbjs-css-vars": "^1.0.0", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.30" + }, + "dependencies": { + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "requires": { + "asap": "~2.0.3" + } + } + } + }, + "fbjs-css-vars": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz", + "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==" + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -5412,6 +5596,11 @@ "to-regex-range": "^5.0.1" } }, + "filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=" + }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -6023,6 +6212,11 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, + "hyphenate-style-name": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", + "integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==" + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -6106,6 +6300,14 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, + "inline-style-prefixer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-6.0.1.tgz", + "integrity": "sha512-AsqazZ8KcRzJ9YPN1wMH2aNM7lkWQ8tSPrW5uDk1ziYwiAPWSZnUsC7lfZq+BDqLqz0B4Pho5wscWcJzVvRzDQ==", + "requires": { + "css-in-js-utils": "^2.0.0" + } + }, "internal-slot": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", @@ -6116,6 +6318,14 @@ "side-channel": "^1.0.4" } }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -6338,6 +6548,11 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, "istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", @@ -8129,6 +8344,35 @@ } } }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } + }, "node-forge": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz", @@ -8144,6 +8388,11 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==" }, + "normalize-css-color": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/normalize-css-color/-/normalize-css-color-1.0.2.tgz", + "integrity": "sha1-Apkel8zOxmI/5XOvu/Deah8+n40=" + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -9309,6 +9558,15 @@ "react-is": "^16.13.1" } }, + "prop-types-extra": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", + "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", + "requires": { + "react-is": "^16.3.2", + "warning": "^4.0.0" + } + }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -9345,6 +9603,17 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==" }, + "query-string": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.1.tgz", + "integrity": "sha512-MplouLRDHBZSG9z7fpuAAcI7aAYjDLhtsiVZsevsfaHWDS2IDdORKbSd1kWUA+V4zyva/HZoSfpwnYMMQDhb0w==", + "requires": { + "decode-uri-component": "^0.2.0", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + } + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -9416,6 +9685,29 @@ "whatwg-fetch": "^3.6.2" } }, + "react-bootstrap": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.2.3.tgz", + "integrity": "sha512-gXsAEBdDUHnOpJ2C+DDQ4mFt7tN6u6qWnTH3tqiE9jUvV6gGY8uHFp0iGBsM+yjrBwmR6bqCBFh8Z82aQj1LSw==", + "requires": { + "@babel/runtime": "^7.17.2", + "@restart/hooks": "^0.4.6", + "@restart/ui": "^1.2.0", + "@types/invariant": "^2.2.35", + "@types/prop-types": "^15.7.4", + "@types/react": ">=16.14.8", + "@types/react-transition-group": "^4.4.4", + "@types/warning": "^3.0.0", + "classnames": "^2.3.1", + "dom-helpers": "^5.2.1", + "invariant": "^2.2.4", + "prop-types": "^15.8.1", + "prop-types-extra": "^1.1.0", + "react-transition-group": "^4.4.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "react-dev-utils": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.0.tgz", @@ -9527,6 +9819,25 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + }, + "react-native-web": { + "version": "0.17.7", + "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.17.7.tgz", + "integrity": "sha512-4OOU/QjyRySOXyHfTvljEMS4VXKn42Qs3y9uHDPMwaCUFjwg0oasR/j706OaVgan9kF4Ipa2vJ3F6Z/Xqy8KeQ==", + "requires": { + "array-find-index": "^1.0.2", + "create-react-class": "^15.7.0", + "fbjs": "^3.0.0", + "hyphenate-style-name": "^1.0.4", + "inline-style-prefixer": "^6.0.0", + "normalize-css-color": "^1.0.2", + "prop-types": "^15.6.0" + } + }, "react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -9612,12 +9923,15 @@ "clsx": "^1.1.1" } }, - "react-use-navigate": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/react-use-navigate/-/react-use-navigate-0.1.1.tgz", - "integrity": "sha512-FjSKKHmTy0DA0KBGsNlN97HVha3L3WCTRfXG2lucrgWjQGzqZZTKQ2FdCOZgE+rkBdBTAM6PLEV9MfUdm6MHlQ==", + "react-transition-group": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", + "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", "requires": { - "minimatch": "^3.0.4" + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" } }, "readable-stream": { @@ -10161,6 +10475,11 @@ "send": "0.17.2" } }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -10314,6 +10633,11 @@ "wbuf": "^1.7.3" } }, + "split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==" + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -10349,6 +10673,11 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" + }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -10869,6 +11198,11 @@ "is-typedarray": "^1.0.0" } }, + "ua-parser-js": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", + "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==" + }, "unbox-primitive": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", @@ -10880,6 +11214,17 @@ "which-boxed-primitive": "^1.0.2" } }, + "uncontrollable": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", + "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", + "requires": { + "@babel/runtime": "^7.6.3", + "@types/react": ">=16.9.11", + "invariant": "^2.2.4", + "react-lifecycles-compat": "^3.0.4" + } + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -10940,11 +11285,6 @@ "punycode": "^2.1.0" } }, - "use-navigation": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/use-navigation/-/use-navigation-0.0.3.tgz", - "integrity": "sha512-pWyFyDS2ToNXrbQRJG9EySX3TtqhwGpFUt26tXVRgE/lK0Q2fUKV+J6RRqUbMgXXpBBnT8WPQkziUOpfKs71sA==" - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -11027,6 +11367,14 @@ "makeerror": "1.0.12" } }, + "warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "watchpack": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", diff --git a/client/package.json b/client/package.json index 465f25e..9a83b77 100644 --- a/client/package.json +++ b/client/package.json @@ -3,19 +3,21 @@ "version": "0.1.0", "private": true, "dependencies": { + "@react-navigation/native": "^6.0.8", "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.3", "@testing-library/user-event": "^13.5.0", + "bootstrap": "^5.1.3", "encrypt-storage": "^2.2.6", "react": "^17.0.2", + "react-bootstrap": "^2.2.3", "react-dom": "^17.0.2", "react-icons": "^4.3.1", + "react-native-web": "^0.17.7", "react-router-dom": "^6.2.2", "react-scripts": "5.0.0", "react-toastify": "^8.2.0", - "react-use-navigate": "^0.1.1", "styled-components": "^5.3.3", - "use-navigation": "0.0.3", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/client/public/index.html b/client/public/index.html index ce9a6b0..3b5d387 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -18,11 +18,24 @@ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" /> - + Essential Health -
+
+ + + diff --git a/client/src/App.css b/client/src/App.css index d5d1771..ec3cc50 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -1,8 +1,13 @@ @import url("https://fonts.googleapis.com/css2?family=Sora&display=swap"); - * { - font-family: "Sora", sans-serif; - box-sizing: border-box; - margin: 0; - padding: 0; + font-family: "Sora", sans-serif; + box-sizing: border-box; + margin: 0; + padding: 0; } +.background { + background-image: url("components/pictures/peace.jpg"); + background-size: "cover"; + background-repeat: "no-repeat"; + height: 100vh; +} \ No newline at end of file diff --git a/client/src/App.js b/client/src/App.js index 76148ad..c5a8de2 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -8,21 +8,24 @@ import { Route, Navigate, } from "react-router-dom"; + import Home from "./components/Home"; import Login from "./components/Login"; import Register from "./components/Register"; import PersonalForm from "./components/PersonalForm"; -import MedicalForm from "./components/MedicalForm"; -import Navbar from "./components/Navbar/nav"; - - +import Navbar from "./components/navbar"; import { encryptStorage } from "../src/components/encrypt"; +import MedicalForm from "./components/MedicalForm"; +import ListPersonalForm from "./components/ListPersonalForm"; +import Results from "./components/Results" toast.configure(); -function App(props) { - // const [username, setUsername] = useState(""); + +function App() { + const [username, setUsername] = useState(""); const [user_id, setuserid] = useState(""); // we want to make sure it set to false first const [isAuthenticated, setAuthenticated] = useState(false); + //this is going to the be toggle function to set the auth const setAuth = (Boolean) => { setAuthenticated(Boolean); //this will change the state @@ -31,7 +34,7 @@ function App(props) { async function isAuth() { try { //check if the user is still validated - const response = await fetch("http://localhost:4001/auth/is-verify", { + const response = await fetch("http://localhost:3005/auth/is-verify", { method: "GET", headers: { token: localStorage.token }, }); @@ -45,6 +48,10 @@ function App(props) { } useEffect(() => { isAuth(); + //in the login comp we are setting user id + // this app.js we are doing reading the value user id val that was set in the login comp + // and setting the user id value of the app comp to value from what we receive the + // encrypt storage const storedUserID = encryptStorage.getItem("user_id"); //const value = encryptStorage.decryptString(storedUserID); setuserid(storedUserID); // @@ -53,9 +60,11 @@ function App(props) { return ( - - {/* reason why we use render instead of component props is because - anytime we send props to a component we don't want it to remount /} +
+ + {/* reason why we use render instead of component props is because + anytime we send props to a component we don't want it to remount /} + !isAuthenticated ? ( @@ -65,66 +74,90 @@ function App(props) { ) */} -
- - - ) : ( - - ) - } - /> - - ) : ( - - ) - } - /> - - ) : ( - - ) - } - /> - - ) : ( - - ) - } - /> - - ) : ( - - ) - } - /> - {/* }/> */} - {/* {/ } /> */} - +
+ + + ) : ( + + ) + } + /> + + ) : ( + + ) + } + /> + + ) : ( + + ) + } + /> + + ) : ( + + ) + } + /> + + ) : ( + + ) + } + /> + + ) : ( + + ) + } + /> + + ) : ( + + ) + } + /> + + {/* }/> */} + {/* {/ } /> */} + +
diff --git a/client/src/components/EditMForm.js b/client/src/components/EditMForm.js new file mode 100644 index 0000000..dae79ac --- /dev/null +++ b/client/src/components/EditMForm.js @@ -0,0 +1,94 @@ +import React, { useState, setShow } from "react"; +import { Button, Form, Modal } from "react-bootstrap"; +function EditMForm(props) { + console.log(props); + const [show, setShow] = useState(false); + + const handleClose = () => setShow(false); + const handleShow = () => setShow(true); + + const handleSubmit = async function (event) { + console.log(event); + event.preventDefault(); + const userId = props.MedicalForm.user_id; + const any_medication = event.target.form.elements.any_medication.value; + const medication_description = + event.target.form.elements.medication_description.value; + const insurance = event.target.form.elements.insurance.value; + // const phoneNumber = event.target.form.elements.phoneNumber.value; + + const body = { any_medication, medication_description, insurance }; + const response = await fetch( + `http://localhost:3005/MForm/update/${userId}`, + { + method: "PUT", + headers: { + "Content-Type": "application/json", + token: localStorage.token, + }, + body: JSON.stringify(body), + } + ); + console.log(response); + }; + + return ( + <> + + + + + Modal heading + + +
+ + First Name + + + + Last Name + + + + Occupation + + + + + +
+
+ + {/* */} + {/* + */} + +
+ + ); +} + +export default EditMForm; diff --git a/client/src/components/EditPersonalForm.js b/client/src/components/EditPersonalForm.js new file mode 100644 index 0000000..a4f8bac --- /dev/null +++ b/client/src/components/EditPersonalForm.js @@ -0,0 +1,136 @@ +import React, { useState, setShow } from "react"; +import { Button, Form, Modal } from "react-bootstrap"; +function EditPersonalForm(props) { + console.log(props); + const [show, setShow] = useState(false); + + const handleClose = () => setShow(false); + const handleShow = () => setShow(true); + + const handleSubmit = async function (event) { + console.log(event) + event.preventDefault(); + const userId = props.personalForm.user_id; + const firstName = event.target.form.elements.firstName.value; + const lastName = event.target.form.elements.lastName.value; + const occupation = event.target.form.elements.occupation.value; + const phoneNumber = event.target.form.elements.phoneNumber.value; + const pronoun = event.target.form.elements.pronoun.value; + const state = event.target.form.elements.state.value; + const city = event.target.form.elements.city.value; + const zip = event.target.form.elements.zip.value; + + const body = { firstName, lastName, occupation, phoneNumber, pronoun, state, city, zip }; + const response = await fetch( + `http://localhost:3005/pform/update/${userId}`, + { + method: "PUT", + headers: { + "Content-Type": "application/json", + token: localStorage.token, + }, + body: JSON.stringify(body), + } + ); + console.log(response); + }; + + return ( + <> + + + + + Modal heading + + +
+ + First Name + + + + Last Name + + + + Occupation + + + + Phone Number + + + + Pronoun + + + + State + + + + City + + + + Zip + + + + +
+
+ + {/* */} + {/* + */} + +
+ + ); +} + +export default EditPersonalForm; diff --git a/client/src/components/EditPersonalFormTwo.js b/client/src/components/EditPersonalFormTwo.js new file mode 100644 index 0000000..c1583c2 --- /dev/null +++ b/client/src/components/EditPersonalFormTwo.js @@ -0,0 +1,275 @@ +import React, { Fragment, useState } from "react"; + +//we want to send in a prop +const EditPersonalForm = (props) => { + const [updatePform, setupdatePform] = useState([props.personalForm]); + console.log(props.personalForm); + console.log("this is the form ", {updatePform}); + //now we are going to create an edit function that will send the data to the backend + + const updatePersonalForm = async (e) => { + // e.preventDefault(); + + + try { + //console.log("this is the props", props.personalForm); + const body = { updatePform }; + console.log("this is in the try ",updatePform) + const response = await fetch( + `http://localhost:3005/pform/update/${updatePform[0].user_id}`, + { + method: "PUT", + headers: { + "Content-Type": "application/json", + token: localStorage.token, + }, + body: JSON.stringify(body), + } + ); + // const parseRes = await response.json(); + // //console.log(parseRes); + // //setupdatePform(parseRes) + // // window.location = "/home"; + } catch (err) { + console.error(err.message); + } + }; + // console.log({updatePform}); + // console.log(updatePform[0].first_name) + //console.log(updatePform.first_name) + return ( + + {/* */} + + + {/* */} + + {/* */} + {/* + + + + +
+
+
+
+

Edit Anime

+ +
+
+ setupdatePform(e.target.value)} + /> + setupdatePform(e.target.value)} + /> + setupdatePform(e.target.value)} + /> + setupdatePform(e.target.value)} + /> + setupdatePform(e.target.value)} + /> + setupdatePform(e.target.value)} + /> + setupdatePform(e.target.value)} + /> + setupdatePform(e.target.value)} + /> +
+ + + +
+
+
+
+
+ + + + + + */} +
+ ); +}; + +export default EditPersonalForm; diff --git a/client/src/components/Home.js b/client/src/components/Home.js index 4199c7d..7505ca3 100644 --- a/client/src/components/Home.js +++ b/client/src/components/Home.js @@ -1,51 +1,36 @@ import React, { Fragment, useState, useEffect } from "react"; import { toast } from "react-toastify"; - -import { encryptStorage } from "./encrypt"; +import "./pagecss/home.css"; const Home = ({ setAuth }) => { const [username, setUsername] = useState(""); - const [user_id, setuserid] = useState(""); + // const [user_id, setuserid] = useState(""); // const [personalForm, setpersonalForm] = useState([]);// // const [Pform, setform] = useState(false); async function getUsername() { try { - const response = await fetch("http://localhost:4001/home/", { + const response = await fetch("http://localhost:3005/home/", { method: "GET", //pass token with localstorage because it is stored in the header headers: { token: localStorage.token }, }); - const parseRes = await response.json(); // setpersonalForm(parseData); setUsername(parseRes.username); - setuserid(parseRes.user_id); // + // setuserid(parseRes.user_id); // // const encryptStorage = new EncryptStorage('secret-key'); - encryptStorage.setItem("user_id", parseRes.user_id); + // removed the localstorage user id console.log(parseRes); } catch (err) { console.error(err.message); } } - //going to make a request when we get to this component, this is for getting from database useEffect(() => { getUsername(); }, []); - return ( -
+

Welcome,{username}

There are a lot of people in this world that do not recieve the right @@ -56,9 +41,17 @@ const Home = ({ setAuth }) => { clinic and pick the desired one based on the clinic, as well as give a review.

+
+

There are a lot of people in this world that do not recieve the right + help. Essential Health is designed to help improve your mental health + by matching you to the best therapist based on you occupation. We are + consistantly providing as much resources as possible to help improve + your mental health. Also you are able to look at the reviews of the + clinic and pick the desired one based on the clinic, as well as give a + review.

+
); }; - export default Home; diff --git a/client/src/components/ListMedicalForm.js b/client/src/components/ListMedicalForm.js new file mode 100644 index 0000000..b3643db --- /dev/null +++ b/client/src/components/ListMedicalForm.js @@ -0,0 +1,79 @@ +// import React, { Fragment, useState, useEffect } from "react"; +// import { toast } from "react-toastify"; + +// const ListMedicalForm = (props) => { +// console.log(props) +// // const [insperational_message, setinsperational_message] = useState(""); +// // const [insperational_message_id, setinsperational_message_id] = useState(""); +// const [MedicalForm, setMedicalForm] = useState([]); + +// const getForm = async () => { +// try { +// // console.log(props) +// const response = await fetch( +// `http://localhost:3005/MForm/getMform/${props.user_id}`, +// { +// headers: { +// token: localStorage.token, +// }, +// } +// ); +// ///console.log(response.status); +// const parseRes = await response.json(); +// console.log(parseRes); +// //console.log(parseRes.data.personal_information); +// setMedicalForm(parseRes.data.medical_information); +// console.log(parseRes); +// } catch (err) { +// console.error(err.message); +// } +// }; +// //console.log(personalForm); + + +// //going to make a request when we get to this component, this is for getting from database +// useEffect(() => { +// getForm(); +// }, []); + +// return ( +// +// +// +// +// +// +// +// +// +// +// +// +// {/* +// +// +// +// */} + +// +// +// +// +// {/* */} +// {/* */} +// +// +// +//
any_medicationmedical_descriptioninsuranceEditDelete
JohnDoejohn@example.com
{MedicalForm.any_medication}{MedicalForm.medication_description}{MedicalForm.insurance} +// {/* */} +//
+//
+// ); +// }; + +// export default ListMedicalForm; diff --git a/client/src/components/ListPersonalForm.js b/client/src/components/ListPersonalForm.js new file mode 100644 index 0000000..507ce94 --- /dev/null +++ b/client/src/components/ListPersonalForm.js @@ -0,0 +1,145 @@ +import React, { Fragment, useState, useEffect } from "react"; +import EditPersonalForm from "./EditPersonalForm"; +import { toast } from "react-toastify"; +import EditMForm from "./EditMForm"; +const ListPersonalForm = (props) => { + // const [insperational_message, setinsperational_message] = useState(""); + // const [insperational_message_id, setinsperational_message_id] = useState(""); + const [personalForm, setPersonalForm] = useState([]); + const [MedicalForm, setMedicalForm] = useState([]); + + const getForm = async () => { + try { + // console.log(props) + const response = await fetch( + `http://localhost:3005/pform/getting/${props.user_id}`, + { + headers: { + token: localStorage.token, + }, + } + ); + ///console.log(response.status); + const parseRes = await response.json(); + console.log(parseRes); + //console.log(parseRes.data.personal_information); + setPersonalForm(parseRes.data.personal_information); + } catch (err) { + console.error(err.message); + } + }; + //console.log(personalForm); + + const getMForm = async () => { + try { + // console.log(props) + const response = await fetch( + `http://localhost:3005/MForm/getMform/${props.user_id}`, + { + headers: { + token: localStorage.token, + }, + } + ); + ///console.log(response.status); + const parseRes = await response.json(); + console.log(parseRes); + //console.log(parseRes.data.personal_information); + setMedicalForm(parseRes.data.medical_information); + console.log(parseRes); + } catch (err) { + console.error(err.message); + } + }; + + //going to make a request when we get to this component, this is for getting from database + useEffect(() => { + getForm(); + getMForm(); + }, []); + + return ( + + + + + + + + + + + + + + + + + {/* + + + + */} + + + + + + + + + + + + {/* */} + + + +
first_namelast_namepronounoccupationphone_numbercitystatezipEdit
JohnDoejohn@example.com
{personalForm.first_name}{personalForm.last_name}{personalForm.pronoun}{personalForm.occupation}{personalForm.phone_number}{personalForm.city}{personalForm.state}{personalForm.zip} + + + {/* */} +
+ + + + + + + + + + + {/* + + + + */} + + + + + + + {/* */} + + + +
any_medicationmedical_descriptioninsuranceEdit
JohnDoejohn@example.com
{MedicalForm.any_medication}{MedicalForm.medication_description}{MedicalForm.insurance} + {/* */} +
+
+ ); +}; + +export default ListPersonalForm; diff --git a/client/src/components/Login.js b/client/src/components/Login.js index e9dc65d..db9f7ce 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -1,8 +1,9 @@ import React, { Fragment, useState } from "react"; -import Message from "./Message"; +import Messages from "./Messages"; import { Link } from "react-router-dom"; import { toast } from "react-toastify"; -import "./pagecss/loginregister.css"; +import "./pagecss/login.css"; +import { encryptStorage } from "./encrypt"; const Login = ({ setAuth }) => { const [inputs, setInputs] = useState({ @@ -21,7 +22,7 @@ const Login = ({ setAuth }) => { try { const body = { email, password }; - const response = await fetch("http://localhost:4001/auth/login", { + const response = await fetch("http://localhost:3005/auth/login", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), @@ -31,6 +32,8 @@ const Login = ({ setAuth }) => { if (parseRes.token) { localStorage.setItem("token", parseRes.token); + console.log(parseRes); + encryptStorage.setItem("user_id", parseRes.user_id); setAuth(true); toast.success("login successfully!"); } else { @@ -44,15 +47,10 @@ const Login = ({ setAuth }) => { }; return ( -
+
- +
{ value={email} onChange={(e) => onChange(e)} /> - { + const [username, setUsername] = useState(""); + const [inputs, setInputs] = useState({ + any_medication: "", + medication_description: "", + insurance: "", + }); + + //creating const objects + const { any_medication, medication_description, insurance } = inputs; + + const onChange = (e) => { + //takes in every input and target the input value of name like + //email, username, and password + setInputs({ ...inputs, [e.target.name]: e.target.value }); + }; + + const onSubmitForm = async (e) => { + e.preventDefault(); + console.log(inputs); + try { + const body = { any_medication, medication_description, insurance }; + + const response = await fetch( + `http://localhost:4001/mform/${props.user_id}`, + { + method: "POST", + //pass token with localstorage because it is stored in the header + // headers: { token: localStorage.token }, + headers: { + "Content-Type": "application/json", + token: localStorage.token, + }, + body: JSON.stringify(body), + } + ); + + const parseRes = await response.json(); + setUsername(parseRes.username); + if (parseRes.token) { + localStorage.setItem("token", parseRes.token); + console.log(parseRes); + props.setAuth(true); + } else { + props.setAuth(false); + toast.error(parseRes); + } + } catch (err) { + console.error(err.message); + } + }; + + return ( + + +

Medical Form

+
Are you using any medication?
+ +
What type of medication?
+ onChange(e)} + /> +
Please name your insurance
+ onChange(e)} + /> + + +
+ ); +}; +export default MedicalForm; diff --git a/client/src/components/Message.js b/client/src/components/Messages.js similarity index 50% rename from client/src/components/Message.js rename to client/src/components/Messages.js index d132971..248d166 100644 --- a/client/src/components/Message.js +++ b/client/src/components/Messages.js @@ -1,16 +1,34 @@ import React, { Fragment, useState, useEffect } from "react"; - -const Message = () => { +import "./pagecss/messages.css"; +const Messages = () => { const [insperational_message, setinsperational_message] = useState(""); const [insperational_message_id, setinsperational_message_id] = useState(""); // async function getMessage() { + // try { + // const response = await fetch(`http://localhost:3005/message/${insperational_message_id}`, { + // method: "GET", + // // headers: { "Content-Type": "application/json" }, + // }); + // console.log(response.status) + // const parseRes = await response.json(); + // console.log(parseRes) + // setinsperational_message_id(parseRes.data.message.insperational_message_id); + // setinsperational_message(parseRes.data.message.insperational_message); + // console.log(insperational_message); + + // //console.log(parseRes); + // } catch (err) { + // console.error(err.message); + // } + // } + const handleClick = async () => { const newID = Math.floor(1 + Math.random() * (5 - 0)); console.log(newID); try { - const response = await fetch(`http://localhost:4001/message/${newID}`, { + const response = await fetch(`http://localhost:3005/message/${newID}`, { method: "GET", // headers: { "Content-Type": "application/json" }, }); @@ -27,35 +45,30 @@ const Message = () => { } catch (err) { console.error(err.message); } + // let random = insperational_message_id + // random = Math.floor(Math.random()*10) + //console.log(insperational_message) }; //going to make a request when we get to this component, this is for getting from database - useEffect(() => {}, []); + useEffect(() => { + // getMessage(); + }, []); return ( -
-

Not feeling like yourself?

-

Here click me

-

{insperational_message}

+
+

Not feeling like yourself

+

{insperational_message}

); }; -export default Message; +export default Messages; diff --git a/client/src/components/Personalform.js b/client/src/components/Personalform.js new file mode 100644 index 0000000..2c58759 --- /dev/null +++ b/client/src/components/Personalform.js @@ -0,0 +1,170 @@ +import React, { Fragment, useState, useEffect } from "react"; +import { Link, useNavigate } from "react-router-dom"; +import { toast } from "react-toastify"; + +const PersonalForm = (props) => { + const [username, setUsername] = useState(""); + const [inputs, setInputs] = useState({ + first_name: "", + last_name: "", + pronoun: "", + occupation: "", + phone_number: "", + city: "", + state: "", + zip: "", + }); + const { + first_name, + last_name, + pronoun, + occupation, + phone_number, + city, + state, + zip, + } = inputs; + const onChange = (e) => { + // take in every input and target the input value of name + //like email,username, and password + setInputs({ ...inputs, [e.target.name]: e.target.value }); + }; + const onSubmitForm = async (e) => { + e.preventDefault(); + try { + const body = { + first_name, + last_name, + pronoun, + occupation, + phone_number, + city, + state, + zip, + }; + // console.log(user_id) + const response = await fetch( + `http://localhost:4001/pform/${props.user_id}`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + token: localStorage.token, + }, + body: JSON.stringify(body), + } + ); + const parseRes = await response.json(); + + setUsername(parseRes.username); + if (parseRes.token) { + // we want to save the token to our local storage + localStorage.setItem("token", parseRes.token); + console.log(parseRes); + //now we want to setAuth to true + props.setAuth(true); + toast.success("submit succesfully"); // then use toastify + } else { + // if false + props.setAuth(false); // set auth to false + toast.error(parseRes); // set the toast to send and error + } + } catch (err) { + console.error(err.message); + } + }; + + return ( + +
+

Personal Form

+ onChange(e)} + /> + onChange(e)} + /> + onChange(e)} + /> + onChange(e)} + /> + onChange(e)} + /> + onChange(e)} + /> + onChange(e)} + /> + onChange(e)} + /> + +
+
+ ); +}; +export default PersonalForm; diff --git a/client/src/components/Register.js b/client/src/components/Register.js index 199e227..dba7302 100644 --- a/client/src/components/Register.js +++ b/client/src/components/Register.js @@ -1,8 +1,8 @@ import React, { Fragment, useState } from "react"; -import Message from "./Message"; +import Messages from "./Messages"; import { Link } from "react-router-dom"; import { ToastContainer, toast } from "react-toastify"; -import "./pagecss/loginregister.css"; +import "./pagecss/register.css"; const Register = ({ setAuth }) => { const [inputs, setInputs] = useState({ @@ -16,24 +16,28 @@ const Register = ({ setAuth }) => { //like email,username, and password setInputs({ ...inputs, [e.target.name]: e.target.value }); }; + // when we submit we dont want the page to refresh const onSubmitForm = async (e) => { e.preventDefault(); try { const body = { email, password, username }; - const response = await fetch("http://localhost:4001/auth/register", { + const response = await fetch("http://localhost:3005/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), }); - const parseRes = await response.json(); if (parseRes.token) { + // we want to save the token to our local storage localStorage.setItem("token", parseRes.token); + // console.log(parseRes); + //now we want to setAuth to true setAuth(true); - toast.success("Registered Successfully!"); + toast.success("Register Successfully"); // then use toastify } else { - setAuth(false); - toast.error(parseRes); + // if false + setAuth(false); // set auth to false + toast.error(parseRes); // set the toast to send and error } } catch (err) { console.error(err.message); @@ -50,11 +54,11 @@ const Register = ({ setAuth }) => { >
- +

Register

diff --git a/client/src/components/Results.js b/client/src/components/Results.js new file mode 100644 index 0000000..740d12b --- /dev/null +++ b/client/src/components/Results.js @@ -0,0 +1,88 @@ +import React, { Fragment, useState, useEffect } from "react"; +import { toast } from "react-toastify"; +// import "./pagecss/home.css"; +//import "./pagecss/results.css" +const Results = (props) => { + const [username, setUsername] = useState(""); + // const [user_id, setuserid] = useState(""); + const [results, setResults] = useState([]); + // const [personalForm, setpersonalForm] = useState([]);// + // const [Pform, setform] = useState(false); + async function getResults() { + try { + const response = await fetch(`http://localhost:3005/results/${props.user_id}`, { + method: "GET", + //pass token with localstorage because it is stored in the header + headers: { token: localStorage.token }, + }); + const parseRes = await response.json(); + // setpersonalForm(parseData); + console.log(parseRes) + setUsername(parseRes.username); + setResults(parseRes.data.resource_information) + // setuserid(parseRes.user_id); // + // const encryptStorage = new EncryptStorage('secret-key'); + // removed the localstorage user id + console.log(parseRes); + } catch (err) { + console.error(err.message); + } + } + //going to make a request when we get to this component, this is for getting from database + useEffect(() => { + getResults(); + }, []); + return ( + + + + + + + + + + + + + + {/* */} + + + + {/* + + + + */} + {results.map((results) => ( + + + + + + + + + + + {/* */} + {/* */} + + + ))} + +
Therapist NamedescriptionemailWebsitefaxphone_numbercitystatezipEdit
JohnDoejohn@example.com
{results.title}{results.description}{results.email}{results.website}{results.fax}{results.work_phone_number}{results.state}{results.state}{results.zipcode} + + + {/* */} +
+
+ ); +}; +export default Results; diff --git a/client/src/components/encrypt.js b/client/src/components/encrypt.js index e6afbad..14f037f 100644 --- a/client/src/components/encrypt.js +++ b/client/src/components/encrypt.js @@ -1,2 +1,2 @@ -import { EncryptStorage } from "encrypt-storage"; -export const encryptStorage = new EncryptStorage("secret-key"); +import { EncryptStorage } from 'encrypt-storage'; +export const encryptStorage = new EncryptStorage('secret-key'); diff --git a/client/src/components/navbar/NavbarElements.js b/client/src/components/navbar/NavbarElements.js new file mode 100644 index 0000000..5f44134 --- /dev/null +++ b/client/src/components/navbar/NavbarElements.js @@ -0,0 +1,77 @@ +import styled from "styled-components"; +import { NavLink as Link } from "react-router-dom"; +import { FaBars } from "react-icons/fa"; + +export const Nav = styled.nav` + background: #56cc9d; + height: 80px; + display: flex; + justify-content: space-between; + padding: 0.5rem calc((100vw-1000px) / 2); + z-index: 10; +`; +export const NavLink = styled(Link)` + color: #fff; + display: flex; + align-items: center; + text-decoration: none; + padding: 0 1rem; + height: 100%; + font-size: 22px; + cursor: pointer; + &.active { + color: #d6cfcf; + } +`; + +export const Bars = styled(FaBars)` + display: none; + color: #fff; + @media screen and (max-width: 768px) { + display: block; + position: absolute; + top: 0; + right: 0; + transfrom: translate(-100%, 75%); + font-size: 1.8rem; + cursor: pointer; + } +`; + +export const NavMenu = styled.div` + display: flex; + align-items: center; + margin-right: -24px; + @media screen and (max-width: 768px) { + display: none; + } +`; + +export const NavBtn = styled.nav` + display: flex; + align-items: center; + margin-right: 24px; + + @media screen and (max-width: 768px) { + display: none; + } +`; + +export const NavBtnLink = styled(Link)` + border-radius: 4px; + background: #f3969a; + padding: 10px 22px; + color: #fff; + border: none; + outline: none; + cursor: pointer; + transition: all 0.2s ease-in-out; + text-decoration: none; + font-size: 20px; + + &:hover { + transition: all 0.2s ease-in-out; + background: #fff; + color: #010606; + } +`; diff --git a/client/src/components/Navbar/nav.js b/client/src/components/navbar/index.js similarity index 50% rename from client/src/components/Navbar/nav.js rename to client/src/components/navbar/index.js index 2f7a896..ecfd390 100644 --- a/client/src/components/Navbar/nav.js +++ b/client/src/components/navbar/index.js @@ -8,39 +8,48 @@ import { NavBtnLink, } from "./NavbarElements"; import { toast } from "react-toastify"; -import logo from "../pictures/new_logo.png"; -const Navbar = ({ setAuth }) => { - const logout = (e) => { +import logo from '../pictures/new_logo.png'; +const Navbar = ({setAuth}) => { + + const logout = (e) => { e.preventDefault(); localStorage.removeItem("token"); + localStorage.removeItem("user_id"); setAuth(false); toast.success("Logged out Successfully!"); }; + return ( <> diff --git a/client/src/components/pagecss/background.css b/client/src/components/pagecss/background.css new file mode 100644 index 0000000..6f06a5c --- /dev/null +++ b/client/src/components/pagecss/background.css @@ -0,0 +1,10 @@ +/* { + margin: 0; + padding: 0; +} +.background { + background-image: url("../pictures/peace.jpg"); + background-size: "cover"; + background-repeat: "no-repeat"; + height: 100vh; +} */ \ No newline at end of file diff --git a/client/src/components/pagecss/home.css b/client/src/components/pagecss/home.css new file mode 100644 index 0000000..2502cd9 --- /dev/null +++ b/client/src/components/pagecss/home.css @@ -0,0 +1,41 @@ +.btn { + background-color: #F3969A !important; +} +#home { + border-style: hidden; + padding: 5vh 5vw; + background-color: #56CC9D; + border-radius: 20px; + color: white; + margin-top: 7%; + text-align: center; +} +@media only screen and (max-width: 575.98px) { + h2 { + font-size: 2em; + } + h3 { + font-size: 1.2em; + } +} +@media only screen and (max-width: 360px) { + h2 { + font-size: 1.5em; + } + h3 { + font-size: 1em; + } +} +/* .split { + height: 100%; + width: 50%; + position: fixed; + z-index: 1; + top: 0; + overflow-x: hidden; + padding-top: 20px; +} +.right { + right: 0; + background-color: red; + } */ \ No newline at end of file diff --git a/client/src/components/pagecss/login.css b/client/src/components/pagecss/login.css new file mode 100644 index 0000000..f0c0857 --- /dev/null +++ b/client/src/components/pagecss/login.css @@ -0,0 +1,6 @@ +.btn { + background-color: #F3969A !important; +} +#loginform { + margin-top: 150px; +} \ No newline at end of file diff --git a/client/src/components/pagecss/loginregister.css b/client/src/components/pagecss/loginregister.css deleted file mode 100644 index cbec302..0000000 --- a/client/src/components/pagecss/loginregister.css +++ /dev/null @@ -1,15 +0,0 @@ -* { - margin: 0; - padding: 0; -} -.btn { - background-color: #f3969a !important; -} - -.mainbg { - background-image: url("../pictures/peace.jpg"); - background-size: "cover"; - background-repeat: "no-repeat"; - width: 100%; - height: 100vh; -} diff --git a/client/src/components/pagecss/medicalform.css b/client/src/components/pagecss/medicalform.css new file mode 100644 index 0000000..cbd388e --- /dev/null +++ b/client/src/components/pagecss/medicalform.css @@ -0,0 +1,57 @@ +.btn { + background-color: #F3969A !important; +} +#medicalform { + border-style: hidden; + padding: 3vh 5vw; + background-color: #56CC9D; + border-radius: 20px; + color: white; + margin-top: 5vh; + text-align: center; + width: 30vw; +} +@media only screen and (max-width: 575.98px) { + #medicalform { + width: 100%; + } + h1 { + font-size: 2em; + } + h5 { + font-size: 1.2em; + } +} +@media only screen and (max-width: 767.98px) { + #medicalform { + width: 100%; + } + h1 { + font-size: 2em; + } + h5 { + font-size: 1.2em; + } +} +@media only screen and (max-width: 991.98px) { + #medicalform { + width: 100%; + } + h1 { + font-size: 2em; + } + h5 { + font-size: 1.2em; + } +} +@media only screen and (max-width: 1199.98px) { + #medicalform { + width: 100%; + } + h1 { + font-size: 2em; + } + h5 { + font-size: 1.2em; + } +} \ No newline at end of file diff --git a/client/src/components/pagecss/messages.css b/client/src/components/pagecss/messages.css new file mode 100644 index 0000000..78ea6b0 --- /dev/null +++ b/client/src/components/pagecss/messages.css @@ -0,0 +1,43 @@ +.btn { + background-color: #F3969A !important; +} +#messages { + border-style: hidden; + padding: 5vw 3vh; + border-radius: 2vh; + color: white; + background-color: #56CC9D; + text-align: center; +} +@media only screen and (max-width: 575.98px) { + h2 { + font-size: 1.9em; + } + h3 { + font-size: 1.2em; + } +} +@media only screen and (max-width: 767.98px) { + h2 { + font-size: 2em; + } + h3 { + font-size: 1.2em; + } +} +@media only screen and (max-width: 991.98px) { + h2 { + font-size: 2em; + } + h3 { + font-size: 1.2em; + } +} +@media only screen and (max-width: 1199.98px) { + h2 { + font-size: 2em; + } + h3 { + font-size: 1.2em; + } +} \ No newline at end of file diff --git a/client/src/components/pagecss/personalform.css b/client/src/components/pagecss/personalform.css new file mode 100644 index 0000000..5cf2788 --- /dev/null +++ b/client/src/components/pagecss/personalform.css @@ -0,0 +1,45 @@ +.btn { + background-color: #F3969A !important; +} +#personalform { + border-style: hidden; + padding: 3vh 5vw; + background-color: #56CC9D; + border-radius: 20px; + color: white; + margin-top: 5vh; + text-align: center; + width: 30vw; +} +@media only screen and (max-width: 575.98px) { + #personalform { + width: 100%; + } + h2 { + font-size: 2em; + } +} +@media only screen and (max-width: 767.98px) { + #personalform { + width: 100%; + } + h2 { + font-size: 2em; + } +} +@media only screen and (max-width: 991.98px) { + #personalform { + width: 100%; + } + h2 { + font-size: 2em; + } +} +@media only screen and (max-width: 1199.98px) { + #personalform { + width: 100%; + } + h2 { + font-size: 2em; + } +} \ No newline at end of file diff --git a/client/src/components/pagecss/register.css b/client/src/components/pagecss/register.css new file mode 100644 index 0000000..eb4ee46 --- /dev/null +++ b/client/src/components/pagecss/register.css @@ -0,0 +1,6 @@ +.btn { + background-color: #F3969A !important; +} +#registerform { + width: "300px"; +} \ No newline at end of file diff --git a/client/src/components/pagecss/results.css b/client/src/components/pagecss/results.css new file mode 100644 index 0000000..3c54dcf --- /dev/null +++ b/client/src/components/pagecss/results.css @@ -0,0 +1,5 @@ +.table{ + display: flex; + align-items: center; + justify-content: space-around; +} \ No newline at end of file diff --git a/client/src/components/pictures/EH_LOGO.png b/client/src/components/pictures/EH_LOGO.png new file mode 100644 index 0000000..bbcbfb6 Binary files /dev/null and b/client/src/components/pictures/EH_LOGO.png differ diff --git a/client/src/index.js b/client/src/index.js index e0ba05f..62adcf3 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -1,11 +1,12 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import "./index.css"; -import App from "./App"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import './index.css'; +import App from './App'; ReactDOM.render( - - - , - document.getElementById("root") + + + , + document.getElementById('root') ); + diff --git a/server/db.sql b/server/db.sql index 8e6a374..9eb762d 100644 --- a/server/db.sql +++ b/server/db.sql @@ -83,13 +83,18 @@ INSERT INTO insperational_messages(insperational_message) VALUES ('Insperational INSERT INTO Login_Credentials(Username,email,password,activation_status) VALUES ('Bobby','bobby34@gmail.com','jello123','active'); --copy and past the uuid generated in Login_Credentials from when inserting User_id -INSERT INTO Personal_Info(User_id,first_name,last_name,pronoun,Occupation,phone_number,city,state,zip) VALUES ('b6b8cc0e-795a-4d8e-b99c-7a916e1721c1','Bob','Lee','He/Him','Computer Scientist','347-522-6321','Brooklyn','New York','11216'); +INSERT INTO Personal_Info(User_id,first_name,last_name,pronoun,Occupation,phone_number,city,state,zip) VALUES ('36690555-1b84-43b1-82e7-91a307bed675','Bob','Lee','He/Him','Computer Scientist','347-522-6321','Brooklyn','New York','11216'); -INSERT INTO medical_info(User_id,any_medication,medication_description,insurance) VALUES ('b6b8cc0e-795a-4d8e-b99c-7a916e1721c1','Yes','Flovent','Fidelis'); +INSERT INTO medical_info(User_id,any_medication,medication_description,insurance) VALUES ('36690555-1b84-43b1-82e7-91a307bed675','Yes','Flovent','Fidelis'); INSERT INTO resources(title,fax,email,phone_number,description,website,picture,city,state,zip,Occupation) VALUES ('Laura Croft','347-227-1345','Laura@gmail.com','347-221-2510','this is a therapy for computer science','lauratherapy.com','','New York','New York','10001','computer science'); -INSERT INTO User_Saved_Resources(User_id,title,fax,email,phone_number,description,website,picture,city,state,zip,Occupation) VALUES ('b6b8cc0e-795a-4d8e-b99c-7a916e1721c1','Laura Croft','347-227-1345','Laura@gmail.com','347-221-2510','this is a therapy for computer science','lauratherapy.com','','New York','New York','10001','computer science'); +INSERT INTO User_Saved_Resources(User_id,title,fax,email,phone_number,description,website,picture,city,state,zip,Occupation) VALUES ('36690555-1b84-43b1-82e7-91a307bed675','Laura Croft','347-227-1345','Laura@gmail.com','347-221-2510','this is a therapy for computer science','lauratherapy.com','','New York','New York','10001','computer science'); + + + + + --ONLY ADD THIS after revision -- cascading to delete in sequence and update in sequence @@ -109,3 +114,19 @@ ADD CONSTRAINT fk_login_saved_resources FOREIGN KEY(user_id) REFERENCES login_credentials(user_id) ON DELETE CASCADE ON UPDATE CASCADE; + + +INSERT INTO insperational_messages(insperational_message) VALUES ('You are Awesome and Dont FORGET IT !!'); +INSERT INTO insperational_messages(insperational_message) VALUES ('You are Special and Dont FORGET IT !!'); +INSERT INTO insperational_messages(insperational_message) VALUES ('You are Amazing and Dont FORGET IT !!'); + + +--Alter table +Alter table resources rename column phone_number to work_phone_number; +Alter table resources rename column zip to zipcode; + + + +-- more resources + +INSERT INTO resources(title,fax,email,work_phone_number,description,website,picture,city,state,zip,Occupation) VALUES ('Kraft','347-923-9111','Karaft@gmail.com','347-221-9111','this is a therapy for all','karfttherapy.com','','New York','New York','10001','computer science'); diff --git a/server/middleware/authorization.js b/server/middleware/authorization.js index 0fadecc..222d519 100644 --- a/server/middleware/authorization.js +++ b/server/middleware/authorization.js @@ -1,24 +1,21 @@ const jwt = require("jsonwebtoken"); require("dotenv").config(); -// before it hits routes it's going to get access to the requested -// resonse then if everything ends up working ok, it will continue on -// with the process of next so it can keep going with the routes -module.exports = async (req, res, next) => { - try { - const jwtToken = req.header("token"); +module.exports = async(req,res,next)=>{// to create a middleware we did this + //before it even hits the routes its going to request access and then + //response then if its working ok were going to keep going. + try { - if (!jwtToken) { - return res.status(401).json("Not Authorized"); - } - // if this is verified it is going to return us a payload that we can use within our routes - const payload = jwt.verify(jwtToken, process.env.jwtSecret); - - req.user = payload.user; - - next(); - } catch (err) { - console.error(err.message); - return res.status(403).json("Not Authorized"); - } -}; + const jwtToken = req.header("token"); + if(!jwtToken){ + return res.status(401).json("Not Authorized") + } + //if this is verified it will return the payload that we can use in our routes + const payload = jwt.verify(jwtToken,process.env.jwtSecret) + req.user = payload.user + next(); + } catch (err) { + console.error(err.message) + return res.status(403).json("Not Authorized") + } +} diff --git a/server/middleware/validinfo.js b/server/middleware/validinfo.js index 1f6a365..88b498b 100644 --- a/server/middleware/validinfo.js +++ b/server/middleware/validinfo.js @@ -1,23 +1,25 @@ module.exports = (req, res, next) => { - const { email, username, password } = req.body; - - function validEmail(userEmail) { - return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(userEmail); - } - - if (req.path === "/register") { - if (![email, username, password].every(Boolean)) { - return res.status(401).json("Missing Credentials"); - } else if (!validEmail(email)) { - return res.status(401).json("Invalid Email"); - } - } else if (req.path === "/login") { - if (![email, password].every(Boolean)) { - return res.status(401).json("Missing Credentials"); - } else if (!validEmail(email)) { - return res.status(401).json("Invalid Email"); - } - } - - next(); -}; + const { email, username, password } = req.body; + + function validEmail(userEmail) { + return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(userEmail); + } + + if (req.path === "/register") { + // console.log(!email.length); + if (![email, username, password].every(Boolean)) { + return res.status(401).json("Missing Credentials"); + } else if (!validEmail(email)) { + return res.status(401).json("Invalid Email"); + } + } + else if (req.path === "/login") { + if (![email, password].every(Boolean)) { + return res.status(401).json("Missing Credentials"); + } else if (!validEmail(email)) { + return res.status(401).json("Invalid Email"); + } + } + + next(); + }; diff --git a/server/package-lock.json b/server/package-lock.json index 21f4553..56b2578 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -4,6 +4,87 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==" + }, + "@babel/highlight": { + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", + "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, "@mapbox/node-pre-gyp": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.8.tgz", @@ -20,16 +101,78 @@ "tar": "^6.1.11" } }, + "@types/async": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/@types/async/-/async-3.2.12.tgz", + "integrity": "sha512-4i4w4tfNDo73BOjk0qHcB2YJ8A2SjITCrU4BTsgdJFTsVr6atPDXa0T9r0QZTrX3axtWwkqpZqF4B3gR0TqBGw==" + }, + "@types/extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/extend/-/extend-3.0.1.tgz", + "integrity": "sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw==" + }, + "@types/file-type": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@types/file-type/-/file-type-5.2.2.tgz", + "integrity": "sha512-GWtM4fyqfb+bec4ocpo51/y4x0b83Je+iA6eV131LT9wL0//G+1UgwbkMg7w61ceOwR+KkZXK00z44jrrNljWg==", + "requires": { + "@types/node": "*" + } + }, + "@types/isstream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@types/isstream/-/isstream-0.1.0.tgz", + "integrity": "sha512-jo6R5XtVMgu1ej3H4o9NXiUE/4ZxyxmDrGslGiBa4/ugJr+Olw2viio/F2Vlc+zrwC9HJzuApOCCVC2g5jqV0w==" + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==" + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "requires": { + "@types/istanbul-lib-report": "*" + } + }, "@types/node": { "version": "17.0.22", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.22.tgz", "integrity": "sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw==" }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==" + }, + "@types/tough-cookie": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.1.tgz", + "integrity": "sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg==" + }, "@types/webidl-conversions": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz", "integrity": "sha512-XAahCdThVuCFDQLT7R7Pk/vqeObFNL3YqRyFZg+AqAP/W1/w3xHaIxuW7WszQqTbIBOPRcItYJIou3i/mppu3Q==" }, + "@types/websocket": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz", + "integrity": "sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==", + "requires": { + "@types/node": "*" + } + }, "@types/whatwg-url": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.1.tgz", @@ -39,6 +182,19 @@ "@types/webidl-conversions": "*" } }, + "@types/yargs": { + "version": "15.0.14", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz", + "integrity": "sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==" + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -66,6 +222,14 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, "aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -85,6 +249,33 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "async": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "requires": { + "follow-redirects": "^1.14.8" + } + }, + "axios-cookiejar-support": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/axios-cookiejar-support/-/axios-cookiejar-support-1.0.1.tgz", + "integrity": "sha512-IZJxnAJ99XxiLqNeMOqrPbfR7fRyIfaoSLdPUf4AMQEGkH8URs0ghJK/xtqBsD+KsSr3pKl4DEQjCn834pHMig==", + "requires": { + "is-redirect": "^1.0.0", + "pify": "^5.0.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -160,6 +351,14 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, "bson": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.2.tgz", @@ -187,21 +386,64 @@ "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" }, + "bufferutil": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", + "requires": { + "node-gyp-build": "^4.3.0" + } + }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, "chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, "color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -244,6 +486,15 @@ "vary": "^1" } }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -252,6 +503,11 @@ "ms": "2.1.2" } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -277,6 +533,11 @@ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" }, + "diff-sequences": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==" + }, "dotenv": { "version": "16.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", @@ -305,16 +566,63 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, + "es5-ext": { + "version": "0.10.60", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.60.tgz", + "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", + "requires": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "expect": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", + "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "requires": { + "@jest/types": "^26.6.2", + "ansi-styles": "^4.0.0", + "jest-get-type": "^26.3.0", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-regex-util": "^26.0.0" + } + }, "express": { "version": "4.17.3", "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", @@ -367,6 +675,39 @@ } } }, + "ext": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "requires": { + "type": "^2.5.0" + }, + "dependencies": { + "type": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "file-type": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-7.7.1.tgz", + "integrity": "sha512-bTrKkzzZI6wH+NXhyD3SOXtb2zXTw2SbwI2RxUlRcXVsnN7jNL5hJzVQLYv7FOQhxFkK4XWdAflEaWFpaLLWpQ==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -396,6 +737,21 @@ } } }, + "follow-redirects": { + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -448,6 +804,16 @@ "path-is-absolute": "^1.0.0" } }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -474,6 +840,82 @@ "debug": "4" } }, + "ibm-cloud-sdk-core": { + "version": "2.17.13", + "resolved": "https://registry.npmjs.org/ibm-cloud-sdk-core/-/ibm-cloud-sdk-core-2.17.13.tgz", + "integrity": "sha512-OVr4pfT1TE3R1ISTtwumvppubEIz23y42zccyNRDOZhIs6LPdJqOIukb09tHWNNuEHo7wRetHxKuOodkaTSQMA==", + "requires": { + "@types/file-type": "~5.2.1", + "@types/isstream": "^0.1.0", + "@types/node": "~10.14.19", + "@types/tough-cookie": "^4.0.0", + "axios": "^0.26.1", + "axios-cookiejar-support": "^1.0.0", + "camelcase": "^5.3.1", + "debug": "^4.1.1", + "dotenv": "^6.2.0", + "expect": "^26.1.0", + "extend": "^3.0.2", + "file-type": "^7.7.1", + "form-data": "^2.3.3", + "isstream": "~0.1.2", + "jsonwebtoken": "^8.5.1", + "lodash.isempty": "^4.4.0", + "mime-types": "~2.1.18", + "object.omit": "~3.0.0", + "object.pick": "~1.3.0", + "retry-axios": "^2.6.0", + "semver": "^6.2.0", + "tough-cookie": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "10.14.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.22.tgz", + "integrity": "sha512-9taxKC944BqoTVjE+UT3pQH0nHZlTvITwfsOZqyc+R3sfJuxaTtxWjfn1K2UlxyPcKHf0rnaXcVFrS9F9vf0bw==" + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "dotenv": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz", + "integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, + "ibm-watson": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ibm-watson/-/ibm-watson-7.0.0.tgz", + "integrity": "sha512-sZhg2sTr5a2W65bq40uNJpcFODC0p0Oyd+S0EBYwlWI7CncWLOeVjwtxzKEQ7nxbmlx9An4N8DX2qq65TwE1EQ==", + "requires": { + "@types/async": "^3.2.5", + "@types/extend": "^3.0.1", + "@types/isstream": "^0.1.0", + "@types/node": "^13.13.39", + "@types/websocket": "^1.0.1", + "async": "^3.2.0", + "camelcase": "^6.2.0", + "extend": "~3.0.2", + "ibm-cloud-sdk-core": "^2.14.3", + "isstream": "~0.1.2", + "websocket": "^1.0.33" + }, + "dependencies": { + "@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -511,11 +953,105 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } + }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jest-diff": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-get-type": { + "version": "26.3.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", + "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==" + }, + "jest-matcher-utils": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", + "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-message-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", + "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@jest/types": "^26.6.2", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.2", + "pretty-format": "^26.6.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.2" + } + }, + "jest-regex-util": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", + "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, "jsonwebtoken": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", @@ -574,6 +1110,11 @@ "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" }, + "lodash.isempty": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=" + }, "lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", @@ -643,6 +1184,15 @@ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -812,6 +1362,11 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, "node-addon-api": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", @@ -825,6 +1380,11 @@ "whatwg-url": "^5.0.0" } }, + "node-gyp-build": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" + }, "nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -849,6 +1409,22 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object.omit": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-3.0.0.tgz", + "integrity": "sha512-EO+BCv6LJfu+gBIF3ggLicFebFLN5zqzz/WWJlMFfkMyGth+oBkhxzDl0wx2W4GkLzuQs/FsSkXZb2IMWQqmBQ==", + "requires": { + "is-extendable": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -944,6 +1520,16 @@ "split2": "^4.1.0" } }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz", + "integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==" + }, "postgres-array": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", @@ -967,6 +1553,17 @@ "xtend": "^4.0.0" } }, + "pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "requires": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + } + }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -976,6 +1573,11 @@ "ipaddr.js": "1.9.1" } }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -1002,6 +1604,11 @@ "unpipe": "1.0.0" } }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -1012,6 +1619,11 @@ "util-deprecate": "^1.0.1" } }, + "retry-axios": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-2.6.0.tgz", + "integrity": "sha512-pOLi+Gdll3JekwuFjXO3fTq+L9lzMQGcSq7M5gIjExcl3Gu1hd4XXuf5o3+LuSBsaULQH7DiNbsqPd1chVpQGQ==" + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1120,6 +1732,11 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + }, "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -1148,6 +1765,21 @@ "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" + } + } + }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -1179,6 +1811,14 @@ "ansi-regex": "^5.0.1" } }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, "tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -1192,16 +1832,39 @@ "yallist": "^4.0.0" } }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, "toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + } + }, "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1211,11 +1874,32 @@ "mime-types": "~2.1.24" } }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "utf-8-validate": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", + "requires": { + "node-gyp-build": "^4.3.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1236,6 +1920,34 @@ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" }, + "websocket": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "requires": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -1263,6 +1975,11 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" + }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/server/package.json b/server/package.json index bb1e215..cb3fd3e 100644 --- a/server/package.json +++ b/server/package.json @@ -15,6 +15,7 @@ "cors": "^2.8.5", "dotenv": "^16.0.0", "express": "^4.17.3", + "ibm-watson": "^7.0.0", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.2", "morgan": "^1.10.0", diff --git a/server/routes/home.js b/server/routes/home.js index 3d5c23d..8907e12 100644 --- a/server/routes/home.js +++ b/server/routes/home.js @@ -1,20 +1,23 @@ const router = require("express").Router(); const pool = require("../db"); -const authorization = require("../middleware/authorization"); +const authorization = require("../middleware/authorization") -// by passing through the authorization we are able to accesss the request id user object to access -// the users id information -router.get("/", authorization, async (req, res) => { - try { - const user = await pool.query( - "SELECT * FROM login_credentials WHERE user_id=$1", - [req.user] - ); - res.json(user.rows[0]); - } catch (err) { - console.error(err.message); - res.status(500).json("Server Error"); - } -}); -module.exports = router; +//auth by passing threw we are able to access the request id user object to the +//users id information +// +router.get("/",authorization,async(req,res)=>{ + try { + //req.user has the payload + // res.json(req.user) + const user = await pool.query("SELECT * FROM login_credentials WHERE user_id = $1",[req.user]) + res.json(user.rows[0]) + + } catch (err) { + console.error(err.message) + res.status(500).json("server err") + } +}) + + +module.exports = router diff --git a/server/routes/jwtAuth.js b/server/routes/jwtAuth.js index 7544233..adaee75 100644 --- a/server/routes/jwtAuth.js +++ b/server/routes/jwtAuth.js @@ -1,53 +1,53 @@ const router = require("express").Router(); -const { json, response } = require("express"); const pool = require("../db"); const bcrypt = require("bcrypt"); const jwtGenerator = require("../utils/jwtGenerator"); -const validInfo = require("../middleware/validInfo"); +const validInfo = require("../middleware/validinfo"); const authorization = require("../middleware/authorization"); - -//registering - +//regiser router.post("/register", validInfo, async (req, res) => { try { - // 1. destructure the req.body(name,email,password) + //1 destructure the req.body (name ,email,password) + const { username, email, password } = req.body; - // 2. check if user exists (if user exists then throw error) + //2 check if the user exist then if user does not exisit then throw err + const user = await pool.query( - "SELECT * FROM login_credentials WHERE email =$1", + "SELECT * FROM login_credentials WHERE email = $1", [email] ); + + //this checks if user exisit + if (user.rows.length !== 0) { - return res.status(401).json("User already exists"); + return res.status(401).json("user already exisits"); } - // res.json(user.rows); - // 3. bycrpyt the user password + // res.json(user.rows) - const saltRound = 10; - const salt = await bcrypt.genSalt(saltRound); + // 3 bcrypt the user password + const saltround = 10; //now we are going to encrypt the password if user does not exisit + const salt = await bcrypt.genSalt(saltround); const bcryptPassword = await bcrypt.hash(password, salt); - // 4. enter the new user inside our database - + //4 enter the user inside the db const newUser = await pool.query( - "INSERT INTO login_credentials (username,email,password) VALUES ($1,$2,$3) RETURNING *", + "INSERT INTO login_credentials(username,email,password)VALUES($1,$2,$3) RETURNING *", [username, email, bcryptPassword] ); - // res.json(newUser.rows[0]); - // 5. generate our jwt token + //5 generate our token const token = jwtGenerator(newUser.rows[0].user_id); res.json({ token }); } catch (err) { console.error(err.message); - res.status(500).send("server error"); + res.status(500).send("server err"); } }); -//login route +//now we are doing login route router.post("/login", validInfo, async (req, res) => { try { //1. destructure the req.body @@ -67,13 +67,12 @@ router.post("/login", validInfo, async (req, res) => { console.log(validPassword); if (!validPassword) { - return res.status(401).json("password or email is incorrect"); + return res.status(401).json("password or email is not correct"); } - - //4. give the jwt token + //4. check if incoming passsword is the same as the const token = jwtGenerator(user.rows[0].user_id); - - res.json({ token }); + const user_id = user.rows[0].user_id + res.json({ token,user_id }); } catch (err) { console.error(err.message); res.status(500).send("Server Error"); @@ -88,5 +87,4 @@ router.get("/is-verify", authorization, async (req, res) => { res.status(500).send("Server Error"); } }); - module.exports = router; diff --git a/server/routes/medicalform.js b/server/routes/medicalform.js index e5051f3..c1cb4f6 100644 --- a/server/routes/medicalform.js +++ b/server/routes/medicalform.js @@ -1,9 +1,9 @@ const router = require("express").Router(); const pool = require("../db"); -const authorization = require("../middleware/authorization"); +const authorization = require("../middleware/authorization") //insert into medical info -router.post("/:user_id", authorization, async (req, res) => { +router.post("/:user_id",authorization, async (req, res) => { try { const result = await pool.query( "INSERT INTO medical_info (user_id,any_medication,medication_description,insurance) VALUES($1,$2,$3,$4) RETURNING * ", @@ -27,8 +27,10 @@ router.post("/:user_id", authorization, async (req, res) => { console.error(err.message); } }); + //update medical info -router.put("/update/:user_id", authorization, async (req, res) => { +router.put("/update/:userId",authorization, async (req, res) => { + console.log("Request Data:", req.body); try { const result = await pool.query( "UPDATE medical_info SET any_medication = $1, medication_description = $2, insurance = $3 WHERE user_id = $4 RETURNING * ", @@ -36,12 +38,12 @@ router.put("/update/:user_id", authorization, async (req, res) => { req.body.any_medication, req.body.medication_description, req.body.insurance, - req.params.user_id, + req.params.userId, ] ); console.log(req.body); - + console.log("New Row:", result.rows[0]); res.status(200).json({ status: "success", data: { @@ -53,7 +55,7 @@ router.put("/update/:user_id", authorization, async (req, res) => { } }); //get medical info -router.get("/getting/:user_id", authorization, async (req, res) => { +router.get("/getMform/:user_id",authorization,async (req, res) => { try { const result = await pool.query( "SELECT * FROM medical_info WHERE user_id=$1 ", diff --git a/server/routes/message.js b/server/routes/message.js index 851d209..285f25d 100644 --- a/server/routes/message.js +++ b/server/routes/message.js @@ -1,10 +1,12 @@ const router = require("express").Router(); const pool = require("../db"); + + router.get("/:insperational_message_id", async (req, res) => { try { const getOneMessage = await pool.query( - "SELECT * FROM insperational_messages WHERE insperational_message_id = $1", + "SELECT * FROM insperational_messages WHERE insperational_message_id = $1", [req.params.insperational_message_id] ); // console.log(getOneMessage.rows[0]); diff --git a/server/routes/personalform.js b/server/routes/personalform.js index f99a065..0f7f3d5 100644 --- a/server/routes/personalform.js +++ b/server/routes/personalform.js @@ -2,7 +2,9 @@ const router = require("express").Router(); const pool = require("../db"); const authorization = require("../middleware/authorization"); +// insert user info router.post("/:user_id", authorization, async (req, res) => { + //console.log("Request Data:", req.data); try { const result = await pool.query( "INSERT INTO personal_info (user_id,first_name,last_name,pronoun,occupation,phone_number,city,state,zip) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9) RETURNING * ", @@ -32,24 +34,27 @@ router.post("/:user_id", authorization, async (req, res) => { } }); -router.put("/update/:user_id", authorization, async (req, res) => { +//update user info +router.put("/update/:userId", authorization, async (req, res) => { + console.log("Request Data:", req.body); + try { const result = await pool.query( "UPDATE personal_info SET first_name=$1,last_name=$2,pronoun=$3,occupation=$4,phone_number=$5,city=$6,state=$7,zip=$8 WHERE user_id = $9 RETURNING * ", [ - req.body.first_name, - req.body.last_name, + req.body.firstName, + req.body.lastName, req.body.pronoun, req.body.occupation, - req.body.phone_number, + req.body.phoneNumber, req.body.city, req.body.state, req.body.zip, - req.params.user_id, + req.params.userId, ] ); - console.log(req.body); + console.log("New Row:", result.rows[0]); res.status(200).json({ status: "success", @@ -58,10 +63,11 @@ router.put("/update/:user_id", authorization, async (req, res) => { }, }); } catch (err) { - console.error(err.message); + console.error("Error:", err.message); } }); +//get back user info router.get("/getting/:user_id", authorization, async (req, res) => { try { const result = await pool.query( diff --git a/server/routes/results.js b/server/routes/results.js index 7ecc820..4ee400e 100644 --- a/server/routes/results.js +++ b/server/routes/results.js @@ -1,8 +1,8 @@ const router = require("express").Router(); const pool = require("../db"); -const authorization = require("../middleware/authorization"); +const authorization = require("../middleware/authorization") -router.get("/:user_id", authorization, async (req, res) => { +router.get("/:user_id",authorization, async (req, res) => { try { const result = await pool.query( "SELECT * FROM resources INNER JOIN personal_info on resources.state=personal_info.state WHERE user_id= $1;", @@ -14,7 +14,7 @@ router.get("/:user_id", authorization, async (req, res) => { res.status(200).json({ status: "success", data: { - resource_information: result.rows[0], //this gets the one row we need + resource_information: result.rows, //this gets the one row we need }, }); } catch (err) { diff --git a/server/server.js b/server/server.js index 62b8f7c..870d255 100644 --- a/server/server.js +++ b/server/server.js @@ -16,13 +16,70 @@ const port = process.env.PORT || 3001; app.use(cors()); app.use(express.json()); +//routes register and login routes +app.use("/auth", require("./routes/jwtAuth")); + + +//Home +app.use("/home",require("./routes/home")) + + +app.use("/message",require("./routes/message")) + +app.use("/pform",require("./routes/personalform")) + +app.use("/mform",require("./routes/medicalform")) + +app.use("/results",require("./routes/results")) + +// here we will try to put the chatbot backend here + +//app.use("/pformupdate",require("./routes/personalform")) + + // ROUTES -//register and login routes +// insperational_messages route good +// app.get("/api/v1/message/:insperational_message_id", async (req, res) => { +// try { +// const getOneMessage = await db.query( +// "SELECT * FROM insperational_messages WHERE insperational_message_id = $1", +// [req.params.insperational_message_id] +// ); +// // console.log(getOneMessage.rows[0]); +// // console.log(req); +// res.status(200).json({ +// // to send a good status +// status: "success", // of success +// data: { +// message: getOneMessage.rows[0], +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); -app.use("/auth", require("./routes/jwtAuth")); +// login good, +// insert into +// app.post("/api/v1/SignUp", async (req, res) => { +// try { +// const result = await db.query( +// "INSERT INTO login_credentials (username,email,password) VALUES($1,$2,$3) RETURNING *", +// [req.body.username, req.body.email, req.body.password] +// ); +// console.log(req.body); -//Home +// res.status(201).json({ +// status: "success", +// data: { +// login: result.rows[0], //this gets the one row we need +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); app.use("/home", require("./routes/home")); @@ -32,89 +89,161 @@ app.use("/home", require("./routes/home")); app.use("/message", require("./routes/message")); //good +// Insert into personal info table,need to fix vulnerability risk +//login credential = 2 medical info = 4 +// app.post("/api/v1/PForm/:username", async (req, res) => { +// try { +// const result = await db.query( +// "INSERT INTO personal_info (username,first_name,last_name,pronoun,area_of_expertise,phone_number,city,state,zip) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9) RETURNING * ", +// [ +// req.params.username, +// req.body.first_name, +// req.body.last_name, +// req.body.pronoun, +// req.body.area_of_expertise, +// req.body.phone_number, +// req.body.city, +// req.body.state, +// req.body.zip, +// ] +// ); + +// console.log(req.body); + +// res.status(201).json({ +// status: "success", +// data: { +// personal_information: result.rows[0], //this gets the one row we need +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); + +// app.put("/api/v1/PForm/update/:username", async (req, res) => { +// try { +// const result = await db.query( +// "UPDATE personal_info SET first_name=$1,last_name=$2,pronoun=$3,area_of_expertise=$4,phone_number=$5,city=$6,state=$7,zip=$8 WHERE username = $9 RETURNING * ", +// [ +// req.body.first_name, +// req.body.last_name, +// req.body.pronoun, +// req.body.area_of_expertise, +// req.body.phone_number, +// req.body.city, +// req.body.state, +// req.body.zip, +// req.params.username, +// ] +// ); -app.use("/pform", require("./routes/personalform")); +// console.log(req.body); + +// res.status(200).json({ +// status: "success", +// data: { +// personal_information: result.rows[0], //this gets the one row we need +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); //geting personal information GOOD -//good +// app.get("/api/v1/PForm/:username", async (req, res) => { +// try { +// const result = await db.query( +// "SELECT * FROM personal_info WHERE username=$1 ", +// [req.params.username] +// ); -app.use("/mform", require("./routes/medicalform")); +// console.log(req.params); -//resources -app.use("/results", require("./routes/results")); +// res.status(200).json({ +// status: "success", +// data: { +// personal_information: result.rows[0], //this gets the one row we need +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); // inserting into medical information GOOD -app.post("/api/v1/MForm/:username", async (req, res) => { - try { - const result = await db.query( - "INSERT INTO medical_info (username,any_medication,medication_description,insurance) VALUES($1,$2,$3,$4) RETURNING * ", - [ - req.params.username, - req.body.any_medication, - req.body.medication_description, - req.body.insurance, - ] - ); +// app.post("/api/v1/MForm/:username", async (req, res) => { +// try { +// const result = await db.query( +// "INSERT INTO medical_info (username,any_medication,medication_description,insurance) VALUES($1,$2,$3,$4) RETURNING * ", +// [ +// req.params.username, +// req.body.any_medication, +// req.body.medication_description, +// req.body.insurance, +// ] +// ); - console.log(req.body); +// console.log(req.body); - res.status(201).json({ - status: "success", - data: { - medical_information: result.rows[0], //this gets the one row we need - }, - }); - } catch (err) { - console.error(err.message); - } -}); +// res.status(201).json({ +// status: "success", +// data: { +// medical_information: result.rows[0], //this gets the one row we need +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); // updating the medical information good -app.put("/api/v1/MForm/update/:username", async (req, res) => { - try { - const result = await db.query( - "UPDATE medical_info SET any_medication = $1, medication_description = $2, insurance = $3 WHERE username = $4 RETURNING * ", - [ - req.body.any_medication, - req.body.medication_description, - req.body.insurance, - req.params.username, - ] - ); +// app.put("/api/v1/MForm/update/:username", async (req, res) => { +// try { +// const result = await db.query( +// "UPDATE medical_info SET any_medication = $1, medication_description = $2, insurance = $3 WHERE username = $4 RETURNING * ", +// [ +// req.body.any_medication, +// req.body.medication_description, +// req.body.insurance, +// req.params.username, +// ] +// ); - console.log(req.body); +// console.log(req.body); - res.status(200).json({ - status: "success", - data: { - medical_information: result.rows[0], //this gets the one row we need - }, - }); - } catch (err) { - console.error(err.message); - } -}); +// res.status(200).json({ +// status: "success", +// data: { +// medical_information: result.rows[0], //this gets the one row we need +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); // retrieve into medical information Good -app.get("/api/v1/MForm/:username", async (req, res) => { - try { - const result = await db.query( - "SELECT * FROM medical_info WHERE username=$1 ", - [req.params.username] - ); +// app.get("/api/v1/MForm/:username", async (req, res) => { +// try { +// const result = await db.query( +// "SELECT * FROM medical_info WHERE username=$1 ", +// [req.params.username] +// ); - console.log(req.params); +// console.log(req.params); - res.status(200).json({ - status: "success", - data: { - medical_information: result.rows[0], //this gets the one row we need - }, - }); - } catch (err) { - console.error(err.message); - } -}); +// res.status(200).json({ +// status: "success", +// data: { +// medical_information: result.rows[0], //this gets the one row we need +// }, +// }); +// } catch (err) { +// console.error(err.message); +// } +// }); // getting the resources diff --git a/server/utils/jwtGenerator.js b/server/utils/jwtGenerator.js index ced5351..4dc1478 100644 --- a/server/utils/jwtGenerator.js +++ b/server/utils/jwtGenerator.js @@ -1,11 +1,9 @@ const jwt = require("jsonwebtoken"); -require("dotenv").config(); - -function jwtGenerator(user_id) { - const payload = { - user: user_id, - }; - return jwt.sign(payload, process.env.jwtSecret, { expiresIn: "1hr" }); +require('dotenv').config(); +function jwtGenerator(user_id){ + const payload = { + user:user_id + } + return jwt.sign(payload,process.env.jwtSecret,{expiresIn:"1hr"}); } - module.exports = jwtGenerator;