diff --git a/api/database/bookshelf.js b/api/database/bookshelf.js index 3ffed86..6d02f74 100644 --- a/api/database/bookshelf.js +++ b/api/database/bookshelf.js @@ -1,6 +1,3 @@ -// MODULES -const fs = require('fs'); - // Setting up the database connection const knex = require('knex')({ client: "mysql", diff --git a/api/functions.js b/api/functions.js index 950aa99..929292e 100644 --- a/api/functions.js +++ b/api/functions.js @@ -1,35 +1,35 @@ -const regexInt = RegExp(/^[1-9]\d*$/) -const regexXSS = RegExp(/<[^>]*script/) +const regexInt = RegExp(/^[1-9]\d*$/); +const regexXSS = RegExp(/<[^>]*script/); // Check if int for param validation const paramIntCheck = (req, res, next, input) => { try { if (regexInt.test(input)) { - next() + next(); } else { - throw new Error + throw new Error; } } catch (err) { res.status(err.code).send(JSON.stringify({ "message": "Le paramètre doit être un entier non-nul.", "code": 403, }) - ) + ); } -} +}; // Check if script injection attempt const isXSSAttempt = (string) => { return regexXSS.test(string); -} +}; // Check if object is null const isEmptyObject = (obj) => { return (Object.keys(obj).length === 0 && obj.constructor === Object); -} +}; module.exports = { paramIntCheck, isXSSAttempt, isEmptyObject -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/index.js b/api/index.js index 3e8fe7b..aed8537 100644 --- a/api/index.js +++ b/api/index.js @@ -6,11 +6,10 @@ const bodyParser = require('body-parser'); const helmet = require('helmet'); const morgan = require('morgan'); const cors = require('cors'); // module to format the json response -const dotenv = require('dotenv').config(); +require('dotenv').config(); // CONSTANTS const port = 2814; -const base_url = 'http://localhost:2814/api'; // Import routes const routes = require('./routes'); diff --git a/api/models/api-token-model.js b/api/models/api-token-model.js index d38e04f..0c78809 100644 --- a/api/models/api-token-model.js +++ b/api/models/api-token-model.js @@ -1,4 +1,3 @@ -'use strict' const bookshelf = require('../database/bookshelf').bookshelf; require('./user-model'); @@ -9,6 +8,6 @@ let APIToken = bookshelf.Model.extend({ user() { return this.belongsTo('User', 'user_uuid', 'uuid'); } -}) +}); module.exports = bookshelf.model('APIToken', APIToken); \ No newline at end of file diff --git a/api/models/ingredient-model.js b/api/models/ingredient-model.js index eee2669..069a793 100644 --- a/api/models/ingredient-model.js +++ b/api/models/ingredient-model.js @@ -1,13 +1,12 @@ -'use strict' -const bookshelf = require('../database/bookshelf').bookshelf +const bookshelf = require('../database/bookshelf').bookshelf; -require('./spell-model') +require('./spell-model'); let Ingredient = bookshelf.Model.extend({ tableName: 'ingredient', spells() { - return this.belongsToMany('Spell', 'spell_ingredient') + return this.belongsToMany('Spell', 'spell_ingredient'); } -}) +}); -module.exports = bookshelf.model('Ingredient', Ingredient) \ No newline at end of file +module.exports = bookshelf.model('Ingredient', Ingredient); \ No newline at end of file diff --git a/api/models/meta-school-model.js b/api/models/meta-school-model.js index bf7b215..3be356a 100644 --- a/api/models/meta-school-model.js +++ b/api/models/meta-school-model.js @@ -1,13 +1,12 @@ -'use strict' -const bookshelf = require('../database/bookshelf').bookshelf +const bookshelf = require('../database/bookshelf').bookshelf; -require('./school-model') +require('./school-model'); let MetaSchool = bookshelf.Model.extend({ tableName: 'meta_school', schools() { - return this.hasMany('School') + return this.hasMany('School'); } -}) +}); -module.exports = bookshelf.model('MetaSchool', MetaSchool) \ No newline at end of file +module.exports = bookshelf.model('MetaSchool', MetaSchool); \ No newline at end of file diff --git a/api/models/permission-model.js b/api/models/permission-model.js index ea6e7cc..857cf18 100644 --- a/api/models/permission-model.js +++ b/api/models/permission-model.js @@ -1,13 +1,13 @@ -const bookshelf = require('../database/bookshelf').bookshelf +const bookshelf = require('../database/bookshelf').bookshelf; -require('./role-model') +require('./role-model'); let Permission = bookshelf.Model.extend({ tableName: 'permission', hidden: ['id'], role() { - return this.belongsToMany('Role', 'role_permission') + return this.belongsToMany('Role', 'role_permission'); } -}) +}); module.exports = bookshelf.model('Permission', Permission); \ No newline at end of file diff --git a/api/models/role-model.js b/api/models/role-model.js index 3976401..60d2e8a 100644 --- a/api/models/role-model.js +++ b/api/models/role-model.js @@ -1,12 +1,12 @@ -const bookshelf = require('../database/bookshelf').bookshelf +const bookshelf = require('../database/bookshelf').bookshelf; -require('./permission-model') +require('./permission-model'); let Role = bookshelf.Model.extend({ tableName: 'role', permissions() { return this.belongsToMany('Permission', 'role_permission'); } -}) +}); module.exports = bookshelf.model('Role', Role); \ No newline at end of file diff --git a/api/models/school-model.js b/api/models/school-model.js index 25d7d8e..01e142f 100644 --- a/api/models/school-model.js +++ b/api/models/school-model.js @@ -1,17 +1,16 @@ -'use strict' -const bookshelf = require('../database/bookshelf').bookshelf +const bookshelf = require('../database/bookshelf').bookshelf; -require('./spell-model') -require('./meta-school-model') +require('./spell-model'); +require('./meta-school-model'); let School = bookshelf.Model.extend({ tableName: 'school', spells() { - return this.belongsToMany('Spell', 'spell_school') + return this.belongsToMany('Spell', 'spell_school'); }, meta_schools() { - return this.belongsTo('MetaSchool', 'meta_school_id') + return this.belongsTo('MetaSchool', 'meta_school_id'); } -}) +}); -module.exports = bookshelf.model('School', School) \ No newline at end of file +module.exports = bookshelf.model('School', School); \ No newline at end of file diff --git a/api/models/spell-model.js b/api/models/spell-model.js index 10dd65e..effa75d 100644 --- a/api/models/spell-model.js +++ b/api/models/spell-model.js @@ -1,9 +1,8 @@ -'use strict' -const bookshelf = require('../database/bookshelf').bookshelf +const bookshelf = require('../database/bookshelf').bookshelf; -require('./school-model') -require('./variable-model') -require('./ingredient-model') +require('./school-model'); +require('./variable-model'); +require('./ingredient-model'); let Spell = bookshelf.Model.extend({ tableName: 'spell', @@ -20,6 +19,6 @@ let Spell = bookshelf.Model.extend({ ingredients() { return this.belongsToMany( 'Ingredient', 'spell_ingredient' ); } -}) +}); -module.exports = bookshelf.model('Spell', Spell) \ No newline at end of file +module.exports = bookshelf.model('Spell', Spell); \ No newline at end of file diff --git a/api/models/user-model.js b/api/models/user-model.js index ccb7639..e68e112 100644 --- a/api/models/user-model.js +++ b/api/models/user-model.js @@ -1,4 +1,3 @@ -'use strict' const bookshelf = require('../database/bookshelf').bookshelf; require('./role-model'); @@ -13,6 +12,6 @@ let User = bookshelf.Model.extend({ spells() { return this.hasMany('Spell', 'author_id'); } -}) +}); -module.exports = bookshelf.model('User', User) \ No newline at end of file +module.exports = bookshelf.model('User', User); \ No newline at end of file diff --git a/api/models/variable-model.js b/api/models/variable-model.js index cb86e31..61f5316 100644 --- a/api/models/variable-model.js +++ b/api/models/variable-model.js @@ -1,13 +1,12 @@ -'use strict' -const bookshelf = require('../database/bookshelf').bookshelf +const bookshelf = require('../database/bookshelf').bookshelf; -require('./spell-model') +require('./spell-model'); let Variable = bookshelf.Model.extend({ tableName: 'variable', spells() { - return this.belongsToMany('Spell', 'spell_variable') + return this.belongsToMany('Spell', 'spell_variable'); } -}) +}); -module.exports = bookshelf.model('Variable', Variable) \ No newline at end of file +module.exports = bookshelf.model('Variable', Variable); \ No newline at end of file diff --git a/api/package-lock.json b/api/package-lock.json index a993376..12cf152 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -4,6 +4,206 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/generator": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", + "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.11", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", + "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.10", + "@babel/template": "^7.12.7", + "@babel/types": "^7.12.11" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", + "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", + "dev": true, + "requires": { + "@babel/types": "^7.12.10" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", + "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", + "dev": true, + "requires": { + "@babel/types": "^7.12.11" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "@babel/parser": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz", + "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", + "dev": true + }, + "@babel/template": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", + "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } + }, + "@babel/traverse": { + "version": "7.12.12", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.12.tgz", + "integrity": "sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.11", + "@babel/generator": "^7.12.11", + "@babel/helper-function-name": "^7.12.11", + "@babel/helper-split-export-declaration": "^7.12.11", + "@babel/parser": "^7.12.11", + "@babel/types": "^7.12.12", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "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 + } + } + }, + "@babel/types": { + "version": "7.12.12", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.12.tgz", + "integrity": "sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "@eslint/eslintrc": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", + "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "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 + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -18,11 +218,50 @@ "negotiator": "0.6.2" } }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", @@ -37,6 +276,15 @@ "readable-stream": "^2.0.6" } }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", @@ -62,6 +310,19 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "array-includes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz", + "integrity": "sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "get-intrinsic": "^1.0.1", + "is-string": "^1.0.5" + } + }, "array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", @@ -72,16 +333,55 @@ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, + "array.prototype.flat": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, + "babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -254,11 +554,78 @@ "unset-value": "^1.0.0" } }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelize": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "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" + } + } + } + }, "chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", @@ -299,6 +666,21 @@ "object-visit": "^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==", + "dev": true, + "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=", + "dev": true + }, "colorette": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.1.0.tgz", @@ -324,6 +706,12 @@ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -376,6 +764,28 @@ "resolved": "https://registry.npmjs.org/create-error/-/create-error-0.3.1.tgz", "integrity": "sha1-aYECRaYp5lRDK/BDdzYAA6U1GiM=" }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "dasherize": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", @@ -399,6 +809,21 @@ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -466,6 +891,15 @@ "resolved": "https://registry.npmjs.org/dns-prefetch-control/-/dns-prefetch-control-0.2.0.tgz", "integrity": "sha512-hvSnros73+qyZXhHFjx2CMLwoj3Fe7eR9EJsFsqmcI1bB2OBWL/+0YzaEaKssCHnj/6crawNnUyw74Gm2EKe+Q==" }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dont-sniff-mimetype": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", @@ -481,21 +915,339 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, + "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 + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", + "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.3.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.0", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "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 + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "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 + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "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-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + } + }, + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, "esm": { "version": "3.2.25", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==" }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -666,11 +1418,38 @@ } } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, "feature-policy": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz", "integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==" }, + "file-entry-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", + "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -706,6 +1485,15 @@ "unpipe": "~1.0.0" } }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, "findup-sync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", @@ -734,6 +1522,33 @@ "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==" }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -783,6 +1598,18 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -798,6 +1625,17 @@ "wide-align": "^1.1.0" } }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -821,6 +1659,15 @@ "path-is-absolute": "^1.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-modules": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", @@ -843,6 +1690,21 @@ "which": "^1.2.14" } }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "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 + }, "handlebars": { "version": "4.7.6", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", @@ -862,6 +1724,27 @@ } } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "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-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -954,6 +1837,12 @@ "parse-passwd": "^1.0.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "hpkp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hpkp/-/hpkp-2.0.0.tgz", @@ -999,6 +1888,12 @@ "resolved": "https://registry.npmjs.org/ienoopen/-/ienoopen-1.1.0.tgz", "integrity": "sha512-MFs36e/ca6ohEKtinTJ5VvAJ6oDRAYFdYXweUnGY9L9vcoqFOU4n2ZhmJ0C4z/cwGZ3YIQRSB3XZ1+ghZkY5NQ==" }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "ignore-walk": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", @@ -1007,6 +1902,22 @@ "minimatch": "^3.0.4" } }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflection": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", @@ -1068,11 +1979,23 @@ } } }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -1091,6 +2014,12 @@ } } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -1134,6 +2063,12 @@ "is-extglob": "^2.1.1" } }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -1160,6 +2095,15 @@ "isobject": "^3.0.1" } }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", @@ -1168,6 +2112,21 @@ "is-unc-path": "^1.0.0" } }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", @@ -1196,6 +2155,49 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "jsonschema": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.6.tgz", @@ -1258,6 +2260,16 @@ } } }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "liftoff": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", @@ -1273,11 +2285,50 @@ "resolve": "^1.1.7" } }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -1462,6 +2513,12 @@ "to-regex": "^3.0.1" } }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "needle": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/needle/-/needle-2.5.0.tgz", @@ -1538,6 +2595,18 @@ "osenv": "^0.1.4" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "npm-bundled": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", @@ -1610,6 +2679,18 @@ } } }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -1618,6 +2699,18 @@ "isobject": "^3.0.0" } }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, "object.defaults": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", @@ -1646,6 +2739,18 @@ "isobject": "^3.0.1" } }, + "object.values": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", + "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + } + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -1667,6 +2772,20 @@ "wrappy": "1" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -1686,6 +2805,39 @@ "os-tmpdir": "^1.0.0" } }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", @@ -1696,6 +2848,15 @@ "path-root": "^0.1.1" } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -1711,11 +2872,23 @@ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -1739,21 +2912,57 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, "pg-connection-string": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.2.0.tgz", "integrity": "sha512-xB/+wxcpFipUZOQcSzcgkjcNOosGhEoPSjz06jC89lv1dj7mc9bZv6wLVy8M2fVjP0a/xN0N988YDq1L0FhK3A==" }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "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==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "proxy-addr": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", @@ -1763,6 +2972,12 @@ "ipaddr.js": "1.9.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -1795,6 +3010,27 @@ "strip-json-comments": "~2.0.1" } }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -1831,6 +3067,12 @@ "safe-regex": "^1.1.0" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", @@ -1841,6 +3083,12 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -1858,6 +3106,12 @@ "global-modules": "^1.0.0" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -1973,11 +3227,69 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "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 + }, + "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 + } + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -2097,6 +3409,38 @@ "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "dev": true + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -2105,6 +3449,12 @@ "extend-shallow": "^3.0.0" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sqlstring": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", @@ -2144,6 +3494,26 @@ "strip-ansi": "^3.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", + "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -2160,11 +3530,96 @@ "ansi-regex": "^2.0.0" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, "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=" }, + "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" + } + }, + "table": { + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", + "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "dev": true, + "requires": { + "ajv": "^7.0.2", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ajv": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", + "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "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 + }, + "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 + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "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" + } + }, + "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" + } + } + } + }, "tar": { "version": "4.4.13", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", @@ -2184,11 +3639,23 @@ "resolved": "https://registry.npmjs.org/tarn/-/tarn-3.0.0.tgz", "integrity": "sha512-PKUnlDFODZueoA8owLehl8vLcgtA8u4dRuVbZc92tspDYZixjJL6TqYOmryf/PfP/EBX+2rgNcrj96NO+RPkdQ==" }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "tildify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/tildify/-/tildify-2.0.0.tgz", "integrity": "sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw==" }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -2232,6 +3699,33 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "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", @@ -2304,6 +3798,15 @@ } } }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", @@ -2329,6 +3832,12 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.2.0.tgz", "integrity": "sha512-CYpGiFTUrmI6OBMkAdjSDM0k5h8SkkiTP4WAjQgDgNB1S3Ou9VBEvr6q0Kv2H1mMk7IWfxYGpMH5sd5AvcIV2Q==" }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, "v8flags": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", @@ -2337,6 +3846,16 @@ "homedir-polyfill": "^1.0.1" } }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -2358,6 +3877,12 @@ "string-width": "^1.0.2 || 2" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -2379,4 +3904,4 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" } } -} \ No newline at end of file +} diff --git a/api/package.json b/api/package.json index 1200215..86ed9a7 100644 --- a/api/package.json +++ b/api/package.json @@ -40,5 +40,34 @@ "mysql": "^2.18.1", "nodemailer": "^6.4.17", "uuid": "^8.2.0" + }, + "devDependencies": { + "babel-eslint": "^10.1.0", + "eslint": "^7.18.0", + "eslint-plugin-import": "^2.22.1" + }, + "eslintConfig": { + "env": { + "es6": true, + "browser": true + }, + "parser": "babel-eslint", + "rules": { + "accessor-pairs": "warn", + "array-callback-return": "error", + "brace-style": "warn", + "consistent-return": "error", + "default-case": "error", + "eqeqeq": "warn", + "no-case-declarations": "error", + "no-empty-pattern": "warn", + "no-fallthrough": "error", + "no-unused-vars": "error", + "no-useless-catch": "error", + "no-var": "error", + "semi": "warn", + "no-extra-semi": "error", + "yoda": "warn" + } } -} \ No newline at end of file +} diff --git a/api/repositories/ingredient-repository.js b/api/repositories/ingredient-repository.js index 79e5631..29150e3 100644 --- a/api/repositories/ingredient-repository.js +++ b/api/repositories/ingredient-repository.js @@ -1,17 +1,16 @@ -'use strict' // Bookshelf -const bookshelf = require('../database/bookshelf').bookshelf -const model = require('../models/ingredient-model') +const bookshelf = require('../database/bookshelf').bookshelf; +const model = require('../models/ingredient-model'); // Model validation -const Validator = require('jsonschema').Validator -const validator = new Validator() -const IngredientValidation = require("../validations/IngredientValidation") -validator.addSchema(IngredientValidation, "/IngredientValidation") +const Validator = require('jsonschema').Validator; +const validator = new Validator(); +const IngredientValidation = require("../validations/IngredientValidation"); +validator.addSchema(IngredientValidation, "/IngredientValidation"); // Validations -const isXSSAttempt = require('../functions').isXSSAttempt -const isEmptyObject = require('../functions').isEmptyObject +const isXSSAttempt = require('../functions').isXSSAttempt; +const isEmptyObject = require('../functions').isEmptyObject; class IngredientRepository { @@ -23,16 +22,16 @@ class IngredientRepository { new model() .fetchAll({ withRelated: ['spells'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Il n'existe aucun ingrédient disponible.", "code": 404, }); - }) - }) + }); + }); } @@ -42,16 +41,16 @@ class IngredientRepository { .where({ 'id': id }) .fetch({ withRelated: ['spells'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "L'ingrédient en question n'a pas pu être trouvé.", "code": 404, }); - }) - }) + }); + }); } getSpellsFromOne(id) { @@ -60,16 +59,16 @@ class IngredientRepository { .where({ 'id': id }) .fetch({ withRelated: ['spells', 'spells.schools', 'spells.variables', 'spells.ingredients', 'spells.schools.meta_schools'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Les sortilèges liés à cet ingrédient n'ont pas pu être récupérés.", "code": 404, }); - }) - }) + }); + }); } addOne(igr) { @@ -99,24 +98,24 @@ class IngredientRepository { transacting: t }) .catch(err => { - throw err - }) + throw err; + }); }) .then(v => { - return v.load(['spells']) + return v.load(['spells']); }) .then(v => { - resolve(this.getOne(v.id)) + resolve(this.getOne(v.id)); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Une erreur d'insertion s'est produite.", "code": 500, }); - }) + }); } - }) + }); } updateOne(id, igr) { @@ -150,33 +149,33 @@ class IngredientRepository { transacting: t }) .catch(err => { - console.log(err) - throw err - }) + console.log(err); + throw err; + }); }) .then(v => { - return v.load(['spells']) + return v.load(['spells']); }) .then(v => { - resolve(this.getOne(v.id)) + resolve(this.getOne(v.id)); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Une erreur d'insertion s'est produite.", "code": 500, }); - }) + }); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "L'ingrédient en question n'a pas été trouvé.", "code": 404, }); - }) + }); } - }) + }); } deleteOne(id) { @@ -185,23 +184,23 @@ class IngredientRepository { .where({ 'id': id }) .fetch({ require: true, withRelated: ['spells'] }) .then(v => { - v.spells().detach() - v.destroy() + v.spells().detach(); + v.destroy(); }) .then(() => { resolve({ 'message': 'Ingredient with ID ' + id + ' successfully deleted !' - }) + }); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "L'ingrédient en question n'a pas été trouvé.", "code": 404, }); - }) - }) + }); + }); } } -module.exports = IngredientRepository \ No newline at end of file +module.exports = IngredientRepository; \ No newline at end of file diff --git a/api/repositories/meta-school-repository.js b/api/repositories/meta-school-repository.js index 7abdbc7..1431c67 100644 --- a/api/repositories/meta-school-repository.js +++ b/api/repositories/meta-school-repository.js @@ -1,6 +1,4 @@ -'use strict' // Bookshelf -const bookshelf = require('../database/bookshelf').bookshelf const model = require('../models/meta-school-model') // Model validation @@ -9,9 +7,6 @@ const validator = new Validator() const MetaSchoolValidation = require("../validations/MetaSchoolValidation") validator.addSchema(MetaSchoolValidation, "/MetaSchoolValidation") -// Validations -const regexXSS = RegExp(/<[^>]*script/) - class MetaSchoolRepository { constructor() { @@ -28,7 +23,7 @@ class MetaSchoolRepository { console.log(err) reject({ "message": "Il n'existe aucune grande école disponible.", - "code": 404, + "code": 404 }); }) }) @@ -46,7 +41,7 @@ class MetaSchoolRepository { console.log(err) reject({ "message": "La grande école en question n'a pas pu être trouvée.", - "code": 404, + "code": 404 }); }) }) diff --git a/api/repositories/school-repository.js b/api/repositories/school-repository.js index a6d2651..22740e8 100644 --- a/api/repositories/school-repository.js +++ b/api/repositories/school-repository.js @@ -1,17 +1,16 @@ -'use strict' // Bookshelf -const bookshelf = require('../database/bookshelf').bookshelf -const model = require('../models/school-model') +const bookshelf = require('../database/bookshelf').bookshelf; +const model = require('../models/school-model'); // Model validation -const Validator = require('jsonschema').Validator -const validator = new Validator() -const SchoolValidation = require("../validations/SchoolValidation") -validator.addSchema(SchoolValidation, "/SchoolValidation") +const Validator = require('jsonschema').Validator; +const validator = new Validator(); +const SchoolValidation = require("../validations/SchoolValidation"); +validator.addSchema(SchoolValidation, "/SchoolValidation"); // Validations -const isXSSAttempt = require('../functions').isXSSAttempt -const isEmptyObject = require('../functions').isEmptyObject +const isXSSAttempt = require('../functions').isXSSAttempt; +const isEmptyObject = require('../functions').isEmptyObject; class SchoolRepository { @@ -23,7 +22,7 @@ class SchoolRepository { new model() .fetchAll({ withRelated: ['meta_schools'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { console.log(err); @@ -31,8 +30,8 @@ class SchoolRepository { "message": "Il n'existe aucune école disponible.", "code": 404, }); - }) - }) + }); + }); } getOne(id) { @@ -41,7 +40,7 @@ class SchoolRepository { .where({ 'id': id }) .fetch({ withRelated: ['meta_schools'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { console.log(err); @@ -49,8 +48,8 @@ class SchoolRepository { "message": "L'école en question n'a pas pu être trouvée.", "code": 404, }); - }) - }) + }); + }); } getSpellsFromOne(id) { @@ -59,7 +58,7 @@ class SchoolRepository { .where({ 'id': id }) .fetch({ withRelated: ['spells', 'spells.schools', 'spells.variables', 'spells.ingredients', 'spells.schools.meta_schools'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { console.log(err); @@ -67,8 +66,8 @@ class SchoolRepository { "message": "Les sortilèges de cette école n'ont pas pu être récupérés.", "code": 404, }); - }) - }) + }); + }); } addOne(s) { @@ -99,8 +98,8 @@ class SchoolRepository { transacting: t }) .catch(err => { - throw err - }) + throw err; + }); }) .then(v => { return v.load(['meta_schools']); @@ -109,14 +108,14 @@ class SchoolRepository { resolve(this.getOne(v.id)); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Une erreur d'insertion s'est produite.", "code": 500, - }) - }) + }); + }); } - }) + }); } updateOne(id, s) { @@ -151,23 +150,23 @@ class SchoolRepository { transacting: t }) .catch(err => { - console.log(err) - throw err - }) + console.log(err); + throw err; + }); }) .then(v => { - return v.load(['meta_schools']) + return v.load(['meta_schools']); }) .then(v => { - resolve(this.getOne(v.id)) + resolve(this.getOne(v.id)); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Une erreur d'insertion s'est produite.", "code": 500, - }) - }) + }); + }); }) .catch(err => { console.log(err); @@ -175,9 +174,9 @@ class SchoolRepository { "message": "L'école en question n'a pas été trouvée.", "code": 404, }); - }) + }); } - }) + }); } deleteOne(id) { @@ -186,13 +185,13 @@ class SchoolRepository { .where({ 'id': id }) .fetch({ require: true, withRelated: ['spells', 'meta_schools'] }) .then(v => { - v.spells().detach() - v.destroy() + v.spells().detach(); + v.destroy(); }) .then(() => { resolve({ 'message': 'School with ID ' + id + ' successfully deleted !' - }) + }); }) .catch(err => { console.log(err); @@ -200,9 +199,9 @@ class SchoolRepository { "message": "L'école en question n'a pas été trouvée.", "code": 404, }); - }) - }) + }); + }); } } -module.exports = SchoolRepository \ No newline at end of file +module.exports = SchoolRepository; \ No newline at end of file diff --git a/api/repositories/spell-repository.js b/api/repositories/spell-repository.js index 0a309d6..aa07ddd 100644 --- a/api/repositories/spell-repository.js +++ b/api/repositories/spell-repository.js @@ -23,12 +23,24 @@ class SpellRepository { let query = new model(); - if (name) { query.where('name', 'like', `%${name}%`) } - if (description) { query.where('description', 'like', `%${description}%`) } - if (level) { query.where({ 'level': level }) } - if (charge) { query.where({ 'charge': charge }) } - if (cost) { query.where({ 'cost': cost }) } - if (ritual) { query.where({ 'is_ritual': ritual }) } + if (name) { + query.where('name', 'like', `%${name}%`) + } + if (description) { + query.where('description', 'like', `%${description}%`) + } + if (level) { + query.where({ 'level': level }) + } + if (charge) { + query.where({ 'charge': charge }) + } + if (cost) { + query.where({ 'cost': cost }) + } + if (ritual) { + query.where({ 'is_ritual': ritual }) + } query.fetchAll({ withRelated: ['schools.meta_schools', 'variables', 'ingredients', 'author'] }) .then(v => { @@ -49,12 +61,24 @@ class SpellRepository { let query = new model().where({ 'public': 1 }) - if (name) { query.where('name', 'like', `%${name}%`) } - if (description) { query.where('description', 'like', `%${description}%`) } - if (level) { query.where({ 'level': level }) } - if (charge) { query.where({ 'charge': charge }) } - if (cost) { query.where({ 'cost': cost }) } - if (ritual) { query.where({ 'is_ritual': ritual }) } + if (name) { + query.where('name', 'like', `%${name}%`) + } + if (description) { + query.where('description', 'like', `%${description}%`) + } + if (level) { + query.where({ 'level': level }) + } + if (charge) { + query.where({ 'charge': charge }) + } + if (cost) { + query.where({ 'cost': cost }) + } + if (ritual) { + query.where({ 'is_ritual': ritual }) + } query.fetchAll({ withRelated: ['schools.meta_schools', 'variables', 'ingredients', 'author'] }) .then(v => { @@ -226,18 +250,21 @@ class SpellRepository { let schools = spell.related('school'); return spell.schools().detach(schools, { transacting: t }); } + return spell }) .tap(spell => { if (s.variables) { let variables = spell.related('variable'); return spell.variables().detach(variables, { transacting: t }); } + return spell; }) .tap(spell => { if (s.ingredients) { let ingredients = spell.related('ingredient'); return spell.ingredients().detach(ingredients, { transacting: t }); } + return spell; }) .tap(spell => { return spell diff --git a/api/repositories/user-repository.js b/api/repositories/user-repository.js index 1fc1852..6edc212 100644 --- a/api/repositories/user-repository.js +++ b/api/repositories/user-repository.js @@ -360,7 +360,7 @@ class UserRepository { }) .catch(err => { // If the account already has an API key linked... - if (err.errno == 1062) { + if (err.errno === 1062) { this.fetchAPIKey(user.uuid) .then(old_api_key => { reject({ @@ -473,7 +473,7 @@ class UserRepository { }) // Unhandled errors - .catch(err => { + .catch(() => { reject({ "message": "Une erreur inconnue est survenue.", "code": 500, @@ -541,7 +541,7 @@ class UserRepository { resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { - console.log(err); + reject(err); }) }) } diff --git a/api/repositories/variable-repository.js b/api/repositories/variable-repository.js index 8719878..69192cb 100644 --- a/api/repositories/variable-repository.js +++ b/api/repositories/variable-repository.js @@ -1,17 +1,16 @@ -'use strict' // Bookshelf -const bookshelf = require('../database/bookshelf').bookshelf -const model = require('../models/variable-model') +const bookshelf = require('../database/bookshelf').bookshelf; +const model = require('../models/variable-model'); // Model validation -const Validator = require('jsonschema').Validator -const validator = new Validator() -const VariableValidation = require("../validations/VariableValidation") -validator.addSchema(VariableValidation, "/VariableValidation") +const Validator = require('jsonschema').Validator; +const validator = new Validator(); +const VariableValidation = require("../validations/VariableValidation"); +validator.addSchema(VariableValidation, "/VariableValidation"); // Validations -const isXSSAttempt = require('../functions').isXSSAttempt -const isEmptyObject = require('../functions').isEmptyObject +const isXSSAttempt = require('../functions').isXSSAttempt; +const isEmptyObject = require('../functions').isEmptyObject; class VariableRepository { @@ -23,16 +22,16 @@ class VariableRepository { new model() .fetchAll({ withRelated: ['spells'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Il n'existe aucune variable disponible.", "code": 404, }); - }) - }) + }); + }); } @@ -42,16 +41,16 @@ class VariableRepository { .where({ 'id': id }) .fetch({ withRelated: ['spells'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "La variable en question n'a pas pu être trouvée.", "code": 404, }); - }) - }) + }); + }); } getSpellsFromOne(id) { @@ -60,16 +59,16 @@ class VariableRepository { .where({ 'id': id }) .fetch({ withRelated: ['spells', 'spells.schools', 'spells.variables', 'spells.ingredients', 'spells.schools.meta_schools'] }) .then(v => { - resolve(v.toJSON({ omitPivot: true })) + resolve(v.toJSON({ omitPivot: true })); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Les sortilèges liés à cette variable n'ont pas pu être récupérés.", "code": 404, }); - }) - }) + }); + }); } addOne(vr) { @@ -98,24 +97,24 @@ class VariableRepository { transacting: t }) .catch(err => { - throw err - }) + throw err; + }); }) .then(v => { - return v.load(['spells']) + return v.load(['spells']); }) .then(v => { - resolve(this.getOne(v.id)) + resolve(this.getOne(v.id)); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Une erreur d'insertion s'est produite.", "code": 500, }); - }) + }); } - }) + }); } updateOne(id, vr) { @@ -148,33 +147,33 @@ class VariableRepository { transacting: t }) .catch(err => { - console.log(err) - throw err - }) + console.log(err); + throw err; + }); }) .then(v => { - return v.load(['spells']) + return v.load(['spells']); }) .then(v => { - resolve(this.getOne(v.id)) + resolve(this.getOne(v.id)); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "Une erreur d'insertion s'est produite.", "code": 500, }); - }) + }); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "La variable en question n'a pas été trouvée.", "code": 404, }); - }) + }); } - }) + }); } deleteOne(id) { @@ -183,23 +182,23 @@ class VariableRepository { .where({ 'id': id }) .fetch({ require: true, withRelated: ['spells'] }) .then(v => { - v.spells().detach() - v.destroy() + v.spells().detach(); + v.destroy(); }) .then(() => { resolve({ 'message': 'Variable with ID ' + id + ' successfully deleted !' - }) + }); }) .catch(err => { - console.log(err) + console.log(err); reject({ "message": "La variable en question n'a pas été trouvée.", "code": 404, }); - }) - }) + }); + }); } } -module.exports = VariableRepository \ No newline at end of file +module.exports = VariableRepository; \ No newline at end of file diff --git a/api/routes/auth.js b/api/routes/auth.js index 96a3c03..16a23b4 100644 --- a/api/routes/auth.js +++ b/api/routes/auth.js @@ -1,4 +1,3 @@ -'use strict' // Router const express = require('express'); let router = express.Router(); @@ -12,18 +11,18 @@ const Users = new UserRepository(); const generateAPIToken = (mail, password) => { return Users.genAPIToken(mail, password) .catch(err => { - throw err - }) -} + throw err; + }); +}; router.get('/genToken', async (req, res) => { generateAPIToken(req.body.mail, req.body.password) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { - res.status(err.code).send(JSON.stringify(err)) - }) -}) + res.status(err.code).send(JSON.stringify(err)); + }); +}); module.exports = router; \ No newline at end of file diff --git a/api/routes/index.js b/api/routes/index.js index 87f95dd..01c4109 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -15,4 +15,4 @@ module.exports = { ingredients, variables, users, -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/routes/ingredients.js b/api/routes/ingredients.js index e4bccb2..c2e8ce5 100644 --- a/api/routes/ingredients.js +++ b/api/routes/ingredients.js @@ -1,5 +1,3 @@ -'use strict' - // Router const express = require('express'); let router = express.Router(); @@ -19,17 +17,17 @@ const functions = require('../functions'); const getIngredients = () => { return Ingredients.getAll() .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/', async (req, res) => { getIngredients() .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -37,26 +35,26 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET ONE ------------------ const getIngredient = (id) => { return Ingredients.getOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/:id/', async (req, res) => { getIngredient(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -64,26 +62,26 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET SPELLS FROM ONE ------------------ const getSpellsFromOne = (id) => { return Ingredients.getSpellsFromOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/:id/spells', async (req, res) => { getSpellsFromOne(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -91,27 +89,27 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // CREATE ONE ------------------ const addIngredient = (igr) => { return Ingredients.addOne(igr) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.post( '/', authGuard(['SUBMIT_INGREDIENTS']), async (req, res) => { addIngredient(req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -119,27 +117,27 @@ router.post( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // UPDATE ONE ------------------ const updateIngredient = (id, igr) => { return Ingredients.updateOne(id, igr) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.put( '/:id/', authGuard(['SUBMIT_INGREDIENTS', 'MODIFY_INGREDIENTS']), async (req, res) => { updateIngredient(req.params.id, req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -147,27 +145,27 @@ router.put( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // DELETE ONE ------------------ const deleteIngredient = (id) => { return Ingredients.deleteOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.delete( '/:id/', authGuard(['SUBMIT_INGREDIENTS', 'MODIFY_INGREDIENTS', 'DELETE_INGREDIENTS']), async (req, res) => { deleteIngredient(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -175,11 +173,11 @@ router.delete( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // Param validations -router.param('id', functions.paramIntCheck) +router.param('id', functions.paramIntCheck); -module.exports = router \ No newline at end of file +module.exports = router; \ No newline at end of file diff --git a/api/routes/meta_schools.js b/api/routes/meta_schools.js index 90b7d0f..587de24 100644 --- a/api/routes/meta_schools.js +++ b/api/routes/meta_schools.js @@ -1,5 +1,3 @@ -'use strict' - // Router const express = require('express'); let router = express.Router(); @@ -16,15 +14,15 @@ const MetaSchools = new MetaSchoolRepository(); const getMetaSchools = () => { return MetaSchools.getAll() .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get('/', async (req, res) => { getMetaSchools() .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -32,24 +30,24 @@ router.get('/', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); // GET ONE ------------------ const getMetaSchool = (id) => { return MetaSchools.getOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get('/:id/', async (req, res) => { getMetaSchool(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -57,11 +55,11 @@ router.get('/:id/', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); // Param validations -router.param('id', functions.paramIntCheck) +router.param('id', functions.paramIntCheck); -module.exports = router \ No newline at end of file +module.exports = router; \ No newline at end of file diff --git a/api/routes/middleware/authGuard.js b/api/routes/middleware/authGuard.js index 9f145e1..ec951b2 100644 --- a/api/routes/middleware/authGuard.js +++ b/api/routes/middleware/authGuard.js @@ -11,13 +11,13 @@ const authGuard = (permissions) => { // Uses repo to validate the associated perms with the token Users.checkAPITokenPerms(api_token, permissions) - .then(v => { + .then(() => { next(); }) .catch(err => { - res.status(err.code).send(JSON.stringify(err)) + res.status(err.code).send(JSON.stringify(err)); }); - } -} + }; +}; module.exports = authGuard; \ No newline at end of file diff --git a/api/routes/schools.js b/api/routes/schools.js index 169637f..306e917 100644 --- a/api/routes/schools.js +++ b/api/routes/schools.js @@ -1,5 +1,3 @@ -'use strict' - // Router const express = require('express'); let router = express.Router(); @@ -19,17 +17,17 @@ const functions = require('../functions'); const getSchools = () => { return Schools.getAll() .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/', async (req, res) => { getSchools() .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -37,26 +35,26 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET ONE ------------------ const getSchool = (id) => { return Schools.getOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/:id/', async (req, res) => { getSchool(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -64,26 +62,26 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET SPELLS FROM ONE ------------------ const getSpellsFromOne = (id) => { return Schools.getSpellsFromOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/:id/spells', async (req, res) => { getSpellsFromOne(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -91,27 +89,27 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // CREATE ONE ------------------ const addSchool = (s) => { return Schools.addOne(s) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.post( '/', authGuard(['SUBMIT_SCHOOL']), async (req, res) => { addSchool(req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -119,26 +117,26 @@ router.post( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // UPDATE ONE ------------------ const updateSchool = (id, s) => { return Schools.updateOne(id, s) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.put( '/:id/', authGuard(['SUBMIT_SCHOOLS', 'MODIFY_SCHOOLS']), async (req, res) => { updateSchool(req.params.id, req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -146,27 +144,27 @@ router.put( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // DELETE ONE ------------------ const deleteSchool = (id) => { return Schools.deleteOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.delete( '/:id/', authGuard(['SUBMIT_SCHOOLS', 'MODIFY_SCHOOLS', 'DELETE_SCHOOLS']), async (req, res) => { deleteSchool(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -174,11 +172,11 @@ router.delete( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // Param validations -router.param('id', functions.paramIntCheck) +router.param('id', functions.paramIntCheck); -module.exports = router \ No newline at end of file +module.exports = router; \ No newline at end of file diff --git a/api/routes/spells.js b/api/routes/spells.js index 685aec8..151d31e 100644 --- a/api/routes/spells.js +++ b/api/routes/spells.js @@ -1,5 +1,3 @@ -'use strict' - // Router const express = require('express'); let router = express.Router(); @@ -19,17 +17,17 @@ const functions = require('../functions'); const getPublicSpells = (name, description, level, charge, cost, ritual) => { return Spells.getAllPublic(name, description, level, charge, cost, ritual) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '//:name?/:description?/:level?/:charge?/:cost?/:ritual?/', async (req, res) => { getPublicSpells(req.query.name, req.query.description, req.query.level, req.query.charge, req.query.cost, req.query.ritual) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -37,26 +35,26 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET ALL ------------------ const getSpells = (name, description, level, charge, cost, ritual) => { return Spells.getAll(name, description, level, charge, cost, ritual) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/private/:name?/:description?/:level?/:charge?/:cost?/:ritual?/', authGuard(['SECRET_SPELLS']), async (req, res) => { getSpells(req.query.name, req.query.description, req.query.level, req.query.charge, req.query.cost, req.query.ritual) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -64,25 +62,25 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET SOME ------------------ const getSomeSpells = (page) => { return Spells.getPage(page) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/page/:page', async (req, res) => { getSomeSpells(req.params.page) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -90,25 +88,25 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET ONE ------------------ const getSpell = (id) => { return Spells.getOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/:id/', async (req, res) => { getSpell(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -116,27 +114,27 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // CREATE ONE ------------------ const addSpell = (s) => { return Spells.addOne(s) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.post( '/', authGuard(['SUBMIT_SPELLS']), async (req, res) => { addSpell(req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -144,27 +142,27 @@ router.post( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // UPDATE ONE ------------------ const updateSpell = (id, s) => { return Spells.updateOne(id, s) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.put( '/:id/', authGuard(['SUBMIT_SPELLS', 'MODIFY_SPELLS']), async (req, res) => { updateSpell(req.params.id, req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -172,27 +170,27 @@ router.put( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // DELETE ONE ------------------ const deleteSpell = (id) => { return Spells.deleteOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.delete( '/:id/', authGuard(['SUBMIT_SPELLS', 'MODIFY_SPELLS', 'DELETE_SPELLS']), async (req, res) => { deleteSpell(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -200,12 +198,12 @@ router.delete( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // Param validations -router.param('id', functions.paramIntCheck) -router.param('page', functions.paramIntCheck) +router.param('id', functions.paramIntCheck); +router.param('page', functions.paramIntCheck); -module.exports = router +module.exports = router; diff --git a/api/routes/users.js b/api/routes/users.js index bfe80b0..754bba6 100644 --- a/api/routes/users.js +++ b/api/routes/users.js @@ -1,11 +1,9 @@ -'use strict' - // Router const express = require('express'); let router = express.Router(); // AuthGuard -const authGuard = require('./middleware/authGuard'); +// const authGuard = require('./middleware/authGuard'); // Repository const UserRepository = require('../repositories/user-repository'); @@ -16,14 +14,14 @@ const Users = new UserRepository(); const getUsers = () => { return Users.getAll() .catch(err => { - throw err - }) -} + throw err; + }); +}; router.get('/', async (req, res) => { getUsers() .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -31,23 +29,23 @@ router.get('/', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); // GET ONE FROM UUID ------------------ const getUserByUUID = (uuid) => { return Users.getOneByUUID(uuid) .catch(err => { - throw err - }) -} + throw err; + }); +}; router.get('/:uuid/', async (req, res) => { getUserByUUID(req.params.uuid) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -55,22 +53,22 @@ router.get('/:uuid/', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); // GET SPELLS FROM ONE ------------------ const getSpellsFromUser = (uuid) => { return Users.getSpellsFromOne(uuid) .catch(err => { - throw err - }) -} + throw err; + }); +}; router.get('/:uuid/spells', async (req, res) => { getSpellsFromUser(req.params.uuid) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -78,23 +76,23 @@ router.get('/:uuid/spells', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); // CHECK IF MAIL IS AVAILABLE ------------------ const checkIfEmailAvailable = (mail) => { return Users.checkIfEmailAvailable(mail) .catch(err => { - throw err - }) -} + throw err; + }); +}; router.get('/available/:mail/', async (req, res) => { checkIfEmailAvailable(req.params.mail) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -102,23 +100,23 @@ router.get('/available/:mail/', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); // CREATE ONE ------------------ const addUser = (u) => { return Users.addOne(u) .catch(err => { - throw err - }) -} + throw err; + }); +}; router.post('/', async (req, res) => { addUser(req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -126,9 +124,9 @@ router.post('/', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); // VERIFY A USER @@ -136,13 +134,13 @@ const verifyUser = (token) => { return Users.verifyUser(token) .catch(err => { throw err; - }) -} + }); +}; router.get('/verification/:token', async (req, res) => { verifyUser(req.params.token) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -150,22 +148,22 @@ router.get('/verification/:token', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) + ); + }); }); // LOG A USER ------------------ const logUser = (mail, password) => { return Users.logUser(mail, password) .catch(err => { - throw err - }) -} + throw err; + }); +}; router.post('/login', async (req, res) => { logUser(req.body.mail, req.body.password) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -173,8 +171,8 @@ router.post('/login', async (req, res) => { "error": err.message, "code": err.code }) - ) - }) -}) + ); + }); +}); -module.exports = router \ No newline at end of file +module.exports = router; \ No newline at end of file diff --git a/api/routes/variables.js b/api/routes/variables.js index d4051ba..30a5e90 100644 --- a/api/routes/variables.js +++ b/api/routes/variables.js @@ -1,4 +1,4 @@ -'use strict' +'use strict'; // Router const express = require('express'); @@ -19,17 +19,17 @@ const functions = require('../functions'); const getvariables = () => { return Variables.getAll() .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/', async (req, res) => { getvariables() .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -37,26 +37,26 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET ONE ------------------ const getVariable = (id) => { return Variables.getOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/:id/', async (req, res) => { getVariable(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -64,26 +64,26 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // GET SPELLS FROM ONE ------------------ const getSpellsFromOne = (id) => { return Variables.getSpellsFromOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.get( '/:id/spells', async (req, res) => { getSpellsFromOne(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.end(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.end(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -91,27 +91,27 @@ router.get( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // CREATE ONE ------------------ const addVariable = (vr) => { return Variables.addOne(vr) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.post( '/', authGuard(['SUBMIT_VARIABLES']), async (req, res) => { addVariable(req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -119,27 +119,27 @@ router.post( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // UPDATE ONE ------------------ const updateVariable = (id, vr) => { return Variables.updateOne(id, vr) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.put( '/:id/', authGuard(['SUBMIT_VARIABLES', 'MODIFY_VARIABLES']), async (req, res) => { updateVariable(req.params.id, req.body) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -147,27 +147,27 @@ router.put( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // DELETE ONE ------------------ const deleteVariable = (id) => { return Variables.deleteOne(id) .catch(err => { - console.log(err) - throw err - }) -} + console.log(err); + throw err; + }); +}; router.delete( '/:id/', authGuard(['SUBMIT_VARIABLES', 'MODIFY_VARIABLES', 'DELETE_VARIABLES']), async (req, res) => { deleteVariable(req.params.id) .then(v => { - res.setHeader('Content-Type', 'application/json;charset=utf-8') - res.send(JSON.stringify(v)) + res.setHeader('Content-Type', 'application/json;charset=utf-8'); + res.send(JSON.stringify(v)); }) .catch(err => { res.status(err.code).send(JSON.stringify( @@ -175,11 +175,11 @@ router.delete( "error": err.message, "code": err.code }) - ) - }) - }) + ); + }); + }); // Param validations -router.param('id', functions.paramIntCheck) +router.param('id', functions.paramIntCheck); -module.exports = router \ No newline at end of file +module.exports = router; \ No newline at end of file diff --git a/api/smtp/mails.js b/api/smtp/mails.js index 0991911..b267b1d 100644 --- a/api/smtp/mails.js +++ b/api/smtp/mails.js @@ -14,8 +14,8 @@ const getTemplateFile = (path) => { } else { resolve(html); } - }) - }) + }); + }); }; /** @@ -50,12 +50,12 @@ const sendRegistrationMail = (data) => { .catch(err => { console.log(err); }); -} +}; -const sendBanEmail = (date) => { - return null; -} +// const sendBanEmail = (date) => { +// return null; +// }; module.exports = { sendRegistrationMail, -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/smtp/templates/template-sign-up.html b/api/smtp/templates/template-sign-up.html index 6124ab2..1b15b5b 100644 --- a/api/smtp/templates/template-sign-up.html +++ b/api/smtp/templates/template-sign-up.html @@ -91,7 +91,7 @@
Votre compte Auracle a bien été enregistré et est rattaché à cette adresse mail.
Cependant, afin de garantir la sécurité de vos données, votre compte doit être vérifié avant votre première connexion. Vous pouvez - + suivre ce lien afin de confirmer votre inscription.
diff --git a/api/validations/IngredientValidation.js b/api/validations/IngredientValidation.js index 7e7ef68..962b6f9 100644 --- a/api/validations/IngredientValidation.js +++ b/api/validations/IngredientValidation.js @@ -6,6 +6,6 @@ const Ingredient = { "description": { "type": "string" } }, "required": ["name", "description"] -} +}; -module.exports = Ingredient \ No newline at end of file +module.exports = Ingredient; \ No newline at end of file diff --git a/api/validations/MetaSchoolValidation.js b/api/validations/MetaSchoolValidation.js index 0bbcf23..44b1848 100644 --- a/api/validations/MetaSchoolValidation.js +++ b/api/validations/MetaSchoolValidation.js @@ -7,6 +7,6 @@ const MetaSchool = { "schools": { "type": "array" } }, "required": ["name", "description"] -} +}; -module.exports = MetaSchool \ No newline at end of file +module.exports = MetaSchool; \ No newline at end of file diff --git a/api/validations/SchoolValidation.js b/api/validations/SchoolValidation.js index f2dd21d..03f0148 100644 --- a/api/validations/SchoolValidation.js +++ b/api/validations/SchoolValidation.js @@ -7,6 +7,6 @@ const School = { "meta_school_id": { "type": "number" }, }, "required": ["name", "description", "meta_school_id"] -} +}; -module.exports = School \ No newline at end of file +module.exports = School; \ No newline at end of file diff --git a/api/validations/SpellValidation.js b/api/validations/SpellValidation.js index 4ae434b..c440a6c 100644 --- a/api/validations/SpellValidation.js +++ b/api/validations/SpellValidation.js @@ -34,6 +34,6 @@ const Spell = { } }, "required": ["name", "description"] -} +}; -module.exports = Spell \ No newline at end of file +module.exports = Spell; \ No newline at end of file diff --git a/api/validations/UserValidation.js b/api/validations/UserValidation.js index 4ea8968..c6dd4e9 100644 --- a/api/validations/UserValidation.js +++ b/api/validations/UserValidation.js @@ -7,6 +7,6 @@ const User = { "password": { "type": "string" }, }, "required": ["name", "password", "mail"] -} +}; -module.exports = User \ No newline at end of file +module.exports = User; \ No newline at end of file diff --git a/api/validations/VariableValidation.js b/api/validations/VariableValidation.js index 29cf829..72e0928 100644 --- a/api/validations/VariableValidation.js +++ b/api/validations/VariableValidation.js @@ -5,6 +5,6 @@ const Variable = { "description": { "type": "string" }, }, "required": ["description"] -} +}; -module.exports = Variable \ No newline at end of file +module.exports = Variable; \ No newline at end of file