From 8d22775457b11c2ac4a77c7d5693f9f34566e574 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Fri, 11 Sep 2020 16:43:14 -0300 Subject: [PATCH 01/55] Add .gitignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Vítor Morandi --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30bc162 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file From ccd8f20d9bf4924035d3aa57e76e8eb3db014d08 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Fri, 11 Sep 2020 16:47:37 -0300 Subject: [PATCH 02/55] Start Express project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Vítor Morandi --- package-lock.json | 1438 +++++++++++++++++++++++++++++++++++++++++++ package.json | 28 + src/index.js | 20 + src/routes/index.js | 12 + 4 files changed, 1498 insertions(+) create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/index.js create mode 100644 src/routes/index.js diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..dbb2a56 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1438 @@ +{ + "name": "2020.1-Grupo2-backend", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + } + }, + "boxen": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", + "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "cli-boxes": "^2.2.0", + "string-width": "^4.1.0", + "term-size": "^2.1.0", + "type-fest": "^0.8.1", + "widest-line": "^3.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "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==", + "dev": true, + "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==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "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==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chokidar": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "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" + } + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "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==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-dirs": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", + "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", + "dev": true, + "requires": { + "ini": "^1.3.5" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-installed-globally": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", + "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", + "dev": true, + "requires": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + } + }, + "is-npm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", + "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "requires": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, + "nodemon": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.4.tgz", + "integrity": "sha512-Ltced+hIfTmaS28Zjv1BM552oQ3dbwPqI4+zI0SLgq+wpJhSyqgYude/aZa/3i31VCQWMfXJVxvu86abcam3uQ==", + "dev": true, + "requires": { + "chokidar": "^3.2.2", + "debug": "^3.2.6", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.7", + "semver": "^5.7.1", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.2", + "update-notifier": "^4.0.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pupa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", + "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==", + "dev": true, + "requires": { + "escape-goat": "^2.0.0" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "registry-auth-token": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz", + "integrity": "sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "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==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "term-size": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz", + "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==", + "dev": true + }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, + "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==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "requires": { + "nopt": "~1.0.10" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "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==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "undefsafe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", + "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", + "dev": true, + "requires": { + "debug": "^2.2.0" + } + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "update-notifier": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.1.tgz", + "integrity": "sha512-9y+Kds0+LoLG6yN802wVXoIfxYEwh3FlZwzMwpCZp62S2i1/Jzeqb9Eeeju3NSHccGGasfGlK5/vEHbAifYRDg==", + "dev": true, + "requires": { + "boxen": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "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==", + "dev": true, + "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==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "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==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "requires": { + "string-width": "^4.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1dc773e --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "2020.1-Grupo2-backend", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "node src/index.js", + "dev": "nodemon src/index.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/fga-eps-mds/2020.1-Grupo2-backend.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/fga-eps-mds/2020.1-Grupo2-backend/issues" + }, + "homepage": "https://github.com/fga-eps-mds/2020.1-Grupo2-backend#readme", + "dependencies": { + "express": "^4.17.1", + "morgan": "^1.10.0" + }, + "devDependencies": { + "nodemon": "^2.0.4" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..9a870d2 --- /dev/null +++ b/src/index.js @@ -0,0 +1,20 @@ +const express = require('express'); +const app = express(); +const morgan = require('morgan'); + +// settings +app.set('port', process.env.PORT || 3000); +app.set('json spaces', 2); + +// middlewares +app.use(morgan('dev')); +app.use(express.urlencoded({extended: false})); +app.use(express.json()); + +// routes +app.use(require('./routes/index.js')); + +// starting the server +app.listen(app.get('port'), () => { + console.log(`Server on port ${app.get('port')}`); +}); \ No newline at end of file diff --git a/src/routes/index.js b/src/routes/index.js new file mode 100644 index 0000000..a9ecae6 --- /dev/null +++ b/src/routes/index.js @@ -0,0 +1,12 @@ +const { Router } = require('express'); +const router = Router(); + +router.get('/test', (req, res) => { + const data = { + "name": "Zeca", + "website": "google.com" + } + res.json(data) +}); + +module.exports = router; \ No newline at end of file From a47908b8308d4bd73b6dfb593c1b2a2249de845c Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Fri, 11 Sep 2020 17:17:19 -0300 Subject: [PATCH 03/55] Dockerize environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Vítor Morandi --- Dockerfile | 13 +++++++++++++ docker-compose.yml | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..77b1731 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:14.10.1-alpine3.10 + +WORKDIR /app + +VOLUME .:/app + +COPY ./package.json . + +RUN npm install + +EXPOSE 3000 + +ENTRYPOINT [ "npm", "run", "dev" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..815da4a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' +services: + backend: + build: . + ports: + - 3000:3000 + container_name: backend + volumes: + - .:/app \ No newline at end of file From 0bdd125e8879c16f8d4953ef08cf58408fd6f7b4 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Fri, 11 Sep 2020 17:21:50 -0300 Subject: [PATCH 04/55] Update Readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Vítor Morandi --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dca1134..6c8adf0 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ -# 2020.1-Grupo2-BackEnd \ No newline at end of file +# 2020.1-Grupo2-BackEnd + +## Descrição + +Repositório responsável por operar o Backend do projeto do Grupo 2 da disciplina de Engenharia de Produto de Software em conjunto com Métodos de Desenvolvimento de Software da Universidade de Brasília, campus Gama. + +## Instalação + +Para subir o ambiente de desenvolvimento: + +``` +docker-compose up --build +``` + From 0e834f36b39811f3c9a3a1483e907cf245a737f0 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Tue, 15 Sep 2020 18:43:58 -0300 Subject: [PATCH 05/55] Update .gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 30bc162..59f47b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -/node_modules \ No newline at end of file +/node_modules +.env +package-lock.json +yarn.lock \ No newline at end of file From bd57b0c87ec6245463a6e327200e6a032afa9820 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Tue, 15 Sep 2020 20:14:58 -0300 Subject: [PATCH 06/55] Add mongo to docker-compose Signed-off-by: Rafael Makaha --- docker-compose.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 815da4a..5071b6d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,17 @@ version: '3' services: backend: + container_name: backend + restart: always build: . ports: - 3000:3000 - container_name: backend volumes: - - .:/app \ No newline at end of file + - .:/app + links: + - mongo + mongo: + container_name: mongo + image: mongo + ports: + - 27017:27017 \ No newline at end of file From 9ba6a54529e38632749a316d71bb22b8e87b5793 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Tue, 15 Sep 2020 20:15:07 -0300 Subject: [PATCH 07/55] Add mongoDB to project. Signed-off-by: Rafael Makaha --- package.json | 1 + src/index.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/package.json b/package.json index 1dc773e..8ef7b92 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "homepage": "https://github.com/fga-eps-mds/2020.1-Grupo2-backend#readme", "dependencies": { "express": "^4.17.1", + "mongoose": "^5.10.5", "morgan": "^1.10.0" }, "devDependencies": { diff --git a/src/index.js b/src/index.js index 9a870d2..81b0200 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,16 @@ const express = require('express'); const app = express(); const morgan = require('morgan'); +const mongoose = require('mongoose'); + +// MongoDB connection +mongoose + .connect( + 'mongodb://mongo:27017/backend', + { useNewUrlParser: true } + ) + .then(() => console.log('MongoDB Connected')) + .catch(err => console.log(err)); // settings app.set('port', process.env.PORT || 3000); From 1cb1e1f916d9805ede687b6349a964d8929233f8 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 11:18:30 -0300 Subject: [PATCH 08/55] Add models, routes, schemas folders Signed-off-by: Rafael Makaha --- src/models/index.js | 0 src/routes/index.js | 12 ------------ src/schemas/index.js | 0 3 files changed, 12 deletions(-) create mode 100644 src/models/index.js create mode 100644 src/schemas/index.js diff --git a/src/models/index.js b/src/models/index.js new file mode 100644 index 0000000..e69de29 diff --git a/src/routes/index.js b/src/routes/index.js index a9ecae6..e69de29 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -1,12 +0,0 @@ -const { Router } = require('express'); -const router = Router(); - -router.get('/test', (req, res) => { - const data = { - "name": "Zeca", - "website": "google.com" - } - res.json(data) -}); - -module.exports = router; \ No newline at end of file diff --git a/src/schemas/index.js b/src/schemas/index.js new file mode 100644 index 0000000..e69de29 From 8e9d7de55ee12ed30853b4bdab02c023128f5028 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 11:19:01 -0300 Subject: [PATCH 09/55] Add Joi package to project Signed-off-by: Rafael Makaha --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 8ef7b92..f952ad0 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "homepage": "https://github.com/fga-eps-mds/2020.1-Grupo2-backend#readme", "dependencies": { "express": "^4.17.1", + "joi": "^17.2.1", "mongoose": "^5.10.5", "morgan": "^1.10.0" }, From 243af33eaa3819045a5c4f7aebd7c3ecf3a0d638 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 11:19:31 -0300 Subject: [PATCH 10/55] Add item model Signed-off-by: Rafael Makaha --- src/models/item.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/models/item.js diff --git a/src/models/item.js b/src/models/item.js new file mode 100644 index 0000000..f550f7d --- /dev/null +++ b/src/models/item.js @@ -0,0 +1,17 @@ +const mongoose = require('mongoose'); + +var ItemSchema = mongoose.Schema({ + name: { + type: String, + unique: true, + required: true + }, + email: { + type: String, + required: true + }, +},{ + timestamps: true +}); + +module.exports = Item = mongoose.model('Item', ItemSchema); \ No newline at end of file From 136cea2fd4622f42a29f1f892e501b477167aef2 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 11:20:32 -0300 Subject: [PATCH 11/55] Add item schema Signed-off-by: Rafael Makaha --- src/schemas/itemSchema.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/schemas/itemSchema.js diff --git a/src/schemas/itemSchema.js b/src/schemas/itemSchema.js new file mode 100644 index 0000000..75db8f2 --- /dev/null +++ b/src/schemas/itemSchema.js @@ -0,0 +1,6 @@ +const Joi = require('joi'); + +module.exports = ItemSchema = Joi.object({ + name: Joi.string().min(4).max(30).required(), + email: Joi.string().email().required(), +}) \ No newline at end of file From 9dcc4d5f3ec1171434b3c1aee58e7c06138e26ac Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 11:21:32 -0300 Subject: [PATCH 12/55] Add item routes Signed-off-by: Rafael Makaha --- src/routes/itemRoutes.js | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/routes/itemRoutes.js diff --git a/src/routes/itemRoutes.js b/src/routes/itemRoutes.js new file mode 100644 index 0000000..a1d8b76 --- /dev/null +++ b/src/routes/itemRoutes.js @@ -0,0 +1,73 @@ +const { Router } = require('express'); +const router = Router(); +const Item = require('../models/item'); +const ItemSchema = require('../schemas/itemSchema'); + +// Get all +router.get('/', async (req,res,next) => { + try { + const items = await Item.find(); + res.send(items); + } catch (error) { + next(error); + } +}); + +// Create One +router.post('/add', async (req, res, next) => { + try { + const value = await ItemSchema.validateAsync(req.body, { abortEarly: false }); + const validated = new Item(value); + const inserted = await validated.save(); + res.json(inserted); + } catch (error) { + next(error); + } +}); + +// Get One +router.get('/:id', async (req, res, next) => { + try { + const { id } = req.params; + const item = await Item.findOne({ + _id: id + }); + if (!item) return next(); + return res.json(item); + } catch (error) { + next(error); + } +}) + +// Edit One +router.put('/edit/:id', async (req,res, next) => { + try { + const { id } = req.params; + const value = await ItemSchema.validateAsync(req.body, { abortEarly: false }) + const item = await Item.findOne({ + _id: id + }); + if (!item) return next(); + const updated = await Item.update({ + _id: id + }, { + $set: value + }); + res.json(updated); + } catch (error) { + next(error); + } +}); + +router.delete('/delete/:id', async (req,res,next) => { + try { + const { id } = req.params; + const deleted = await Item.remove({_id: id}); + res.json(deleted); + } catch (error) { + next(error); + } +}); + + +module.exports = router; \ No newline at end of file From 2d0bb254e0958d07e4a9b3994edf17d7937840e3 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 11:25:35 -0300 Subject: [PATCH 13/55] Add item routes to API Signed-off-by: Rafael Makaha --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 81b0200..62a985b 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,8 @@ const app = express(); const morgan = require('morgan'); const mongoose = require('mongoose'); +const itemRoutes = require('./routes/itemRoutes'); + // MongoDB connection mongoose .connect( @@ -22,7 +24,7 @@ app.use(express.urlencoded({extended: false})); app.use(express.json()); // routes -app.use(require('./routes/index.js')); +app.use('/item',itemRoutes); // starting the server app.listen(app.get('port'), () => { From f7d15c966c306074f62bb32bff4edd2527167068 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 14:07:57 -0300 Subject: [PATCH 14/55] Update package-lock.json Signed-off-by: Rafael Makaha --- package-lock.json | 245 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 243 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index dbb2a56..39ed5c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,37 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@hapi/address": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-4.1.0.tgz", + "integrity": "sha512-SkszZf13HVgGmChdHo/PxchnSaCJ6cetVqLzyciudzZRT0jcOouIF/Q93mgjw8cce+D+4F4C1Z/WrfFN+O3VHQ==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@hapi/formula": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-2.0.0.tgz", + "integrity": "sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==" + }, + "@hapi/hoek": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.1.0.tgz", + "integrity": "sha512-i9YbZPN3QgfighY/1X1Pu118VUz2Fmmhd6b2n0/O8YVgGGfw0FbUYoA97k7FkpGJ+pLCFEDLUmAPPV4D1kpeFw==" + }, + "@hapi/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-vzXR5MY7n4XeIvLpfl3HtE3coZYO4raKXW766R6DZw/6aLqR26iuZ109K7a0NtF2Db0jxqh7xz2AxkUwpUFybw==" + }, + "@hapi/topo": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz", + "integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -103,6 +134,20 @@ "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, + "bl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", + "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -207,6 +252,11 @@ "fill-range": "^7.0.1" } }, + "bson": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz", + "integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg==" + }, "bytes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", @@ -330,6 +380,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -365,6 +420,11 @@ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", "dev": true }, + "denque": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz", + "integrity": "sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==" + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -717,12 +777,34 @@ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", "dev": true }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "joi": { + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.2.1.tgz", + "integrity": "sha512-YT3/4Ln+5YRpacdmfEfrrKh50/kkgX3LgBltjqnlMPIYiZ4hxXZuVJcxmsvxsdeHg9soZfE3qXxHC2tMpCCBOA==", + "requires": { + "@hapi/address": "^4.1.0", + "@hapi/formula": "^2.0.0", + "@hapi/hoek": "^9.0.0", + "@hapi/pinpoint": "^2.0.0", + "@hapi/topo": "^5.0.0" + } + }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", "dev": true }, + "kareem": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.1.tgz", + "integrity": "sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw==" + }, "keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -769,6 +851,12 @@ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, + "memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -818,6 +906,54 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, + "mongodb": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.2.tgz", + "integrity": "sha512-sSZOb04w3HcnrrXC82NEh/YGCmBuRgR+C1hZgmmv4L6dBz4BkRse6Y8/q/neXer9i95fKUBbFi4KgeceXmbsOA==", + "requires": { + "bl": "^2.2.1", + "bson": "^1.1.4", + "denque": "^1.4.1", + "require_optional": "^1.0.1", + "safe-buffer": "^5.1.2", + "saslprep": "^1.0.0" + } + }, + "mongoose": { + "version": "5.10.5", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.10.5.tgz", + "integrity": "sha512-BOQZsZn9Y79f3rWZFLD1gvOLNN5gOiGvGr5raqQ5v/T4fdAmnjXGCVynpW4SRnQLtrcCeLXyaaXVRT75863Q0w==", + "requires": { + "bson": "^1.1.4", + "kareem": "2.3.1", + "mongodb": "3.6.2", + "mongoose-legacy-pluralize": "1.0.2", + "mpath": "0.7.0", + "mquery": "3.2.2", + "ms": "2.1.2", + "regexp-clone": "1.0.0", + "safe-buffer": "5.2.1", + "sift": "7.0.1", + "sliced": "1.0.1" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + } + } + }, + "mongoose-legacy-pluralize": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", + "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" + }, "morgan": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", @@ -837,6 +973,33 @@ } } }, + "mpath": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.7.0.tgz", + "integrity": "sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg==" + }, + "mquery": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.2.tgz", + "integrity": "sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==", + "requires": { + "bluebird": "3.5.1", + "debug": "3.1.0", + "regexp-clone": "^1.0.0", + "safe-buffer": "5.1.2", + "sliced": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -973,6 +1136,11 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "proxy-addr": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", @@ -1040,6 +1208,20 @@ "strip-json-comments": "~2.0.1" } }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, "readdirp": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", @@ -1049,6 +1231,11 @@ "picomatch": "^2.2.1" } }, + "regexp-clone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", + "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" + }, "registry-auth-token": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz", @@ -1067,6 +1254,20 @@ "rc": "^1.2.8" } }, + "require_optional": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", + "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", + "requires": { + "resolve-from": "^2.0.0", + "semver": "^5.1.0" + } + }, + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + }, "responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", @@ -1086,11 +1287,19 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "saslprep": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", + "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", + "optional": true, + "requires": { + "sparse-bitfield": "^3.0.3" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "semver-diff": { "version": "3.1.1", @@ -1152,12 +1361,31 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, + "sift": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", + "integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==" + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + }, + "sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", + "optional": true, + "requires": { + "memory-pager": "^1.0.2" + } + }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -1203,6 +1431,14 @@ } } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -1391,6 +1627,11 @@ "prepend-http": "^2.0.0" } }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", From ae95ad39870cd34399beba2902b651c153450641 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 15:48:07 -0300 Subject: [PATCH 15/55] Removes volume from Dockerfile Signed-off-by: Rafael Makaha --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77b1731..6df965d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,12 @@ FROM node:14.10.1-alpine3.10 WORKDIR /app -VOLUME .:/app - COPY ./package.json . RUN npm install +COPY . . + EXPOSE 3000 ENTRYPOINT [ "npm", "run", "dev" ] \ No newline at end of file From 0d1ef0504c7e140977390ab9f55085c69e3e4c94 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 15:48:40 -0300 Subject: [PATCH 16/55] Changes volume on docker-compose.yml Signed-off-by: Rafael Makaha --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5071b6d..a8483b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: ports: - 3000:3000 volumes: - - .:/app + - ./src:/app/src links: - mongo mongo: From e572216278735874d2408d7ab170c8b65d5caa04 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 15:49:01 -0300 Subject: [PATCH 17/55] Add dockerignore file Signed-off-by: Rafael Makaha --- .dockerignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..edd83c0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +npm-debug.log +Dockerfile +.dockerignore \ No newline at end of file From 2c1f8ad23fb16104f0a4ee124f6d91d70c4a15ab Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 15:49:21 -0300 Subject: [PATCH 18/55] Add Makefile with iterative container command Signed-off-by: Rafael Makaha --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e58b344 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +.PHONY: serve build push + +help: + @echo "" + @echo "Usage: make COMMAND" + @echo "" + @echo "A Makefile for building and deploying mkdocs markdown website" + @echo "" + @echo "Commands:" + @echo "bash Enters iterative mode on backend" + @echo "" + +# all: run + +# clear1: +# sudo docker rm $(sudo docker ps -a -q) + +# clear2: +# sudo docker image prune + +# clear3: +# sudo docker volume prune + +bash: + sudo docker exec -it backend sh \ No newline at end of file From 55025a63c306702acebd808b15a119243d5d5a19 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Wed, 16 Sep 2020 17:22:36 -0300 Subject: [PATCH 19/55] Add docker command to makefile Signed-off-by: Rafael Makaha --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index e58b344..478c68c 100644 --- a/Makefile +++ b/Makefile @@ -21,5 +21,11 @@ help: # clear3: # sudo docker volume prune +run: + sudo docker-compose up --build + +down: + sudo docker-compose down + bash: sudo docker exec -it backend sh \ No newline at end of file From 1474a3abf0d2062d8190f1d56cdc9c00496dd439 Mon Sep 17 00:00:00 2001 From: Marofelipe Date: Sun, 13 Sep 2020 19:40:24 -0300 Subject: [PATCH 20/55] Add .Env and basic of architecture Co-authored-by : Antonio Ruan Moura Barreto --- .gitignore | 2 +- package-lock.json | 5 + package.json | 2 + src/config/index.js | 5 + src/index.js | 9 +- yarn.lock | 1178 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 1198 insertions(+), 3 deletions(-) create mode 100644 src/config/index.js create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index 59f47b5..214574e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /node_modules .env package-lock.json -yarn.lock \ No newline at end of file +yarn.lock diff --git a/package-lock.json b/package-lock.json index 39ed5c9..aec6cbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -444,6 +444,11 @@ "is-obj": "^2.0.0" } }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", diff --git a/package.json b/package.json index f952ad0..5c7fbbd 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ }, "homepage": "https://github.com/fga-eps-mds/2020.1-Grupo2-backend#readme", "dependencies": { + "body-parser": "^1.19.0", + "dotenv": "^8.2.0", "express": "^4.17.1", "joi": "^17.2.1", "mongoose": "^5.10.5", diff --git a/src/config/index.js b/src/config/index.js new file mode 100644 index 0000000..d112692 --- /dev/null +++ b/src/config/index.js @@ -0,0 +1,5 @@ +module.exports = { + app : { + port: process.env.PORT || 5000, + }, +}; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 62a985b..ed1e4a5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,5 @@ +require('dotenv').config(); +const config = require('./config') const express = require('express'); const app = express(); const morgan = require('morgan'); @@ -27,6 +29,9 @@ app.use(express.json()); app.use('/item',itemRoutes); // starting the server -app.listen(app.get('port'), () => { - console.log(`Server on port ${app.get('port')}`); +app.listen(config.app.port, (err) => { + if (err) + console.log('Erro') + + console.log(`Server on port ${config.app.port}`); }); \ No newline at end of file diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..a1f8f88 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1178 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== + +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + +"@types/color-name@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +ansi-align@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" + integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== + dependencies: + string-width "^3.0.0" + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" + integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== + dependencies: + "@types/color-name" "^1.1.1" + color-convert "^2.0.1" + +anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +basic-auth@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a" + integrity sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg== + dependencies: + safe-buffer "5.1.2" + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +body-parser@1.19.0, body-parser@^1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + +boxen@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" + integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^5.3.1" + chalk "^3.0.0" + cli-boxes "^2.2.0" + string-width "^4.1.0" + term-size "^2.1.0" + type-fest "^0.8.1" + widest-line "^3.1.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@^3.2.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.2.tgz#38dc8e658dec3809741eb3ef7bb0a47fe424232d" + integrity sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.4.0" + optionalDependencies: + fsevents "~2.1.2" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cli-boxes@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +configstore@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" + integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== + dependencies: + dot-prop "^5.2.0" + graceful-fs "^4.1.2" + make-dir "^3.0.0" + unique-string "^2.0.0" + write-file-atomic "^3.0.0" + xdg-basedir "^4.0.0" + +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + +crypto-random-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" + integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== + +debug@2.6.9, debug@^2.2.0: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +defer-to-connect@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" + integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +depd@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + +dot-prop@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" + integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== + dependencies: + is-obj "^2.0.0" + +dotenv@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" + integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +escape-goat@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" + integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + +express@^4.17.1: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +global-dirs@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.0.1.tgz#acdf3bb6685bcd55cb35e8a052266569e9469201" + integrity sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A== + dependencies: + ini "^1.3.5" + +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +graceful-fs@^4.1.2: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-yarn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" + integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== + +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore-by-default@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" + integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= + +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inherits@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^1.3.5, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-installed-globally@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141" + integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== + dependencies: + global-dirs "^2.0.1" + is-path-inside "^3.0.1" + +is-npm@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" + integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + +is-path-inside@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" + integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== + +is-typedarray@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-yarn-global@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" + integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== + dependencies: + json-buffer "3.0.0" + +latest-version@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" + integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== + dependencies: + package-json "^6.3.0" + +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + +mime-db@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== + +mime-types@~2.1.24: + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + dependencies: + mime-db "1.44.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +morgan@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" + integrity sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ== + dependencies: + basic-auth "~2.0.1" + debug "2.6.9" + depd "~2.0.0" + on-finished "~2.3.0" + on-headers "~1.0.2" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + +nodemon@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.4.tgz#55b09319eb488d6394aa9818148c0c2d1c04c416" + integrity sha512-Ltced+hIfTmaS28Zjv1BM552oQ3dbwPqI4+zI0SLgq+wpJhSyqgYude/aZa/3i31VCQWMfXJVxvu86abcam3uQ== + dependencies: + chokidar "^3.2.2" + debug "^3.2.6" + ignore-by-default "^1.0.1" + minimatch "^3.0.4" + pstree.remy "^1.1.7" + semver "^5.7.1" + supports-color "^5.5.0" + touch "^3.1.0" + undefsafe "^2.0.2" + update-notifier "^4.0.0" + +nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= + dependencies: + abbrev "1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@^4.1.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" + integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +on-headers@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" + integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== + +once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== + +package-json@^6.3.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" + integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== + dependencies: + got "^9.6.0" + registry-auth-token "^4.0.0" + registry-url "^5.0.0" + semver "^6.2.0" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + +proxy-addr@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" + integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.1" + +pstree.remy@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" + integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pupa@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.0.1.tgz#dbdc9ff48ffbea4a26a069b6f9f7abb051008726" + integrity sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA== + dependencies: + escape-goat "^2.0.0" + +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + +rc@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readdirp@~3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada" + integrity sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ== + dependencies: + picomatch "^2.2.1" + +registry-auth-token@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.0.tgz#1d37dffda72bbecd0f581e4715540213a65eb7da" + integrity sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w== + dependencies: + rc "^1.2.8" + +registry-url@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" + integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== + dependencies: + rc "^1.2.8" + +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver-diff@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" + integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== + dependencies: + semver "^6.3.0" + +semver@^5.7.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + +signal-exit@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +"statuses@>= 1.5.0 < 2", statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.0.0, string-width@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +term-size@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.0.tgz#1f16adedfe9bdc18800e1776821734086fcc6753" + integrity sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw== + +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + +touch@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" + integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== + dependencies: + nopt "~1.0.10" + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +undefsafe@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae" + integrity sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A== + dependencies: + debug "^2.2.0" + +unique-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" + integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== + dependencies: + crypto-random-string "^2.0.0" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +update-notifier@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.1.tgz#895fc8562bbe666179500f9f2cebac4f26323746" + integrity sha512-9y+Kds0+LoLG6yN802wVXoIfxYEwh3FlZwzMwpCZp62S2i1/Jzeqb9Eeeju3NSHccGGasfGlK5/vEHbAifYRDg== + dependencies: + boxen "^4.2.0" + chalk "^3.0.0" + configstore "^5.0.1" + has-yarn "^2.1.0" + import-lazy "^2.1.0" + is-ci "^2.0.0" + is-installed-globally "^0.3.1" + is-npm "^4.0.0" + is-yarn-global "^0.3.0" + latest-version "^5.0.0" + pupa "^2.0.1" + semver-diff "^3.1.1" + xdg-basedir "^4.0.0" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + +xdg-basedir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" + integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== From d7b4dbb09bb88b15f690a280e7566f8a83504afd Mon Sep 17 00:00:00 2001 From: Marofelipe Date: Sun, 13 Sep 2020 21:11:10 -0300 Subject: [PATCH 21/55] Add Controllers,models,database conection Co-authored-by: Antonio Ruan Moura Barreto --- src/config/index.js | 2 +- src/controller/plantController.js | 18 +++ src/database/BancoMongo.js | 6 + src/index.js | 6 + src/model/Plant.js | 27 +++++ yarn.lock | 186 +++++++++++++++++++++++++++++- 6 files changed, 240 insertions(+), 5 deletions(-) create mode 100644 src/controller/plantController.js create mode 100644 src/database/BancoMongo.js create mode 100644 src/model/Plant.js diff --git a/src/config/index.js b/src/config/index.js index d112692..aef1de3 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,5 +1,5 @@ module.exports = { app : { - port: process.env.PORT || 5000, + port: process.env.PORT || 3000, }, }; \ No newline at end of file diff --git a/src/controller/plantController.js b/src/controller/plantController.js new file mode 100644 index 0000000..885cd6f --- /dev/null +++ b/src/controller/plantController.js @@ -0,0 +1,18 @@ +const express = require('express'); + +const Plant = require('../model/Plant'); + +const router = express.Router(); + +router.post('/register', async (req , res) => { + try{ + const plant = await Plant.create(req.body); + + return res.send({ plant }); + }catch (err){ + return res.status(400).send({ error: 'Registration failed'}); + } +}); + + +module.exports = app => app.use('/plant' , router); \ No newline at end of file diff --git a/src/database/BancoMongo.js b/src/database/BancoMongo.js new file mode 100644 index 0000000..bdd9aff --- /dev/null +++ b/src/database/BancoMongo.js @@ -0,0 +1,6 @@ +const mongoose = require('mongose'); + +mongoose.connect('mongodb://localhost/noderest', { useMongoClient: true}); +mongoose.Promise = global.Promise; + +module.exports = mongoose; diff --git a/src/index.js b/src/index.js index ed1e4a5..b34dd7a 100644 --- a/src/index.js +++ b/src/index.js @@ -28,6 +28,12 @@ app.use(express.json()); // routes app.use('/item',itemRoutes); + +//Controller +require('./controller/plantController')(app); + + + // starting the server app.listen(config.app.port, (err) => { if (err) diff --git a/src/model/Plant.js b/src/model/Plant.js new file mode 100644 index 0000000..9b7ed3b --- /dev/null +++ b/src/model/Plant.js @@ -0,0 +1,27 @@ +const mongoose = require('mongoose'); + +const PlantSchema = new mongoose.Schema({ + scientificName: { + type: String, + require: true + }, + Family: { + type: String, + require: true + }, + gbifID: { + type: String, + require: true, + unique:true + }, + stateProvince: { + type: String, + require : true + }, + +}); + + +const Plant = mongoose.model('Plant',PlantSchema); + +module.exports = Plant; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a1f8f88..c81745f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -87,6 +87,19 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== +bl@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.1.tgz#8c11a7b730655c5d56898cdc871224f40fd901d5" + integrity sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +bluebird@3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" + integrity sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== + body-parser@1.19.0, body-parser@^1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -132,6 +145,11 @@ braces@~3.0.2: dependencies: fill-range "^7.0.1" +bson@^1.1.4: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.5.tgz#2aaae98fcdf6750c0848b0cba1ddec3c73060a34" + integrity sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg== + bytes@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" @@ -246,6 +264,11 @@ cookie@0.4.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + crypto-random-string@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" @@ -258,6 +281,13 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + debug@^3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" @@ -282,6 +312,11 @@ defer-to-connect@^1.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +denque@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf" + integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ== + depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -546,7 +581,7 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -inherits@2.0.4: +inherits@2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -635,11 +670,21 @@ is-yarn-global@^0.3.0: resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + json-buffer@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= +kareem@2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.1.tgz#def12d9c941017fabfb00f873af95e9c99e1be87" + integrity sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw== + keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -676,6 +721,11 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= +memory-pager@^1.0.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" + integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg== + merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" @@ -720,6 +770,41 @@ minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +mongodb@3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.6.2.tgz#1154a4ac107bf1375112d83a29c5cf97704e96b6" + integrity sha512-sSZOb04w3HcnrrXC82NEh/YGCmBuRgR+C1hZgmmv4L6dBz4BkRse6Y8/q/neXer9i95fKUBbFi4KgeceXmbsOA== + dependencies: + bl "^2.2.1" + bson "^1.1.4" + denque "^1.4.1" + require_optional "^1.0.1" + safe-buffer "^5.1.2" + optionalDependencies: + saslprep "^1.0.0" + +mongoose-legacy-pluralize@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4" + integrity sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ== + +mongoose@^5.10.5: + version "5.10.5" + resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.10.5.tgz#47bef488d1fd39ab9c93ab05a9b6d0b08fd8c662" + integrity sha512-BOQZsZn9Y79f3rWZFLD1gvOLNN5gOiGvGr5raqQ5v/T4fdAmnjXGCVynpW4SRnQLtrcCeLXyaaXVRT75863Q0w== + dependencies: + bson "^1.1.4" + kareem "2.3.1" + mongodb "3.6.2" + mongoose-legacy-pluralize "1.0.2" + mpath "0.7.0" + mquery "3.2.2" + ms "2.1.2" + regexp-clone "1.0.0" + safe-buffer "5.2.1" + sift "7.0.1" + sliced "1.0.1" + morgan@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" @@ -731,6 +816,22 @@ morgan@^1.10.0: on-finished "~2.3.0" on-headers "~1.0.2" +mpath@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/mpath/-/mpath-0.7.0.tgz#20e8102e276b71709d6e07e9f8d4d0f641afbfb8" + integrity sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg== + +mquery@3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/mquery/-/mquery-3.2.2.tgz#e1383a3951852ce23e37f619a9b350f1fb3664e7" + integrity sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q== + dependencies: + bluebird "3.5.1" + debug "3.1.0" + regexp-clone "^1.0.0" + safe-buffer "5.1.2" + sliced "1.0.1" + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -741,7 +842,7 @@ ms@2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -ms@^2.1.1: +ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -838,6 +939,11 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + proxy-addr@~2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" @@ -896,6 +1002,19 @@ rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" +readable-stream@^2.3.5: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + readdirp@~3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada" @@ -903,6 +1022,11 @@ readdirp@~3.4.0: dependencies: picomatch "^2.2.1" +regexp-clone@1.0.0, regexp-clone@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63" + integrity sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw== + registry-auth-token@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.0.tgz#1d37dffda72bbecd0f581e4715540213a65eb7da" @@ -917,6 +1041,19 @@ registry-url@^5.0.0: dependencies: rc "^1.2.8" +require_optional@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e" + integrity sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g== + dependencies: + resolve-from "^2.0.0" + semver "^5.1.0" + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= + responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -924,16 +1061,28 @@ responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" -safe-buffer@5.1.2: +safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-buffer@5.2.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +saslprep@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226" + integrity sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag== + dependencies: + sparse-bitfield "^3.0.3" + semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" @@ -941,7 +1090,7 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -semver@^5.7.1: +semver@^5.1.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -985,11 +1134,28 @@ setprototypeof@1.1.1: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +sift@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/sift/-/sift-7.0.1.tgz#47d62c50b159d316f1372f8b53f9c10cd21a4b08" + integrity sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g== + signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +sliced@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41" + integrity sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E= + +sparse-bitfield@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11" + integrity sha1-/0rm5oZWBWuks+eSqzM004JzyhE= + dependencies: + memory-pager "^1.0.2" + "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -1013,6 +1179,13 @@ string-width@^4.0.0, string-width@^4.1.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + strip-ansi@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" @@ -1140,6 +1313,11 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" From cab57856185577fa632eda10da26ded461ae5f28 Mon Sep 17 00:00:00 2001 From: Antonio Ruan Moura Barreto Date: Mon, 14 Sep 2020 13:32:33 -0300 Subject: [PATCH 22/55] Bugs fixed Co-authored-by: Marcos Felipe De Almeida Souza --- src/database/BancoMongo.js | 7 ++++--- src/model/Plant.js | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/database/BancoMongo.js b/src/database/BancoMongo.js index bdd9aff..729359b 100644 --- a/src/database/BancoMongo.js +++ b/src/database/BancoMongo.js @@ -1,6 +1,7 @@ -const mongoose = require('mongose'); +const mongoose = require('mongoose'); -mongoose.connect('mongodb://localhost/noderest', { useMongoClient: true}); +mongoose.set('useCreateIndex', true); +mongoose.connect('mongodb://localhost:27017/noderest', {useNewUrlParser : true, useUnifiedTopology: true}); mongoose.Promise = global.Promise; -module.exports = mongoose; +module.exports = mongoose; \ No newline at end of file diff --git a/src/model/Plant.js b/src/model/Plant.js index 9b7ed3b..6b02bbc 100644 --- a/src/model/Plant.js +++ b/src/model/Plant.js @@ -1,16 +1,16 @@ -const mongoose = require('mongoose'); +const mongoose = require('../database/BancoMongo.js'); const PlantSchema = new mongoose.Schema({ scientificName: { type: String, require: true }, - Family: { + family: { type: String, require: true }, gbifID: { - type: String, + type: Number, require: true, unique:true }, @@ -18,7 +18,6 @@ const PlantSchema = new mongoose.Schema({ type: String, require : true }, - }); From a036355ed72ca1aee3d2310b99147daa49b06009 Mon Sep 17 00:00:00 2001 From: Marofelipe Date: Mon, 14 Sep 2020 19:09:16 -0300 Subject: [PATCH 23/55] Add topic's model and some changes in controllers Co-authored-by: Antonio Ruan Moura Barreto --- src/controller/commentController.js | 19 ++++++++++ src/controller/plantController.js | 57 +++++++++++++++++++++++++++- src/controller/topicController.js | 58 +++++++++++++++++++++++++++++ src/index.js | 2 + src/model/Comment.js | 36 ++++++++++++++++++ src/model/Plant.js | 43 ++++++++++++++++++++- src/model/Topico.js | 21 +++++++++++ 7 files changed, 233 insertions(+), 3 deletions(-) create mode 100644 src/controller/commentController.js create mode 100644 src/controller/topicController.js create mode 100644 src/model/Comment.js create mode 100644 src/model/Topico.js diff --git a/src/controller/commentController.js b/src/controller/commentController.js new file mode 100644 index 0000000..8ed2bf9 --- /dev/null +++ b/src/controller/commentController.js @@ -0,0 +1,19 @@ +const express = require('express'); +const Plant = require('../model/Plant'); +const Topico = require('../model/Topico'); +const Comment = require('../model/Comment'); + +const router = express.Router(); + +router.post('/register', async (req , res) => { + try{ + const comment = await Comment.create(req.body); + + return res.send({ comment }); + }catch (err){ + return res.status(400).send({ error: 'Registration failed'}); + } +}); + + +module.exports = app => app.use('/comment' , router); \ No newline at end of file diff --git a/src/controller/plantController.js b/src/controller/plantController.js index 885cd6f..a6f9527 100644 --- a/src/controller/plantController.js +++ b/src/controller/plantController.js @@ -1,18 +1,73 @@ const express = require('express'); const Plant = require('../model/Plant'); +const Topico = require('../model/Topico'); const router = express.Router(); +//registro de uma nova planta router.post('/register', async (req , res) => { try{ - const plant = await Plant.create(req.body); + const { scientificName,family_name,gender_name,specie_name,common_name,usage,first_User,collection_count,extinction,profile_picture, gbifID,stateProvince,topicos} = req.body; + + const plant = await Plant.create({scientificName,family_name,gender_name,specie_name,common_name,usage,first_User,collection_count,extinction,profile_picture, gbifID,stateProvince}); + + topicos.map(topico =>{ + const plantTopic = new Topico({...topico,plant : plant._id}); + + plantTopic.save().then(topico => plant.topicos.push(topico)); + }); + + await plant.save(); + return res.send({ plant }); }catch (err){ return res.status(400).send({ error: 'Registration failed'}); } }); +//Listagem de Todas as plantas +router.get('/', async (req , res) => { + try{ + const plants = await Plant.find().populate('topic'); + + return res.send({ plants }); + }catch (err){ + return res.status(400).send({ error: 'Loading plants failed'}); + } +}); +//Procurando planta por id +router.get('/:plantId', async (req , res) => { + try{ + const plant = await Plant.findById(req.params.plantId).populate('topic'); + + return res.send({ plant }); + }catch (err){ + return res.status(400).send({ error: 'error when searching for this plant '}); + } +}); +//Deletando planta por id +router.delete('/:plantId', async (req , res) => { + try{ + await Plant.findByIdAndRemove(req.params.plantId); + + return res.send(); + }catch (err){ + return res.status(400).send({ error: 'Error when Delete this plant'}); + } +}); +//Dando upgrade planta por id +router.put('/:plantId', async (req , res) => { + try{ + await Plant.findByIdAndRemove(req.params.plantId); + + const plants = await Plant.find().populate('topic'); + + return res.send({ plants }); + }catch (err){ + return res.status(400).send({ error: 'Error when Delete this plant'}); + } +}); module.exports = app => app.use('/plant' , router); \ No newline at end of file diff --git a/src/controller/topicController.js b/src/controller/topicController.js new file mode 100644 index 0000000..44ba63d --- /dev/null +++ b/src/controller/topicController.js @@ -0,0 +1,58 @@ +const express = require('express'); +const Plant = require('../model/Plant'); +const Topico = require('../model/Topico'); + +const router = express.Router(); + +router.post('/register', async (req , res) => { + try{ + const topic = await Topico.create(req.body); + return res.send({ topic }); + }catch (err){ + return res.status(400).send({ error: 'Registration failed'}); + } +}); +//Listando todos os topics +router.get('/', async (req , res) => { + try{ + const topics = await Topico.find(); + + return res.send({ topics }); + }catch (err){ + return res.status(400).send({ error: 'Loading plants failed'}); + } +}); +//Procurando topic por id +router.get('/:topicId', async (req , res) => { + try{ + const topico = await Topico.findById(req.params.topicId); + + return res.send({ topico }); + }catch (err){ + return res.status(400).send({ error: 'error when searching for this topic '}); + } +}); +//Deletando topic por id +router.delete('/:topicId', async (req , res) => { + try{ + await Topico.findByIdAndRemove(req.params.topicId); + + return res.send(); + }catch (err){ + return res.status(400).send({ error: 'Error when Delete this topic'}); + } +}); +//Dando upgrade topic por id +router.put('/:topicId', async (req , res) => { + try{ + await Topico.findByIdAndRemove(req.params.plantId); + + const topics = await Topico.find(); + + return res.send({ topics }); + }catch (err){ + return res.status(400).send({ error: 'Error when Delete this plant'}); + } +}); + +module.exports = app => app.use('/topic' , router); \ No newline at end of file diff --git a/src/index.js b/src/index.js index b34dd7a..069ef39 100644 --- a/src/index.js +++ b/src/index.js @@ -31,6 +31,8 @@ app.use('/item',itemRoutes); //Controller require('./controller/plantController')(app); +require('./controller/commentController')(app); +require('./controller/topicController')(app); diff --git a/src/model/Comment.js b/src/model/Comment.js new file mode 100644 index 0000000..11fd726 --- /dev/null +++ b/src/model/Comment.js @@ -0,0 +1,36 @@ +const mongoose = require('../database/BancoMongo.js'); + +const CommentSchema = new mongoose.Schema({ + username: { + type: String, + require : true + }, + message: { + type: String, + require: true + }, + vote_count:{ + type: Number, + require:true + } + +}); + + +const Comment = mongoose.model('comment',CommentSchema); + +module.exports = Comment; +//Exemplo de teste insominia +//{ +// "scientificName":"scientificName", +// "family_name":"family_name", +// "gender_name":"gender_name", +// "specie_name":"specie_name", +// "usage":"usage", +// "first_User":"first_User", +// "collection_count":"17", +// "extinction":"1", +// "profile_picture":"7", +// "gbifID":"17", +// "stateProvince":"brasilia" +//} diff --git a/src/model/Plant.js b/src/model/Plant.js index 6b02bbc..0d60d6e 100644 --- a/src/model/Plant.js +++ b/src/model/Plant.js @@ -5,10 +5,44 @@ const PlantSchema = new mongoose.Schema({ type: String, require: true }, - family: { + family_name: { type: String, require: true }, + gender_name: { + type: String, + require: true + }, + specie_name: { + type: String, + require: true + }, + common_name: { + type: String, + require: true + }, + usage: { + type: String, + require: true + }, + first_User: { + type: String, + require: true + }, + collection_count: { + type: Number, + require: true, + unique: true + }, + extinction: { + type: Boolean, + require: true + }, + profile_picture: { + type: Number, + require : true + }, + gbifID: { type: Number, require: true, @@ -18,9 +52,14 @@ const PlantSchema = new mongoose.Schema({ type: String, require : true }, + topicos: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'topic', + + }], }); -const Plant = mongoose.model('Plant',PlantSchema); +const Plant = mongoose.model('plant',PlantSchema); module.exports = Plant; \ No newline at end of file diff --git a/src/model/Topico.js b/src/model/Topico.js new file mode 100644 index 0000000..90efc41 --- /dev/null +++ b/src/model/Topico.js @@ -0,0 +1,21 @@ +const mongoose = require('../database/BancoMongo.js'); + +const TopicoSchema = new mongoose.Schema({ + plant:{ + type:mongoose.Schema.Types.ObjectId, + ref:'plant', + require:true + + }, + description: { + type: String, + require: true + } + +}); + + + +const Topico = mongoose.model('topic',TopicoSchema); + +module.exports = Topico; \ No newline at end of file From cad5c88ed6fc688a004a2e9662b59c239044c742 Mon Sep 17 00:00:00 2001 From: Marofelipe Date: Mon, 14 Sep 2020 22:56:55 -0300 Subject: [PATCH 24/55] Add TopicController without the upgrade topic Co-authored-by: Antonio Ruan Moura Barreto --- src/controller/plantController.js | 47 ++++++++++++++++++++++--------- src/controller/topicController.js | 33 ++++++++++++++++------ src/model/Plant.js | 7 ++--- 3 files changed, 60 insertions(+), 27 deletions(-) diff --git a/src/controller/plantController.js b/src/controller/plantController.js index a6f9527..ba6c8a4 100644 --- a/src/controller/plantController.js +++ b/src/controller/plantController.js @@ -12,11 +12,13 @@ router.post('/register', async (req , res) => { const plant = await Plant.create({scientificName,family_name,gender_name,specie_name,common_name,usage,first_User,collection_count,extinction,profile_picture, gbifID,stateProvince}); - topicos.map(topico =>{ + await Promise.all(topicos.map(async topico =>{ const plantTopic = new Topico({...topico,plant : plant._id}); - plantTopic.save().then(topico => plant.topicos.push(topico)); - }); + await plantTopic.save(); + + plant.topicos.push(plantTopic); + })); await plant.save(); @@ -29,7 +31,7 @@ router.post('/register', async (req , res) => { //Listagem de Todas as plantas router.get('/', async (req , res) => { try{ - const plants = await Plant.find().populate('topic'); + const plants = await Plant.find().populate('topicos'); return res.send({ plants }); }catch (err){ @@ -39,7 +41,7 @@ router.get('/', async (req , res) => { //Procurando planta por id router.get('/:plantId', async (req , res) => { try{ - const plant = await Plant.findById(req.params.plantId).populate('topic'); + const plant = await Plant.findById(req.params.plantId).populate('topicos'); return res.send({ plant }); }catch (err){ @@ -58,15 +60,32 @@ router.delete('/:plantId', async (req , res) => { }); //Dando upgrade planta por id router.put('/:plantId', async (req , res) => { - try{ - await Plant.findByIdAndRemove(req.params.plantId); - - const plants = await Plant.find().populate('topic'); - - return res.send({ plants }); - }catch (err){ - return res.status(400).send({ error: 'Error when Delete this plant'}); - } + + try{ + const { scientificName,family_name,gender_name,specie_name,common_name,usage,first_User,collection_count,extinction,profile_picture, gbifID,stateProvince,topicos} = req.body; + + const plant = await Plant.findByIdAndUpdate(req.params.plantId, + {scientificName,family_name,gender_name,specie_name,common_name,usage,first_User,collection_count,extinction,profile_picture, gbifID,stateProvince},{ new: true}); + + plant.topicos = []; + await Topico.remove({plant: plant._id}); + + await Promise.all(topicos.map(async topico =>{ + const plantTopic = new Topico({...topico,plant : plant._id}); + + await plantTopic.save(); + + plant.topicos.push(plantTopic); + })); + + await plant.save(); + + + return res.send({ plant }); + }catch (err){ + return res.status(400).send({ error: 'Registration failed'}); + } + }); diff --git a/src/controller/topicController.js b/src/controller/topicController.js index 44ba63d..6032503 100644 --- a/src/controller/topicController.js +++ b/src/controller/topicController.js @@ -3,11 +3,28 @@ const Plant = require('../model/Plant'); const Topico = require('../model/Topico'); const router = express.Router(); - -router.post('/register', async (req , res) => { +//Criar um novo topico pelo id da planta +router.put('/:plantId', async (req , res) => { + try{ - const topic = await Topico.create(req.body); - return res.send({ topic }); + const {topicos} = req.body; + + const plant = await Plant.findByIdAndUpdate(req.params.plantId, + {},{ new: true}).populate('topicos'); + + + await Promise.all(topicos.map(async topico =>{ + const plantTopic = new Topico({...topico,plant : plant._id}); + + await plantTopic.save(); + + plant.topicos.push(plantTopic); + })); + + await plant.save(); + + + return res.send({ plant }); }catch (err){ return res.status(400).send({ error: 'Registration failed'}); } @@ -45,12 +62,12 @@ router.delete('/:topicId', async (req , res) => { //Dando upgrade topic por id router.put('/:topicId', async (req , res) => { try{ - await Topico.findByIdAndRemove(req.params.plantId); - - const topics = await Topico.find(); + + await Topico.findByIdAndUpdate(req.params.topicId,{description: 'marcos felipe'},{new : true}); - return res.send({ topics }); + return res.send(); }catch (err){ + console.log(err); return res.status(400).send({ error: 'Error when Delete this plant'}); } }); diff --git a/src/model/Plant.js b/src/model/Plant.js index 0d60d6e..f03c699 100644 --- a/src/model/Plant.js +++ b/src/model/Plant.js @@ -32,7 +32,6 @@ const PlantSchema = new mongoose.Schema({ collection_count: { type: Number, require: true, - unique: true }, extinction: { type: Boolean, @@ -41,12 +40,10 @@ const PlantSchema = new mongoose.Schema({ profile_picture: { type: Number, require : true - }, - + }, gbifID: { type: Number, - require: true, - unique:true + require: true, }, stateProvince: { type: String, From 3a80880697ef142c0e4cb5a360ebd7642506dbd4 Mon Sep 17 00:00:00 2001 From: Marofelipe Date: Thu, 17 Sep 2020 17:13:20 -0300 Subject: [PATCH 25/55] Changes at the architecture, controllers was deleted and we adjusted tha connection with mongodb.Database as deleted and the connection now is on the index.js like the base Co-authored-by: Antonio Ruan Moura Barreto --- src/database/BancoMongo.js | 7 ------ src/index.js | 25 ++++++++----------- src/{model => models}/Comment.js | 2 +- src/{model => models}/Plant.js | 6 ++--- src/{model => models}/Topico.js | 2 +- .../commentRoutes.js} | 6 ++--- .../plantRoutes.js} | 4 +-- .../topicRoutes.js} | 4 +-- 8 files changed, 22 insertions(+), 34 deletions(-) delete mode 100644 src/database/BancoMongo.js rename src/{model => models}/Comment.js (92%) rename src/{model => models}/Plant.js (91%) rename src/{model => models}/Topico.js (84%) rename src/{controller/commentController.js => routes/commentRoutes.js} (74%) rename src/{controller/plantController.js => routes/plantRoutes.js} (97%) rename src/{controller/topicController.js => routes/topicRoutes.js} (95%) diff --git a/src/database/BancoMongo.js b/src/database/BancoMongo.js deleted file mode 100644 index 729359b..0000000 --- a/src/database/BancoMongo.js +++ /dev/null @@ -1,7 +0,0 @@ -const mongoose = require('mongoose'); - -mongoose.set('useCreateIndex', true); -mongoose.connect('mongodb://localhost:27017/noderest', {useNewUrlParser : true, useUnifiedTopology: true}); -mongoose.Promise = global.Promise; - -module.exports = mongoose; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 069ef39..bb07374 100644 --- a/src/index.js +++ b/src/index.js @@ -8,17 +8,13 @@ const mongoose = require('mongoose'); const itemRoutes = require('./routes/itemRoutes'); // MongoDB connection -mongoose - .connect( - 'mongodb://mongo:27017/backend', - { useNewUrlParser: true } - ) - .then(() => console.log('MongoDB Connected')) - .catch(err => console.log(err)); - -// settings -app.set('port', process.env.PORT || 3000); -app.set('json spaces', 2); + + +mongoose.set('useCreateIndex', true); +mongoose.connect('mongodb://localhost:27017/noderest', {useNewUrlParser : true, useUnifiedTopology: true}); +mongoose.Promise = global.Promise; + +module.exports = mongoose; // middlewares app.use(morgan('dev')); @@ -29,10 +25,9 @@ app.use(express.json()); app.use('/item',itemRoutes); -//Controller -require('./controller/plantController')(app); -require('./controller/commentController')(app); -require('./controller/topicController')(app); +require('./routes/plantRoutes')(app); +require('./routes/topicRoutes')(app); +require('./routes/commentRoutes')(app); diff --git a/src/model/Comment.js b/src/models/Comment.js similarity index 92% rename from src/model/Comment.js rename to src/models/Comment.js index 11fd726..4f54775 100644 --- a/src/model/Comment.js +++ b/src/models/Comment.js @@ -1,4 +1,4 @@ -const mongoose = require('../database/BancoMongo.js'); +const mongoose = require('../index.js'); const CommentSchema = new mongoose.Schema({ username: { diff --git a/src/model/Plant.js b/src/models/Plant.js similarity index 91% rename from src/model/Plant.js rename to src/models/Plant.js index f03c699..5ca96e7 100644 --- a/src/model/Plant.js +++ b/src/models/Plant.js @@ -1,4 +1,4 @@ -const mongoose = require('../database/BancoMongo.js'); +const mongoose = require('../index.js'); const PlantSchema = new mongoose.Schema({ scientificName: { @@ -31,14 +31,14 @@ const PlantSchema = new mongoose.Schema({ }, collection_count: { type: Number, - require: true, + require: true }, extinction: { type: Boolean, require: true }, profile_picture: { - type: Number, + type: String, require : true }, gbifID: { diff --git a/src/model/Topico.js b/src/models/Topico.js similarity index 84% rename from src/model/Topico.js rename to src/models/Topico.js index 90efc41..1816c84 100644 --- a/src/model/Topico.js +++ b/src/models/Topico.js @@ -1,4 +1,4 @@ -const mongoose = require('../database/BancoMongo.js'); +const mongoose = require('../index.js'); const TopicoSchema = new mongoose.Schema({ plant:{ diff --git a/src/controller/commentController.js b/src/routes/commentRoutes.js similarity index 74% rename from src/controller/commentController.js rename to src/routes/commentRoutes.js index 8ed2bf9..8aec224 100644 --- a/src/controller/commentController.js +++ b/src/routes/commentRoutes.js @@ -1,7 +1,7 @@ const express = require('express'); -const Plant = require('../model/Plant'); -const Topico = require('../model/Topico'); -const Comment = require('../model/Comment'); +const Plant = require('../models/Plant'); +const Topico = require('../models/Topico'); +const Comment = require('../models/Comment'); const router = express.Router(); diff --git a/src/controller/plantController.js b/src/routes/plantRoutes.js similarity index 97% rename from src/controller/plantController.js rename to src/routes/plantRoutes.js index ba6c8a4..8ccfea0 100644 --- a/src/controller/plantController.js +++ b/src/routes/plantRoutes.js @@ -1,7 +1,7 @@ const express = require('express'); -const Plant = require('../model/Plant'); -const Topico = require('../model/Topico'); +const Plant = require('../models/Plant'); +const Topico = require('../models/Topico'); const router = express.Router(); diff --git a/src/controller/topicController.js b/src/routes/topicRoutes.js similarity index 95% rename from src/controller/topicController.js rename to src/routes/topicRoutes.js index 6032503..cdb130e 100644 --- a/src/controller/topicController.js +++ b/src/routes/topicRoutes.js @@ -1,6 +1,6 @@ const express = require('express'); -const Plant = require('../model/Plant'); -const Topico = require('../model/Topico'); +const Plant = require('../models/Plant'); +const Topico = require('../models/Topico'); const router = express.Router(); //Criar um novo topico pelo id da planta From b1d10042e51336e88cc3efddfb8f473caf69146a Mon Sep 17 00:00:00 2001 From: Marofelipe Date: Thu, 17 Sep 2020 22:24:34 -0300 Subject: [PATCH 26/55] I really dont know what i have changed but my console ask for a commit --- package.json | 1 + src/routes/plantRoutes.js | 1 + 2 files changed, 2 insertions(+) diff --git a/package.json b/package.json index 5c7fbbd..947d067 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "dotenv": "^8.2.0", "express": "^4.17.1", "joi": "^17.2.1", + "mongodb": "^3.6.2", "mongoose": "^5.10.5", "morgan": "^1.10.0" }, diff --git a/src/routes/plantRoutes.js b/src/routes/plantRoutes.js index 8ccfea0..ec48c58 100644 --- a/src/routes/plantRoutes.js +++ b/src/routes/plantRoutes.js @@ -25,6 +25,7 @@ router.post('/register', async (req , res) => { return res.send({ plant }); }catch (err){ + console.log(err); return res.status(400).send({ error: 'Registration failed'}); } }); From a26951ed10db162eec5d764e6bcfe07534ec700d Mon Sep 17 00:00:00 2001 From: senaarth Date: Mon, 14 Sep 2020 18:16:47 -0300 Subject: [PATCH 27/55] Update dependencies. Co-authored-by: Victor Santos --- package-lock.json | 130 ++++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- 2 files changed, 110 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 39ed5c9..b4d2667 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "2020.1-Grupo2-backend", + "name": "2020.1-grupo2-backend", "version": "1.0.0", "lockfileVersion": 1, "requires": true, @@ -99,6 +99,14 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", @@ -120,14 +128,6 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "requires": { - "safe-buffer": "5.1.2" - } - }, "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", @@ -300,6 +300,16 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, + "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" + } + }, "chokidar": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", @@ -337,6 +347,19 @@ "mimic-response": "^1.0.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=" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -486,6 +509,11 @@ "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", @@ -528,6 +556,11 @@ "vary": "~1.1.2" } }, + "filesize": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", + "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==" + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -623,8 +656,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-yarn": { "version": "2.1.0", @@ -966,10 +998,47 @@ "on-headers": "~1.0.2" }, "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + } + } + }, + "mongoose-legacy-pluralize": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", + "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" + }, + "mpath": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.7.0.tgz", + "integrity": "sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg==" + }, + "mquery": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.2.tgz", + "integrity": "sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==", + "requires": { + "bluebird": "3.5.1", + "debug": "3.1.0", + "regexp-clone": "^1.0.0", + "safe-buffer": "5.1.2", + "sliced": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } } } }, @@ -1074,11 +1143,6 @@ "ee-first": "1.1.1" } }, - "on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1458,7 +1522,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -1642,6 +1705,31 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, + "volleyball": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/volleyball/-/volleyball-1.5.1.tgz", + "integrity": "sha512-JUY9rRJRKTlhcDkbeoVNyqduCvZlI/GFQJx6G4loWRUD6KRvBepO5E0mVB6tgvjiSwjhs7DBru8unpNUK7FZgg==", + "requires": { + "chalk": "^2.4.0", + "debug": "^3.1.0", + "filesize": "^3.6.1" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/package.json b/package.json index f952ad0..01ae5e3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "2020.1-Grupo2-backend", + "name": "2020.1-grupo2-backend", "version": "1.0.0", "description": "", "main": "index.js", From a158dd6bb77d9ed634cf4bc169fd1c81db00e3dc Mon Sep 17 00:00:00 2001 From: senaarth Date: Mon, 14 Sep 2020 18:28:01 -0300 Subject: [PATCH 28/55] Setting environment, error handlers and middlewares. Co-authored-by: Victor Santos --- src/index.js | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 62a985b..c756ea1 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,7 @@ const express = require('express'); +const volleyball = require('volleyball'); +const mongoose = require('mongoose'); + const app = express(); const morgan = require('morgan'); const mongoose = require('mongoose'); @@ -19,14 +22,37 @@ app.set('port', process.env.PORT || 3000); app.set('json spaces', 2); // middlewares -app.use(morgan('dev')); +app.use(volleyball); app.use(express.urlencoded({extended: false})); app.use(express.json()); // routes app.use('/item',itemRoutes); +app.use(require('./routes')); + +function notFound(req, res, next) { + res.status(404); + const error = new Error('Not Found - ' + req.originalUrl); + next(error); +} + +function errorHandler(err, req, res, next) { + res.status(res.statusCode || 500); + res.json({ + message: err.messege, + stack: err.stack + }); +} + +app.use(notFound); +app.use(errorHandler); // starting the server -app.listen(app.get('port'), () => { - console.log(`Server on port ${app.get('port')}`); -}); \ No newline at end of file + +mongoose.connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true }) + .then(() => { + app.listen(app.get('port'), () => { + console.log(`Server on port ${app.get('port')}`); + }); + }) + .catch(err => console.log(err)); From 190069b07d2d5afc68eec12946be42a215de9439 Mon Sep 17 00:00:00 2001 From: senaarth Date: Mon, 14 Sep 2020 18:38:33 -0300 Subject: [PATCH 29/55] Creating authentication routes Co-authored-by: Victor Santos --- src/index.js | 2 ++ src/routes/auth/index.js | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/routes/auth/index.js diff --git a/src/index.js b/src/index.js index c756ea1..c2563ba 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ const express = require('express'); const volleyball = require('volleyball'); const mongoose = require('mongoose'); +const auth = require('./routes/auth'); const app = express(); const morgan = require('morgan'); @@ -29,6 +30,7 @@ app.use(express.json()); // routes app.use('/item',itemRoutes); app.use(require('./routes')); +app.use('/auth', auth); function notFound(req, res, next) { res.status(404); diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js new file mode 100644 index 0000000..5f1cc62 --- /dev/null +++ b/src/routes/auth/index.js @@ -0,0 +1,12 @@ +const express = require('express'); + +const router = express.Router(); + +// Every route ir is preceded by /auth +router.get('/', (req, res) => { + res.json({ + message: 'Authentication!' + }); +}); + +module.exports = router; \ No newline at end of file From f2699bb278c60cc8bedf188cc8aa365f0f85da3b Mon Sep 17 00:00:00 2001 From: senaarth Date: Mon, 14 Sep 2020 18:46:43 -0300 Subject: [PATCH 30/55] Create user schema Co-authored-by: Victor Santos --- src/db/user.js | 17 +++++++++++++++++ src/index.js | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 src/db/user.js diff --git a/src/db/user.js b/src/db/user.js new file mode 100644 index 0000000..b366442 --- /dev/null +++ b/src/db/user.js @@ -0,0 +1,17 @@ +const mongoose = require('mongoose'); +const Schema = mongoose.Schema; + +const userSchema = new Schema({ + username: { + type: String, + required: true + }, + password: { + type: String, + required: true + } +}); + +const User = mongoose.model('User', userSchema); + +module.exports = User; \ No newline at end of file diff --git a/src/index.js b/src/index.js index c2563ba..9a0ce1f 100644 --- a/src/index.js +++ b/src/index.js @@ -32,6 +32,7 @@ app.use('/item',itemRoutes); app.use(require('./routes')); app.use('/auth', auth); +// error handlers function notFound(req, res, next) { res.status(404); const error = new Error('Not Found - ' + req.originalUrl); @@ -53,6 +54,7 @@ app.use(errorHandler); mongoose.connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true }) .then(() => { + // The server only starts when the mongoose connects to the database. app.listen(app.get('port'), () => { console.log(`Server on port ${app.get('port')}`); }); From 8771ad4a305160d0481f64dedf03601bbf48f5bd Mon Sep 17 00:00:00 2001 From: senaarth Date: Mon, 14 Sep 2020 18:54:18 -0300 Subject: [PATCH 31/55] Validate req body (username and password) Co-authored-by: Victor Santos --- src/routes/auth/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index 5f1cc62..d83594a 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -1,12 +1,31 @@ const express = require('express'); +const Joi = require('Joi'); const router = express.Router(); +const schema = Joi.object({ + username: Joi.string().alphanum().min(4).max(20).required(), + password: Joi.string().alphanum().min(8).required() +}); + // Every route ir is preceded by /auth + router.get('/', (req, res) => { res.json({ message: 'Authentication!' }); }); +router.post('/signup', (req, res) => { + const result = schema.validate(req.body); + + if(result.error) { + console.log(result.error); + next(result.error); + } else { + + } + +}); + module.exports = router; \ No newline at end of file From 66234a48acadd14c931002cb830352d4ed59d14e Mon Sep 17 00:00:00 2001 From: senaarth Date: Mon, 14 Sep 2020 19:24:33 -0300 Subject: [PATCH 32/55] Register user in the database after verifying username availability Co-authored-by: Victor Santos --- src/index.js | 6 +++--- src/routes/auth/index.js | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/index.js b/src/index.js index 9a0ce1f..cbd5841 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ const express = require('express'); const volleyball = require('volleyball'); -const mongoose = require('mongoose'); const auth = require('./routes/auth'); +const mongoose = require('mongoose'); const app = express(); const morgan = require('morgan'); @@ -32,7 +32,7 @@ app.use('/item',itemRoutes); app.use(require('./routes')); app.use('/auth', auth); -// error handlers +// Error Handlers function notFound(req, res, next) { res.status(404); const error = new Error('Not Found - ' + req.originalUrl); @@ -54,7 +54,7 @@ app.use(errorHandler); mongoose.connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true }) .then(() => { - // The server only starts when the mongoose connects to the database. + // Only starts to listen after connecting to the database app.listen(app.get('port'), () => { console.log(`Server on port ${app.get('port')}`); }); diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index d83594a..34e82de 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -1,31 +1,50 @@ const express = require('express'); -const Joi = require('Joi'); +const Joi = require('joi'); const router = express.Router(); +const User = require('../../db/user'); const schema = Joi.object({ - username: Joi.string().alphanum().min(4).max(20).required(), - password: Joi.string().alphanum().min(8).required() + username: Joi.string().alphanum().min(4).max(30).required(), + password: Joi.string().min(8).required() }); -// Every route ir is preceded by /auth - router.get('/', (req, res) => { res.json({ message: 'Authentication!' }); }); -router.post('/signup', (req, res) => { +router.post('/signup', (req, res, next) => { + // This validation returns null if there is no errors const result = schema.validate(req.body); if(result.error) { + // if there is an error we throw it to the errorHandler console.log(result.error); next(result.error); } else { - + // Looking for a user with same username that is being received in the req + User.findOne({ + username: req.body.username + }).then(user => { + if( user ) { + const error = new Error(user.username + ' username is already being used.'); + next(error); + } else { + const user = new User({ + username: req.body.username, + password: req.body.password + }); + + user.save() + .then( result => { + res.send(result); + }) + .catch(err => console.log(err)); + } + }) } - }); -module.exports = router; \ No newline at end of file +module.exports = router; From 0a4bfaacfcae56cbe07c7aedf8c92d636c15725d Mon Sep 17 00:00:00 2001 From: senaarth Date: Mon, 14 Sep 2020 20:05:43 -0300 Subject: [PATCH 33/55] Organize directories --- src/{db => models}/user.js | 4 ++++ src/routes/auth/index.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) rename src/{db => models}/user.js (82%) diff --git a/src/db/user.js b/src/models/user.js similarity index 82% rename from src/db/user.js rename to src/models/user.js index b366442..693d346 100644 --- a/src/db/user.js +++ b/src/models/user.js @@ -9,6 +9,10 @@ const userSchema = new Schema({ password: { type: String, required: true + }, + email: { + type: String, + required: true } }); diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index 34e82de..f7dbae3 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -2,7 +2,7 @@ const express = require('express'); const Joi = require('joi'); const router = express.Router(); -const User = require('../../db/user'); +const User = require('../../models/user'); const schema = Joi.object({ username: Joi.string().alphanum().min(4).max(30).required(), From 92a19cc3c682d93456195722d247a28fd803a394 Mon Sep 17 00:00:00 2001 From: senaarth Date: Tue, 15 Sep 2020 13:04:16 -0300 Subject: [PATCH 34/55] Add email to validation schema --- src/routes/auth/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index f7dbae3..e58ea92 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -6,7 +6,8 @@ const User = require('../../models/user'); const schema = Joi.object({ username: Joi.string().alphanum().min(4).max(30).required(), - password: Joi.string().min(8).required() + password: Joi.string().min(8).required(), + email: Joi.string().email().required() }); router.get('/', (req, res) => { @@ -28,13 +29,16 @@ router.post('/signup', (req, res, next) => { User.findOne({ username: req.body.username }).then(user => { - if( user ) { + + if(user) { + // If user is not undefined it means that there is already an user with the username const error = new Error(user.username + ' username is already being used.'); next(error); } else { const user = new User({ username: req.body.username, - password: req.body.password + password: req.body.password, + email: req.body.email }); user.save() @@ -43,7 +47,8 @@ router.post('/signup', (req, res, next) => { }) .catch(err => console.log(err)); } - }) + + }); } }); From 44745e3f41fd4d0e957f86a5a31e539277377295 Mon Sep 17 00:00:00 2001 From: senaarth Date: Tue, 15 Sep 2020 21:29:54 -0300 Subject: [PATCH 35/55] Create routes to update and delete user Co-authored-by: Victor Santos --- src/routes/auth/index.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index e58ea92..c80679b 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -52,4 +52,31 @@ router.post('/signup', (req, res, next) => { } }); +router.put('/update-user', (req, res, next) => { + // This validation returns null if there is no errors + const result = schema.validate(req.body); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + + } + +}); + +router.delete('/delete-user', (req, res, next) => { + // This validation returns null if there is no errors + const result = schema.validate(req.body); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + + } +}); + module.exports = router; From a96b9e29d72e5c9d8daccc33aebe9ca8ff93cf37 Mon Sep 17 00:00:00 2001 From: senaarth Date: Tue, 15 Sep 2020 21:47:37 -0300 Subject: [PATCH 36/55] Looks for user and returns an error if not found Co-authored-by: Victor Santos --- src/routes/auth/index.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index c80679b..ae95f00 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -61,7 +61,16 @@ router.put('/update-user', (req, res, next) => { console.log(result.error); next(result.error); } else { - + User.findOne({ + username: req.body.username + }).then( user => { + if(!user) { + const error = new Error(req.body.username + ' user not found.'); + next(error); + } else { + + } + }); } }); @@ -75,7 +84,16 @@ router.delete('/delete-user', (req, res, next) => { console.log(result.error); next(result.error); } else { - + User.findOne({ + username: req.body.username + }).then( user => { + if(!user) { + const error = new Error(req.body.username + ' user not found.'); + next(error); + } else { + + } + }); } }); From c45583b029a22f7bf72b33fd3d2acc3a85e84b91 Mon Sep 17 00:00:00 2001 From: senaarth Date: Tue, 15 Sep 2020 21:48:21 -0300 Subject: [PATCH 37/55] Verify password and email before update/removal Co-authored-by: Victor Santos --- src/routes/auth/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index ae95f00..d0e0605 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -67,8 +67,11 @@ router.put('/update-user', (req, res, next) => { if(!user) { const error = new Error(req.body.username + ' user not found.'); next(error); - } else { + } else if(req.body.password == user.password && req.body.email == user.email) { + } else { + const error = new Error('Password or email not valid, please try again.'); + next(error); } }); } @@ -90,8 +93,11 @@ router.delete('/delete-user', (req, res, next) => { if(!user) { const error = new Error(req.body.username + ' user not found.'); next(error); - } else { + } else if(req.body.password == user.password && req.body.email == user.email) { + } else { + const error = new Error('Password or email not valid, please try again.'); + next(error); } }); } From e7403e1226dc4bc05ba36ac6e1a07aefaee2dbcf Mon Sep 17 00:00:00 2001 From: senaarth Date: Tue, 15 Sep 2020 21:50:53 -0300 Subject: [PATCH 38/55] Finishes delete user route Co-authored-by: Victor Santos --- src/routes/auth/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index d0e0605..583c004 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -94,7 +94,13 @@ router.delete('/delete-user', (req, res, next) => { const error = new Error(req.body.username + ' user not found.'); next(error); } else if(req.body.password == user.password && req.body.email == user.email) { - + User.deleteOne({ + username: user.username + }).then(() => { + res.json({ + message: 'User successfully deleted.' + }); + }); } else { const error = new Error('Password or email not valid, please try again.'); next(error); From 606020b1539ae02ba4e2f0a398f00390ce58cc31 Mon Sep 17 00:00:00 2001 From: senaarth Date: Tue, 15 Sep 2020 21:52:38 -0300 Subject: [PATCH 39/55] Finishes update user route Co-authored-by: Victor Santos --- src/routes/auth/index.js | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index 583c004..5792351 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -53,8 +53,20 @@ router.post('/signup', (req, res, next) => { }); router.put('/update-user', (req, res, next) => { + const oldInfo = { + username: req.body.username, + password: req.body.password, + email: req.body.email + } + + const newInfo = { + username: req.body.updatedUsername, + password: req.body.updatedPassword, + email: req.body.updatedEmail + } + // This validation returns null if there is no errors - const result = schema.validate(req.body); + const result = schema.validate(newInfo); if(result.error) { // if there is an error we throw it to the errorHandler @@ -62,20 +74,31 @@ router.put('/update-user', (req, res, next) => { next(result.error); } else { User.findOne({ - username: req.body.username - }).then( user => { + username: oldInfo.username + }).then(user => { if(!user) { - const error = new Error(req.body.username + ' user not found.'); + const error = new Error(oldInfo.username + ' user not found.'); next(error); - } else if(req.body.password == user.password && req.body.email == user.email) { - + } else if(oldInfo.password == user.password && oldInfo.email == user.email) { + // Looking for a user with same username that is being received in the req + User.updateOne( + { username: oldInfo.username}, + { $set: { + username: newInfo.username, + password: newInfo.password, + email: newInfo.email + }} + ).then( () => { + response.json({ + message: 'User successfully updated.' + }) + }); } else { const error = new Error('Password or email not valid, please try again.'); next(error); - } + } }); } - }); router.delete('/delete-user', (req, res, next) => { From aac1f2d67f2483d883250cc0f45799daf65fcd6c Mon Sep 17 00:00:00 2001 From: senaarth Date: Tue, 15 Sep 2020 22:01:58 -0300 Subject: [PATCH 40/55] Fix misspelled variable Co-authored-by: Victor Santos --- src/routes/auth/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/auth/index.js b/src/routes/auth/index.js index 5792351..f175de2 100644 --- a/src/routes/auth/index.js +++ b/src/routes/auth/index.js @@ -52,7 +52,7 @@ router.post('/signup', (req, res, next) => { } }); -router.put('/update-user', (req, res, next) => { +router.put('/update-user', (req, response, next) => { const oldInfo = { username: req.body.username, password: req.body.password, From b505b86467d5a61f939ab0157cdf86aa62984c4e Mon Sep 17 00:00:00 2001 From: Victor Samuel Date: Wed, 16 Sep 2020 14:17:48 -0300 Subject: [PATCH 41/55] Update directories pattern Co-authored-by: Arthur Sena --- src/index.js | 2 +- src/routes/{auth/index.js => authRoutes.js} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/routes/{auth/index.js => authRoutes.js} (99%) diff --git a/src/index.js b/src/index.js index cbd5841..5d7f2f5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ const express = require('express'); const volleyball = require('volleyball'); -const auth = require('./routes/auth'); +const auth = require('./routes/authRoutes'); const mongoose = require('mongoose'); const app = express(); diff --git a/src/routes/auth/index.js b/src/routes/authRoutes.js similarity index 99% rename from src/routes/auth/index.js rename to src/routes/authRoutes.js index f175de2..d90bda0 100644 --- a/src/routes/auth/index.js +++ b/src/routes/authRoutes.js @@ -2,7 +2,7 @@ const express = require('express'); const Joi = require('joi'); const router = express.Router(); -const User = require('../../models/user'); +const User = require('../models/user'); const schema = Joi.object({ username: Joi.string().alphanum().min(4).max(30).required(), From 5601a54f872890eac084c1599864edb75702534c Mon Sep 17 00:00:00 2001 From: Victor Samuel Date: Wed, 16 Sep 2020 14:37:53 -0300 Subject: [PATCH 42/55] Create Users Controller Co-authored-by: Arthur Sena --- src/controllers/UsersController.js | 131 +++++++++++++++++++++++++++++ src/routes/authRoutes.js | 127 ++-------------------------- 2 files changed, 136 insertions(+), 122 deletions(-) create mode 100644 src/controllers/UsersController.js diff --git a/src/controllers/UsersController.js b/src/controllers/UsersController.js new file mode 100644 index 0000000..dabd2e2 --- /dev/null +++ b/src/controllers/UsersController.js @@ -0,0 +1,131 @@ +const { response } = require('express'); +const Joi = require('joi'); + +const User = require("../models/user"); + +const schema = Joi.object({ + username: Joi.string().alphanum().min(4).max(30).required(), + password: Joi.string().min(8).required(), + email: Joi.string().email().required() +}); + +class UsersController { + + async signup(request, response, next) { + // This validation returns null if there is no errors + const result = schema.validate(request.body); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + // Looking for a user with same username that is being received in the req + User.findOne({ + username: request.body.username + }).then(user => { + + if(user) { + // If user is not undefined it means that there is already an user with the username + const error = new Error(user.username + ' username is already being used.'); + next(error); + } else { + const user = new User({ + username: request.body.username, + password: request.body.password, + email: request.body.email + }); + + user.save() + .then( result => { + response.send(result); + }) + .catch(err => console.log(err)); + } + }); + } + } + + async update(request, response, next) { + const oldInfo = { + username: request.body.username, + password: request.body.password, + email: request.body.email + } + + const newInfo = { + username: request.body.updatedUsername, + password: request.body.updatedPassword, + email: request.body.updatedEmail + } + + // This validation returns null if there is no errors + const result = schema.validate(newInfo); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + User.findOne({ + username: oldInfo.username + }).then(user => { + if(!user) { + const error = new Error(oldInfo.username + ' user not found.'); + next(error); + } else if(oldInfo.password == user.password && oldInfo.email == user.email) { + // Looking for a user with same username that is being received in the req + User.updateOne( + { username: oldInfo.username}, + { $set: { + username: newInfo.username, + password: newInfo.password, + email: newInfo.email + }} + ).then( () => { + response.json({ + message: 'User successfully updated.' + }) + }); + } else { + const error = new Error('Password or email not valid, please try again.'); + next(error); + } + }); + } + } + + async delete(request, response, next) { + // This validation returns null if there is no errors + const result = schema.validate(request.body); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + User.findOne({ + username: request.body.username + }).then( user => { + if(!user) { + const error = new Error(request.body.username + ' user not found.'); + next(error); + } else if(request.body.password == user.password && request.body.email == user.email) { + User.deleteOne({ + username: user.username + }).then(() => { + response.json({ + message: 'User successfully deleted.' + }); + }); + } else { + const error = new Error('Password or email not valid, please try again.'); + next(error); + } + }); + } + } + +}; + +module.exports = UsersController; \ No newline at end of file diff --git a/src/routes/authRoutes.js b/src/routes/authRoutes.js index d90bda0..5ab9fc9 100644 --- a/src/routes/authRoutes.js +++ b/src/routes/authRoutes.js @@ -1,14 +1,9 @@ const express = require('express'); -const Joi = require('joi'); const router = express.Router(); -const User = require('../models/user'); +const UsersController = require('../controllers/UsersController'); -const schema = Joi.object({ - username: Joi.string().alphanum().min(4).max(30).required(), - password: Joi.string().min(8).required(), - email: Joi.string().email().required() -}); +const usersController = new UsersController(); router.get('/', (req, res) => { res.json({ @@ -16,120 +11,8 @@ router.get('/', (req, res) => { }); }); -router.post('/signup', (req, res, next) => { - // This validation returns null if there is no errors - const result = schema.validate(req.body); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - // Looking for a user with same username that is being received in the req - User.findOne({ - username: req.body.username - }).then(user => { - - if(user) { - // If user is not undefined it means that there is already an user with the username - const error = new Error(user.username + ' username is already being used.'); - next(error); - } else { - const user = new User({ - username: req.body.username, - password: req.body.password, - email: req.body.email - }); - - user.save() - .then( result => { - res.send(result); - }) - .catch(err => console.log(err)); - } - - }); - } -}); - -router.put('/update-user', (req, response, next) => { - const oldInfo = { - username: req.body.username, - password: req.body.password, - email: req.body.email - } - - const newInfo = { - username: req.body.updatedUsername, - password: req.body.updatedPassword, - email: req.body.updatedEmail - } - - // This validation returns null if there is no errors - const result = schema.validate(newInfo); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - User.findOne({ - username: oldInfo.username - }).then(user => { - if(!user) { - const error = new Error(oldInfo.username + ' user not found.'); - next(error); - } else if(oldInfo.password == user.password && oldInfo.email == user.email) { - // Looking for a user with same username that is being received in the req - User.updateOne( - { username: oldInfo.username}, - { $set: { - username: newInfo.username, - password: newInfo.password, - email: newInfo.email - }} - ).then( () => { - response.json({ - message: 'User successfully updated.' - }) - }); - } else { - const error = new Error('Password or email not valid, please try again.'); - next(error); - } - }); - } -}); - -router.delete('/delete-user', (req, res, next) => { - // This validation returns null if there is no errors - const result = schema.validate(req.body); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - User.findOne({ - username: req.body.username - }).then( user => { - if(!user) { - const error = new Error(req.body.username + ' user not found.'); - next(error); - } else if(req.body.password == user.password && req.body.email == user.email) { - User.deleteOne({ - username: user.username - }).then(() => { - res.json({ - message: 'User successfully deleted.' - }); - }); - } else { - const error = new Error('Password or email not valid, please try again.'); - next(error); - } - }); - } -}); +router.post('/signup', usersController.signup); +router.put('/update-user', usersController.update); +router.delete('/delete-user', usersController.delete); module.exports = router; From e91d4a063ddaa2f1ae8ed6e2594562656e799ebd Mon Sep 17 00:00:00 2001 From: senaarth Date: Wed, 16 Sep 2020 14:51:04 -0300 Subject: [PATCH 43/55] Create user schema Co-authored-by: Victor Santos --- src/controllers/UsersController.js | 18 +++++------------- src/schemas/userSchema.js | 9 +++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 src/schemas/userSchema.js diff --git a/src/controllers/UsersController.js b/src/controllers/UsersController.js index dabd2e2..0712aba 100644 --- a/src/controllers/UsersController.js +++ b/src/controllers/UsersController.js @@ -1,19 +1,11 @@ -const { response } = require('express'); -const Joi = require('joi'); - -const User = require("../models/user"); - -const schema = Joi.object({ - username: Joi.string().alphanum().min(4).max(30).required(), - password: Joi.string().min(8).required(), - email: Joi.string().email().required() -}); +const User = require('../models/user'); +const userSchema = require('../schemas/userSchema'); class UsersController { async signup(request, response, next) { // This validation returns null if there is no errors - const result = schema.validate(request.body); + const result = userSchema.validate(request.body); if(result.error) { // if there is an error we throw it to the errorHandler @@ -60,7 +52,7 @@ class UsersController { } // This validation returns null if there is no errors - const result = schema.validate(newInfo); + const result = userSchema.validate(newInfo); if(result.error) { // if there is an error we throw it to the errorHandler @@ -97,7 +89,7 @@ class UsersController { async delete(request, response, next) { // This validation returns null if there is no errors - const result = schema.validate(request.body); + const result = userSchema.validate(request.body); if(result.error) { // if there is an error we throw it to the errorHandler diff --git a/src/schemas/userSchema.js b/src/schemas/userSchema.js new file mode 100644 index 0000000..2a33ff6 --- /dev/null +++ b/src/schemas/userSchema.js @@ -0,0 +1,9 @@ +const Joi = require('Joi'); + +const userSchema = Joi.object({ + username: Joi.string().alphanum().min(4).max(30).required(), + password: Joi.string().min(8).required(), + email: Joi.string().email().required() +}); + +module.exports = userSchema; \ No newline at end of file From be60923c0e912efa2e9da1a44a1423750d2947e3 Mon Sep 17 00:00:00 2001 From: senaarth Date: Wed, 16 Sep 2020 15:02:38 -0300 Subject: [PATCH 44/55] Create UpdateUser schema Co-authored-by: Victor Santos --- src/controllers/UsersController.js | 13 ++++++++++++- src/schemas/updatedUserSchema.js | 9 +++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/schemas/updatedUserSchema.js diff --git a/src/controllers/UsersController.js b/src/controllers/UsersController.js index 0712aba..3603945 100644 --- a/src/controllers/UsersController.js +++ b/src/controllers/UsersController.js @@ -1,5 +1,6 @@ const User = require('../models/user'); const userSchema = require('../schemas/userSchema'); +const updateUserSchema = require('../schemas/updateUserSchema'); class UsersController { @@ -50,9 +51,19 @@ class UsersController { password: request.body.updatedPassword, email: request.body.updatedEmail } + + if(!newInfo.username) { + newInfo.username = oldInfo.username + } + if(!newInfo.password) { + newInfo.password = oldInfo.password + } + if(!newInfo.email) { + newInfo.email = oldInfo.email + } // This validation returns null if there is no errors - const result = userSchema.validate(newInfo); + const result = updateUserSchema.validate(newInfo); if(result.error) { // if there is an error we throw it to the errorHandler diff --git a/src/schemas/updatedUserSchema.js b/src/schemas/updatedUserSchema.js new file mode 100644 index 0000000..6baae21 --- /dev/null +++ b/src/schemas/updatedUserSchema.js @@ -0,0 +1,9 @@ +const Joi = require('Joi'); + +const updateUserSchema = Joi.object({ + username: Joi.string().alphanum().min(4).max(30), + password: Joi.string().min(8), + email: Joi.string().email() +}); + +module.exports = updateUserSchema; From 54accee91dd3af79a69a1865dcd7f99d2f2f6ec9 Mon Sep 17 00:00:00 2001 From: senaarth Date: Wed, 16 Sep 2020 17:28:36 -0300 Subject: [PATCH 45/55] Update repository patterns --- src/controllers/UsersController.js | 134 ----------------------------- src/index.js | 12 +-- src/routes/authRoutes.js | 131 ++++++++++++++++++++++++++-- src/schemas/updatedUserSchema.js | 9 -- 4 files changed, 129 insertions(+), 157 deletions(-) delete mode 100644 src/controllers/UsersController.js delete mode 100644 src/schemas/updatedUserSchema.js diff --git a/src/controllers/UsersController.js b/src/controllers/UsersController.js deleted file mode 100644 index 3603945..0000000 --- a/src/controllers/UsersController.js +++ /dev/null @@ -1,134 +0,0 @@ -const User = require('../models/user'); -const userSchema = require('../schemas/userSchema'); -const updateUserSchema = require('../schemas/updateUserSchema'); - -class UsersController { - - async signup(request, response, next) { - // This validation returns null if there is no errors - const result = userSchema.validate(request.body); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - // Looking for a user with same username that is being received in the req - User.findOne({ - username: request.body.username - }).then(user => { - - if(user) { - // If user is not undefined it means that there is already an user with the username - const error = new Error(user.username + ' username is already being used.'); - next(error); - } else { - const user = new User({ - username: request.body.username, - password: request.body.password, - email: request.body.email - }); - - user.save() - .then( result => { - response.send(result); - }) - .catch(err => console.log(err)); - } - }); - } - } - - async update(request, response, next) { - const oldInfo = { - username: request.body.username, - password: request.body.password, - email: request.body.email - } - - const newInfo = { - username: request.body.updatedUsername, - password: request.body.updatedPassword, - email: request.body.updatedEmail - } - - if(!newInfo.username) { - newInfo.username = oldInfo.username - } - if(!newInfo.password) { - newInfo.password = oldInfo.password - } - if(!newInfo.email) { - newInfo.email = oldInfo.email - } - - // This validation returns null if there is no errors - const result = updateUserSchema.validate(newInfo); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - User.findOne({ - username: oldInfo.username - }).then(user => { - if(!user) { - const error = new Error(oldInfo.username + ' user not found.'); - next(error); - } else if(oldInfo.password == user.password && oldInfo.email == user.email) { - // Looking for a user with same username that is being received in the req - User.updateOne( - { username: oldInfo.username}, - { $set: { - username: newInfo.username, - password: newInfo.password, - email: newInfo.email - }} - ).then( () => { - response.json({ - message: 'User successfully updated.' - }) - }); - } else { - const error = new Error('Password or email not valid, please try again.'); - next(error); - } - }); - } - } - - async delete(request, response, next) { - // This validation returns null if there is no errors - const result = userSchema.validate(request.body); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - User.findOne({ - username: request.body.username - }).then( user => { - if(!user) { - const error = new Error(request.body.username + ' user not found.'); - next(error); - } else if(request.body.password == user.password && request.body.email == user.email) { - User.deleteOne({ - username: user.username - }).then(() => { - response.json({ - message: 'User successfully deleted.' - }); - }); - } else { - const error = new Error('Password or email not valid, please try again.'); - next(error); - } - }); - } - } - -}; - -module.exports = UsersController; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 5d7f2f5..d3cf924 100644 --- a/src/index.js +++ b/src/index.js @@ -51,12 +51,6 @@ app.use(notFound); app.use(errorHandler); // starting the server - -mongoose.connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true }) - .then(() => { - // Only starts to listen after connecting to the database - app.listen(app.get('port'), () => { - console.log(`Server on port ${app.get('port')}`); - }); - }) - .catch(err => console.log(err)); +app.listen(app.get('port'), () => { + console.log(`Server on port ${app.get('port')}`); +}); \ No newline at end of file diff --git a/src/routes/authRoutes.js b/src/routes/authRoutes.js index 5ab9fc9..cbf1d83 100644 --- a/src/routes/authRoutes.js +++ b/src/routes/authRoutes.js @@ -1,9 +1,9 @@ const express = require('express'); const router = express.Router(); -const UsersController = require('../controllers/UsersController'); -const usersController = new UsersController(); +const User = require('../models/user'); +const userSchema = require('../schemas/userSchema'); router.get('/', (req, res) => { res.json({ @@ -11,8 +11,129 @@ router.get('/', (req, res) => { }); }); -router.post('/signup', usersController.signup); -router.put('/update-user', usersController.update); -router.delete('/delete-user', usersController.delete); +router.post('/signup', (request, response, next) => { + // This validation returns null if there is no errors + const result = userSchema.validate(request.body); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + // Looking for a user with same username that is being received in the req + User.findOne({ + username: request.body.username + }).then(user => { + + if(user) { + // If user is not undefined it means that there is already an user with the username + const error = new Error(user.username + ' username is already being used.'); + next(error); + } else { + const user = new User({ + username: request.body.username, + password: request.body.password, + email: request.body.email + }); + + user.save() + .then( result => { + response.send(result); + }) + .catch(err => console.log(err)); + } + }); + } +}); + +router.put('/update-user', (request, response, next) => { + const oldInfo = { + username: request.body.username, + password: request.body.password, + email: request.body.email + } + + const newInfo = { + username: request.body.updatedUsername, + password: request.body.updatedPassword, + email: request.body.updatedEmail + } + + if(!newInfo.username) { + newInfo.username = oldInfo.username + } + if(!newInfo.password) { + newInfo.password = oldInfo.password + } + if(!newInfo.email) { + newInfo.email = oldInfo.email + } + + // This validation returns null if there is no errors + const result = userSchema.validate(newInfo); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + User.findOne({ + username: oldInfo.username + }).then(user => { + if(!user) { + const error = new Error(oldInfo.username + ' user not found.'); + next(error); + } else if(oldInfo.password == user.password && oldInfo.email == user.email) { + // Looking for a user with same username that is being received in the req + User.updateOne( + { username: oldInfo.username}, + { $set: { + username: newInfo.username, + password: newInfo.password, + email: newInfo.email + }} + ).then( () => { + response.json({ + message: 'User successfully updated.' + }) + }); + } else { + const error = new Error('Password or email not valid, please try again.'); + next(error); + } + }); + } +}); + +router.delete('/delete-user', (request, response, next) => { + // This validation returns null if there is no errors + const result = userSchema.validate(request.body); + + if(result.error) { + // if there is an error we throw it to the errorHandler + console.log(result.error); + next(result.error); + } else { + User.findOne({ + username: request.body.username + }).then( user => { + if(!user) { + const error = new Error(request.body.username + ' user not found.'); + next(error); + } else if(request.body.password == user.password && request.body.email == user.email) { + User.deleteOne({ + username: user.username + }).then(() => { + response.json({ + message: 'User successfully deleted.' + }); + }); + } else { + const error = new Error('Password or email not valid, please try again.'); + next(error); + } + }); + } +}); module.exports = router; diff --git a/src/schemas/updatedUserSchema.js b/src/schemas/updatedUserSchema.js deleted file mode 100644 index 6baae21..0000000 --- a/src/schemas/updatedUserSchema.js +++ /dev/null @@ -1,9 +0,0 @@ -const Joi = require('Joi'); - -const updateUserSchema = Joi.object({ - username: Joi.string().alphanum().min(4).max(30), - password: Joi.string().min(8), - email: Joi.string().email() -}); - -module.exports = updateUserSchema; From 63655730789f734a54c26e2745e7f5085bc72829 Mon Sep 17 00:00:00 2001 From: senaarth Date: Fri, 18 Sep 2020 13:02:35 -0300 Subject: [PATCH 46/55] Making routes functions async and using try/catch for error treatment Co-authored-by: Victor Santos --- package-lock.json | 130 +++++----------------------- src/index.js | 7 +- src/routes/authRoutes.js | 178 ++++++++++++++------------------------ src/schemas/userSchema.js | 2 +- 4 files changed, 89 insertions(+), 228 deletions(-) diff --git a/package-lock.json b/package-lock.json index b4d2667..39ed5c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "2020.1-grupo2-backend", + "name": "2020.1-Grupo2-backend", "version": "1.0.0", "lockfileVersion": 1, "requires": true, @@ -99,14 +99,6 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, "anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", @@ -128,6 +120,14 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "requires": { + "safe-buffer": "5.1.2" + } + }, "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", @@ -300,16 +300,6 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "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" - } - }, "chokidar": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", @@ -347,19 +337,6 @@ "mimic-response": "^1.0.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=" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -509,11 +486,6 @@ "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", @@ -556,11 +528,6 @@ "vary": "~1.1.2" } }, - "filesize": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", - "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==" - }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -656,7 +623,8 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true }, "has-yarn": { "version": "2.1.0", @@ -998,47 +966,10 @@ "on-headers": "~1.0.2" }, "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - } - } - }, - "mongoose-legacy-pluralize": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", - "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" - }, - "mpath": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.7.0.tgz", - "integrity": "sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg==" - }, - "mquery": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.2.tgz", - "integrity": "sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==", - "requires": { - "bluebird": "3.5.1", - "debug": "3.1.0", - "regexp-clone": "^1.0.0", - "safe-buffer": "5.1.2", - "sliced": "1.0.1" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" } } }, @@ -1143,6 +1074,11 @@ "ee-first": "1.1.1" } }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1522,6 +1458,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -1705,31 +1642,6 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, - "volleyball": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/volleyball/-/volleyball-1.5.1.tgz", - "integrity": "sha512-JUY9rRJRKTlhcDkbeoVNyqduCvZlI/GFQJx6G4loWRUD6KRvBepO5E0mVB6tgvjiSwjhs7DBru8unpNUK7FZgg==", - "requires": { - "chalk": "^2.4.0", - "debug": "^3.1.0", - "filesize": "^3.6.1" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/src/index.js b/src/index.js index d3cf924..79b9c20 100644 --- a/src/index.js +++ b/src/index.js @@ -1,11 +1,9 @@ const express = require('express'); -const volleyball = require('volleyball'); const auth = require('./routes/authRoutes'); const mongoose = require('mongoose'); const app = express(); const morgan = require('morgan'); -const mongoose = require('mongoose'); const itemRoutes = require('./routes/itemRoutes'); @@ -23,13 +21,12 @@ app.set('port', process.env.PORT || 3000); app.set('json spaces', 2); // middlewares -app.use(volleyball); +app.use(morgan('dev')); app.use(express.urlencoded({extended: false})); app.use(express.json()); // routes app.use('/item',itemRoutes); -app.use(require('./routes')); app.use('/auth', auth); // Error Handlers @@ -53,4 +50,4 @@ app.use(errorHandler); // starting the server app.listen(app.get('port'), () => { console.log(`Server on port ${app.get('port')}`); -}); \ No newline at end of file +}); diff --git a/src/routes/authRoutes.js b/src/routes/authRoutes.js index cbf1d83..71f88b8 100644 --- a/src/routes/authRoutes.js +++ b/src/routes/authRoutes.js @@ -11,129 +11,81 @@ router.get('/', (req, res) => { }); }); -router.post('/signup', (request, response, next) => { - // This validation returns null if there is no errors - const result = userSchema.validate(request.body); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - // Looking for a user with same username that is being received in the req - User.findOne({ - username: request.body.username - }).then(user => { - - if(user) { - // If user is not undefined it means that there is already an user with the username - const error = new Error(user.username + ' username is already being used.'); - next(error); - } else { - const user = new User({ - username: request.body.username, - password: request.body.password, - email: request.body.email - }); - - user.save() - .then( result => { - response.send(result); - }) - .catch(err => console.log(err)); - } - }); +router.post('/signup', async(req, res, next) => { + + try { + + const newUserData = req.body; + const result = userSchema.validate(req.body); + + if( await User.findOne({ username: newUserData.username}) ) { + const error = new Error('Username already being used.'); + return next(error); + } + + if( result.error ) { + return next(result.error); + } + + const user = new User(newUserData); + + user.save() + .then( result => { + return res.send(result); + }) + .catch( err => next(err)); + + } catch(err) { + return next(err); } + }); -router.put('/update-user', (request, response, next) => { - const oldInfo = { - username: request.body.username, - password: request.body.password, - email: request.body.email - } +router.put('/update-user/:id', async(req, res, next) => { - const newInfo = { - username: request.body.updatedUsername, - password: request.body.updatedPassword, - email: request.body.updatedEmail - } + try { - if(!newInfo.username) { - newInfo.username = oldInfo.username - } - if(!newInfo.password) { - newInfo.password = oldInfo.password - } - if(!newInfo.email) { - newInfo.email = oldInfo.email - } + const user = await User.findById(req.params.id); + const newData = req.body; + + if ( !newData.username ) { + newData.username = user.username; + } + if ( !newData.password ) { + newData.password = user.password; + } + if ( !newData.email ) { + newData.email = user.email; + } + + const result = userSchema.validate(newData); + + if(result.error) { + return next(result.error); + } + + await User.findOneAndUpdate({_id: req.params.id}, req.body, { useFindAndModify: false}) + .then( () => { + res.send({ message: 'User updated successfully.'}); + }); - // This validation returns null if there is no errors - const result = userSchema.validate(newInfo); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - User.findOne({ - username: oldInfo.username - }).then(user => { - if(!user) { - const error = new Error(oldInfo.username + ' user not found.'); - next(error); - } else if(oldInfo.password == user.password && oldInfo.email == user.email) { - // Looking for a user with same username that is being received in the req - User.updateOne( - { username: oldInfo.username}, - { $set: { - username: newInfo.username, - password: newInfo.password, - email: newInfo.email - }} - ).then( () => { - response.json({ - message: 'User successfully updated.' - }) - }); - } else { - const error = new Error('Password or email not valid, please try again.'); - next(error); - } - }); + } catch(err) { + return next(err); } + }); -router.delete('/delete-user', (request, response, next) => { - // This validation returns null if there is no errors - const result = userSchema.validate(request.body); - - if(result.error) { - // if there is an error we throw it to the errorHandler - console.log(result.error); - next(result.error); - } else { - User.findOne({ - username: request.body.username - }).then( user => { - if(!user) { - const error = new Error(request.body.username + ' user not found.'); - next(error); - } else if(request.body.password == user.password && request.body.email == user.email) { - User.deleteOne({ - username: user.username - }).then(() => { - response.json({ - message: 'User successfully deleted.' - }); - }); - } else { - const error = new Error('Password or email not valid, please try again.'); - next(error); - } - }); +router.delete('/delete-user/:id', async(req, res, next) => { + + try { + + await User.findByIdAndDelete(req.params.id); + return res.send({ message: 'User successfully deleted.' }); + + } catch(err) { + return next(err); } + }); module.exports = router; diff --git a/src/schemas/userSchema.js b/src/schemas/userSchema.js index 2a33ff6..ef69ee8 100644 --- a/src/schemas/userSchema.js +++ b/src/schemas/userSchema.js @@ -1,4 +1,4 @@ -const Joi = require('Joi'); +const Joi = require('joi'); const userSchema = Joi.object({ username: Joi.string().alphanum().min(4).max(30).required(), From 4709f8435ffda92e3dd38bc2cc3629a2d7bb6f51 Mon Sep 17 00:00:00 2001 From: senaarth Date: Wed, 23 Sep 2020 20:57:03 -0300 Subject: [PATCH 47/55] Add password confirmation Co-authored-by: Victor Santos --- src/schemas/userSchema.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/schemas/userSchema.js b/src/schemas/userSchema.js index ef69ee8..5853b2b 100644 --- a/src/schemas/userSchema.js +++ b/src/schemas/userSchema.js @@ -3,7 +3,8 @@ const Joi = require('joi'); const userSchema = Joi.object({ username: Joi.string().alphanum().min(4).max(30).required(), password: Joi.string().min(8).required(), + passwordConfirmation: Joi.string().min(8).required().valid(Joi.ref('password')).error(new Error('Password confirmation does not match.')), email: Joi.string().email().required() }); -module.exports = userSchema; \ No newline at end of file +module.exports = userSchema; From ecd1f0c1db853a2c24451c95a06c7bb3557e39d1 Mon Sep 17 00:00:00 2001 From: Guilherme de Lyra Date: Wed, 23 Sep 2020 21:00:32 -0300 Subject: [PATCH 48/55] Revert "US05, US10 and US11, create, edit and delete user" --- package.json | 2 +- src/index.js | 25 +---------- src/models/user.js | 21 --------- src/routes/authRoutes.js | 91 --------------------------------------- src/schemas/userSchema.js | 9 ---- 5 files changed, 3 insertions(+), 145 deletions(-) delete mode 100644 src/models/user.js delete mode 100644 src/routes/authRoutes.js delete mode 100644 src/schemas/userSchema.js diff --git a/package.json b/package.json index 01ae5e3..f952ad0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "2020.1-grupo2-backend", + "name": "2020.1-Grupo2-backend", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/src/index.js b/src/index.js index 79b9c20..62a985b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,7 @@ const express = require('express'); -const auth = require('./routes/authRoutes'); -const mongoose = require('mongoose'); - const app = express(); const morgan = require('morgan'); +const mongoose = require('mongoose'); const itemRoutes = require('./routes/itemRoutes'); @@ -27,27 +25,8 @@ app.use(express.json()); // routes app.use('/item',itemRoutes); -app.use('/auth', auth); - -// Error Handlers -function notFound(req, res, next) { - res.status(404); - const error = new Error('Not Found - ' + req.originalUrl); - next(error); -} - -function errorHandler(err, req, res, next) { - res.status(res.statusCode || 500); - res.json({ - message: err.messege, - stack: err.stack - }); -} - -app.use(notFound); -app.use(errorHandler); // starting the server app.listen(app.get('port'), () => { console.log(`Server on port ${app.get('port')}`); -}); +}); \ No newline at end of file diff --git a/src/models/user.js b/src/models/user.js deleted file mode 100644 index 693d346..0000000 --- a/src/models/user.js +++ /dev/null @@ -1,21 +0,0 @@ -const mongoose = require('mongoose'); -const Schema = mongoose.Schema; - -const userSchema = new Schema({ - username: { - type: String, - required: true - }, - password: { - type: String, - required: true - }, - email: { - type: String, - required: true - } -}); - -const User = mongoose.model('User', userSchema); - -module.exports = User; \ No newline at end of file diff --git a/src/routes/authRoutes.js b/src/routes/authRoutes.js deleted file mode 100644 index 71f88b8..0000000 --- a/src/routes/authRoutes.js +++ /dev/null @@ -1,91 +0,0 @@ -const express = require('express'); - -const router = express.Router(); - -const User = require('../models/user'); -const userSchema = require('../schemas/userSchema'); - -router.get('/', (req, res) => { - res.json({ - message: 'Authentication!' - }); -}); - -router.post('/signup', async(req, res, next) => { - - try { - - const newUserData = req.body; - const result = userSchema.validate(req.body); - - if( await User.findOne({ username: newUserData.username}) ) { - const error = new Error('Username already being used.'); - return next(error); - } - - if( result.error ) { - return next(result.error); - } - - const user = new User(newUserData); - - user.save() - .then( result => { - return res.send(result); - }) - .catch( err => next(err)); - - } catch(err) { - return next(err); - } - -}); - -router.put('/update-user/:id', async(req, res, next) => { - - try { - - const user = await User.findById(req.params.id); - const newData = req.body; - - if ( !newData.username ) { - newData.username = user.username; - } - if ( !newData.password ) { - newData.password = user.password; - } - if ( !newData.email ) { - newData.email = user.email; - } - - const result = userSchema.validate(newData); - - if(result.error) { - return next(result.error); - } - - await User.findOneAndUpdate({_id: req.params.id}, req.body, { useFindAndModify: false}) - .then( () => { - res.send({ message: 'User updated successfully.'}); - }); - - } catch(err) { - return next(err); - } - -}); - -router.delete('/delete-user/:id', async(req, res, next) => { - - try { - - await User.findByIdAndDelete(req.params.id); - return res.send({ message: 'User successfully deleted.' }); - - } catch(err) { - return next(err); - } - -}); - -module.exports = router; diff --git a/src/schemas/userSchema.js b/src/schemas/userSchema.js deleted file mode 100644 index ef69ee8..0000000 --- a/src/schemas/userSchema.js +++ /dev/null @@ -1,9 +0,0 @@ -const Joi = require('joi'); - -const userSchema = Joi.object({ - username: Joi.string().alphanum().min(4).max(30).required(), - password: Joi.string().min(8).required(), - email: Joi.string().email().required() -}); - -module.exports = userSchema; \ No newline at end of file From aab50a6e7c2343464162e12cf7ceba287021b5ee Mon Sep 17 00:00:00 2001 From: Guilherme de Lyra Date: Wed, 23 Sep 2020 21:00:32 -0300 Subject: [PATCH 49/55] Revert "US05, US10 and US11, create, edit and delete user" --- package.json | 2 +- src/index.js | 25 +---------- src/models/user.js | 21 ---------- src/routes/authRoutes.js | 91 ---------------------------------------- 4 files changed, 3 insertions(+), 136 deletions(-) delete mode 100644 src/models/user.js delete mode 100644 src/routes/authRoutes.js diff --git a/package.json b/package.json index 01ae5e3..f952ad0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "2020.1-grupo2-backend", + "name": "2020.1-Grupo2-backend", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/src/index.js b/src/index.js index 79b9c20..62a985b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,7 @@ const express = require('express'); -const auth = require('./routes/authRoutes'); -const mongoose = require('mongoose'); - const app = express(); const morgan = require('morgan'); +const mongoose = require('mongoose'); const itemRoutes = require('./routes/itemRoutes'); @@ -27,27 +25,8 @@ app.use(express.json()); // routes app.use('/item',itemRoutes); -app.use('/auth', auth); - -// Error Handlers -function notFound(req, res, next) { - res.status(404); - const error = new Error('Not Found - ' + req.originalUrl); - next(error); -} - -function errorHandler(err, req, res, next) { - res.status(res.statusCode || 500); - res.json({ - message: err.messege, - stack: err.stack - }); -} - -app.use(notFound); -app.use(errorHandler); // starting the server app.listen(app.get('port'), () => { console.log(`Server on port ${app.get('port')}`); -}); +}); \ No newline at end of file diff --git a/src/models/user.js b/src/models/user.js deleted file mode 100644 index 693d346..0000000 --- a/src/models/user.js +++ /dev/null @@ -1,21 +0,0 @@ -const mongoose = require('mongoose'); -const Schema = mongoose.Schema; - -const userSchema = new Schema({ - username: { - type: String, - required: true - }, - password: { - type: String, - required: true - }, - email: { - type: String, - required: true - } -}); - -const User = mongoose.model('User', userSchema); - -module.exports = User; \ No newline at end of file diff --git a/src/routes/authRoutes.js b/src/routes/authRoutes.js deleted file mode 100644 index 71f88b8..0000000 --- a/src/routes/authRoutes.js +++ /dev/null @@ -1,91 +0,0 @@ -const express = require('express'); - -const router = express.Router(); - -const User = require('../models/user'); -const userSchema = require('../schemas/userSchema'); - -router.get('/', (req, res) => { - res.json({ - message: 'Authentication!' - }); -}); - -router.post('/signup', async(req, res, next) => { - - try { - - const newUserData = req.body; - const result = userSchema.validate(req.body); - - if( await User.findOne({ username: newUserData.username}) ) { - const error = new Error('Username already being used.'); - return next(error); - } - - if( result.error ) { - return next(result.error); - } - - const user = new User(newUserData); - - user.save() - .then( result => { - return res.send(result); - }) - .catch( err => next(err)); - - } catch(err) { - return next(err); - } - -}); - -router.put('/update-user/:id', async(req, res, next) => { - - try { - - const user = await User.findById(req.params.id); - const newData = req.body; - - if ( !newData.username ) { - newData.username = user.username; - } - if ( !newData.password ) { - newData.password = user.password; - } - if ( !newData.email ) { - newData.email = user.email; - } - - const result = userSchema.validate(newData); - - if(result.error) { - return next(result.error); - } - - await User.findOneAndUpdate({_id: req.params.id}, req.body, { useFindAndModify: false}) - .then( () => { - res.send({ message: 'User updated successfully.'}); - }); - - } catch(err) { - return next(err); - } - -}); - -router.delete('/delete-user/:id', async(req, res, next) => { - - try { - - await User.findByIdAndDelete(req.params.id); - return res.send({ message: 'User successfully deleted.' }); - - } catch(err) { - return next(err); - } - -}); - -module.exports = router; From f27ae46e7a33b4cf7ea764f7a83cc434e001214e Mon Sep 17 00:00:00 2001 From: senaarth Date: Wed, 23 Sep 2020 20:57:03 -0300 Subject: [PATCH 50/55] Add password confirmation Co-authored-by: Victor Santos --- src/schemas/userSchema.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/schemas/userSchema.js diff --git a/src/schemas/userSchema.js b/src/schemas/userSchema.js new file mode 100644 index 0000000..5853b2b --- /dev/null +++ b/src/schemas/userSchema.js @@ -0,0 +1,10 @@ +const Joi = require('joi'); + +const userSchema = Joi.object({ + username: Joi.string().alphanum().min(4).max(30).required(), + password: Joi.string().min(8).required(), + passwordConfirmation: Joi.string().min(8).required().valid(Joi.ref('password')).error(new Error('Password confirmation does not match.')), + email: Joi.string().email().required() +}); + +module.exports = userSchema; From 341b57608ad2b777eedd1a82e46a9e91d1523c89 Mon Sep 17 00:00:00 2001 From: Marofelipe Date: Thu, 24 Sep 2020 19:44:46 -0300 Subject: [PATCH 51/55] Fixing some issues to close de pull request and the branch #11 , #12 Co-authored-by: Antonio Ruan Moura Barreto --- src/index.js | 27 ++++++++++++++++----------- src/models/Comment.js | 2 +- src/models/Plant.js | 2 +- src/models/Topico.js | 2 +- src/routes/commentRoutes.js | 2 +- src/routes/plantRoutes.js | 3 +-- src/routes/topicRoutes.js | 2 +- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/index.js b/src/index.js index bb07374..f96e35d 100644 --- a/src/index.js +++ b/src/index.js @@ -6,15 +6,22 @@ const morgan = require('morgan'); const mongoose = require('mongoose'); const itemRoutes = require('./routes/itemRoutes'); +const plantRoutes = require('./routes/plantRoutes'); +const topicRoutes = require('./routes/topicRoutes'); +const commentRoutes = require('./routes/commentRoutes'); // MongoDB connection - -mongoose.set('useCreateIndex', true); -mongoose.connect('mongodb://localhost:27017/noderest', {useNewUrlParser : true, useUnifiedTopology: true}); -mongoose.Promise = global.Promise; - -module.exports = mongoose; +//mongodb://localhost:27017/noderest => meu banco de dados local polupado +//mongodb://mongo:27017/backend => banco de dados da develop +mongoose + .connect('mongodb://localhost:27017/noderest', + { useNewUrlParser: true } + + ) + .then(() => console.log('MongoDB Connected')) + .catch(err => console.log(err)); + // middlewares app.use(morgan('dev')); @@ -23,11 +30,9 @@ app.use(express.json()); // routes app.use('/item',itemRoutes); - - -require('./routes/plantRoutes')(app); -require('./routes/topicRoutes')(app); -require('./routes/commentRoutes')(app); +app.use('/plant',plantRoutes); +app.use('/topic',topicRoutes); +app.use('/comment',commentRoutes); diff --git a/src/models/Comment.js b/src/models/Comment.js index 4f54775..3d0abd7 100644 --- a/src/models/Comment.js +++ b/src/models/Comment.js @@ -1,4 +1,4 @@ -const mongoose = require('../index.js'); +const mongoose = require('mongoose'); const CommentSchema = new mongoose.Schema({ username: { diff --git a/src/models/Plant.js b/src/models/Plant.js index 5ca96e7..d9e9593 100644 --- a/src/models/Plant.js +++ b/src/models/Plant.js @@ -1,4 +1,4 @@ -const mongoose = require('../index.js'); +const mongoose = require('mongoose'); const PlantSchema = new mongoose.Schema({ scientificName: { diff --git a/src/models/Topico.js b/src/models/Topico.js index 1816c84..9cead4a 100644 --- a/src/models/Topico.js +++ b/src/models/Topico.js @@ -1,4 +1,4 @@ -const mongoose = require('../index.js'); +const mongoose = require('mongoose'); const TopicoSchema = new mongoose.Schema({ plant:{ diff --git a/src/routes/commentRoutes.js b/src/routes/commentRoutes.js index 8aec224..d8dc5bf 100644 --- a/src/routes/commentRoutes.js +++ b/src/routes/commentRoutes.js @@ -16,4 +16,4 @@ router.post('/register', async (req , res) => { }); -module.exports = app => app.use('/comment' , router); \ No newline at end of file +module.exports = router; \ No newline at end of file diff --git a/src/routes/plantRoutes.js b/src/routes/plantRoutes.js index ec48c58..46fb162 100644 --- a/src/routes/plantRoutes.js +++ b/src/routes/plantRoutes.js @@ -89,5 +89,4 @@ router.put('/:plantId', async (req , res) => { }); - -module.exports = app => app.use('/plant' , router); \ No newline at end of file +module.exports = router; \ No newline at end of file diff --git a/src/routes/topicRoutes.js b/src/routes/topicRoutes.js index cdb130e..17e4bda 100644 --- a/src/routes/topicRoutes.js +++ b/src/routes/topicRoutes.js @@ -72,4 +72,4 @@ router.put('/:topicId', async (req , res) => { } }); -module.exports = app => app.use('/topic' , router); \ No newline at end of file +module.exports = router; \ No newline at end of file From ffd1a2bb8983faab3b964dcf223e47b8d28f912d Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Mon, 28 Sep 2020 19:31:09 -0300 Subject: [PATCH 52/55] Change MongoDB connection Co-authored-by: Joao Vitor Morandi --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index f96e35d..fd4b8c8 100644 --- a/src/index.js +++ b/src/index.js @@ -15,13 +15,13 @@ const commentRoutes = require('./routes/commentRoutes'); //mongodb://localhost:27017/noderest => meu banco de dados local polupado //mongodb://mongo:27017/backend => banco de dados da develop mongoose - .connect('mongodb://localhost:27017/noderest', + .connect( + 'mongodb://mongo:27017/backend', { useNewUrlParser: true } - ) .then(() => console.log('MongoDB Connected')) .catch(err => console.log(err)); - + // middlewares app.use(morgan('dev')); From 548c1928832981677907e9ead0b86e91b43b63b1 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Mon, 28 Sep 2020 19:32:36 -0300 Subject: [PATCH 53/55] Add unique key on scientific name Plan model. Co-authored-by: Joao Vitor Morandi --- src/models/Plant.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/Plant.js b/src/models/Plant.js index d9e9593..412b525 100644 --- a/src/models/Plant.js +++ b/src/models/Plant.js @@ -3,7 +3,8 @@ const mongoose = require('mongoose'); const PlantSchema = new mongoose.Schema({ scientificName: { type: String, - require: true + require: true, + unique: true }, family_name: { type: String, From 59b5b4fdf7e42523c8e9b7e2866bc37e869fb75c Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Mon, 28 Sep 2020 19:33:13 -0300 Subject: [PATCH 54/55] Fix routes returns and removes unused break lines. Co-authored-by: Joao Vitor Morandi --- src/routes/plantRoutes.js | 18 ++++++++---------- src/routes/topicRoutes.js | 12 ------------ 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/routes/plantRoutes.js b/src/routes/plantRoutes.js index 46fb162..ed4c1e0 100644 --- a/src/routes/plantRoutes.js +++ b/src/routes/plantRoutes.js @@ -12,21 +12,19 @@ router.post('/register', async (req , res) => { const plant = await Plant.create({scientificName,family_name,gender_name,specie_name,common_name,usage,first_User,collection_count,extinction,profile_picture, gbifID,stateProvince}); - await Promise.all(topicos.map(async topico =>{ - const plantTopic = new Topico({...topico,plant : plant._id}); + // await Promise.all(topicos.map(async topico =>{ + // const plantTopic = new Topico({...topico,plant : plant._id}); - await plantTopic.save(); + // await plantTopic.save(); - plant.topicos.push(plantTopic); - })); + // plant.topicos.push(plantTopic); + // })); await plant.save(); - return res.send({ plant }); }catch (err){ - console.log(err); - return res.status(400).send({ error: 'Registration failed'}); + return res.send(err); } }); //Listagem de Todas as plantas @@ -52,9 +50,9 @@ router.get('/:plantId', async (req , res) => { //Deletando planta por id router.delete('/:plantId', async (req , res) => { try{ - await Plant.findByIdAndRemove(req.params.plantId); + const deleted = await Plant.findByIdAndRemove(req.params.plantId); - return res.send(); + return res.send(deleted); }catch (err){ return res.status(400).send({ error: 'Error when Delete this plant'}); } diff --git a/src/routes/topicRoutes.js b/src/routes/topicRoutes.js index 17e4bda..e2db253 100644 --- a/src/routes/topicRoutes.js +++ b/src/routes/topicRoutes.js @@ -5,14 +5,10 @@ const Topico = require('../models/Topico'); const router = express.Router(); //Criar um novo topico pelo id da planta router.put('/:plantId', async (req , res) => { - try{ const {topicos} = req.body; - const plant = await Plant.findByIdAndUpdate(req.params.plantId, {},{ new: true}).populate('topicos'); - - await Promise.all(topicos.map(async topico =>{ const plantTopic = new Topico({...topico,plant : plant._id}); @@ -20,10 +16,7 @@ router.put('/:plantId', async (req , res) => { plant.topicos.push(plantTopic); })); - await plant.save(); - - return res.send({ plant }); }catch (err){ return res.status(400).send({ error: 'Registration failed'}); @@ -33,7 +26,6 @@ router.put('/:plantId', async (req , res) => { router.get('/', async (req , res) => { try{ const topics = await Topico.find(); - return res.send({ topics }); }catch (err){ return res.status(400).send({ error: 'Loading plants failed'}); @@ -43,7 +35,6 @@ router.get('/', async (req , res) => { router.get('/:topicId', async (req , res) => { try{ const topico = await Topico.findById(req.params.topicId); - return res.send({ topico }); }catch (err){ return res.status(400).send({ error: 'error when searching for this topic '}); @@ -53,7 +44,6 @@ router.get('/:topicId', async (req , res) => { router.delete('/:topicId', async (req , res) => { try{ await Topico.findByIdAndRemove(req.params.topicId); - return res.send(); }catch (err){ return res.status(400).send({ error: 'Error when Delete this topic'}); @@ -62,9 +52,7 @@ router.delete('/:topicId', async (req , res) => { //Dando upgrade topic por id router.put('/:topicId', async (req , res) => { try{ - await Topico.findByIdAndUpdate(req.params.topicId,{description: 'marcos felipe'},{new : true}); - return res.send(); }catch (err){ console.log(err); From 16fc976d694dc72dae8e6734a3c136d701294ff8 Mon Sep 17 00:00:00 2001 From: Rafael Makaha Date: Thu, 8 Oct 2020 15:01:13 -0300 Subject: [PATCH 55/55] Remove config folder and update index.js --- src/config/index.js | 5 ----- src/index.js | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 src/config/index.js diff --git a/src/config/index.js b/src/config/index.js deleted file mode 100644 index aef1de3..0000000 --- a/src/config/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - app : { - port: process.env.PORT || 3000, - }, -}; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 49c4596..749ce3d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,3 @@ -require('dotenv').config(); -const config = require('./config') const express = require('express'); const app = express(); const morgan = require('morgan'); @@ -37,6 +35,7 @@ app.use('/comment',commentRoutes); app.use('/auth',authRoutes); // starting the server +app.set('port', process.env.PORT || 3000); app.listen(app.get('port'), () => { console.log(`Server on port ${app.get('port')}`); });