From 3bd9808f74a63304435ba98efd79d9980027a59b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 04:32:18 +0800 Subject: [PATCH 001/167] add typescript Signed-off-by: Raccoon --- .gitignore | 4 +++- package-lock.json | 6 ++++++ package.json | 2 ++ tsconfig.json | 11 +++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index d46e704e74..0aaa5f0d30 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,6 @@ public/uploads/* /.nyc_output /coverage/ -.vscode/settings.json \ No newline at end of file +.vscode/settings.json + +/dist diff --git a/package-lock.json b/package-lock.json index 858ccc8d77..fe97f2fb66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15937,6 +15937,12 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, + "typescript": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", + "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", + "dev": true + }, "typo-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typo-js/-/typo-js-1.0.3.tgz", diff --git a/package.json b/package.json index a55ecc924c..f493fd4239 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,7 @@ "@hackmd/idle-js": "~1.0.1", "@hackmd/js-sequence-diagrams": "~0.0.1-alpha.3", "@susisu/mte-kernel": "^2.1.0", + "@types/node": "^10.17.14", "acorn": "~6.1.1", "babel-core": "~6.26.3", "babel-loader": "~7.1.4", @@ -191,6 +192,7 @@ "style-loader": "~0.23.1", "tedious": "~6.2.0", "turndown": "~5.0.3", + "typescript": "^4.3.2", "typo-js": "^1.0.3", "uglifyjs-webpack-plugin": "~1.2.7", "url-loader": "~1.0.1", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..f4cd87fdc9 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "allowJs": true, + "target": "ES5", + "outDir": "./dist/" + }, + "include": [ + "./lib/**/*" + ] +} From 45def871a6513d6add48a9d9f73826974766f076 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 04:32:33 +0800 Subject: [PATCH 002/167] temp comment pandoc (ts error) Signed-off-by: Raccoon --- lib/note/noteActions.js | 86 ++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/lib/note/noteActions.js b/lib/note/noteActions.js index 31f7c1f46f..f91d283c08 100644 --- a/lib/note/noteActions.js +++ b/lib/note/noteActions.js @@ -6,7 +6,7 @@ const markdownpdf = require('markdown-pdf') const shortId = require('shortid') const querystring = require('querystring') const moment = require('moment') -const { Pandoc } = require('@hackmd/pandoc.js') +// const { Pandoc } = require('@hackmd/pandoc.js') const config = require('../config') const logger = require('../logger') @@ -117,48 +117,48 @@ const outputFormats = { docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' } -async function actionPandoc (req, res, note) { - var url = config.serverURL || 'http://' + req.get('host') - var body = note.content - var extracted = Note.extractMeta(body) - var content = extracted.markdown - var title = Note.decodeTitle(note.title) - - if (!fs.existsSync(config.tmpPath)) { - fs.mkdirSync(config.tmpPath) - } - const pandoc = new Pandoc() - - var path = config.tmpPath + '/' + Date.now() - content = content.replace(/\]\(\//g, '](' + url + '/') - - // TODO: check export type - const { exportType } = req.query - - try { - // TODO: timeout rejection - - await pandoc.convertToFile(content, 'markdown', exportType, path, [ - '--metadata', `title=${title}` - ]) - - var stream = fs.createReadStream(path) - var filename = title - // Be careful of special characters - filename = encodeURIComponent(filename) - // Ideally this should strip them - res.setHeader('Content-disposition', `attachment; filename="${filename}.${exportType}"`) - res.setHeader('Cache-Control', 'private') - res.setHeader('Content-Type', `${outputFormats[exportType]}; charset=UTF-8`) - res.setHeader('X-Robots-Tag', 'noindex, nofollow') // prevent crawling - stream.pipe(res) - } catch (err) { - // TODO: handle error - res.json({ - message: err.message - }) - } -} +// async function actionPandoc (req, res, note) { +// var url = config.serverURL || 'http://' + req.get('host') +// var body = note.content +// var extracted = Note.extractMeta(body) +// var content = extracted.markdown +// var title = Note.decodeTitle(note.title) +// +// if (!fs.existsSync(config.tmpPath)) { +// fs.mkdirSync(config.tmpPath) +// } +// const pandoc = new Pandoc() +// +// var path = config.tmpPath + '/' + Date.now() +// content = content.replace(/\]\(\//g, '](' + url + '/') +// +// // TODO: check export type +// const { exportType } = req.query +// +// try { +// // TODO: timeout rejection +// +// await pandoc.convertToFile(content, 'markdown', exportType, path, [ +// '--metadata', `title=${title}` +// ]) +// +// var stream = fs.createReadStream(path) +// var filename = title +// // Be careful of special characters +// filename = encodeURIComponent(filename) +// // Ideally this should strip them +// res.setHeader('Content-disposition', `attachment; filename="${filename}.${exportType}"`) +// res.setHeader('Cache-Control', 'private') +// res.setHeader('Content-Type', `${outputFormats[exportType]}; charset=UTF-8`) +// res.setHeader('X-Robots-Tag', 'noindex, nofollow') // prevent crawling +// stream.pipe(res) +// } catch (err) { +// // TODO: handle error +// res.json({ +// message: err.message +// }) +// } +// } function actionGist (req, res, note) { const data = { From 92c0575977830ad9f1da61c8b58b829a49f1ef2d Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 04:50:12 +0800 Subject: [PATCH 003/167] ts: lib/homepage/index.ts Signed-off-by: Raccoon --- lib/homepage/{index.js => index.ts} | 19 ++++++++++--------- package-lock.json | 24 ++++++++++++++++-------- package.json | 4 +++- tsconfig.json | 3 ++- 4 files changed, 31 insertions(+), 19 deletions(-) rename lib/homepage/{index.js => index.ts} (62%) diff --git a/lib/homepage/index.js b/lib/homepage/index.ts similarity index 62% rename from lib/homepage/index.js rename to lib/homepage/index.ts index d3ce9f055c..8d4d526219 100644 --- a/lib/homepage/index.js +++ b/lib/homepage/index.ts @@ -1,12 +1,13 @@ -'use strict' +import * as fs from 'fs' +import * as path from 'path' +import * as config from '../config' +// @ts-ignore +import {User} from '../models' +import * as logger from '../logger' +import {Request, Response} from "express"; -const fs = require('fs') -const path = require('path') -const config = require('../config') -const { User } = require('../models') -const logger = require('../logger') -exports.showIndex = async (req, res) => { +export async function showIndex(req: Request, res: Response) { const isLogin = req.isAuthenticated() const deleteToken = '' @@ -25,7 +26,7 @@ exports.showIndex = async (req, res) => { const user = await User.findOne({ where: { - id: req.user.id + id: (req.user as any).id } }) if (user) { @@ -33,6 +34,6 @@ exports.showIndex = async (req, res) => { return res.render('index.ejs', data) } - logger.error(`error: user not found with id ${req.user.id}`) + logger.error(`error: user not found with id ${(req.user as any).id}`) return res.render('index.ejs', data) } diff --git a/package-lock.json b/package-lock.json index fe97f2fb66..363515a422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1277,15 +1277,25 @@ } }, "@types/express": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.2.tgz", - "integrity": "sha512-5mHFNyavtLoJmnusB8OKJ5bshSzw+qkMIBAobLrIM48HJvunFva9mOa6aBwh64lBFyNwBbs0xiEFuj4eU/NjCA==", + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.9.tgz", + "integrity": "sha512-SDzEIZInC4sivGIFY4Sz1GG6J9UObPwCInYJjko2jzOf/Imx/dlpume6Xxwj1ORL82tBbmN4cPDIDkLbWHk9hw==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "*", + "@types/qs": "*", "@types/serve-static": "*" } }, + "@types/express-flash": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@types/express-flash/-/express-flash-0.0.2.tgz", + "integrity": "sha512-1l0s3YiZpMkWZ/65S4iSOLOnI7bYNDgnxx54nw5eA2pWOZ7Vvc7PpDv6iJq0bB7EBusoVWkzd+RV4r/nLY4/HA==", + "dev": true, + "requires": { + "@types/express": "*" + } + }, "@types/express-serve-static-core": { "version": "4.17.2", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.2.tgz", @@ -1353,9 +1363,9 @@ "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" }, "@types/node": { - "version": "10.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.14.tgz", - "integrity": "sha512-G0UmX5uKEmW+ZAhmZ6PLTQ5eu/VPaT+d/tdLd5IFsKRPcbe6lPxocBtcYBFSaLaCW8O60AX90e91Nsp8lVHCNw==" + "version": "12.20.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.15.tgz", + "integrity": "sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==" }, "@types/passport": { "version": "1.0.2", @@ -9653,7 +9663,6 @@ "integrity": "sha512-ipVpHX1UL9K5klPYTlQzrBbGejrFjavrld4PVbSShz5nnaK8oYo6v/85Ys/S7jylCkgpQn5QLGGWEhYYjcFbWA==", "requires": { "@types/ldapjs": "^1.0.0", - "@types/node": "^10.12.12", "bcryptjs": "^2.4.0", "ldapjs": "^1.0.2", "lru-cache": "^5.1.1" @@ -11950,7 +11959,6 @@ "resolved": "https://registry.npmjs.org/passport-ldapauth/-/passport-ldapauth-2.1.3.tgz", "integrity": "sha512-23n425UTasN6XhcXG0qQ0h0YrS/zfo8kNIEhSLfPsNpglhYhhQFfB1pmDc5RrH+Kiz5fKLkki5BpvkKHCwkixg==", "requires": { - "@types/node": "^10.12.26", "@types/passport": "^1.0.0", "ldapauth-fork": "^4.2.0", "passport-strategy": "^1.0.0" diff --git a/package.json b/package.json index f493fd4239..47abae449d 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,9 @@ "@hackmd/idle-js": "~1.0.1", "@hackmd/js-sequence-diagrams": "~0.0.1-alpha.3", "@susisu/mte-kernel": "^2.1.0", - "@types/node": "^10.17.14", + "@types/express": "4.17.9", + "@types/express-flash": "~0.0.2", + "@types/node": "~12.20.15", "acorn": "~6.1.1", "babel-core": "~6.26.3", "babel-loader": "~7.1.4", diff --git a/tsconfig.json b/tsconfig.json index f4cd87fdc9..2cbcc281e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,5 +7,6 @@ }, "include": [ "./lib/**/*" - ] + ], + "exclude": ["node_modules"] } From bf1ca53c655fe8f77b83156afee705ad92ef58d1 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:02:46 +0800 Subject: [PATCH 004/167] fix: type check error Signed-off-by: Raccoon --- package-lock.json | 43 +++++++++++++++++++++++++++++-------------- package.json | 3 ++- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 363515a422..cf0582bde9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1297,11 +1297,12 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.2.tgz", - "integrity": "sha512-El9yMpctM6tORDAiBwZVLMcxoTMcqqRO9dVyYcn7ycLWbvR8klrDn8CAOwRfZujZtWD7yS/mshTdz43jMOejbg==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.21.tgz", + "integrity": "sha512-gwCiEZqW6f7EoR8TTEfalyEhb1zA5jQJnRngr97+3pzMaO1RKoI1w2bw07TK72renMUVWcWS5mLI6rk1NqN0nA==", "requires": { "@types/node": "*", + "@types/qs": "*", "@types/range-parser": "*" } }, @@ -1358,9 +1359,9 @@ } }, "@types/mime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", - "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, "@types/node": { "version": "12.20.15", @@ -1382,9 +1383,9 @@ "dev": true }, "@types/qs": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.1.tgz", - "integrity": "sha512-lhbQXx9HKZAPgBkISrBcmAcMpZsmpe/Cd/hY7LGZS5OfkySUBItnPZHgQPssWYUET8elF+yCFBbP1Q0RZPTdaw==" + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==" }, "@types/range-parser": { "version": "1.2.3", @@ -1392,12 +1393,12 @@ "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" }, "@types/serve-static": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz", - "integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==", + "version": "1.13.9", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", + "integrity": "sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA==", "requires": { - "@types/express-serve-static-core": "*", - "@types/mime": "*" + "@types/mime": "^1", + "@types/node": "*" } }, "@webassemblyjs/ast": { @@ -9663,11 +9664,17 @@ "integrity": "sha512-ipVpHX1UL9K5klPYTlQzrBbGejrFjavrld4PVbSShz5nnaK8oYo6v/85Ys/S7jylCkgpQn5QLGGWEhYYjcFbWA==", "requires": { "@types/ldapjs": "^1.0.0", + "@types/node": "^10.12.12", "bcryptjs": "^2.4.0", "ldapjs": "^1.0.2", "lru-cache": "^5.1.1" }, "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -11959,9 +11966,17 @@ "resolved": "https://registry.npmjs.org/passport-ldapauth/-/passport-ldapauth-2.1.3.tgz", "integrity": "sha512-23n425UTasN6XhcXG0qQ0h0YrS/zfo8kNIEhSLfPsNpglhYhhQFfB1pmDc5RrH+Kiz5fKLkki5BpvkKHCwkixg==", "requires": { + "@types/node": "^10.12.26", "@types/passport": "^1.0.0", "ldapauth-fork": "^4.2.0", "passport-strategy": "^1.0.0" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } } }, "passport-local": { diff --git a/package.json b/package.json index 47abae449d..4d51c3dc85 100644 --- a/package.json +++ b/package.json @@ -111,8 +111,9 @@ "@hackmd/js-sequence-diagrams": "~0.0.1-alpha.3", "@susisu/mte-kernel": "^2.1.0", "@types/express": "4.17.9", - "@types/express-flash": "~0.0.2", + "@types/express-flash": "0.0.2", "@types/node": "~12.20.15", + "@types/qs": "^6.9.6", "acorn": "~6.1.1", "babel-core": "~6.26.3", "babel-loader": "~7.1.4", From 0387f67a5091773874ba52cd83eeb65cdb180963 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:08:03 +0800 Subject: [PATCH 005/167] let app can run use ts Signed-off-by: Raccoon --- app.js | 28 ++++++++++++++-------------- lib/models/note.js | 2 +- lib/note/noteActions.js | 4 ++-- lib/string.js | 7 +++++++ 4 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 lib/string.js diff --git a/app.js b/app.js index 700f3137c0..402b5c06b0 100644 --- a/app.js +++ b/app.js @@ -20,14 +20,14 @@ var flash = require('connect-flash') var apiMetrics = require('prometheus-api-metrics') // core -var config = require('./lib/config') -var logger = require('./lib/logger') -var response = require('./lib/response') -var models = require('./lib/models') -var csp = require('./lib/csp') -const { Environment } = require('./lib/config/enum') +var config = require('./dist/config') +var logger = require('./dist/logger') +var response = require('./dist/response') +var models = require('./dist/models') +var csp = require('./dist/csp') +const { Environment } = require('./dist/config/enum') -const { versionCheckMiddleware, checkVersion } = require('./lib/web/middleware/checkVersion') +const { versionCheckMiddleware, checkVersion } = require('./dist/web/middleware/checkVersion') function createHttpServer () { if (config.useSSL) { @@ -76,7 +76,7 @@ io.engine.ws = new (require('ws').Server)({ }) // others -var realtime = require('./lib/realtime/realtime.js') +var realtime = require('./dist/realtime/realtime.js') // assign socket io to realtime realtime.io = io @@ -138,7 +138,7 @@ app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.st app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { maxAge: config.staticCacheTime })) app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { maxAge: config.staticCacheTime })) app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), { maxAge: config.staticCacheTime })) -app.use(require('./lib/metrics').router) +app.use(require('./dist/metrics').router) // session app.use(session({ @@ -164,7 +164,7 @@ server.on('resumeSession', function (id, cb) { }) // middleware which blocks requests when we're too busy -app.use(require('./lib/middleware/tooBusy')) +app.use(require('./dist/middleware/tooBusy')) app.use(flash()) @@ -173,10 +173,10 @@ app.use(passport.initialize()) app.use(passport.session()) // check uri is valid before going further -app.use(require('./lib/middleware/checkURIValid')) +app.use(require('./dist/middleware/checkURIValid')) // redirect url without trailing slashes -app.use(require('./lib/middleware/redirectWithoutTrailingSlashes')) -app.use(require('./lib/middleware/codiMDVersion')) +app.use(require('./dist/middleware/redirectWithoutTrailingSlashes')) +app.use(require('./dist/middleware/codiMDVersion')) if (config.autoVersionCheck && process.env.NODE_ENV === Environment.production) { checkVersion(app) @@ -227,7 +227,7 @@ app.locals.enableDropBoxSave = config.isDropboxEnable app.locals.enableGitHubGist = config.isGitHubEnable app.locals.enableGitlabSnippets = config.isGitlabSnippetsEnable -app.use(require('./lib/routes').router) +app.use(require('./dist/routes').router) // response not found if no any route matxches app.get('*', function (req, res) { diff --git a/lib/models/note.js b/lib/models/note.js index 9e0fb6c5ce..790dee6d79 100644 --- a/lib/models/note.js +++ b/lib/models/note.js @@ -14,7 +14,7 @@ var moment = require('moment') var DiffMatchPatch = require('@hackmd/diff-match-patch') var dmp = new DiffMatchPatch() -const { stripTags } = require('../../utils/string') +const { stripTags } = require('../string') // core var config = require('../config') diff --git a/lib/note/noteActions.js b/lib/note/noteActions.js index f91d283c08..4b871329fd 100644 --- a/lib/note/noteActions.js +++ b/lib/note/noteActions.js @@ -117,7 +117,7 @@ const outputFormats = { docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' } -// async function actionPandoc (req, res, note) { +async function actionPandoc (req, res, note) { // var url = config.serverURL || 'http://' + req.get('host') // var body = note.content // var extracted = Note.extractMeta(body) @@ -158,7 +158,7 @@ const outputFormats = { // message: err.message // }) // } -// } +} function actionGist (req, res, note) { const data = { diff --git a/lib/string.js b/lib/string.js new file mode 100644 index 0000000000..23a308a443 --- /dev/null +++ b/lib/string.js @@ -0,0 +1,7 @@ +'use strict' + +function stripTags (s) { + return s.replace(RegExp(']*>', 'gi'), '') +} + +exports.stripTags = stripTags From 6469ac8b9ddab9716d37766c943490603aff734b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:14:08 +0800 Subject: [PATCH 006/167] ts: lib/history/index.js Signed-off-by: Raccoon --- lib/history/{index.js => index.ts} | 32 +++++++++++------------------- 1 file changed, 12 insertions(+), 20 deletions(-) rename lib/history/{index.js => index.ts} (89%) diff --git a/lib/history/index.js b/lib/history/index.ts similarity index 89% rename from lib/history/index.js rename to lib/history/index.ts index ab8b423228..71645c8d51 100644 --- a/lib/history/index.js +++ b/lib/history/index.ts @@ -1,13 +1,11 @@ -'use strict' // history // external modules -var LZString = require('@hackmd/lz-string') +import * as LZString from '@hackmd/lz-string' -// core -var config = require('../config') -var logger = require('../logger') -var response = require('../response') -var models = require('../models') +import * as models from '../models' +import * as logger from '../logger' +import * as config from '../config' +import * as response from '../response' function getHistory (userid, callback) { models.User.findOne({ @@ -18,13 +16,13 @@ function getHistory (userid, callback) { if (!user) { return callback(null, null) } - var history = {} + var history : [] | {} = [] if (user.history) { history = JSON.parse(user.history) // migrate LZString encoded note id to base64url encoded note id - for (let i = 0, l = history.length; i < l; i++) { + for (let i = 0, l = (history as []).length; i < l; i++) { // Calculate minimal string length for an UUID that is encoded - // base64 encoded and optimize comparsion by using -1 + // base64 encoded and optimize comparison by using -1 // this should make a lot of LZ-String parsing errors obsolete // as we can assume that a nodeId that is 48 chars or longer is a // noteID. @@ -73,7 +71,7 @@ function setHistory (userid, history, callback) { }) } -function updateHistory (userid, noteId, document, time) { +export function updateHistory (userid, noteId, document, time) { if (userid && noteId && typeof document !== 'undefined') { getHistory(userid, function (err, history) { if (err || !history) return @@ -113,7 +111,7 @@ function parseHistoryToObject (history) { return _history } -function historyGet (req, res) { +export function historyGet (req, res) { if (req.isAuthenticated()) { getHistory(req.user.id, function (err, history) { if (err) return response.errorInternalError(req, res) @@ -127,7 +125,7 @@ function historyGet (req, res) { } } -function historyPost (req, res) { +export function historyPost (req, res) { if (req.isAuthenticated()) { var noteId = req.params.noteId if (!noteId) { @@ -168,7 +166,7 @@ function historyPost (req, res) { } } -function historyDelete (req, res) { +export function historyDelete (req, res) { if (req.isAuthenticated()) { var noteId = req.params.noteId if (!noteId) { @@ -191,9 +189,3 @@ function historyDelete (req, res) { return response.errorForbidden(req, res) } } - -// public -exports.historyGet = historyGet -exports.historyPost = historyPost -exports.historyDelete = historyDelete -exports.updateHistory = updateHistory From 758ffd462a6c162919ca9caad011e2e912171631 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:16:31 +0800 Subject: [PATCH 007/167] ts: lib/middleware/checkURIValid.js Signed-off-by: Raccoon --- lib/middleware/{checkURIValid.js => checkURIValid.ts} | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename lib/middleware/{checkURIValid.js => checkURIValid.ts} (51%) diff --git a/lib/middleware/checkURIValid.js b/lib/middleware/checkURIValid.ts similarity index 51% rename from lib/middleware/checkURIValid.js rename to lib/middleware/checkURIValid.ts index 00f2341e21..4d9814a4da 100644 --- a/lib/middleware/checkURIValid.js +++ b/lib/middleware/checkURIValid.ts @@ -1,9 +1,7 @@ -'use strict' +import * as logger from '../logger' +import * as response from "../response"; -const logger = require('../logger') -const response = require('../response') - -module.exports = function (req, res, next) { +export = function (req, res, next) { try { decodeURIComponent(req.path) } catch (err) { From 68439de268c86dc5e7beab6e2f8b51a7f9b15f1e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:18:24 +0800 Subject: [PATCH 008/167] ts: lib/middleware/codiMDVersion.js Signed-off-by: Raccoon --- lib/middleware/codiMDVersion.js | 10 ---------- lib/middleware/codiMDVersion.ts | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 lib/middleware/codiMDVersion.js create mode 100644 lib/middleware/codiMDVersion.ts diff --git a/lib/middleware/codiMDVersion.js b/lib/middleware/codiMDVersion.js deleted file mode 100644 index eb965793f6..0000000000 --- a/lib/middleware/codiMDVersion.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict' - -const config = require('../config') - -module.exports = function (req, res, next) { - res.set({ - 'CodiMD-Version': config.version - }) - return next() -} diff --git a/lib/middleware/codiMDVersion.ts b/lib/middleware/codiMDVersion.ts new file mode 100644 index 0000000000..b51823b37f --- /dev/null +++ b/lib/middleware/codiMDVersion.ts @@ -0,0 +1,9 @@ +import * as config from "../config"; +import {Request, Response} from "express"; + +export = function (req: Request, res: Response, next) { + res.set({ + 'CodiMD-Version': config.version + }) + return next() +} From cf630ede21c46f33a0a0b98601452aaed13dc65d Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:19:21 +0800 Subject: [PATCH 009/167] ts: lib/middleware/redirectWithoutTrailingSlashes.js Signed-off-by: Raccoon --- ...TrailingSlashes.js => redirectWithoutTrailingSlashes.ts} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename lib/middleware/{redirectWithoutTrailingSlashes.js => redirectWithoutTrailingSlashes.ts} (74%) diff --git a/lib/middleware/redirectWithoutTrailingSlashes.js b/lib/middleware/redirectWithoutTrailingSlashes.ts similarity index 74% rename from lib/middleware/redirectWithoutTrailingSlashes.js rename to lib/middleware/redirectWithoutTrailingSlashes.ts index 456e3e300f..6412e5d33d 100644 --- a/lib/middleware/redirectWithoutTrailingSlashes.js +++ b/lib/middleware/redirectWithoutTrailingSlashes.ts @@ -1,8 +1,8 @@ -'use strict' +import {Request, Response} from "express"; -const config = require('../config') +import * as config from "../config"; -module.exports = function (req, res, next) { +export = function (req: Request, res: Response, next) { if (req.method === 'GET' && req.path.substr(-1) === '/' && req.path.length > 1) { const queryString = req.url.slice(req.path.length) const urlPath = req.path.slice(0, -1) From 231672d455fe5e6f9a2ca4b36c5235601580b401 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:20:27 +0800 Subject: [PATCH 010/167] ts: lib/middleware/tooBusy.js Signed-off-by: Raccoon --- lib/middleware/tooBusy.js | 16 ---------------- lib/middleware/tooBusy.ts | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 lib/middleware/tooBusy.js create mode 100644 lib/middleware/tooBusy.ts diff --git a/lib/middleware/tooBusy.js b/lib/middleware/tooBusy.js deleted file mode 100644 index 65fa4b7d17..0000000000 --- a/lib/middleware/tooBusy.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' - -const toobusy = require('toobusy-js') - -const config = require('../config') -const response = require('../response') - -toobusy.maxLag(config.responseMaxLag) - -module.exports = function (req, res, next) { - if (toobusy()) { - response.errorServiceUnavailable(req, res) - } else { - next() - } -} diff --git a/lib/middleware/tooBusy.ts b/lib/middleware/tooBusy.ts new file mode 100644 index 0000000000..42b759c43c --- /dev/null +++ b/lib/middleware/tooBusy.ts @@ -0,0 +1,14 @@ +import * as toobusy from "toobusy-js"; + +import * as config from "../config"; +import * as response from "../response"; + +toobusy.maxLag(config.responseMaxLag) + +export = function (req, res, next) { + if (toobusy()) { + response.errorServiceUnavailable(req, res) + } else { + next() + } +} From 8ae51aadef1747f6ed7f81b41c89b60cc7883f48 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:22:19 +0800 Subject: [PATCH 011/167] ts: lib/imageRouter/azure.js Signed-off-by: Raccoon --- lib/imageRouter/{azure.js => azure.ts} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename lib/imageRouter/{azure.js => azure.ts} (75%) diff --git a/lib/imageRouter/azure.js b/lib/imageRouter/azure.ts similarity index 75% rename from lib/imageRouter/azure.js rename to lib/imageRouter/azure.ts index 1756517b28..379074066f 100644 --- a/lib/imageRouter/azure.js +++ b/lib/imageRouter/azure.ts @@ -1,12 +1,12 @@ 'use strict' -const path = require('path') +import * as path from "path"; -const config = require('../config') -const logger = require('../logger') +import * as azure from "azure-storage"; -const azure = require('azure-storage') +import * as config from "../config"; +import * as logger from "../logger"; -exports.uploadImage = function (imagePath, callback) { +export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -19,7 +19,7 @@ exports.uploadImage = function (imagePath, callback) { var azureBlobService = azure.createBlobService(config.azure.connectionString) - azureBlobService.createContainerIfNotExists(config.azure.container, { publicAccessLevel: 'blob' }, function (err, result, response) { + azureBlobService.createContainerIfNotExists(config.azure.container, {publicAccessLevel: 'blob'}, function (err, result, response) { if (err) { callback(new Error(err.message), null) } else { From 8222f1fad9c105707cf08e5f313c1cd92fa1fb21 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:23:22 +0800 Subject: [PATCH 012/167] ts: lib/imageRouter/filesystem.js Signed-off-by: Raccoon --- .../{filesystem.js => filesystem.ts} | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename lib/imageRouter/{filesystem.js => filesystem.ts} (80%) diff --git a/lib/imageRouter/filesystem.js b/lib/imageRouter/filesystem.ts similarity index 80% rename from lib/imageRouter/filesystem.js rename to lib/imageRouter/filesystem.ts index 49a811ef49..4c0233d2db 100644 --- a/lib/imageRouter/filesystem.js +++ b/lib/imageRouter/filesystem.ts @@ -1,17 +1,17 @@ 'use strict' -const crypto = require('crypto') -const fs = require('fs') -const URL = require('url').URL -const path = require('path') +import * as fs from "fs"; +import * as path from "path"; +import * as crypto from "crypto"; +import {URL} from "url"; -const config = require('../config') -const logger = require('../logger') +import * as config from "../config"; +import * as logger from "../logger"; /** * generate a random filename for uploaded image */ -function randomFilename () { +function randomFilename() { const buf = crypto.randomBytes(16) return `upload_${buf.toString('hex')}` } @@ -20,7 +20,7 @@ function randomFilename () { * pick a filename not exist in filesystem * maximum attempt 5 times */ -function pickFilename (defaultFilename) { +function pickFilename(defaultFilename) { let retryCounter = 5 let filename = defaultFilename const extname = path.extname(defaultFilename) @@ -34,7 +34,7 @@ function pickFilename (defaultFilename) { throw new Error('file exists.') } -exports.uploadImage = function (imagePath, callback) { +export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return From e97c2821faf08f95a9d087c824d7ba13c684a4e8 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 05:24:37 +0800 Subject: [PATCH 013/167] ts: lib/imageRouter/imgur.js Signed-off-by: Raccoon --- lib/imageRouter/{imgur.js => imgur.ts} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename lib/imageRouter/{imgur.js => imgur.ts} (73%) diff --git a/lib/imageRouter/imgur.js b/lib/imageRouter/imgur.ts similarity index 73% rename from lib/imageRouter/imgur.js rename to lib/imageRouter/imgur.ts index 3ed014f594..46869f2b82 100644 --- a/lib/imageRouter/imgur.js +++ b/lib/imageRouter/imgur.ts @@ -1,10 +1,10 @@ 'use strict' -const config = require('../config') -const logger = require('../logger') +import * as imgur from "@hackmd/imgur"; -const imgur = require('@hackmd/imgur') +import * as config from "../config"; +import * as logger from "../logger"; -exports.uploadImage = function (imagePath, callback) { +export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -23,6 +23,6 @@ exports.uploadImage = function (imagePath, callback) { } callback(null, json.data.link.replace(/^http:\/\//i, 'https://')) }).catch(function (err) { - callback(new Error(err), null) - }) + callback(new Error(err), null) + }) } From 307b6c5d85159b15cb052da364e2de30efd7a45b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:02:25 +0800 Subject: [PATCH 014/167] allowSyntheticDefaultImports Signed-off-by: Raccoon --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 2cbcc281e5..a66e06779a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "allowJs": true, "target": "ES5", - "outDir": "./dist/" + "outDir": "./dist/", + "allowSyntheticDefaultImports": true }, "include": [ "./lib/**/*" From dbf140544a9b28fd8ae3ecf34ae1b9ea954e84a7 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:02:38 +0800 Subject: [PATCH 015/167] ts: lib/imageRouter/lutim.js Signed-off-by: Raccoon --- lib/imageRouter/{lutim.js => lutim.ts} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename lib/imageRouter/{lutim.js => lutim.ts} (73%) diff --git a/lib/imageRouter/lutim.js b/lib/imageRouter/lutim.ts similarity index 73% rename from lib/imageRouter/lutim.js rename to lib/imageRouter/lutim.ts index 1a13178c8c..01cc9a0efc 100644 --- a/lib/imageRouter/lutim.js +++ b/lib/imageRouter/lutim.ts @@ -1,10 +1,10 @@ -'use strict' -const config = require('../config') -const logger = require('../logger') +import lutim from "lutim"; -const lutim = require('lutim') +import config from "../config"; +import logger from "../logger"; -exports.uploadImage = function (imagePath, callback) { + +export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -26,6 +26,6 @@ exports.uploadImage = function (imagePath, callback) { } callback(null, lutim.getAPIUrl() + json.msg.short) }).catch(function (err) { - callback(new Error(err), null) - }) + callback(new Error(err), null) + }) } From 5416bafa2bc57c2d8f727b219b0985d61f9f779c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:08:53 +0800 Subject: [PATCH 016/167] ts: lib/imageRouter/minio.ts Signed-off-by: Raccoon --- lib/imageRouter/{minio.js => minio.ts} | 22 +++++++++++----------- package-lock.json | 9 +++++++++ package.json | 1 + 3 files changed, 21 insertions(+), 11 deletions(-) rename lib/imageRouter/{minio.js => minio.ts} (66%) diff --git a/lib/imageRouter/minio.js b/lib/imageRouter/minio.ts similarity index 66% rename from lib/imageRouter/minio.js rename to lib/imageRouter/minio.ts index fc978512d1..47a3d2e828 100644 --- a/lib/imageRouter/minio.js +++ b/lib/imageRouter/minio.ts @@ -1,12 +1,12 @@ -'use strict' -const fs = require('fs') -const path = require('path') +import fs from "fs"; +import path from "path"; -const config = require('../config') -const { getImageMimeType } = require('../utils') -const logger = require('../logger') +import Minio from "minio"; + +import config from "../config"; +import {getImageMimeType} from "../utils"; +import logger from "../logger"; -const Minio = require('minio') const minioClient = new Minio.Client({ endPoint: config.minio.endPoint, port: config.minio.port, @@ -15,7 +15,7 @@ const minioClient = new Minio.Client({ secretKey: config.minio.secretKey }) -exports.uploadImage = function (imagePath, callback) { +export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -28,16 +28,16 @@ exports.uploadImage = function (imagePath, callback) { fs.readFile(imagePath, function (err, buffer) { if (err) { - callback(new Error(err), null) + callback(err, null) return } const key = path.join('uploads', path.basename(imagePath)) const protocol = config.minio.secure ? 'https' : 'http' - minioClient.putObject(config.s3bucket, key, buffer, buffer.size, getImageMimeType(imagePath), function (err, data) { + minioClient.putObject(config.s3bucket, key, buffer, buffer.length, getImageMimeType(imagePath), function (err, data) { if (err) { - callback(new Error(err), null) + callback(err, null) return } const hidePort = [80, 443].includes(config.minio.port) diff --git a/package-lock.json b/package-lock.json index cf0582bde9..0696b5dc50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1363,6 +1363,15 @@ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, + "@types/minio": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/minio/-/minio-7.0.7.tgz", + "integrity": "sha512-cK0VuWZ5zvFmkxQzK46RtJ4qt2Gtrv34hsXDr0D3vqesjrnEKT+0rw0zWk40JtCPkoEFgLdIUbXnePsKjbb80Q==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/node": { "version": "12.20.15", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.15.tgz", diff --git a/package.json b/package.json index 4d51c3dc85..12a67cd405 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,7 @@ "@susisu/mte-kernel": "^2.1.0", "@types/express": "4.17.9", "@types/express-flash": "0.0.2", + "@types/minio": "^7.0.7", "@types/node": "~12.20.15", "@types/qs": "^6.9.6", "acorn": "~6.1.1", From 4cfa5a1bf422ce872b0e46de447ebff32ff1689b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:11:41 +0800 Subject: [PATCH 017/167] ts: lib/imageRouter/s3.js Signed-off-by: Raccoon --- lib/imageRouter/{s3.js => s3.ts} | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) rename lib/imageRouter/{s3.js => s3.ts} (71%) diff --git a/lib/imageRouter/s3.js b/lib/imageRouter/s3.ts similarity index 71% rename from lib/imageRouter/s3.js rename to lib/imageRouter/s3.ts index 0d6be44ebd..62ccd6395f 100644 --- a/lib/imageRouter/s3.js +++ b/lib/imageRouter/s3.ts @@ -1,13 +1,13 @@ -'use strict' -const fs = require('fs') -const path = require('path') +import fs from "fs"; +import path from "path"; -const config = require('../config') -const { getImageMimeType } = require('../utils') -const logger = require('../logger') +import {S3Client} from "@aws-sdk/client-s3-node/S3Client"; +import {PutObjectCommand, PutObjectInput} from "@aws-sdk/client-s3-node/commands/PutObjectCommand"; + +import config from "../config"; +import {getImageMimeType} from "../utils"; +import logger from "../logger"; -const { S3Client } = require('@aws-sdk/client-s3-node/S3Client') -const { PutObjectCommand } = require('@aws-sdk/client-s3-node/commands/PutObjectCommand') const credentials = { accessKeyId: config.s3.accessKeyId, @@ -20,7 +20,7 @@ const s3 = new S3Client({ endpoint: config.s3.endpoint }) -exports.uploadImage = function (imagePath, callback) { +export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -33,17 +33,19 @@ exports.uploadImage = function (imagePath, callback) { fs.readFile(imagePath, function (err, buffer) { if (err) { - callback(new Error(err), null) + callback(err, null) return } - const params = { + const params: PutObjectInput = { Bucket: config.s3bucket, Key: path.join('uploads', path.basename(imagePath)), Body: buffer, ACL: 'public-read' } const mimeType = getImageMimeType(imagePath) - if (mimeType) { params.ContentType = mimeType } + if (mimeType) { + params.ContentType = mimeType + } const command = new PutObjectCommand(params) From 87e2a25f9a2361b34eb4bfd6a4f630aaf07f77a4 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:17:47 +0800 Subject: [PATCH 018/167] ts: lib/imageRouter/s3.js Signed-off-by: Raccoon --- lib/imageRouter/s3.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/imageRouter/s3.ts b/lib/imageRouter/s3.ts index 62ccd6395f..4752555090 100644 --- a/lib/imageRouter/s3.ts +++ b/lib/imageRouter/s3.ts @@ -1,12 +1,12 @@ -import fs from "fs"; -import path from "path"; +import * as fs from "fs"; +import * as path from "path"; import {S3Client} from "@aws-sdk/client-s3-node/S3Client"; import {PutObjectCommand, PutObjectInput} from "@aws-sdk/client-s3-node/commands/PutObjectCommand"; -import config from "../config"; +import * as config from "../config"; import {getImageMimeType} from "../utils"; -import logger from "../logger"; +import * as logger from "../logger"; const credentials = { From 710620a920a480bada6c1eb826fd0e5aed6541c8 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:17:56 +0800 Subject: [PATCH 019/167] ts: lib/imageRouter/minio.js Signed-off-by: Raccoon --- lib/imageRouter/minio.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/imageRouter/minio.ts b/lib/imageRouter/minio.ts index 47a3d2e828..3432e5e3d2 100644 --- a/lib/imageRouter/minio.ts +++ b/lib/imageRouter/minio.ts @@ -1,11 +1,11 @@ -import fs from "fs"; -import path from "path"; +import * as fs from "fs"; +import * as path from "path"; -import Minio from "minio"; +import * as Minio from "minio"; -import config from "../config"; +import * as config from "../config"; import {getImageMimeType} from "../utils"; -import logger from "../logger"; +import * as logger from "../logger"; const minioClient = new Minio.Client({ endPoint: config.minio.endPoint, From 352758c2a0a4dca71b1cb0ca60320ae0e67624ae Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:18:01 +0800 Subject: [PATCH 020/167] ts: lib/imageRouter/lutim.js Signed-off-by: Raccoon --- lib/imageRouter/lutim.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/imageRouter/lutim.ts b/lib/imageRouter/lutim.ts index 01cc9a0efc..112ed1e5c4 100644 --- a/lib/imageRouter/lutim.ts +++ b/lib/imageRouter/lutim.ts @@ -1,7 +1,7 @@ -import lutim from "lutim"; +import * as lutim from "lutim"; -import config from "../config"; -import logger from "../logger"; +import * as config from "../config"; +import * as logger from "../logger"; export function uploadImage(imagePath, callback) { From 5b75f482f0dd09d9b47c3e16b8ee7ec3f13aa55d Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:18:05 +0800 Subject: [PATCH 021/167] ts: lib/imageRouter/index.js Signed-off-by: Raccoon --- lib/imageRouter/{index.js => index.ts} | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) rename lib/imageRouter/{index.js => index.ts} (67%) diff --git a/lib/imageRouter/index.js b/lib/imageRouter/index.ts similarity index 67% rename from lib/imageRouter/index.js rename to lib/imageRouter/index.ts index 5e2d3dfbb3..0ff7980b10 100644 --- a/lib/imageRouter/index.js +++ b/lib/imageRouter/index.ts @@ -1,28 +1,27 @@ -'use strict' +import * as fs from "fs"; +import * as path from "path"; -const fs = require('fs') -const path = require('path') -const Router = require('express').Router -const formidable = require('formidable') +import {Router} from "express"; +import * as formidable from "formidable"; +import * as readChunk from "read-chunk"; +import * as imageType from "image-type"; +import * as mime from "mime-types"; -const readChunk = require('read-chunk') -const imageType = require('image-type') -const mime = require('mime-types') +import * as config from "../config"; +import * as logger from "../logger"; +import * as response from "../response"; -const config = require('../config') -const logger = require('../logger') -const response = require('../response') +const imageRouter = Router() +export = imageRouter -const imageRouter = module.exports = Router() - -function checkImageValid (filepath) { +function checkImageValid(filepath) { const buffer = readChunk.sync(filepath, 0, 12) /** @type {{ ext: string, mime: string } | null} */ const mimetypeFromBuf = imageType(buffer) const mimeTypeFromExt = mime.lookup(path.extname(filepath)) return mimetypeFromBuf && config.allowedUploadMimeTypes.includes(mimetypeFromBuf.mime) && - mimeTypeFromExt && config.allowedUploadMimeTypes.includes(mimeTypeFromExt) + mimeTypeFromExt && config.allowedUploadMimeTypes.includes(mimeTypeFromExt) } // upload image @@ -46,7 +45,8 @@ imageRouter.post('/uploadimage', function (req, res) { const uploadProvider = require('./' + config.imageUploadType) uploadProvider.uploadImage(files.image.path, function (err, url) { // remove temporary upload file, and ignore any error - fs.unlink(files.image.path, () => {}) + fs.unlink(files.image.path, () => { + }) if (err !== null) { logger.error(err) return res.status(500).end('upload image error') From 3393c83cfa05f92dc8e588b53e61f7bc8f5ac8de Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:20:35 +0800 Subject: [PATCH 022/167] ts: lib/note/noteActions.js Signed-off-by: Raccoon --- lib/note/{noteActions.js => noteActions.ts} | 50 +++++++++------------ 1 file changed, 21 insertions(+), 29 deletions(-) rename lib/note/{noteActions.js => noteActions.ts} (86%) diff --git a/lib/note/noteActions.js b/lib/note/noteActions.ts similarity index 86% rename from lib/note/noteActions.js rename to lib/note/noteActions.ts index 4b871329fd..f44b0189e4 100644 --- a/lib/note/noteActions.js +++ b/lib/note/noteActions.ts @@ -1,27 +1,28 @@ -'use strict' - -const fs = require('fs') -const path = require('path') -const markdownpdf = require('markdown-pdf') -const shortId = require('shortid') -const querystring = require('querystring') -const moment = require('moment') +import * as fs from "fs"; +import * as path from "path"; + +import * as markdownpdf from "markdown-pdf"; +import * as shortId from "shortid"; +import * as querystring from "querystring"; +import * as moment from "moment"; // const { Pandoc } = require('@hackmd/pandoc.js') -const config = require('../config') -const logger = require('../logger') -const { Note, Revision } = require('../models') -const { errorInternalError, errorNotFound } = require('../response') +import * as config from "../config"; +import * as logger from "../logger"; +// @ts-ignore +import {Note, Revision} from "../models"; +import {errorInternalError, errorNotFound} from "../response"; + -function actionPublish (req, res, note) { +export function actionPublish(req, res, note) { res.redirect(config.serverURL + '/s/' + (note.alias || note.shortid)) } -function actionSlide (req, res, note) { +export function actionSlide(req, res, note) { res.redirect(config.serverURL + '/p/' + (note.alias || note.shortid)) } -function actionDownload (req, res, note) { +export function actionDownload(req, res, note) { const body = note.content const title = Note.decodeTitle(note.title) const filename = encodeURIComponent(title) @@ -37,7 +38,7 @@ function actionDownload (req, res, note) { res.send(body) } -function actionInfo (req, res, note) { +export function actionInfo(req, res, note) { const body = note.content const extracted = Note.extractMeta(body) const markdown = extracted.markdown @@ -64,7 +65,7 @@ function actionInfo (req, res, note) { res.send(data) } -function actionPDF (req, res, note) { +export function actionPDF(req, res, note) { const url = config.serverURL || 'http://' + req.get('host') const body = note.content const extracted = Note.extractMeta(body) @@ -117,7 +118,7 @@ const outputFormats = { docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' } -async function actionPandoc (req, res, note) { +export async function actionPandoc(req, res, note) { // var url = config.serverURL || 'http://' + req.get('host') // var body = note.content // var extracted = Note.extractMeta(body) @@ -160,7 +161,7 @@ async function actionPandoc (req, res, note) { // } } -function actionGist (req, res, note) { +export function actionGist(req, res, note) { const data = { client_id: config.github.clientID, redirect_uri: config.serverURL + '/auth/github/callback/' + Note.encodeNoteId(note.id) + '/gist', @@ -171,7 +172,7 @@ function actionGist (req, res, note) { res.redirect('https://github.com/login/oauth/authorize?' + query) } -function actionRevision (req, res, note) { +export function actionRevision(req, res, note) { const actionId = req.params.actionId if (actionId) { const time = moment(parseInt(actionId)) @@ -215,12 +216,3 @@ function actionRevision (req, res, note) { }) } } - -exports.actionPublish = actionPublish -exports.actionSlide = actionSlide -exports.actionDownload = actionDownload -exports.actionInfo = actionInfo -exports.actionPDF = actionPDF -exports.actionGist = actionGist -exports.actionPandoc = actionPandoc -exports.actionRevision = actionRevision From 7827554bd9ab7983a55997b36af92b54c8beec6f Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:23:52 +0800 Subject: [PATCH 023/167] ts: lib/note/index.js Signed-off-by: Raccoon --- lib/note/{index.js => index.ts} | 55 +++++++++++++++++---------------- 1 file changed, 29 insertions(+), 26 deletions(-) rename lib/note/{index.js => index.ts} (85%) diff --git a/lib/note/index.js b/lib/note/index.ts similarity index 85% rename from lib/note/index.js rename to lib/note/index.ts index 41d8cf587d..4c4cb2af59 100644 --- a/lib/note/index.js +++ b/lib/note/index.ts @@ -1,15 +1,25 @@ -'use strict' +import * as config from "../config"; +import * as logger from "../logger"; -const config = require('../config') -const logger = require('../logger') -const { Note, User, Revision } = require('../models') +// @ts-ignore +import {Note, Revision, User} from "../models"; -const { newCheckViewPermission, errorForbidden, responseCodiMD, errorNotFound, errorInternalError } = require('../response') -const { updateHistory, historyDelete } = require('../history') -const { actionPublish, actionSlide, actionInfo, actionDownload, actionPDF, actionGist, actionRevision, actionPandoc } = require('./noteActions') -const realtime = require('../realtime/realtime') -async function getNoteById (noteId, { includeUser } = { includeUser: false }) { +import {errorForbidden, errorInternalError, errorNotFound, newCheckViewPermission, responseCodiMD} from "../response"; +import {historyDelete, updateHistory} from "../history"; +import { + actionDownload, + actionGist, + actionInfo, actionPandoc, + actionPDF, + actionPublish, + actionRevision, + actionSlide +} from "./noteActions"; + +import * as realtime from "../realtime/realtime"; + +async function getNoteById(noteId, {includeUser} = {includeUser: false}) { const id = await Note.parseNoteIdAsync(noteId) const includes = [] @@ -33,7 +43,7 @@ async function getNoteById (noteId, { includeUser } = { includeUser: false }) { return note } -async function createNote (userId, noteAlias) { +async function createNote(userId, noteAlias) { if (!config.allowAnonymous && !userId) { throw new Error('can not create note') } @@ -51,7 +61,7 @@ async function createNote (userId, noteAlias) { } // controller -async function showNote (req, res) { +export async function showNote(req, res) { const noteId = req.params.noteId const userId = req.user ? req.user.id : null @@ -79,7 +89,7 @@ async function showNote (req, res) { return responseCodiMD(res, note) } -function canViewNote (note, isLogin, userId) { +function canViewNote(note, isLogin, userId) { if (note.permission === 'private') { return note.ownerId === userId } @@ -89,7 +99,7 @@ function canViewNote (note, isLogin, userId) { return true } -async function showPublishNote (req, res) { +export async function showPublishNote(req, res) { const shortid = req.params.shortid const note = await getNoteById(shortid, { @@ -143,7 +153,7 @@ async function showPublishNote (req, res) { res.render('pretty.ejs', data) } -async function noteActions (req, res) { +export async function noteActions(req, res) { const noteId = req.params.noteId const note = await getNoteById(noteId) @@ -191,7 +201,7 @@ async function noteActions (req, res) { } } -async function getMyNoteList (userId, callback) { +async function getMyNoteList(userId, callback) { const myNotes = await Note.findAll({ where: { ownerId: userId @@ -219,7 +229,7 @@ async function getMyNoteList (userId, callback) { } } -function listMyNotes (req, res) { +export function listMyNotes(req, res) { if (req.isAuthenticated()) { getMyNoteList(req.user.id, (err, myNoteList) => { if (err) return errorInternalError(req, res) @@ -233,7 +243,7 @@ function listMyNotes (req, res) { } } -const deleteNote = async (req, res) => { +export const deleteNote = async (req, res) => { if (req.isAuthenticated()) { const noteId = await Note.parseNoteIdAsync(req.params.noteId) try { @@ -267,7 +277,7 @@ const deleteNote = async (req, res) => { } } -const updateNote = async (req, res) => { +export const updateNote = async (req, res) => { if (req.isAuthenticated() || config.allowAnonymousEdits) { const noteId = await Note.parseNoteIdAsync(req.params.noteId) try { @@ -283,7 +293,7 @@ const updateNote = async (req, res) => { if (realtime.isNoteExistsInPool(noteId)) { logger.error('Update note failed: There are online users opening this note.') - return res.status('403').json({ status: 'error', message: 'Update API can only be used when no users is online' }) + return res.status('403').json({status: 'error', message: 'Update API can only be used when no users is online'}) } const now = Date.now() @@ -331,10 +341,3 @@ const updateNote = async (req, res) => { return errorForbidden(req, res) } } - -exports.showNote = showNote -exports.showPublishNote = showPublishNote -exports.noteActions = noteActions -exports.listMyNotes = listMyNotes -exports.deleteNote = deleteNote -exports.updateNote = updateNote From fd5fe5212bc5a26fb7b44c4261537a5b487c4d73 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:24:11 +0800 Subject: [PATCH 024/167] fix updateHistory argument typing Signed-off-by: Raccoon --- lib/history/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/history/index.ts b/lib/history/index.ts index 71645c8d51..537a547181 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -71,7 +71,7 @@ function setHistory (userid, history, callback) { }) } -export function updateHistory (userid, noteId, document, time) { +export function updateHistory (userid, noteId, document?: string, time?: any) { if (userid && noteId && typeof document !== 'undefined') { getHistory(userid, function (err, history) { if (err || !history) return From d379bc7f88b7944f94eebd082b8d8c1a2e32153c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:25:35 +0800 Subject: [PATCH 025/167] ts: lib/errorPage/index.js Signed-off-by: Raccoon --- lib/errorPage/{index.js => index.ts} | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename lib/errorPage/{index.js => index.ts} (59%) diff --git a/lib/errorPage/index.js b/lib/errorPage/index.ts similarity index 59% rename from lib/errorPage/index.js rename to lib/errorPage/index.ts index 076330635e..03aced89fc 100644 --- a/lib/errorPage/index.js +++ b/lib/errorPage/index.ts @@ -1,9 +1,8 @@ -'use strict' +import * as config from "../config"; -const config = require('../config') -const { responseError } = require('../response') +import {responseError} from "../response"; -exports.errorForbidden = (req, res) => { +export function errorForbidden(req, res) { if (req.user) { return responseError(res, '403', 'Forbidden', 'oh no.') } @@ -12,10 +11,10 @@ exports.errorForbidden = (req, res) => { res.redirect(config.serverURL + '/') } -exports.errorNotFound = (req, res) => { +export function errorNotFound(req, res) { responseError(res, '404', 'Not Found', 'oops.') } -exports.errorInternalError = (req, res) => { +export function errorInternalError(req, res) { responseError(res, '500', 'Internal Error', 'wtf.') } From 52b4d133c7fdfa79703dcb256860be1d99484c8c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:29:35 +0800 Subject: [PATCH 026/167] ts: lib/realtime/processQueue.js Signed-off-by: Raccoon --- .../{processQueue.js => processQueue.ts} | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) rename lib/realtime/{processQueue.js => processQueue.ts} (72%) diff --git a/lib/realtime/processQueue.js b/lib/realtime/processQueue.ts similarity index 72% rename from lib/realtime/processQueue.js rename to lib/realtime/processQueue.ts index d98c4139b4..7e5910917b 100644 --- a/lib/realtime/processQueue.js +++ b/lib/realtime/processQueue.ts @@ -1,6 +1,4 @@ -'use strict' - -const EventEmitter = require('events').EventEmitter +import {EventEmitter} from "events"; /** * Queuing Class for connection queuing @@ -12,15 +10,22 @@ const QueueEvent = { Finish: 'Finish' } -class ProcessQueue extends EventEmitter { - constructor ({ - maximumLength = 500, - triggerTimeInterval = 5000, - // execute on push - proactiveMode = true, - // execute next work on finish - continuousMode = true - }) { +export class ProcessQueue extends EventEmitter { + private max: number; + private triggerTime: number; + private taskMap: Map; + private queue: any[]; + private lock: boolean; + private eventTrigger: NodeJS.Timeout; + + constructor({ + maximumLength = 500, + triggerTimeInterval = 5000, + // execute on push + proactiveMode = true, + // execute next work on finish + continuousMode = true + }) { super() this.max = maximumLength this.triggerTime = triggerTimeInterval @@ -37,7 +42,7 @@ class ProcessQueue extends EventEmitter { } } - onEventProcessFunc () { + onEventProcessFunc() { if (this.lock) return this.lock = true setImmediate(() => { @@ -45,21 +50,21 @@ class ProcessQueue extends EventEmitter { }) } - start () { + start() { if (this.eventTrigger) return this.eventTrigger = setInterval(() => { this.emit(QueueEvent.Tick) }, this.triggerTime) } - stop () { + stop() { if (this.eventTrigger) { clearInterval(this.eventTrigger) this.eventTrigger = null } } - checkTaskIsInQueue (id) { + checkTaskIsInQueue(id) { return this.taskMap.has(id) } @@ -69,7 +74,7 @@ class ProcessQueue extends EventEmitter { * @param processingFunc {Function} * @returns {boolean} if success return true, otherwise false */ - push (id, processingFunc) { + push(id: string, processingFunc) { if (this.queue.length >= this.max) return false if (this.checkTaskIsInQueue(id)) return false const task = { @@ -83,7 +88,7 @@ class ProcessQueue extends EventEmitter { return true } - process () { + process() { if (this.queue.length <= 0) { this.stop() this.lock = false @@ -103,4 +108,3 @@ class ProcessQueue extends EventEmitter { } } -exports.ProcessQueue = ProcessQueue From 0f8b126d0434aa8ba4bb0a92cb351a1f3334521b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:31:04 +0800 Subject: [PATCH 027/167] ts: lib/realtime/realtimeCleanDanglingUserJob.js Signed-off-by: Raccoon --- ...Job.js => realtimeCleanDanglingUserJob.ts} | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) rename lib/realtime/{realtimeCleanDanglingUserJob.js => realtimeCleanDanglingUserJob.ts} (79%) diff --git a/lib/realtime/realtimeCleanDanglingUserJob.js b/lib/realtime/realtimeCleanDanglingUserJob.ts similarity index 79% rename from lib/realtime/realtimeCleanDanglingUserJob.js rename to lib/realtime/realtimeCleanDanglingUserJob.ts index 7719d63e10..1a75f6c2c2 100644 --- a/lib/realtime/realtimeCleanDanglingUserJob.js +++ b/lib/realtime/realtimeCleanDanglingUserJob.ts @@ -1,29 +1,33 @@ 'use strict' -const async = require('async') -const config = require('../config') -const logger = require('../logger') +import * as async from "async"; + +import * as config from "../config"; +import * as logger from "../logger"; /** * clean when user not in any rooms or user not in connected list */ -class CleanDanglingUserJob { - constructor (realtime) { +export class CleanDanglingUserJob { + private realtime: any; + private timer: NodeJS.Timeout; + + constructor(realtime) { this.realtime = realtime } - start () { + start() { if (this.timer) return this.timer = setInterval(this.cleanDanglingUser.bind(this), 60000) } - stop () { + stop() { if (!this.timer) return clearInterval(this.timer) this.timer = undefined } - cleanDanglingUser () { + cleanDanglingUser() { const users = this.realtime.getUserPool() async.each(Object.keys(users), (key, callback) => { const socket = this.realtime.io.sockets.connected[key] @@ -46,4 +50,3 @@ class CleanDanglingUserJob { } } -exports.CleanDanglingUserJob = CleanDanglingUserJob From b38915da20db424128d48b6addf0279841027773 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:32:19 +0800 Subject: [PATCH 028/167] ts: lib/realtime/realtimeSaveRevisionJob.js Signed-off-by: Raccoon --- ...isionJob.js => realtimeSaveRevisionJob.ts} | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) rename lib/realtime/{realtimeSaveRevisionJob.js => realtimeSaveRevisionJob.ts} (68%) diff --git a/lib/realtime/realtimeSaveRevisionJob.js b/lib/realtime/realtimeSaveRevisionJob.ts similarity index 68% rename from lib/realtime/realtimeSaveRevisionJob.js rename to lib/realtime/realtimeSaveRevisionJob.ts index 967449d0e4..1803885161 100644 --- a/lib/realtime/realtimeSaveRevisionJob.js +++ b/lib/realtime/realtimeSaveRevisionJob.ts @@ -1,29 +1,33 @@ 'use strict' -const models = require('../models') -const logger = require('../logger') +import * as models from "../models"; +import * as logger from "../logger"; /** * clean when user not in any rooms or user not in connected list */ -class SaveRevisionJob { - constructor (realtime) { +export class SaveRevisionJob { + private realtime: any; + private saverSleep: boolean; + private timer: NodeJS.Timeout; + + constructor(realtime) { this.realtime = realtime this.saverSleep = false } - start () { + start() { if (this.timer) return this.timer = setInterval(this.saveRevision.bind(this), 5 * 60 * 1000) } - stop () { + stop() { if (!this.timer) return clearInterval(this.timer) this.timer = undefined } - saveRevision () { + saveRevision() { if (this.getSaverSleep()) return models.Revision.saveAllNotesRevision((err, notes) => { if (err) return logger.error('revision saver failed: ' + err) @@ -33,13 +37,11 @@ class SaveRevisionJob { }) } - getSaverSleep () { + getSaverSleep() { return this.saverSleep } - setSaverSleep (val) { + setSaverSleep(val) { this.saverSleep = val } } - -exports.SaveRevisionJob = SaveRevisionJob From d7dc137a93acf8f03b43e7120da6d2891e5ceb9c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:34:15 +0800 Subject: [PATCH 029/167] ts: lib/realtime/realtimeUpdateDirtyNoteJob.js Signed-off-by: Raccoon --- ...teJob.js => realtimeUpdateDirtyNoteJob.ts} | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename lib/realtime/{realtimeUpdateDirtyNoteJob.js => realtimeUpdateDirtyNoteJob.ts} (82%) diff --git a/lib/realtime/realtimeUpdateDirtyNoteJob.js b/lib/realtime/realtimeUpdateDirtyNoteJob.ts similarity index 82% rename from lib/realtime/realtimeUpdateDirtyNoteJob.js rename to lib/realtime/realtimeUpdateDirtyNoteJob.ts index c428ec53b6..2225d3ca6b 100644 --- a/lib/realtime/realtimeUpdateDirtyNoteJob.js +++ b/lib/realtime/realtimeUpdateDirtyNoteJob.ts @@ -1,26 +1,28 @@ -'use strict' +import * as moment from "moment"; -const config = require('../config') -const logger = require('../logger') -const moment = require('moment') +import * as config from "../config"; +import * as logger from "../logger"; -class UpdateDirtyNoteJob { - constructor (realtime) { +export class UpdateDirtyNoteJob { + private realtime: any; + private timer: NodeJS.Timeout; + + constructor(realtime) { this.realtime = realtime } - start () { + start() { if (this.timer) return this.timer = setInterval(this.updateDirtyNotes.bind(this), 1000) } - stop () { + stop() { if (!this.timer) return clearInterval(this.timer) this.timer = undefined } - updateDirtyNotes () { + updateDirtyNotes() { const notes = this.realtime.getNotePool() Object.keys(notes).forEach((key) => { const note = notes[key] @@ -31,7 +33,7 @@ class UpdateDirtyNoteJob { }) } - async updateDirtyNote (note) { + async updateDirtyNote(note) { const notes = this.realtime.getNotePool() if (!note.server.isDirty) return @@ -63,7 +65,7 @@ class UpdateDirtyNoteJob { } } - updateNoteAsync (note) { + updateNoteAsync(note): Promise { return new Promise((resolve, reject) => { this.realtime.updateNote(note, (err, _note) => { if (err) { @@ -74,5 +76,3 @@ class UpdateDirtyNoteJob { }) } } - -exports.UpdateDirtyNoteJob = UpdateDirtyNoteJob From d97fe350f858568f8b611651e062e75ea5e47553 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:35:39 +0800 Subject: [PATCH 030/167] ts: lib/realtime/realtimeClientConnection.js Signed-off-by: Raccoon --- ...nection.js => realtimeClientConnection.ts} | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) rename lib/realtime/{realtimeClientConnection.js => realtimeClientConnection.ts} (87%) diff --git a/lib/realtime/realtimeClientConnection.js b/lib/realtime/realtimeClientConnection.ts similarity index 87% rename from lib/realtime/realtimeClientConnection.js rename to lib/realtime/realtimeClientConnection.ts index b723bc26be..0a2aa7449a 100644 --- a/lib/realtime/realtimeClientConnection.js +++ b/lib/realtime/realtimeClientConnection.ts @@ -1,18 +1,21 @@ 'use strict' -const get = require('lodash/get') +import {get} from "lodash"; -const config = require('../config') -const models = require('../models') -const logger = require('../logger') +import config from "../config"; +import models from "../models"; +import logger from "../logger"; class RealtimeClientConnection { - constructor (socket) { + private socket: any; + private realtime: any; + + constructor(socket) { this.socket = socket this.realtime = require('./realtime') } - registerEventHandler () { + registerEventHandler() { // received client refresh request this.socket.on('refresh', this.refreshEventHandler.bind(this)) // received user status @@ -37,27 +40,27 @@ class RealtimeClientConnection { this.socket.on('permission', this.permissionChangeEventHandler.bind(this)) } - isUserLoggedIn () { + isUserLoggedIn() { return this.socket.request.user && this.socket.request.user.logged_in } - isNoteAndUserExists () { + isNoteAndUserExists() { const note = this.realtime.getNoteFromNotePool(this.socket.noteId) const user = this.realtime.getUserFromUserPool(this.socket.id) return note && user } - isNoteOwner () { + isNoteOwner() { const note = this.getCurrentNote() return get(note, 'owner') === this.getCurrentLoggedInUserId() } - isAnonymousEnable () { + isAnonymousEnable() { // TODO: move this method to config module return config.allowAnonymous || config.allowAnonymousEdits } - getAvailablePermissions () { + getAvailablePermissions() { // TODO: move this method to config module const availablePermission = Object.assign({}, config.permission) if (!config.allowAnonymous && !config.allowAnonymousViews) { @@ -70,31 +73,31 @@ class RealtimeClientConnection { return availablePermission } - getCurrentUser () { + getCurrentUser() { if (!this.socket.id) return return this.realtime.getUserFromUserPool(this.socket.id) } - getCurrentLoggedInUserId () { + getCurrentLoggedInUserId() { return get(this.socket, 'request.user.id') } - getCurrentNote () { + getCurrentNote() { if (!this.socket.noteId) return return this.realtime.getNoteFromNotePool(this.socket.noteId) } - getNoteChannel () { + getNoteChannel() { return this.socket.broadcast.to(this.socket.noteId) } - async destroyNote (id) { + async destroyNote(id) { return models.Note.destroy({ - where: { id: id } + where: {id: id} }) } - async changeNotePermission (newPermission) { + async changeNotePermission(newPermission) { const [changedRows] = await models.Note.update({ permission: newPermission }, { @@ -107,7 +110,7 @@ class RealtimeClientConnection { } } - notifyPermissionChanged () { + notifyPermissionChanged() { this.realtime.io.to(this.getCurrentNote().id).emit('permission', { permission: this.getCurrentNote().permission }) @@ -125,18 +128,18 @@ class RealtimeClientConnection { }) } - refreshEventHandler () { + refreshEventHandler() { this.realtime.emitRefresh(this.socket) } - checkVersionEventHandler () { + checkVersionEventHandler() { this.socket.emit('version', { version: config.fullversion, minimumCompatibleVersion: config.minimumCompatibleVersion }) } - userStatusEventHandler (data) { + userStatusEventHandler(data) { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() if (config.debug) { @@ -149,7 +152,7 @@ class RealtimeClientConnection { this.realtime.emitUserStatus(this.socket) } - userChangedEventHandler () { + userChangedEventHandler() { logger.info('user changed') const note = this.getCurrentNote() @@ -161,7 +164,7 @@ class RealtimeClientConnection { this.realtime.emitOnlineUsers(this.socket) } - onlineUsersEventHandler () { + onlineUsersEventHandler() { if (!this.isNoteAndUserExists()) return const currentNote = this.getCurrentNote() @@ -174,7 +177,7 @@ class RealtimeClientConnection { }) } - cursorFocusEventHandler (data) { + cursorFocusEventHandler(data) { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() user.cursor = data @@ -182,7 +185,7 @@ class RealtimeClientConnection { this.getNoteChannel().emit('cursor focus', out) } - cursorActivityEventHandler (data) { + cursorActivityEventHandler(data) { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() user.cursor = data @@ -190,7 +193,7 @@ class RealtimeClientConnection { this.getNoteChannel().emit('cursor activity', out) } - cursorBlurEventHandler () { + cursorBlurEventHandler() { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() user.cursor = null @@ -199,7 +202,7 @@ class RealtimeClientConnection { }) } - deleteNoteEventHandler () { + deleteNoteEventHandler() { // need login to do more actions if (this.isUserLoggedIn() && this.isNoteAndUserExists()) { const note = this.getCurrentNote() @@ -217,7 +220,7 @@ class RealtimeClientConnection { } } - permissionChangeEventHandler (permission) { + permissionChangeEventHandler(permission) { if (!this.isUserLoggedIn()) return if (!this.isNoteAndUserExists()) return @@ -234,7 +237,7 @@ class RealtimeClientConnection { .catch(err => logger.error('update note permission failed: ' + err)) } - disconnectEventHandler () { + disconnectEventHandler() { if (this.realtime.disconnectProcessQueue.checkTaskIsInQueue(this.socket.id)) { return } From f21b2342de01fddf2a5f2f764f21c4165ddf52ce Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:46:13 +0800 Subject: [PATCH 031/167] ts: lib/realtime/processQueue.js Signed-off-by: Raccoon --- lib/realtime/processQueue.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/realtime/processQueue.ts b/lib/realtime/processQueue.ts index 7e5910917b..a048cd5aea 100644 --- a/lib/realtime/processQueue.ts +++ b/lib/realtime/processQueue.ts @@ -14,8 +14,8 @@ export class ProcessQueue extends EventEmitter { private max: number; private triggerTime: number; private taskMap: Map; - private queue: any[]; - private lock: boolean; + public queue: any[]; + public lock: boolean; private eventTrigger: NodeJS.Timeout; constructor({ From 16618e1e614afee41530d4f4ab47b5e59d2428de Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:46:26 +0800 Subject: [PATCH 032/167] ts: lib/realtime/realtimeClientConneciton.js Signed-off-by: Raccoon --- lib/realtime/realtimeClientConnection.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index 0a2aa7449a..3d48f15fcb 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -2,11 +2,11 @@ import {get} from "lodash"; -import config from "../config"; -import models from "../models"; -import logger from "../logger"; +import * as config from "../config"; +import * as models from "../models"; +import * as logger from "../logger"; -class RealtimeClientConnection { +export class RealtimeClientConnection { private socket: any; private realtime: any; From 7cea9a29a9a59dbf9ceaba32e8ee5f93620c4ab0 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:46:32 +0800 Subject: [PATCH 033/167] ts: lib/realtime/realtime.ts Signed-off-by: Raccoon --- lib/realtime/{realtime.js => realtime.ts} | 200 +++++++++------------- 1 file changed, 79 insertions(+), 121 deletions(-) rename lib/realtime/{realtime.js => realtime.ts} (80%) diff --git a/lib/realtime/realtime.js b/lib/realtime/realtime.ts similarity index 80% rename from lib/realtime/realtime.js rename to lib/realtime/realtime.ts index f8c7ade398..b2cf97a054 100644 --- a/lib/realtime/realtime.js +++ b/lib/realtime/realtime.ts @@ -1,62 +1,53 @@ -'use strict' // realtime // external modules -const cookie = require('cookie') -const cookieParser = require('cookie-parser') -const url = require('url') -const randomcolor = require('randomcolor') -const Chance = require('chance') -const chance = new Chance() -const moment = require('moment') - -const get = require('lodash/get') +import * as cookie from "cookie"; +import * as cookieParser from "cookie-parser"; +import * as url from "url"; +import * as randomcolor from "randomcolor"; +import * as Chance from "chance"; +import * as moment from "moment"; +import {get} from "lodash"; // core -const config = require('../config') -const logger = require('../logger') -const history = require('../history') -const models = require('../models') +import * as config from "../config"; +import * as logger from "../logger"; +import * as history from "../history"; +import * as models from "../models"; // ot -const ot = require('../ot') +import * as ot from "../ot"; -const { ProcessQueue } = require('./processQueue') -const { RealtimeClientConnection } = require('./realtimeClientConnection') -const { UpdateDirtyNoteJob } = require('./realtimeUpdateDirtyNoteJob') -const { CleanDanglingUserJob } = require('./realtimeCleanDanglingUserJob') -const { SaveRevisionJob } = require('./realtimeSaveRevisionJob') +import {ProcessQueue} from "./processQueue"; +import {RealtimeClientConnection} from "./realtimeClientConnection"; +import {UpdateDirtyNoteJob} from "./realtimeUpdateDirtyNoteJob"; +import {CleanDanglingUserJob} from "./realtimeCleanDanglingUserJob"; +import {SaveRevisionJob} from "./realtimeSaveRevisionJob"; -// public -const realtime = { - io: null, - onAuthorizeSuccess: onAuthorizeSuccess, - onAuthorizeFail: onAuthorizeFail, - secure: secure, - connection: connection, - getStatus: getStatus, - isReady: isReady, - maintenance: true -} +const chance = new Chance() + +export let io = null +export let maintenance = true +// public const connectProcessQueue = new ProcessQueue({}) -const disconnectProcessQueue = new ProcessQueue({}) -const updateDirtyNoteJob = new UpdateDirtyNoteJob(realtime) -const cleanDanglingUserJob = new CleanDanglingUserJob(realtime) -const saveRevisionJob = new SaveRevisionJob(realtime) +export const disconnectProcessQueue = new ProcessQueue({}) +const updateDirtyNoteJob = new UpdateDirtyNoteJob(exports) +const cleanDanglingUserJob = new CleanDanglingUserJob(exports) +export const saveRevisionJob = new SaveRevisionJob(exports) // TODO: test it -function onAuthorizeSuccess (data, accept) { +export function onAuthorizeSuccess(data, accept) { accept() } // TODO: test it -function onAuthorizeFail (data, message, error, accept) { +export function onAuthorizeFail(data, message, error, accept) { accept() // accept whether authorize or not to allow anonymous usage } // TODO: test it // secure the origin by the cookie -function secure (socket, next) { +export function secure(socket, next) { try { var handshakeData = socket.request if (handshakeData.headers.cookie) { @@ -82,7 +73,7 @@ function secure (socket, next) { // TODO: only use in `updateDirtyNote` // TODO: test it -function emitCheck (note) { +export function emitCheck(note) { var out = { title: note.title, updatetime: note.updatetime, @@ -91,50 +82,50 @@ function emitCheck (note) { authors: note.authors, authorship: note.authorship } - realtime.io.to(note.id).emit('check', out) + io.to(note.id).emit('check', out) } // actions -var users = {} -var notes = {} +export var users = {} +export var notes = {} -function getNotePool () { +export function getNotePool() { return notes } -function isNoteExistsInPool (noteId) { +export function isNoteExistsInPool(noteId) { return !!notes[noteId] } -function addNote (note) { +export function addNote(note) { if (exports.isNoteExistsInPool(note.id)) return false notes[note.id] = note return true } -function getNotePoolSize () { +export function getNotePoolSize() { return Object.keys(notes).length } -function deleteNoteFromPool (noteId) { +export function deleteNoteFromPool(noteId) { delete notes[noteId] } -function deleteAllNoteFromPool () { +export function deleteAllNoteFromPool() { Object.keys(notes).forEach(noteId => { delete notes[noteId] }) } -function getNoteFromNotePool (noteId) { +export function getNoteFromNotePool(noteId) { return notes[noteId] } -function getUserPool () { +export function getUserPool() { return users } -function getUserFromUserPool (userId) { +export function getUserFromUserPool(userId) { return users[userId] } @@ -143,7 +134,7 @@ updateDirtyNoteJob.start() cleanDanglingUserJob.start() saveRevisionJob.start() -function disconnectSocketOnNote (note) { +export function disconnectSocketOnNote(note) { note.socks.forEach((sock) => { if (sock) { sock.emit('delete') @@ -154,7 +145,7 @@ function disconnectSocketOnNote (note) { }) } -function updateNote (note, callback) { +export function updateNote(note, callback) { _updateNoteAsync(note).then(_note => { callback(null, _note) }).catch((err) => { @@ -163,7 +154,7 @@ function updateNote (note, callback) { }) } -function findNoteByIdAsync (id) { +function findNoteByIdAsync(id) { return models.Note.findOne({ where: { id: id @@ -171,7 +162,7 @@ function findNoteByIdAsync (id) { }) } -function updateHistoryForEveryUserCollaborateNote (note) { +function updateHistoryForEveryUserCollaborateNote(note) { // update history to every user in this note const tempUsers = Object.assign({}, note.tempUsers) note.tempUsers = {} @@ -181,7 +172,7 @@ function updateHistoryForEveryUserCollaborateNote (note) { }) } -async function getUserProfileByIdAsync (id) { +async function getUserProfileByIdAsync(id) { const user = await models.User.findOne({ where: { id: id @@ -192,14 +183,14 @@ async function getUserProfileByIdAsync (id) { } class UserNotFoundException extends Error { - constructor () { + constructor() { super('user not found') this.name = this.constructor.name Error.captureStackTrace(this, this.constructor) } } -async function getLastChangeUserProfileAsync (currentLastChangeUserId, lastChangeUserIdInDatabase, lastChangeUserProfileInDatabase) { +async function getLastChangeUserProfileAsync(currentLastChangeUserId, lastChangeUserIdInDatabase, lastChangeUserProfileInDatabase) { if (!currentLastChangeUserId) return null if (currentLastChangeUserId === lastChangeUserIdInDatabase) return lastChangeUserProfileInDatabase const profile = await getUserProfileByIdAsync(currentLastChangeUserId) @@ -209,7 +200,7 @@ async function getLastChangeUserProfileAsync (currentLastChangeUserId, lastChang return profile } -function buildNoteUpdateData (note) { +function buildNoteUpdateData(note) { const body = note.server.document const title = note.title = models.Note.parseNoteTitle(body) return { @@ -221,7 +212,7 @@ function buildNoteUpdateData (note) { } } -async function _updateNoteAsync (note) { +async function _updateNoteAsync(note) { let noteModel = await findNoteByIdAsync(note.id) if (!noteModel) return null @@ -247,7 +238,7 @@ async function _updateNoteAsync (note) { } // TODO: test it -function getStatus () { +export function getStatus() { return models.Note.count() .then(function (notecount) { var distinctaddresses = [] @@ -308,14 +299,14 @@ function getStatus () { } // TODO: test it -function isReady () { - return realtime.io && +export function isReady() { + return io && Object.keys(notes).length === 0 && Object.keys(users).length === 0 && connectProcessQueue.queue.length === 0 && !connectProcessQueue.lock && disconnectProcessQueue.queue.length === 0 && !disconnectProcessQueue.lock } -function parseUrl (data) { +function parseUrl(data) { try { if (url.URL) { return new url.URL(data) @@ -329,8 +320,8 @@ function parseUrl (data) { return null } -function extractNoteIdFromSocket (socket) { - function extractNoteIdFromReferer (referer) { +export function extractNoteIdFromSocket(socket) { + function extractNoteIdFromReferer(referer) { if (referer) { const hostUrl = parseUrl(referer) if (!hostUrl) { @@ -362,7 +353,7 @@ function extractNoteIdFromSocket (socket) { return false } -async function parseNoteIdFromSocketAsync (socket) { +export async function parseNoteIdFromSocketAsync(socket) { const noteId = extractNoteIdFromSocket(socket) if (!noteId) { return null @@ -382,7 +373,7 @@ async function parseNoteIdFromSocketAsync (socket) { } // TODO: test it -function emitOnlineUsers (socket) { +export function emitOnlineUsers(socket) { var noteId = socket.noteId if (!noteId || !notes[noteId]) return var users = [] @@ -395,11 +386,11 @@ function emitOnlineUsers (socket) { var out = { users: users } - realtime.io.to(noteId).emit('online users', out) + io.to(noteId).emit('online users', out) } // TODO: test it -function emitUserStatus (socket) { +export function emitUserStatus(socket) { var noteId = socket.noteId var user = users[socket.id] if (!noteId || !notes[noteId] || !user) return @@ -408,7 +399,7 @@ function emitUserStatus (socket) { } // TODO: test it -function emitRefresh (socket) { +export function emitRefresh(socket) { var noteId = socket.noteId if (!noteId || !notes[noteId]) return var note = notes[noteId] @@ -428,7 +419,7 @@ function emitRefresh (socket) { socket.emit('refresh', out) } -function checkViewPermission (req, note) { +export function checkViewPermission(req, note) { if (note.permission === 'private') { if (req.user && req.user.logged_in && req.user.id === note.owner) { return true @@ -447,7 +438,7 @@ function checkViewPermission (req, note) { } // TODO: test it -async function fetchFullNoteAsync (noteId) { +async function fetchFullNoteAsync(noteId) { return models.Note.findOne({ where: { id: noteId @@ -469,7 +460,7 @@ async function fetchFullNoteAsync (noteId) { }) } -function buildAuthorProfilesFromNote (noteAuthors) { +function buildAuthorProfilesFromNote(noteAuthors) { const authors = {} noteAuthors.forEach((author) => { const profile = models.User.getProfile(author.user) @@ -485,7 +476,7 @@ function buildAuthorProfilesFromNote (noteAuthors) { return authors } -function makeNewServerNote (note) { +function makeNewServerNote(note) { const authors = buildAuthorProfilesFromNote(note.authors) return { @@ -509,7 +500,7 @@ function makeNewServerNote (note) { } // TODO: test it -function failConnection (code, err, socket) { +export function failConnection(code, err, socket) { logger.error(err) // emit error info socket.emit('info', { @@ -518,7 +509,7 @@ function failConnection (code, err, socket) { return socket.disconnect(true) } -function queueForDisconnect (socket) { +export function queueForDisconnect(socket) { disconnectProcessQueue.push(socket.id, async function () { if (users[socket.id]) { delete users[socket.id] @@ -559,7 +550,7 @@ function queueForDisconnect (socket) { }) } -function buildUserOutData (user) { +export function buildUserOutData(user) { var out = { id: user.id, login: user.login, @@ -575,7 +566,7 @@ function buildUserOutData (user) { } // TODO: test it -function updateUserData (socket, user) { +export function updateUserData(socket, user) { // retrieve user data from passport if (socket.request.user && socket.request.user.logged_in) { var profile = models.User.getProfile(socket.request.user) @@ -590,7 +581,7 @@ function updateUserData (socket, user) { } } -function canEditNote (notePermission, noteOwnerId, currentUserId) { +function canEditNote(notePermission, noteOwnerId, currentUserId) { switch (notePermission) { case 'freely': return true @@ -606,7 +597,7 @@ function canEditNote (notePermission, noteOwnerId, currentUserId) { } } -function ifMayEdit (socket, callback) { +export function ifMayEdit(socket, callback) { const note = getNoteFromNotePool(socket.noteId) if (!note) return const mayEdit = canEditNote(note.permission, note.owner, socket.request.user.id) @@ -623,7 +614,7 @@ function ifMayEdit (socket, callback) { } // TODO: test it -function operationCallback (socket, operation) { +function operationCallback(socket, operation) { var noteId = socket.noteId if (!noteId || !notes[noteId]) return var note = notes[noteId] @@ -666,12 +657,12 @@ function operationCallback (socket, operation) { } // TODO: test it -function updateHistory (userId, note, time) { +export function updateHistory(userId, note, time) { var noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) if (note.server) history.updateHistory(userId, noteId, note.server.document, time) } -function getUniqueColorPerNote (noteId, maxAttempt = 10) { +function getUniqueColorPerNote(noteId, maxAttempt = 10) { // random color let color = randomcolor() if (!notes[noteId]) return color @@ -693,7 +684,7 @@ function getUniqueColorPerNote (noteId, maxAttempt = 10) { return color } -function queueForConnect (socket) { +function queueForConnect(socket) { connectProcessQueue.push(socket.id, async function () { try { const noteId = await exports.parseNoteIdFromSocketAsync(socket) @@ -792,47 +783,14 @@ function queueForConnect (socket) { }) } -function connection (socket) { - if (realtime.maintenance) return +export function connection(socket) { + if (maintenance) return queueForConnect(socket) } // TODO: test it -function terminate () { +export function terminate() { disconnectProcessQueue.stop() connectProcessQueue.stop() updateDirtyNoteJob.stop() } - -exports = module.exports = realtime -exports.extractNoteIdFromSocket = extractNoteIdFromSocket -exports.updateNote = updateNote -exports.failConnection = failConnection -exports.updateUserData = updateUserData -exports.emitRefresh = emitRefresh -exports.emitUserStatus = emitUserStatus -exports.emitOnlineUsers = emitOnlineUsers -exports.checkViewPermission = checkViewPermission -exports.getUserFromUserPool = getUserFromUserPool -exports.buildUserOutData = buildUserOutData -exports.emitCheck = emitCheck -exports.disconnectSocketOnNote = disconnectSocketOnNote -exports.queueForDisconnect = queueForDisconnect -exports.terminate = terminate -exports.updateHistory = updateHistory -exports.ifMayEdit = ifMayEdit -exports.parseNoteIdFromSocketAsync = parseNoteIdFromSocketAsync -exports.disconnectProcessQueue = disconnectProcessQueue -exports.users = users -exports.getUserPool = getUserPool - -exports.notes = notes -exports.getNotePool = getNotePool -exports.getNotePoolSize = getNotePoolSize -exports.isNoteExistsInPool = isNoteExistsInPool -exports.addNote = addNote -exports.getNoteFromNotePool = getNoteFromNotePool -exports.deleteNoteFromPool = deleteNoteFromPool -exports.deleteAllNoteFromPool = deleteAllNoteFromPool - -exports.saveRevisionJob = saveRevisionJob From efcaba9fd307b941bcae3b52eb2ca88dee9f9c2a Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:47:50 +0800 Subject: [PATCH 034/167] ts: lib/status/index.js Signed-off-by: Raccoon --- lib/status/{index.js => index.ts} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename lib/status/{index.js => index.ts} (85%) diff --git a/lib/status/index.js b/lib/status/index.ts similarity index 85% rename from lib/status/index.js rename to lib/status/index.ts index 2e344efa2f..cc53b5ca63 100644 --- a/lib/status/index.js +++ b/lib/status/index.ts @@ -1,9 +1,9 @@ -'use strict' +import * as realtime from "../realtime/realtime"; -const realtime = require('../realtime/realtime') -const config = require('../config') +import * as config from "../config"; -exports.getStatus = async (req, res) => { + +export async function getStatus(req, res) { res.set({ 'Cache-Control': 'private', // only cache by client 'X-Robots-Tag': 'noindex, nofollow', // prevent crawling @@ -19,7 +19,7 @@ exports.getStatus = async (req, res) => { } } -exports.getMetrics = async (req, res) => { +export async function getMetrics(req, res) { const data = await realtime.getStatus() res.set({ @@ -30,7 +30,7 @@ exports.getMetrics = async (req, res) => { res.render('../js/lib/common/metrics.ejs', data) } -exports.getConfig = (req, res) => { +export function getConfig(req, res) { const data = { domain: config.domain, urlpath: config.urlPath, From ced6f7f201b2b0b02ba2ec095613ad175266522b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:49:31 +0800 Subject: [PATCH 035/167] ts: lib/user/index.js Signed-off-by: Raccoon --- lib/user/{index.js => index.ts} | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) rename lib/user/{index.js => index.ts} (85%) diff --git a/lib/user/index.js b/lib/user/index.ts similarity index 85% rename from lib/user/index.js rename to lib/user/index.ts index 6006450c07..ca8799e604 100644 --- a/lib/user/index.js +++ b/lib/user/index.ts @@ -1,15 +1,12 @@ -'use strict' - -const archiver = require('archiver') -const async = require('async') - -const response = require('../response') -const config = require('../config') -const models = require('../models') -const logger = require('../logger') -const { generateAvatar } = require('../letter-avatars') - -exports.getMe = async (req, res) => { +import * as archiver from 'archiver' +import * as async from 'async' +import * as response from '../response' +import * as config from '../config' +import * as models from '../models' +import * as logger from '../logger' +import { generateAvatar } from '../letter-avatars' + +export async function getMe (req, res) { if (!req.isAuthenticated()) { return res.status(401).send({ status: 'forbidden' @@ -35,7 +32,7 @@ exports.getMe = async (req, res) => { }) } -exports.deleteUser = async (req, res) => { +export async function deleteUser (req, res) { if (!req.isAuthenticated()) { return response.errorForbidden(req, res) } @@ -58,7 +55,7 @@ exports.deleteUser = async (req, res) => { return res.redirect(config.serverURL + '/') } -exports.exportMyData = (req, res) => { +export function exportMyData (req, res) { if (!req.isAuthenticated()) { return response.errorForbidden(req, res) } @@ -117,7 +114,7 @@ exports.exportMyData = (req, res) => { }) } -exports.getMyAvatar = (req, res) => { +export function getMyAvatar (req, res) { res.setHeader('Content-Type', 'image/svg+xml') res.setHeader('Cache-Control', 'public, max-age=86400') res.send(generateAvatar(req.params.username)) From 82ddb43d22efd1619f08173a85e6c0394242eafc Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:50:53 +0800 Subject: [PATCH 036/167] ts: lib/web/middleware/checkVersion.js Signed-off-by: Raccoon --- .../{checkVersion.js => checkVersion.ts} | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) rename lib/web/middleware/{checkVersion.js => checkVersion.ts} (75%) diff --git a/lib/web/middleware/checkVersion.js b/lib/web/middleware/checkVersion.ts similarity index 75% rename from lib/web/middleware/checkVersion.js rename to lib/web/middleware/checkVersion.ts index 7382db4b4a..75a6e25189 100644 --- a/lib/web/middleware/checkVersion.js +++ b/lib/web/middleware/checkVersion.ts @@ -1,11 +1,9 @@ -'use strict' +import {promisify} from "util"; -const { promisify } = require('util') +import * as request from "request"; -const request = require('request') - -const logger = require('../../logger') -const config = require('../../config') +import * as logger from "../../logger"; +import * as config from "../../config"; let lastCheckAt @@ -14,11 +12,10 @@ const CHECK_TIMEOUT = 1000 * 60 * 60 * 24 // 1 day const rp = promisify(request) -exports.checkVersion = checkVersion /** * @param {Express.Application|Express.Request} ctx */ -async function checkVersion (ctx) { +export async function checkVersion(ctx) { if (lastCheckAt && (lastCheckAt + CHECK_TIMEOUT > Date.now())) { return } @@ -27,7 +24,7 @@ async function checkVersion (ctx) { lastCheckAt = Date.now() try { - const { statusCode, body: data } = await rp({ + const {statusCode, body: data} = await rp({ url: `${VERSION_CHECK_ENDPOINT}?v=${config.version}`, method: 'GET', json: true, @@ -45,7 +42,7 @@ async function checkVersion (ctx) { locals.versionInfo.versionItem = data.latest ? null : data.versionItem if (!data.latest) { - const { version, link } = data.versionItem + const {version, link} = data.versionItem logger.info(`Your CodiMD version is out of date! The latest version is ${version}. Please see what's new on ${link}.`) } @@ -56,7 +53,7 @@ async function checkVersion (ctx) { } } -exports.versionCheckMiddleware = function (req, res, next) { +export function versionCheckMiddleware(req, res, next) { checkVersion(req) .then(() => { next() From e0322f0c71519c1d361de7aa2cf267c7dc3f650e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:51:47 +0800 Subject: [PATCH 037/167] ts: lib/worker/dmpWorker.js Signed-off-by: Raccoon --- lib/workers/{dmpWorker.js => dmpWorker.ts} | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) rename lib/workers/{dmpWorker.js => dmpWorker.ts} (96%) diff --git a/lib/workers/dmpWorker.js b/lib/workers/dmpWorker.ts similarity index 96% rename from lib/workers/dmpWorker.js rename to lib/workers/dmpWorker.ts index d999cc7260..459b1835dd 100644 --- a/lib/workers/dmpWorker.js +++ b/lib/workers/dmpWorker.ts @@ -1,12 +1,11 @@ 'use strict' // external modules -var DiffMatchPatch = require('@hackmd/diff-match-patch') -var dmp = new DiffMatchPatch() - +import * as DiffMatchPatch from "@hackmd/diff-match-patch"; // core -var config = require('../config') -var logger = require('../logger') +import * as config from "../config"; +import * as logger from "../logger"; +var dmp = new DiffMatchPatch() process.on('message', function (data) { if (!data || !data.msg || !data.cacheKey) { return logger.error('dmp worker error: not enough data') From 952a1663cc4fd7bf2c2b6a68ee7dc8e8f0c76839 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:53:03 +0800 Subject: [PATCH 038/167] ts: lib/utils.js Signed-off-by: Raccoon --- lib/utils.js | 35 ----------------------------------- lib/utils.ts | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 lib/utils.js create mode 100644 lib/utils.ts diff --git a/lib/utils.js b/lib/utils.js deleted file mode 100644 index eb10ca452f..0000000000 --- a/lib/utils.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict' -const fs = require('fs') -const path = require('path') -const bodyParser = require('body-parser') -const mime = require('mime-types') - -exports.isSQLite = function isSQLite (sequelize) { - return sequelize.options.dialect === 'sqlite' -} - -exports.getImageMimeType = function getImageMimeType (imagePath) { - return mime.lookup(path.extname(imagePath)) -} - -exports.isRevealTheme = function isRevealTheme (theme) { - if (fs.existsSync(path.join(__dirname, '..', 'public', 'build', 'reveal.js', 'css', 'theme', theme + '.css'))) { - return theme - } - return undefined -} - -exports.wrap = innerHandler => (req, res, next) => innerHandler(req, res).catch(err => next(err)) - -// create application/x-www-form-urlencoded parser -exports.urlencodedParser = bodyParser.urlencoded({ - extended: false, - limit: 1024 * 1024 * 10 // 10 mb -}) - -// create text/markdown parser -exports.markdownParser = bodyParser.text({ - inflate: true, - type: ['text/plain', 'text/markdown'], - limit: 1024 * 1024 * 10 // 10 mb -}) diff --git a/lib/utils.ts b/lib/utils.ts new file mode 100644 index 0000000000..17fea0afe3 --- /dev/null +++ b/lib/utils.ts @@ -0,0 +1,37 @@ +import * as fs from "fs"; +import * as path from "path"; + +import * as mime from "mime-types"; +import * as bodyParser from "body-parser"; + +export function isSQLite(sequelize) { + return sequelize.options.dialect === 'sqlite' +} + +export function getImageMimeType(imagePath) { + return mime.lookup(path.extname(imagePath)) +} + +export function isRevealTheme(theme) { + if (fs.existsSync(path.join(__dirname, '..', 'public', 'build', 'reveal.js', 'css', 'theme', theme + '.css'))) { + return theme + } + return undefined +} + +export function wrap(innerHandler) { + return (req, res, next) => innerHandler(req, res).catch(err => next(err)) +} + +// create application/x-www-form-urlencoded parser +export const urlencodedParser = bodyParser.urlencoded({ + extended: false, + limit: 1024 * 1024 * 10 // 10 mb +}) + +// create text/markdown parser +export const markdownParser = bodyParser.text({ + inflate: true, + type: ['text/plain', 'text/markdown'], + limit: 1024 * 1024 * 10 // 10 mb +}) From 238bf1cc786ba74f411f7b2dccf7b3bd233301e5 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:53:37 +0800 Subject: [PATCH 039/167] ts: lib/string.js Signed-off-by: Raccoon --- lib/string.js | 7 ------- lib/string.ts | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 lib/string.js create mode 100644 lib/string.ts diff --git a/lib/string.js b/lib/string.js deleted file mode 100644 index 23a308a443..0000000000 --- a/lib/string.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -function stripTags (s) { - return s.replace(RegExp(']*>', 'gi'), '') -} - -exports.stripTags = stripTags diff --git a/lib/string.ts b/lib/string.ts new file mode 100644 index 0000000000..0b24a25668 --- /dev/null +++ b/lib/string.ts @@ -0,0 +1,3 @@ +export function stripTags(s) { + return s.replace(RegExp(']*>', 'gi'), '') +} From e5e40d04909ce5a10b4c612e93d59f8dffbffd4c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:55:08 +0800 Subject: [PATCH 040/167] ts: lib/routes.js Signed-off-by: Raccoon --- lib/{routes.js => routes.ts} | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) rename lib/{routes.js => routes.ts} (83%) diff --git a/lib/routes.js b/lib/routes.ts similarity index 83% rename from lib/routes.js rename to lib/routes.ts index 9d15c3499b..9f62914032 100644 --- a/lib/routes.js +++ b/lib/routes.ts @@ -1,18 +1,17 @@ -'use strict' +import {Router} from "express"; +import {markdownParser, urlencodedParser, wrap} from "./utils"; -const { Router } = require('express') +// load controller +import * as indexController from "./homepage"; +import * as errorPageController from "./errorPage"; +import * as statusController from "./status"; +import * as historyController from "./history"; +import * as userController from "./user"; +import * as noteController from "./note"; -const { wrap, urlencodedParser, markdownParser } = require('./utils') +import * as response from "./response"; +import * as bodyParser from "body-parser"; -// load controller -const indexController = require('./homepage') -const errorPageController = require('./errorPage') -const statusController = require('./status') -const historyController = require('./history') -const userController = require('./user') -const noteController = require('./note') -const response = require('./response') -const bodyParser = require('body-parser') const appRouter = Router() // register route From 06a48e1e7d243c6aae5367481f5f78d75677f73d Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:59:01 +0800 Subject: [PATCH 041/167] ts: lib/response.js Signed-off-by: Raccoon --- lib/{response.js => response.ts} | 98 +++++++++++++++----------------- 1 file changed, 45 insertions(+), 53 deletions(-) rename lib/{response.js => response.ts} (80%) diff --git a/lib/response.js b/lib/response.ts similarity index 80% rename from lib/response.js rename to lib/response.ts index 37a955ba66..046a56a091 100644 --- a/lib/response.js +++ b/lib/response.ts @@ -1,65 +1,45 @@ -'use strict' // response // external modules -const request = require('request') - +import * as request from "request"; // core -const config = require('./config') -const logger = require('./logger') -const models = require('./models') -const utils = require('./utils') -const history = require('./history') - -// public -exports.responseError = responseError -exports.errorForbidden = errorForbidden -exports.errorNotFound = errorNotFound -exports.errorBadRequest = errorBadRequest -exports.errorTooLong = errorTooLong -exports.errorInternalError = errorInternalError -exports.errorServiceUnavailable = errorServiceUnavailable -exports.newNote = newNote -exports.showPublishSlide = showPublishSlide -exports.publishNoteActions = publishNoteActions -exports.publishSlideActions = publishSlideActions -exports.githubActions = githubActions -exports.gitlabActions = gitlabActions -exports.checkViewPermission = checkViewPermission -exports.newCheckViewPermission = newCheckViewPermission -exports.responseCodiMD = responseCodiMD +import * as config from "./config"; +import * as logger from "./logger"; +import * as models from "./models"; +import * as utils from "./utils"; +import * as history from "./history"; -function errorForbidden (req, res) { +export function errorForbidden(req, res) { if (req.user) { responseError(res, '403', 'Forbidden', 'oh no.') } else { var nextURL = new URL('', config.serverURL) - nextURL.search = new URLSearchParams({ next: req.originalUrl }) + nextURL.search = (new URLSearchParams({next: req.originalUrl})).toString() req.flash('error', 'You are not allowed to access this page. Maybe try logging in?') res.redirect(nextURL.toString()) } } -function errorNotFound (req, res) { +export function errorNotFound(req, res) { responseError(res, '404', 'Not Found', 'oops.') } -function errorBadRequest (req, res) { +export function errorBadRequest(req, res) { responseError(res, '400', 'Bad Request', 'something not right.') } -function errorTooLong (req, res) { +export function errorTooLong(req, res) { responseError(res, '413', 'Payload Too Large', 'Shorten your note!') } -function errorInternalError (req, res) { +export function errorInternalError(req, res) { responseError(res, '500', 'Internal Error', 'wtf.') } -function errorServiceUnavailable (req, res) { +export function errorServiceUnavailable(req, res) { res.status(503).send('I\'m busy right now, try again later.') } -function responseError (res, code, detail, msg) { +export function responseError(res, code, detail, msg) { res.status(code).render('error.ejs', { title: code + ' ' + detail + ' ' + msg, code: code, @@ -68,7 +48,7 @@ function responseError (res, code, detail, msg) { }) } -function responseCodiMD (res, note) { +export function responseCodiMD(res, note) { var body = note.content var extracted = models.Note.extractMeta(body) var meta = models.Note.parseMeta(extracted.meta) @@ -83,13 +63,13 @@ function responseCodiMD (res, note) { }) } -function updateHistory (userId, note, document, time) { +function updateHistory(userId, note, document, time?: any) { var noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) history.updateHistory(userId, noteId, document, time) logger.info('history updated') } -function newNote (req, res, next) { +export function newNote(req, res, next?: any) { var owner = null var body = '' if (req.body && req.body.length > config.documentMaxLength) { @@ -119,7 +99,7 @@ function newNote (req, res, next) { }) } -function newCheckViewPermission (note, isLogin, userId) { +export function newCheckViewPermission(note, isLogin, userId) { if (note.permission === 'private') { return note.ownerId === userId } @@ -129,17 +109,25 @@ function newCheckViewPermission (note, isLogin, userId) { return true } -function checkViewPermission (req, note) { +export function checkViewPermission(req, note) { if (note.permission === 'private') { - if (!req.isAuthenticated() || note.ownerId !== req.user.id) { return false } else { return true } + if (!req.isAuthenticated() || note.ownerId !== req.user.id) { + return false + } else { + return true + } } else if (note.permission === 'limited' || note.permission === 'protected') { - if (!req.isAuthenticated()) { return false } else { return true } + if (!req.isAuthenticated()) { + return false + } else { + return true + } } else { return true } } -function findNote (req, res, callback, include) { +function findNote(req, res, callback, include?: any) { var noteId = req.params.noteId var id = req.params.noteId || req.params.shortid models.Note.parseNoteId(id, function (err, _id) { @@ -173,7 +161,7 @@ function findNote (req, res, callback, include) { }) } -function actionDownload (req, res, note) { +function actionDownload(req, res, note) { var body = note.content var title = models.Note.decodeTitle(note.title) var filename = title @@ -190,7 +178,7 @@ function actionDownload (req, res, note) { res.send(body) } -function publishNoteActions (req, res, next) { +export function publishNoteActions(req, res, next) { findNote(req, res, function (note) { var action = req.params.action switch (action) { @@ -207,7 +195,7 @@ function publishNoteActions (req, res, next) { }) } -function publishSlideActions (req, res, next) { +export function publishSlideActions(req, res, next) { findNote(req, res, function (note) { var action = req.params.action switch (action) { @@ -221,7 +209,7 @@ function publishSlideActions (req, res, next) { }) } -function githubActions (req, res, next) { +export function githubActions(req, res, next) { var noteId = req.params.noteId findNote(req, res, function (note) { var action = req.params.action @@ -236,7 +224,7 @@ function githubActions (req, res, next) { }) } -function githubActionGist (req, res, note) { +function githubActionGist(req, res, note) { var code = req.query.code var state = req.query.state if (!code || !state) { @@ -293,7 +281,7 @@ function githubActionGist (req, res, note) { } } -function gitlabActions (req, res, next) { +export function gitlabActions(req, res, next) { var noteId = req.params.noteId findNote(req, res, function (note) { var action = req.params.action @@ -308,15 +296,17 @@ function gitlabActions (req, res, next) { }) } -function gitlabActionProjects (req, res, note) { +function gitlabActionProjects(req, res, note) { if (req.isAuthenticated()) { models.User.findOne({ where: { id: req.user.id } }).then(function (user) { - if (!user) { return errorNotFound(req, res) } - var ret = { baseURL: config.gitlab.baseURL, version: config.gitlab.version } + if (!user) { + return errorNotFound(req, res) + } + var ret: any = {baseURL: config.gitlab.baseURL, version: config.gitlab.version} ret.accesstoken = user.accessToken ret.profileid = user.profileid request( @@ -339,7 +329,7 @@ function gitlabActionProjects (req, res, note) { } } -function showPublishSlide (req, res, next) { +export function showPublishSlide(req, res, next) { var include = [{ model: models.User, as: 'owner' @@ -350,7 +340,9 @@ function showPublishSlide (req, res, next) { findNote(req, res, function (note) { // force to use short id var shortid = req.params.shortid - if ((note.alias && shortid !== note.alias) || (!note.alias && shortid !== note.shortid)) { return res.redirect(config.serverURL + '/p/' + (note.alias || note.shortid)) } + if ((note.alias && shortid !== note.alias) || (!note.alias && shortid !== note.shortid)) { + return res.redirect(config.serverURL + '/p/' + (note.alias || note.shortid)) + } note.increment('viewcount').then(function (note) { if (!note) { return errorNotFound(req, res) From b98e0c3d537b803b8ec1ee5a8d9a2bc56fe35a7e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 06:59:58 +0800 Subject: [PATCH 042/167] ts: lib/metrics.js Signed-off-by: Raccoon --- lib/{metrics.js => metrics.ts} | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) rename lib/{metrics.js => metrics.ts} (74%) diff --git a/lib/metrics.js b/lib/metrics.ts similarity index 74% rename from lib/metrics.js rename to lib/metrics.ts index 789cc278a3..e3e03928a5 100644 --- a/lib/metrics.js +++ b/lib/metrics.ts @@ -1,8 +1,5 @@ -'use strict' - -const { Router } = require('express') - -const { wrap } = require('./utils') +import {Router} from "express"; +import {wrap} from "./utils"; // load controller const statusController = require('./status') From 7a6b2efaeff059d996cb9006d532a829169ae608 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:00:47 +0800 Subject: [PATCH 043/167] ts: lib/letter-avatars.js Signed-off-by: Raccoon --- lib/{letter-avatars.js => letter-avatars.ts} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename lib/{letter-avatars.js => letter-avatars.ts} (84%) diff --git a/lib/letter-avatars.js b/lib/letter-avatars.ts similarity index 84% rename from lib/letter-avatars.js rename to lib/letter-avatars.ts index 1ef671a9d0..811c41db4b 100644 --- a/lib/letter-avatars.js +++ b/lib/letter-avatars.ts @@ -1,11 +1,11 @@ -'use strict' // external modules -const crypto = require('crypto') -const randomcolor = require('randomcolor') -const config = require('./config') +import * as crypto from "crypto"; +import * as randomcolor from "randomcolor"; + +import * as config from "./config"; // core -exports.generateAvatar = function (name) { +export function generateAvatar(name) { const color = randomcolor({ seed: name, luminosity: 'dark' @@ -25,7 +25,7 @@ exports.generateAvatar = function (name) { return svg } -exports.generateAvatarURL = function (name, email = '', big = true) { +export function generateAvatarURL(name, email = '', big = true) { let photo if (typeof email !== 'string') { email = '' + name + '@example.com' From 8ea1eb2650af44609dd0425a0f9621052e86b029 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:01:37 +0800 Subject: [PATCH 044/167] ts: lib/csp.js Signed-off-by: Raccoon --- lib/{csp.js => csp.ts} | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename lib/{csp.js => csp.ts} (87%) diff --git a/lib/csp.js b/lib/csp.ts similarity index 87% rename from lib/csp.js rename to lib/csp.ts index c87ca972fc..d485f0f890 100644 --- a/lib/csp.js +++ b/lib/csp.ts @@ -1,5 +1,5 @@ -var config = require('./config') -var uuid = require('uuid') +import * as config from "./config"; +import * as uuid from "uuid"; var CspStrategy = {} @@ -52,7 +52,7 @@ CspStrategy.computeDirectives = function () { return directives } -function mergeDirectives (existingDirectives, newDirectives) { +function mergeDirectives(existingDirectives, newDirectives) { for (var propertyName in newDirectives) { var newDirective = newDirectives[propertyName] if (newDirective) { @@ -62,28 +62,28 @@ function mergeDirectives (existingDirectives, newDirectives) { } } -function mergeDirectivesIf (condition, existingDirectives, newDirectives) { +function mergeDirectivesIf(condition, existingDirectives, newDirectives) { if (condition) { mergeDirectives(existingDirectives, newDirectives) } } -function areAllInlineScriptsAllowed (directives) { +function areAllInlineScriptsAllowed(directives) { return directives.scriptSrc.indexOf('\'unsafe-inline\'') !== -1 } -function addInlineScriptExceptions (directives) { +function addInlineScriptExceptions(directives) { directives.scriptSrc.push(getCspNonce) // TODO: This is the SHA-256 hash of the inline script in build/reveal.js/plugins/notes/notes.html // Any more clean solution appreciated. directives.scriptSrc.push('\'sha256-81acLZNZISnyGYZrSuoYhpzwDTTxi7vC1YM4uNxqWaM=\'') } -function getCspNonce (req, res) { +function getCspNonce(req, res) { return "'nonce-" + res.locals.nonce + "'" } -function addUpgradeUnsafeRequestsOptionTo (directives) { +function addUpgradeUnsafeRequestsOptionTo(directives) { if (config.csp.upgradeInsecureRequests === 'auto' && config.useSSL) { directives.upgradeInsecureRequests = true } else if (config.csp.upgradeInsecureRequests === true) { @@ -91,7 +91,7 @@ function addUpgradeUnsafeRequestsOptionTo (directives) { } } -function addReportURI (directives) { +function addReportURI(directives) { if (config.csp.reportURI) { directives.reportUri = config.csp.reportURI } @@ -102,4 +102,4 @@ CspStrategy.addNonceToLocals = function (req, res, next) { next() } -module.exports = CspStrategy +export = CspStrategy From 385ef6940bb7fa6fe4831afb8976e2346797ae7c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:05:41 +0800 Subject: [PATCH 045/167] ts: lib/csp.js Signed-off-by: Raccoon --- lib/csp.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/csp.ts b/lib/csp.ts index d485f0f890..bc960a7d6a 100644 --- a/lib/csp.ts +++ b/lib/csp.ts @@ -1,7 +1,7 @@ import * as config from "./config"; import * as uuid from "uuid"; -var CspStrategy = {} +var CspStrategy: any = {} var defaultDirectives = { defaultSrc: ['\'self\''], @@ -86,8 +86,10 @@ function getCspNonce(req, res) { function addUpgradeUnsafeRequestsOptionTo(directives) { if (config.csp.upgradeInsecureRequests === 'auto' && config.useSSL) { directives.upgradeInsecureRequests = true - } else if (config.csp.upgradeInsecureRequests === true) { - directives.upgradeInsecureRequests = true + } else { // @ts-ignore + if (config.csp.upgradeInsecureRequests === true) { + directives.upgradeInsecureRequests = true + } } } From 2a376db0fca7e86dff0d3d541deb744e5188a8bd Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:05:47 +0800 Subject: [PATCH 046/167] ts: lib/logger.js Signed-off-by: Raccoon --- lib/{logger.js => logger.ts} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename lib/{logger.js => logger.ts} (69%) diff --git a/lib/logger.js b/lib/logger.ts similarity index 69% rename from lib/logger.js rename to lib/logger.ts index 6d4bf69af3..9d94d532bd 100644 --- a/lib/logger.js +++ b/lib/logger.ts @@ -1,7 +1,10 @@ -'use strict' -const { createLogger, format, transports } = require('winston') +import {createLogger, format, transports, Logger} from "winston"; -const logger = createLogger({ +interface CodiMDLogger extends Logger { + stream: any +} + +const logger: CodiMDLogger = createLogger({ level: 'debug', format: format.combine( format.uncolorize(), @@ -24,4 +27,4 @@ logger.stream = { } } -module.exports = logger +export = logger From 294283f64f8a3f70c642b8c462b88887c71c06c6 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:06:51 +0800 Subject: [PATCH 047/167] ts: lib/config/utils.js Signed-off-by: Raccoon --- lib/config/{utils.js => utils.ts} | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) rename lib/config/{utils.js => utils.ts} (75%) diff --git a/lib/config/utils.js b/lib/config/utils.ts similarity index 75% rename from lib/config/utils.js rename to lib/config/utils.ts index 9646f8c0e6..85b38c957d 100644 --- a/lib/config/utils.js +++ b/lib/config/utils.ts @@ -1,30 +1,28 @@ -'use strict' +import * as fs from "fs"; +import * as path from "path"; -const fs = require('fs') -const path = require('path') - -exports.toBooleanConfig = function toBooleanConfig (configValue) { +export function toBooleanConfig(configValue) { if (configValue && typeof configValue === 'string') { return (configValue === 'true') } return configValue } -exports.toArrayConfig = function toArrayConfig (configValue, separator = ',', fallback) { +export function toArrayConfig(configValue, separator = ',', fallback) { if (configValue && typeof configValue === 'string') { return (configValue.split(separator).map(arrayItem => arrayItem.trim())) } return fallback } -exports.toIntegerConfig = function toIntegerConfig (configValue) { +export function toIntegerConfig(configValue) { if (configValue && typeof configValue === 'string') { return parseInt(configValue) } return configValue } -exports.getGitCommit = function getGitCommit (repodir) { +export function getGitCommit(repodir) { if (!fs.existsSync(repodir + '/.git/HEAD')) { return undefined } @@ -37,7 +35,7 @@ exports.getGitCommit = function getGitCommit (repodir) { return reference } -exports.getGitHubURL = function getGitHubURL (repo, reference) { +export function getGitHubURL(repo, reference) { // if it's not a github reference, we handle handle that anyway if (!repo.startsWith('https://github.com') && !repo.startsWith('git@github.com')) { return repo From 8028e2c91083196712928f2397afc95b92a26ba1 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:08:12 +0800 Subject: [PATCH 048/167] ts: lib/config/utils.js Signed-off-by: Raccoon --- lib/config/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config/utils.ts b/lib/config/utils.ts index 85b38c957d..a6ef36714a 100644 --- a/lib/config/utils.ts +++ b/lib/config/utils.ts @@ -8,7 +8,7 @@ export function toBooleanConfig(configValue) { return configValue } -export function toArrayConfig(configValue, separator = ',', fallback) { +export function toArrayConfig(configValue, separator: string = ',', fallback ?: any) { if (configValue && typeof configValue === 'string') { return (configValue.split(separator).map(arrayItem => arrayItem.trim())) } From b78cfc3d96b0f49037bd989391cfc66bc6725a6e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:08:24 +0800 Subject: [PATCH 049/167] ts: lib/config/environment.js Signed-off-by: Raccoon --- lib/config/{environment.js => environment.ts} | 7 +++--- typings/lutim/index.d.ts | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) rename lib/config/{environment.js => environment.ts} (98%) create mode 100644 typings/lutim/index.d.ts diff --git a/lib/config/environment.js b/lib/config/environment.ts similarity index 98% rename from lib/config/environment.js rename to lib/config/environment.ts index b0124a0dc2..6409ddc786 100644 --- a/lib/config/environment.js +++ b/lib/config/environment.ts @@ -1,8 +1,7 @@ -'use strict' +import {toArrayConfig, toBooleanConfig, toIntegerConfig} from "./utils"; -const { toBooleanConfig, toArrayConfig, toIntegerConfig } = require('./utils') -module.exports = { +const environmentConfig = { sourceURL: process.env.CMD_SOURCE_URL, domain: process.env.CMD_DOMAIN, urlPath: process.env.CMD_URL_PATH, @@ -151,3 +150,5 @@ module.exports = { autoVersionCheck: toBooleanConfig(process.env.CMD_AUTO_VERSION_CHECK), defaultTocDepth: toIntegerConfig(process.env.CMD_DEFAULT_TOC_DEPTH) } + +export = environmentConfig diff --git a/typings/lutim/index.d.ts b/typings/lutim/index.d.ts new file mode 100644 index 0000000000..aaf2efd1eb --- /dev/null +++ b/typings/lutim/index.d.ts @@ -0,0 +1,24 @@ +export = lutim +declare global { + namespace lutim { + function setApiUrl(url: object) + + function getApiUrl(): string + + function getServerInfos(): Promise + + function uploadImage(filePath: string, deleteDay?: number, firstView?: number, keepExif?: number, crypt?: number): Promise + + function deleteImage(realShort: String, token: String): Promise + + function modifyImage(realShort: String, token: String, deleteDay: number, firstView?: number): Promise + + function getImage(short: String): Promise + + function getImageInfos(real_short: String): Promise + + function getImageCountAndStatus(short: String, token: String): Promise + + } +} + From 3b52b19dc986ee3a2bd72866a3a6fcd1d2771938 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:08:48 +0800 Subject: [PATCH 050/167] ts: lib/config/enum.js Signed-off-by: Raccoon --- lib/config/{enum.js => enum.ts} | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) rename lib/config/{enum.js => enum.ts} (76%) diff --git a/lib/config/enum.js b/lib/config/enum.ts similarity index 76% rename from lib/config/enum.js rename to lib/config/enum.ts index 07cdfcfe3d..2555992136 100644 --- a/lib/config/enum.js +++ b/lib/config/enum.ts @@ -1,16 +1,14 @@ -'use strict' - -exports.Environment = { +export const Environment = { development: 'development', production: 'production', test: 'test' -} +}; -exports.Permission = { +export const Permission = { freely: 'freely', editable: 'editable', limited: 'limited', locked: 'locked', protected: 'protected', private: 'private' -} +}; From 10e77f34a5ac8bc59ab77eed6653d6e5cb2279b2 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:10:14 +0800 Subject: [PATCH 051/167] ts: lib/config/dockerSecret.js Signed-off-by: Raccoon --- lib/config/{dockerSecret.js => dockerSecret.ts} | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) rename lib/config/{dockerSecret.js => dockerSecret.ts} (92%) diff --git a/lib/config/dockerSecret.js b/lib/config/dockerSecret.ts similarity index 92% rename from lib/config/dockerSecret.js rename to lib/config/dockerSecret.ts index bbac972233..593fe7a2d2 100644 --- a/lib/config/dockerSecret.js +++ b/lib/config/dockerSecret.ts @@ -1,18 +1,17 @@ -'use strict' - -const fs = require('fs') -const path = require('path') +import * as fs from "fs"; +import * as path from "path"; const basePath = path.resolve('/var/run/secrets/') -function getSecret (secret) { +function getSecret(secret) { const filePath = path.join(basePath, secret) if (fs.existsSync(filePath)) return fs.readFileSync(filePath) return undefined } +let dockerSecretConfig: any = {} if (fs.existsSync(basePath)) { - module.exports = { + dockerSecretConfig = { dbURL: getSecret('dburl'), // ssl path sslKeyPath: getSecret('sslkeypath'), @@ -77,3 +76,5 @@ if (fs.existsSync(basePath)) { } } } + +export = dockerSecretConfig From 8d8d3f4c41ffa3ac61d863c7d53852c17c024026 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:11:06 +0800 Subject: [PATCH 052/167] ts: lib/config/defaultSSL.js Signed-off-by: Raccoon --- lib/config/{defaultSSL.js => defaultSSL.ts} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename lib/config/{defaultSSL.js => defaultSSL.ts} (75%) diff --git a/lib/config/defaultSSL.js b/lib/config/defaultSSL.ts similarity index 75% rename from lib/config/defaultSSL.js rename to lib/config/defaultSSL.ts index ba020466d3..879003ce6c 100644 --- a/lib/config/defaultSSL.js +++ b/lib/config/defaultSSL.ts @@ -1,17 +1,17 @@ -'use strict' +import * as fs from "fs"; -const fs = require('fs') - -function getFile (path) { +function getFile(path) { if (fs.existsSync(path)) { return path } return undefined } -module.exports = { +const defaultSSLConfig = { sslKeyPath: getFile('/run/secrets/key.pem'), sslCertPath: getFile('/run/secrets/cert.pem'), sslCAPath: getFile('/run/secrets/ca.pem') !== undefined ? [getFile('/run/secrets/ca.pem')] : [], dhParamPath: getFile('/run/secrets/dhparam.pem') } + +export = defaultSSLConfig From 39c5636b259b0872dd3468cde0b23de07a8870b7 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:11:59 +0800 Subject: [PATCH 053/167] ts: lib/config/default.js Signed-off-by: Raccoon --- lib/config/{default.js => default.ts} | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename lib/config/{default.js => default.ts} (98%) diff --git a/lib/config/default.js b/lib/config/default.ts similarity index 98% rename from lib/config/default.js rename to lib/config/default.ts index 488363b614..ab292e17c1 100644 --- a/lib/config/default.js +++ b/lib/config/default.ts @@ -1,8 +1,6 @@ -'use strict' +import * as os from "os"; -const os = require('os') - -module.exports = { +const defaultConfig = { domain: '', urlPath: '', host: '0.0.0.0', @@ -19,8 +17,7 @@ module.exports = { }, csp: { enable: true, - directives: { - }, + directives: {}, addDefaults: true, addDisqus: true, addGoogleAnalytics: true, @@ -192,3 +189,5 @@ module.exports = { autoVersionCheck: true, defaultTocDepth: 3 } + +export = defaultConfig From 6696a0ab742f13a538fc553f59290b58646a95c6 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:22:04 +0800 Subject: [PATCH 054/167] ts: lib/config/index.js Signed-off-by: Raccoon --- lib/config/{index.js => index.ts} | 34 +++++++++++++++---------------- lib/logger.ts | 9 ++++++-- 2 files changed, 23 insertions(+), 20 deletions(-) rename lib/config/{index.js => index.ts} (91%) diff --git a/lib/config/index.js b/lib/config/index.ts similarity index 91% rename from lib/config/index.js rename to lib/config/index.ts index 467ab123eb..a4c3899f3e 100644 --- a/lib/config/index.js +++ b/lib/config/index.ts @@ -1,14 +1,12 @@ +import * as crypto from "crypto"; +import * as fs from "fs"; +import * as path from "path"; +import {merge} from "lodash"; +import * as deepFreeze from "deep-freeze"; -'use strict' - -const crypto = require('crypto') -const fs = require('fs') -const path = require('path') -const { merge } = require('lodash') -const deepFreeze = require('deep-freeze') -const { Environment, Permission } = require('./enum') -const logger = require('../logger') -const { getGitCommit, getGitHubURL } = require('./utils') +import {Environment, Permission} from "./enum"; +import * as logger from "../logger"; +import {getGitCommit, getGitHubURL} from "./utils"; const appRootPath = path.resolve(__dirname, '../../') const env = process.env.NODE_ENV || Environment.development @@ -17,7 +15,7 @@ const debugConfig = { } // Get version string from package.json -const { version, repository } = require(path.join(appRootPath, 'package.json')) +const {version, repository} = require(path.join(appRootPath, 'package.json')) const commitID = getGitCommit(appRootPath) const sourceURL = getGitHubURL(repository.url, commitID || version) @@ -31,7 +29,7 @@ const packageConfig = { } const configFilePath = path.resolve(appRootPath, process.env.CMD_CONFIG_FILE || -'config.json') + 'config.json') const fileConfig = fs.existsSync(configFilePath) ? require(configFilePath)[env] : undefined let config = require('./default') @@ -43,7 +41,7 @@ merge(config, require('./environment')) merge(config, require('./dockerSecret')) if (['debug', 'verbose', 'info', 'warn', 'error'].includes(config.loglevel)) { - logger.level = config.loglevel + logger.setLevel(config.loglevel) } else { logger.error('Selected loglevel %s doesn\'t exist, using default level \'debug\'. Available options: debug, verbose, info, warn, error', config.loglevel) } @@ -79,15 +77,15 @@ if (!(config.defaultPermission in config.permission)) { } // cache result, cannot change config in runtime!!! -config.isStandardHTTPsPort = (function isStandardHTTPsPort () { +config.isStandardHTTPsPort = (function isStandardHTTPsPort() { return config.useSSL && config.port === 443 })() -config.isStandardHTTPPort = (function isStandardHTTPPort () { +config.isStandardHTTPPort = (function isStandardHTTPPort() { return !config.useSSL && config.port === 80 })() // cache serverURL -config.serverURL = (function getserverurl () { +config.serverURL = (function getserverurl() { var url = '' if (config.domain) { var protocol = config.protocolUseSSL ? 'https://' : 'http://' @@ -147,8 +145,8 @@ for (let i = keys.length; i--;) { // and the config with uppercase is not set // we set the new config using the old key. if (uppercase.test(keys[i]) && - config[lowercaseKey] !== undefined && - fileConfig[keys[i]] === undefined) { + config[lowercaseKey] !== undefined && + fileConfig[keys[i]] === undefined) { logger.warn('config.js contains deprecated lowercase setting for ' + keys[i] + '. Please change your config.js file to replace ' + lowercaseKey + ' with ' + keys[i]) config[keys[i]] = config[lowercaseKey] } diff --git a/lib/logger.ts b/lib/logger.ts index 9d94d532bd..fa2927e864 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -1,10 +1,11 @@ import {createLogger, format, transports, Logger} from "winston"; -interface CodiMDLogger extends Logger { +type CodiMDLogger = Logger & { stream: any + setLevel?: (string) => void } -const logger: CodiMDLogger = createLogger({ +let logger: CodiMDLogger = createLogger({ level: 'debug', format: format.combine( format.uncolorize(), @@ -27,4 +28,8 @@ logger.stream = { } } +logger.setLevel = function (level) { + logger.level = level +} + export = logger From 5ba1a41c6df38ad30a688c5c9af106ea4c6bb273 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:23:25 +0800 Subject: [PATCH 055/167] ts: lib/config/index.js Signed-off-by: Raccoon --- lib/config/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/config/index.ts b/lib/config/index.ts index a4c3899f3e..d79eedf9e3 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -32,7 +32,7 @@ const configFilePath = path.resolve(appRootPath, process.env.CMD_CONFIG_FILE || 'config.json') const fileConfig = fs.existsSync(configFilePath) ? require(configFilePath)[env] : undefined -let config = require('./default') +let config: any = require('./default') merge(config, require('./defaultSSL')) merge(config, debugConfig) merge(config, packageConfig) @@ -209,6 +209,6 @@ config.docsPath = path.resolve(appRootPath, config.docsPath) config.uploadsPath = path.resolve(appRootPath, config.uploadsPath) // make config readonly -config = deepFreeze(config) +config = deepFreeze(config) as any -module.exports = config +export = config From b4f59ed9bc02e863fac567a5fd46fe9bc849285a Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:24:38 +0800 Subject: [PATCH 056/167] ts: lib/auth/utils.js Signed-off-by: Raccoon --- lib/auth/{utils.js => utils.ts} | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) rename lib/auth/{utils.js => utils.ts} (79%) diff --git a/lib/auth/utils.js b/lib/auth/utils.ts similarity index 79% rename from lib/auth/utils.js rename to lib/auth/utils.ts index 2d24db5517..3d65fe5a5f 100644 --- a/lib/auth/utils.js +++ b/lib/auth/utils.ts @@ -1,10 +1,10 @@ 'use strict' -const models = require('../models') -const config = require('../config') -const logger = require('../logger') +import * as models from "../models"; +import * as config from "../config"; +import * as logger from "../logger"; -exports.setReturnToFromReferer = function setReturnToFromReferer (req) { +export function setReturnToFromReferer(req) { if (!req.session) req.session = {} var referer = req.get('referer') @@ -30,7 +30,7 @@ exports.setReturnToFromReferer = function setReturnToFromReferer (req) { } } -exports.passportGeneralCallback = function callback (accessToken, refreshToken, profile, done) { +export function passportGeneralCallback(accessToken, refreshToken, profile, done) { var stringifiedProfile = JSON.stringify(profile) models.User.findOrCreate({ where: { @@ -58,11 +58,15 @@ exports.passportGeneralCallback = function callback (accessToken, refreshToken, } if (needSave) { user.save().then(function () { - if (config.debug) { logger.info('user login: ' + user.id) } + if (config.debug) { + logger.info('user login: ' + user.id) + } return done(null, user) }) } else { - if (config.debug) { logger.info('user login: ' + user.id) } + if (config.debug) { + logger.info('user login: ' + user.id) + } return done(null, user) } } From d17c55000247db19335cb59d65555cf1ae4016b5 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:25:56 +0800 Subject: [PATCH 057/167] ts: lib/auth/bitbucket/index.js Signed-off-by: Raccoon --- lib/auth/bitbucket/{index.js => index.ts} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename lib/auth/bitbucket/{index.js => index.ts} (64%) diff --git a/lib/auth/bitbucket/index.js b/lib/auth/bitbucket/index.ts similarity index 64% rename from lib/auth/bitbucket/index.js rename to lib/auth/bitbucket/index.ts index 6cbdd9b426..a70710290a 100644 --- a/lib/auth/bitbucket/index.js +++ b/lib/auth/bitbucket/index.ts @@ -1,12 +1,12 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; +import {Strategy as BitbucketStrategy} from "passport-bitbucket-oauth2"; -const Router = require('express').Router -const passport = require('passport') -const BitbucketStrategy = require('passport-bitbucket-oauth2').Strategy -const config = require('../../config') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') +import * as config from "../../config"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; -const bitbucketAuth = module.exports = Router() +const bitbucketAuth = Router() +export = bitbucketAuth passport.use(new BitbucketStrategy({ clientID: config.bitbucket.clientID, From 1ec3c0d3e966bf7d2a9e4401c49ab7d0dc4e0e78 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:26:53 +0800 Subject: [PATCH 058/167] ts: lib/auth/dropbox/index.js Signed-off-by: Raccoon --- lib/auth/dropbox/{index.js => index.ts} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename lib/auth/dropbox/{index.js => index.ts} (64%) diff --git a/lib/auth/dropbox/index.js b/lib/auth/dropbox/index.ts similarity index 64% rename from lib/auth/dropbox/index.js rename to lib/auth/dropbox/index.ts index 099e372426..ae3be792d5 100644 --- a/lib/auth/dropbox/index.js +++ b/lib/auth/dropbox/index.ts @@ -1,12 +1,12 @@ -'use strict' +import {Router} from "express"; +import passport from "passport"; +import {Strategy as DropboxStrategy} from "passport-dropbox-oauth2"; -const Router = require('express').Router -const passport = require('passport') -const DropboxStrategy = require('passport-dropbox-oauth2').Strategy -const config = require('../../config') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') +import * as config from "../../config"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; -const dropboxAuth = module.exports = Router() +const dropboxAuth = Router() +export = dropboxAuth passport.use(new DropboxStrategy({ apiVersion: '2', From 89e01907eb128d2985f53763e66c4114cbbca88c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:28:49 +0800 Subject: [PATCH 059/167] ts: lib/auth/email/index.js Signed-off-by: Raccoon --- lib/auth/email/{index.js => index.ts} | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) rename lib/auth/email/{index.js => index.ts} (80%) diff --git a/lib/auth/email/index.js b/lib/auth/email/index.ts similarity index 80% rename from lib/auth/email/index.js rename to lib/auth/email/index.ts index 40adf0d9d6..28295e0775 100644 --- a/lib/auth/email/index.js +++ b/lib/auth/email/index.ts @@ -1,17 +1,17 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; +import * as validator from "validator"; +import {Strategy as LocalStrategy} from 'passport-local'; -const Router = require('express').Router -const passport = require('passport') -const validator = require('validator') -const LocalStrategy = require('passport-local').Strategy -const config = require('../../config') -const models = require('../../models') -const logger = require('../../logger') -const { setReturnToFromReferer } = require('../utils') -const { urlencodedParser } = require('../../utils') -const response = require('../../response') +import * as config from '../../config'; +import * as models from '../../models'; +import * as logger from "../../logger"; +import {setReturnToFromReferer} from "../utils"; +import {urlencodedParser} from "../../utils"; +import * as response from "../../response"; -const emailAuth = module.exports = Router() +const emailAuth = Router() +export = emailAuth passport.use(new LocalStrategy({ usernameField: 'email' From 4c157d7cfe0b5985e647994ca34e35845ece9c0c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:29:47 +0800 Subject: [PATCH 060/167] ts: lib/auth/facebook/index.js Signed-off-by: Raccoon --- lib/auth/facebook/{index.js => index.ts} | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename lib/auth/facebook/{index.js => index.ts} (64%) diff --git a/lib/auth/facebook/index.js b/lib/auth/facebook/index.ts similarity index 64% rename from lib/auth/facebook/index.js rename to lib/auth/facebook/index.ts index 201c82cf40..0c0adbd158 100644 --- a/lib/auth/facebook/index.js +++ b/lib/auth/facebook/index.ts @@ -1,13 +1,12 @@ -'use strict' +import {Router} from "express"; +import passport from "passport"; +import {Strategy as FacebookStrategy} from "passport-facebook"; -const Router = require('express').Router -const passport = require('passport') -const FacebookStrategy = require('passport-facebook').Strategy +import * as config from "../../config"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; -const config = require('../../config') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') - -const facebookAuth = module.exports = Router() +const facebookAuth = Router() +export = facebookAuth passport.use(new FacebookStrategy({ clientID: config.facebook.clientID, From 83098002d368143dfd3d60d36180489a21786279 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:30:57 +0800 Subject: [PATCH 061/167] ts: lib/auth/github/index.js Signed-off-by: Raccoon --- lib/auth/github/{index.js => index.ts} | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) rename lib/auth/github/{index.js => index.ts} (70%) diff --git a/lib/auth/github/index.js b/lib/auth/github/index.ts similarity index 70% rename from lib/auth/github/index.js rename to lib/auth/github/index.ts index 8f05f1220c..2f3acab388 100644 --- a/lib/auth/github/index.js +++ b/lib/auth/github/index.ts @@ -1,14 +1,13 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; +import {Strategy as GithubStrategy} from "passport-github"; +import * as config from "../../config"; +import * as response from "../../response"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; +import {URL} from "url"; -const Router = require('express').Router -const passport = require('passport') -const GithubStrategy = require('passport-github').Strategy -const config = require('../../config') -const response = require('../../response') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') -const { URL } = require('url') - -const githubAuth = module.exports = Router() +const githubAuth = Router() +export = githubAuth function githubUrl (path) { return config.github.enterpriseURL && new URL(path, config.github.enterpriseURL).toString() From ce7319661a6c63a92014dcae8dbfcd7d8a313a66 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:33:33 +0800 Subject: [PATCH 062/167] ts: lib/auth/gitlab/index.js Signed-off-by: Raccoon --- lib/auth/gitlab/{index.js => index.ts} | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename lib/auth/gitlab/{index.js => index.ts} (70%) diff --git a/lib/auth/gitlab/index.js b/lib/auth/gitlab/index.ts similarity index 70% rename from lib/auth/gitlab/index.js rename to lib/auth/gitlab/index.ts index ab4f6900a8..b4c1afea9a 100644 --- a/lib/auth/gitlab/index.js +++ b/lib/auth/gitlab/index.ts @@ -1,14 +1,14 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; +import {Strategy as GitlabStrategy} from "passport-gitlab2"; -const Router = require('express').Router -const passport = require('passport') -const GitlabStrategy = require('passport-gitlab2').Strategy -const config = require('../../config') -const response = require('../../response') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') -const HttpsProxyAgent = require('https-proxy-agent') +import * as config from "../../config"; +import * as response from "../../response"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; +import * as HttpsProxyAgent from "https-proxy-agent"; -const gitlabAuth = module.exports = Router() +const gitlabAuth = Router() +export = gitlabAuth const gitlabAuthStrategy = new GitlabStrategy({ baseURL: config.gitlab.baseURL, From edc1a9d800dcc20ec24059abf8519650a7e241f5 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:35:10 +0800 Subject: [PATCH 063/167] ts: lib/auth/google/index.js Signed-off-by: Raccoon --- lib/auth/google/{index.js => index.ts} | 11 +++++---- package-lock.json | 31 ++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 37 insertions(+), 6 deletions(-) rename lib/auth/google/{index.js => index.ts} (72%) diff --git a/lib/auth/google/index.js b/lib/auth/google/index.ts similarity index 72% rename from lib/auth/google/index.js rename to lib/auth/google/index.ts index 280a08cc29..cf0d1ac2b4 100644 --- a/lib/auth/google/index.js +++ b/lib/auth/google/index.ts @@ -1,10 +1,9 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; +import {Strategy as GoogleStrategy} from "passport-google-oauth20"; -const Router = require('express').Router -const passport = require('passport') -var GoogleStrategy = require('passport-google-oauth20').Strategy -const config = require('../../config') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') +import * as config from "../../config"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const googleAuth = module.exports = Router() diff --git a/package-lock.json b/package-lock.json index 0696b5dc50..e8c61da7ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1377,6 +1377,15 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.15.tgz", "integrity": "sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==" }, + "@types/oauth": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.1.tgz", + "integrity": "sha512-a1iY62/a3yhZ7qH7cNUsxoI3U/0Fe9+RnuFrpTKr+0WVOzbKlSLojShCKe20aOD1Sppv+i8Zlq0pLDuTJnwS4A==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/passport": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.2.tgz", @@ -1385,6 +1394,28 @@ "@types/express": "*" } }, + "@types/passport-google-oauth20": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@types/passport-google-oauth20/-/passport-google-oauth20-2.0.8.tgz", + "integrity": "sha512-Lc+DYCCFeMVbodISydQLT6PjIlL0TcLup3HMiJ8RHHHBltArA3oC4qocyQH1OsEq5ovQ19PaKlpGqsNT8NYz1w==", + "dev": true, + "requires": { + "@types/express": "*", + "@types/passport": "*", + "@types/passport-oauth2": "*" + } + }, + "@types/passport-oauth2": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@types/passport-oauth2/-/passport-oauth2-1.4.10.tgz", + "integrity": "sha512-klShWm9xAqjM3rU31KyMMiB9M8jmJPkStUvCJ/kIv73/Vh3OVnfeTExrkMCM2wA+94MliExqwHVL3J0WD2kbnQ==", + "dev": true, + "requires": { + "@types/express": "*", + "@types/oauth": "*", + "@types/passport": "*" + } + }, "@types/q": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", diff --git a/package.json b/package.json index 12a67cd405..b6d9d9773e 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,7 @@ "@types/express-flash": "0.0.2", "@types/minio": "^7.0.7", "@types/node": "~12.20.15", + "@types/passport-google-oauth20": "^2.0.8", "@types/qs": "^6.9.6", "acorn": "~6.1.1", "babel-core": "~6.26.3", From 6d920c0e4a24b2b0862981cce21d8729329cd772 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:36:26 +0800 Subject: [PATCH 064/167] ts: lib/auth/ldap/index.js Signed-off-by: Raccoon --- lib/auth/ldap/{index.js => index.ts} | 36 +++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) rename lib/auth/ldap/{index.js => index.ts} (73%) diff --git a/lib/auth/ldap/index.js b/lib/auth/ldap/index.ts similarity index 73% rename from lib/auth/ldap/index.js rename to lib/auth/ldap/index.ts index 348c0d76d8..60b29d1a59 100644 --- a/lib/auth/ldap/index.js +++ b/lib/auth/ldap/index.ts @@ -1,16 +1,16 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; +import * as LDAPStrategy from "passport-ldapauth"; -const Router = require('express').Router -const passport = require('passport') -const LDAPStrategy = require('passport-ldapauth') -const config = require('../../config') -const models = require('../../models') -const logger = require('../../logger') -const { setReturnToFromReferer } = require('../utils') -const { urlencodedParser } = require('../../utils') -const response = require('../../response') +import * as config from "../../config"; +import * as models from "../../models"; +import * as logger from "../../logger"; +import * as response from "../../response"; +import {setReturnToFromReferer} from "../utils"; +import {urlencodedParser} from "../../utils"; -const ldapAuth = module.exports = Router() +const ldapAuth = Router() +export = ldapAuth passport.use(new LDAPStrategy({ server: { @@ -30,9 +30,9 @@ passport.use(new LDAPStrategy({ if (typeof uuid === 'undefined') { throw new Error('Could not determine UUID for LDAP user. Check that ' + - 'either uidNumber, uid or sAMAccountName is set in your LDAP directory ' + - 'or use another unique attribute and configure it using the ' + - '"useridField" option in ldap settings.') + 'either uidNumber, uid or sAMAccountName is set in your LDAP directory ' + + 'or use another unique attribute and configure it using the ' + + '"useridField" option in ldap settings.') } var username = uuid @@ -66,11 +66,15 @@ passport.use(new LDAPStrategy({ } if (needSave) { user.save().then(function () { - if (config.debug) { logger.debug('user login: ' + user.id) } + if (config.debug) { + logger.debug('user login: ' + user.id) + } return done(null, user) }) } else { - if (config.debug) { logger.debug('user login: ' + user.id) } + if (config.debug) { + logger.debug('user login: ' + user.id) + } return done(null, user) } } From 0faebff2218e7e3ef8e9227ee08aba1d5bcfa01a Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:37:44 +0800 Subject: [PATCH 065/167] ts: lib/auth/mattermost/index.js Signed-off-by: Raccoon --- lib/auth/mattermost/{index.js => index.ts} | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) rename lib/auth/mattermost/{index.js => index.ts} (73%) diff --git a/lib/auth/mattermost/index.js b/lib/auth/mattermost/index.ts similarity index 73% rename from lib/auth/mattermost/index.js rename to lib/auth/mattermost/index.ts index ace631d0d2..c456f6225a 100644 --- a/lib/auth/mattermost/index.js +++ b/lib/auth/mattermost/index.ts @@ -1,14 +1,17 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; + require('babel-polyfill') require('isomorphic-fetch') -const Router = require('express').Router -const passport = require('passport') -const MattermostClient = require('mattermost-redux/client/client4').default -const OAuthStrategy = require('passport-oauth2').Strategy -const config = require('../../config') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') - -const mattermostAuth = module.exports = Router() +import MattermostClient from "mattermost-redux/client/client4"; +import {Strategy as OAuthStrategy} from "passport-oauth2"; + +import * as config from "../../config"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; + + +const mattermostAuth = Router() +export = module.exports const mattermostClient = new MattermostClient() From b94c13059e462d3ea444f346b34fd16a38df5792 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:38:44 +0800 Subject: [PATCH 066/167] ts: lib/auth/twitter/index.js Signed-off-by: Raccoon --- lib/auth/twitter/{index.js => index.ts} | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename lib/auth/twitter/{index.js => index.ts} (64%) diff --git a/lib/auth/twitter/index.js b/lib/auth/twitter/index.ts similarity index 64% rename from lib/auth/twitter/index.js rename to lib/auth/twitter/index.ts index 3c638067a0..e9d50eb6f4 100644 --- a/lib/auth/twitter/index.js +++ b/lib/auth/twitter/index.ts @@ -1,13 +1,12 @@ -'use strict' +import {Router} from "express"; +import passport from "passport"; +import {Strategy as TwitterStrategy} from "passport-twitter"; -const Router = require('express').Router -const passport = require('passport') -const TwitterStrategy = require('passport-twitter').Strategy +import * as config from "../../config"; +import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; -const config = require('../../config') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') - -const twitterAuth = module.exports = Router() +const twitterAuth = Router() +export = module.exports passport.use(new TwitterStrategy({ consumerKey: config.twitter.consumerKey, From 436a603d08c2a58cb52c7c1991dfe3e691d208eb Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:48:35 +0800 Subject: [PATCH 067/167] ts: lib/auth/saml/index.js Signed-off-by: Raccoon --- lib/auth/saml/{index.js => index.ts} | 35 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) rename lib/auth/saml/{index.js => index.ts} (78%) diff --git a/lib/auth/saml/index.js b/lib/auth/saml/index.ts similarity index 78% rename from lib/auth/saml/index.js rename to lib/auth/saml/index.ts index ecf740a6f3..60a80e84b1 100644 --- a/lib/auth/saml/index.js +++ b/lib/auth/saml/index.ts @@ -1,16 +1,19 @@ -'use strict' +import * as fs from "fs"; +import {Router} from "express"; +import * as passport from "passport"; +import {Strategy as SamlStrategy} from "passport-saml"; -const Router = require('express').Router -const passport = require('passport') -const SamlStrategy = require('passport-saml').Strategy -const config = require('../../config') -const models = require('../../models') -const logger = require('../../logger') -const { urlencodedParser } = require('../../utils') -const fs = require('fs') -const intersection = function (array1, array2) { return array1.filter((n) => array2.includes(n)) } +import * as config from "../../config"; +import * as models from "../../models"; +import * as logger from "../../logger"; +import {urlencodedParser} from "../../utils"; -const samlAuth = module.exports = Router() +const intersection = function (array1, array2) { + return array1.filter((n) => array2.includes(n)) +} + +const samlAuth = Router() +export = samlAuth passport.use(new SamlStrategy({ callbackUrl: config.serverURL + '/auth/saml/callback', @@ -62,11 +65,15 @@ passport.use(new SamlStrategy({ } if (needSave) { user.save().then(function () { - if (config.debug) { logger.debug('user login: ' + user.id) } + if (config.debug) { + logger.debug('user login: ' + user.id) + } return done(null, user) }) } else { - if (config.debug) { logger.debug('user login: ' + user.id) } + if (config.debug) { + logger.debug('user login: ' + user.id) + } return done(null, user) } } @@ -92,5 +99,5 @@ samlAuth.post('/auth/saml/callback', urlencodedParser, samlAuth.get('/auth/saml/metadata', function (req, res) { res.type('application/xml') - res.send(passport._strategy('saml').generateServiceProviderMetadata()) + res.send((passport as any)._strategy('saml').generateServiceProviderMetadata()) }) From 8facb0374524c82b2b5842297fe8ce89fa3fb911 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:50:01 +0800 Subject: [PATCH 068/167] ts: lib/auth/openid/index.js Signed-off-by: Raccoon --- lib/auth/openid/{index.js => index.ts} | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) rename lib/auth/openid/{index.js => index.ts} (69%) diff --git a/lib/auth/openid/index.js b/lib/auth/openid/index.ts similarity index 69% rename from lib/auth/openid/index.js rename to lib/auth/openid/index.ts index e51ce087a8..e3ba293039 100644 --- a/lib/auth/openid/index.js +++ b/lib/auth/openid/index.ts @@ -1,13 +1,13 @@ -'use strict' +import {Router} from "express"; +import * as passport from "passport"; +import {Strategy as OpenIDStrategy} from "@passport-next/passport-openid"; + +import * as config from "../../config"; +import * as models from "../../models"; +import * as logger from "../../logger"; +import {urlencodedParser} from "../../utils"; +import {setReturnToFromReferer} from "../utils"; -const Router = require('express').Router -const passport = require('passport') -const OpenIDStrategy = require('@passport-next/passport-openid').Strategy -const config = require('../../config') -const models = require('../../models') -const logger = require('../../logger') -const { urlencodedParser } = require('../../utils') -const { setReturnToFromReferer } = require('../utils') const openIDAuth = module.exports = Router() @@ -33,11 +33,15 @@ passport.use(new OpenIDStrategy({ } if (needSave) { user.save().then(function () { - if (config.debug) { logger.info('user login: ' + user.id) } + if (config.debug) { + logger.info('user login: ' + user.id) + } return done(null, user) }) } else { - if (config.debug) { logger.info('user login: ' + user.id) } + if (config.debug) { + logger.info('user login: ' + user.id) + } return done(null, user) } } From ce5800b5334a6caf070bf4366aa5ffce0959752e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:51:35 +0800 Subject: [PATCH 069/167] ts: lib/auth/oauth2/strategy.js Signed-off-by: Raccoon --- lib/auth/oauth2/{strategy.js => strategy.ts} | 21 ++++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) rename lib/auth/oauth2/{strategy.js => strategy.ts} (79%) diff --git a/lib/auth/oauth2/strategy.js b/lib/auth/oauth2/strategy.ts similarity index 79% rename from lib/auth/oauth2/strategy.js rename to lib/auth/oauth2/strategy.ts index ccd08fe6ff..839567403f 100644 --- a/lib/auth/oauth2/strategy.js +++ b/lib/auth/oauth2/strategy.ts @@ -1,9 +1,7 @@ -'use strict' +import {InternalOAuthError, Strategy} from "passport-oauth2"; +import * as config from "../../config"; -const { Strategy, InternalOAuthError } = require('passport-oauth2') -const config = require('../../config') - -function parseProfile (data) { +export function parseProfile (data) { const username = extractProfileAttribute(data, config.oauth2.userProfileUsernameAttr) const displayName = extractProfileAttribute(data, config.oauth2.userProfileDisplayNameAttr) const email = extractProfileAttribute(data, config.oauth2.userProfileEmailAttr) @@ -22,7 +20,7 @@ function parseProfile (data) { } } -function extractProfileAttribute (data, path) { +export function extractProfileAttribute (data, path) { if (!data) return undefined if (typeof path !== 'string') return undefined // can handle stuff like `attrs[0].name` @@ -41,7 +39,8 @@ function extractProfileAttribute (data, path) { return data } -class OAuth2CustomStrategy extends Strategy { +export class OAuth2CustomStrategy extends Strategy { + private _userProfileURL: any; constructor (options, verify) { options.customHeaders = options.customHeaders || {} super(options, verify) @@ -58,10 +57,10 @@ class OAuth2CustomStrategy extends Strategy { let profile, json try { - json = JSON.parse(body) + json = JSON.parse(body as any) profile = parseProfile(json) } catch (ex) { - return done(new InternalOAuthError('Failed to parse user profile' + ex.toString())) + return done(new InternalOAuthError('Failed to parse user profile' + ex.toString(), null)) } profile.provider = 'oauth2' @@ -70,7 +69,3 @@ class OAuth2CustomStrategy extends Strategy { }) } } - -exports.OAuth2CustomStrategy = OAuth2CustomStrategy -exports.parseProfile = parseProfile -exports.extractProfileAttribute = extractProfileAttribute From 937b75db8574bd19eee31deb14f8eb4fd310159c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:52:28 +0800 Subject: [PATCH 070/167] ts: lib/auth/oauth2/index.js Signed-off-by: Raccoon --- lib/auth/oauth2/{index.js => index.ts} | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename lib/auth/oauth2/{index.js => index.ts} (70%) diff --git a/lib/auth/oauth2/index.js b/lib/auth/oauth2/index.ts similarity index 70% rename from lib/auth/oauth2/index.js rename to lib/auth/oauth2/index.ts index 5c432d3b9c..6ea8aa32f7 100644 --- a/lib/auth/oauth2/index.js +++ b/lib/auth/oauth2/index.ts @@ -1,13 +1,12 @@ -'use strict' +import {Router} from 'express' +import * as passport from 'passport' -const Router = require('express').Router -const passport = require('passport') +import * as config from '../../config' +import {passportGeneralCallback, setReturnToFromReferer} from '../utils' +import {OAuth2CustomStrategy} from './strategy' -const config = require('../../config') -const { setReturnToFromReferer, passportGeneralCallback } = require('../utils') -const { OAuth2CustomStrategy } = require('./strategy') - -const oauth2Auth = module.exports = Router() +const oauth2Auth = Router() +export = oauth2Auth passport.use(new OAuth2CustomStrategy({ authorizationURL: config.oauth2.authorizationURL, From 4b311b6ab2dfcfba5572118102ca0b6aed2eb545 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:54:30 +0800 Subject: [PATCH 071/167] ts: lib/auth/auth/index.js Signed-off-by: Raccoon --- lib/auth/{index.js => index.ts} | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) rename lib/auth/{index.js => index.ts} (77%) diff --git a/lib/auth/index.js b/lib/auth/index.ts similarity index 77% rename from lib/auth/index.js rename to lib/auth/index.ts index fcc39a2a49..6280a90d47 100644 --- a/lib/auth/index.js +++ b/lib/auth/index.ts @@ -1,16 +1,15 @@ -'use strict' +import {Router} from "express"; -const Router = require('express').Router -const passport = require('passport') +import * as passport from "passport"; +import * as config from "../config"; +import * as logger from "../logger"; +import * as models from "../models"; -const config = require('../config') -const logger = require('../logger') -const models = require('../models') - -const authRouter = module.exports = Router() +const authRouter = Router() +export = authRouter // serialize and deserialize -passport.serializeUser(function (user, done) { +passport.serializeUser(function (user: any, done) { logger.info('serializeUser: ' + user.id) return done(null, user.id) }) @@ -23,7 +22,8 @@ passport.deserializeUser(function (id, done) { }).then(function (user) { // Don't die on non-existent user if (user == null) { - return done(null, false, { message: 'Invalid UserID' }) + // @ts-ignore + return done(null, false, {message: 'Invalid UserID'}) } logger.info('deserializeUser: ' + user.id) @@ -51,7 +51,7 @@ if (config.isOpenIDEnable) authRouter.use(require('./openid')) // logout authRouter.get('/logout', function (req, res) { if (config.debug && req.isAuthenticated()) { - logger.debug('user logout: ' + req.user.id) + logger.debug('user logout: ' + (req.user as any).id) } req.logout() res.redirect(config.serverURL + '/') From 147c20064f7c7a8877974dec45d49fc2bfe0b05e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 07:59:04 +0800 Subject: [PATCH 072/167] ts: all migrations Signed-off-by: Raccoon --- ...e-users.js => 20150504155329-create-users.ts} | 3 +-- ...e-notes.js => 20150508114741-create-notes.ts} | 3 +-- ...ate-temp.js => 20150515125813-create-temp.ts} | 3 +-- ..._3_1.js => 20150702001020-update-to-0_3_1.ts} | 3 +-- ...20150915153700-change-notes-title-to-text.ts} | 6 +++--- ....js => 20160112220142-note-add-lastchange.ts} | 3 +-- ...alias.js => 20160420180355-note-add-alias.ts} | 3 +-- ...kens.js => 20160515114000-user-add-tokens.ts} | 3 +-- ...ion.js => 20160607060246-support-revision.ts} | 4 ++-- ...p.js => 20160703062241-support-authorship.ts} | 3 +-- ....js => 20161009040430-support-delete-note.ts} | 3 +-- ...js => 20161201050312-support-email-signin.ts} | 3 +-- .../20171009121200-longtext-for-mysql.js | 16 ---------------- .../20171009121200-longtext-for-mysql.ts | 15 +++++++++++++++ .../20180209120907-longtext-of-authorship.js | 13 ------------- .../20180209120907-longtext-of-authorship.ts | 11 +++++++++++ lib/migrations/20180306150303-fix-enum.js | 11 ----------- lib/migrations/20180306150303-fix-enum.ts | 9 +++++++++ ...s.js => 20180326103000-use-text-in-tokens.ts} | 4 +--- ...s => 20180525153000-user-add-delete-token.ts} | 3 +-- ...le.js => 20200104215332-remove-temp-table.ts} | 4 +--- 21 files changed, 53 insertions(+), 73 deletions(-) rename lib/migrations/{20150504155329-create-users.js => 20150504155329-create-users.ts} (94%) rename lib/migrations/{20150508114741-create-notes.js => 20150508114741-create-notes.ts} (93%) rename lib/migrations/{20150515125813-create-temp.js => 20150515125813-create-temp.ts} (92%) rename lib/migrations/{20150702001020-update-to-0_3_1.js => 20150702001020-update-to-0_3_1.ts} (97%) rename lib/migrations/{20150915153700-change-notes-title-to-text.js => 20150915153700-change-notes-title-to-text.ts} (89%) rename lib/migrations/{20160112220142-note-add-lastchange.js => 20160112220142-note-add-lastchange.ts} (96%) rename lib/migrations/{20160420180355-note-add-alias.js => 20160420180355-note-add-alias.ts} (96%) rename lib/migrations/{20160515114000-user-add-tokens.js => 20160515114000-user-add-tokens.ts} (96%) rename lib/migrations/{20160607060246-support-revision.js => 20160607060246-support-revision.ts} (97%) rename lib/migrations/{20160703062241-support-authorship.js => 20160703062241-support-authorship.ts} (97%) rename lib/migrations/{20161009040430-support-delete-note.js => 20161009040430-support-delete-note.ts} (95%) rename lib/migrations/{20161201050312-support-email-signin.js => 20161201050312-support-email-signin.ts} (97%) delete mode 100644 lib/migrations/20171009121200-longtext-for-mysql.js create mode 100644 lib/migrations/20171009121200-longtext-for-mysql.ts delete mode 100644 lib/migrations/20180209120907-longtext-of-authorship.js create mode 100644 lib/migrations/20180209120907-longtext-of-authorship.ts delete mode 100644 lib/migrations/20180306150303-fix-enum.js create mode 100644 lib/migrations/20180306150303-fix-enum.ts rename lib/migrations/{20180326103000-use-text-in-tokens.js => 20180326103000-use-text-in-tokens.ts} (94%) rename lib/migrations/{20180525153000-user-add-delete-token.js => 20180525153000-user-add-delete-token.ts} (90%) rename lib/migrations/{20200104215332-remove-temp-table.js => 20200104215332-remove-temp-table.ts} (94%) diff --git a/lib/migrations/20150504155329-create-users.js b/lib/migrations/20150504155329-create-users.ts similarity index 94% rename from lib/migrations/20150504155329-create-users.js rename to lib/migrations/20150504155329-create-users.ts index 51e6b29c95..4b031830c2 100644 --- a/lib/migrations/20150504155329-create-users.js +++ b/lib/migrations/20150504155329-create-users.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.createTable('Users', { id: { diff --git a/lib/migrations/20150508114741-create-notes.js b/lib/migrations/20150508114741-create-notes.ts similarity index 93% rename from lib/migrations/20150508114741-create-notes.js rename to lib/migrations/20150508114741-create-notes.ts index 660d40a6c6..24dcaca90b 100644 --- a/lib/migrations/20150508114741-create-notes.js +++ b/lib/migrations/20150508114741-create-notes.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.createTable('Notes', { id: { diff --git a/lib/migrations/20150515125813-create-temp.js b/lib/migrations/20150515125813-create-temp.ts similarity index 92% rename from lib/migrations/20150515125813-create-temp.js rename to lib/migrations/20150515125813-create-temp.ts index ee7b9789e8..b02338a014 100644 --- a/lib/migrations/20150515125813-create-temp.js +++ b/lib/migrations/20150515125813-create-temp.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.createTable('Temp', { id: { diff --git a/lib/migrations/20150702001020-update-to-0_3_1.js b/lib/migrations/20150702001020-update-to-0_3_1.ts similarity index 97% rename from lib/migrations/20150702001020-update-to-0_3_1.js rename to lib/migrations/20150702001020-update-to-0_3_1.ts index e1a88661c6..d6d9928543 100644 --- a/lib/migrations/20150702001020-update-to-0_3_1.js +++ b/lib/migrations/20150702001020-update-to-0_3_1.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Notes', 'shortid', { type: Sequelize.STRING, diff --git a/lib/migrations/20150915153700-change-notes-title-to-text.js b/lib/migrations/20150915153700-change-notes-title-to-text.ts similarity index 89% rename from lib/migrations/20150915153700-change-notes-title-to-text.js rename to lib/migrations/20150915153700-change-notes-title-to-text.ts index 9d00f15fde..c32518b16b 100644 --- a/lib/migrations/20150915153700-change-notes-title-to-text.js +++ b/lib/migrations/20150915153700-change-notes-title-to-text.ts @@ -1,6 +1,6 @@ -'use strict' -const isSQLite = require('../utils').isSQLite -module.exports = { +import {isSQLite} from "../utils"; + +export = { up: function (queryInterface, Sequelize) { return queryInterface.changeColumn('Notes', 'title', { type: Sequelize.TEXT diff --git a/lib/migrations/20160112220142-note-add-lastchange.js b/lib/migrations/20160112220142-note-add-lastchange.ts similarity index 96% rename from lib/migrations/20160112220142-note-add-lastchange.js rename to lib/migrations/20160112220142-note-add-lastchange.ts index a2d74a9c73..6d34339c30 100644 --- a/lib/migrations/20160112220142-note-add-lastchange.js +++ b/lib/migrations/20160112220142-note-add-lastchange.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Notes', 'lastchangeuserId', { type: Sequelize.UUID diff --git a/lib/migrations/20160420180355-note-add-alias.js b/lib/migrations/20160420180355-note-add-alias.ts similarity index 96% rename from lib/migrations/20160420180355-note-add-alias.js rename to lib/migrations/20160420180355-note-add-alias.ts index 45d53e696e..1edadc08f9 100644 --- a/lib/migrations/20160420180355-note-add-alias.js +++ b/lib/migrations/20160420180355-note-add-alias.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Notes', 'alias', { type: Sequelize.STRING diff --git a/lib/migrations/20160515114000-user-add-tokens.js b/lib/migrations/20160515114000-user-add-tokens.ts similarity index 96% rename from lib/migrations/20160515114000-user-add-tokens.js rename to lib/migrations/20160515114000-user-add-tokens.ts index 435ae9cb17..d5e89a30cb 100644 --- a/lib/migrations/20160515114000-user-add-tokens.js +++ b/lib/migrations/20160515114000-user-add-tokens.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Users', 'accessToken', Sequelize.STRING).then(function () { return queryInterface.addColumn('Users', 'refreshToken', Sequelize.STRING) diff --git a/lib/migrations/20160607060246-support-revision.js b/lib/migrations/20160607060246-support-revision.ts similarity index 97% rename from lib/migrations/20160607060246-support-revision.js rename to lib/migrations/20160607060246-support-revision.ts index 547f89b89b..c61032353a 100644 --- a/lib/migrations/20160607060246-support-revision.js +++ b/lib/migrations/20160607060246-support-revision.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Notes', 'savedAt', Sequelize.DATE).then(function () { return queryInterface.createTable('Revisions', { @@ -16,6 +15,7 @@ module.exports = { updatedAt: Sequelize.DATE }) }).catch(function (error) { + // @ts-ignore if (error.message === 'SQLITE_ERROR: duplicate column name: savedAt' | error.message === "ER_DUP_FIELDNAME: Duplicate column name 'savedAt'" || error.message === 'column "savedAt" of relation "Notes" already exists') { console.log('Migration has already run… ignoring.') } else { diff --git a/lib/migrations/20160703062241-support-authorship.js b/lib/migrations/20160703062241-support-authorship.ts similarity index 97% rename from lib/migrations/20160703062241-support-authorship.js rename to lib/migrations/20160703062241-support-authorship.ts index f452b1a7ba..90cfddfe85 100644 --- a/lib/migrations/20160703062241-support-authorship.js +++ b/lib/migrations/20160703062241-support-authorship.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Notes', 'authorship', Sequelize.TEXT).then(function () { return queryInterface.addColumn('Revisions', 'authorship', Sequelize.TEXT) diff --git a/lib/migrations/20161009040430-support-delete-note.js b/lib/migrations/20161009040430-support-delete-note.ts similarity index 95% rename from lib/migrations/20161009040430-support-delete-note.js rename to lib/migrations/20161009040430-support-delete-note.ts index 56a336ac79..8cad1c3ce2 100644 --- a/lib/migrations/20161009040430-support-delete-note.js +++ b/lib/migrations/20161009040430-support-delete-note.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Notes', 'deletedAt', Sequelize.DATE).catch(function (error) { if (error.message === 'SQLITE_ERROR: duplicate column name: deletedAt' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'deletedAt'" || error.message === 'column "deletedAt" of relation "Notes" already exists') { diff --git a/lib/migrations/20161201050312-support-email-signin.js b/lib/migrations/20161201050312-support-email-signin.ts similarity index 97% rename from lib/migrations/20161201050312-support-email-signin.js rename to lib/migrations/20161201050312-support-email-signin.ts index 26bc09ea92..6a9a9959c1 100644 --- a/lib/migrations/20161201050312-support-email-signin.js +++ b/lib/migrations/20161201050312-support-email-signin.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Users', 'email', Sequelize.TEXT).then(function () { return queryInterface.addColumn('Users', 'password', Sequelize.TEXT).catch(function (error) { diff --git a/lib/migrations/20171009121200-longtext-for-mysql.js b/lib/migrations/20171009121200-longtext-for-mysql.js deleted file mode 100644 index 96bf7e8765..0000000000 --- a/lib/migrations/20171009121200-longtext-for-mysql.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' -module.exports = { - up: async function (queryInterface, Sequelize) { - await queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT('long') }) - await queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT('long') }) - await queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT('long') }) - await queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT('long') }) - }, - - down: async function (queryInterface, Sequelize) { - await queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT }) - await queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT }) - await queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT }) - await queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT }) - } -} diff --git a/lib/migrations/20171009121200-longtext-for-mysql.ts b/lib/migrations/20171009121200-longtext-for-mysql.ts new file mode 100644 index 0000000000..3d21156f4a --- /dev/null +++ b/lib/migrations/20171009121200-longtext-for-mysql.ts @@ -0,0 +1,15 @@ +export = { + up: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'content', {type: Sequelize.TEXT('long')}) + await queryInterface.changeColumn('Revisions', 'patch', {type: Sequelize.TEXT('long')}) + await queryInterface.changeColumn('Revisions', 'content', {type: Sequelize.TEXT('long')}) + await queryInterface.changeColumn('Revisions', 'lastContent', {type: Sequelize.TEXT('long')}) + }, + + down: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'content', {type: Sequelize.TEXT}) + await queryInterface.changeColumn('Revisions', 'patch', {type: Sequelize.TEXT}) + await queryInterface.changeColumn('Revisions', 'content', {type: Sequelize.TEXT}) + await queryInterface.changeColumn('Revisions', 'lastContent', {type: Sequelize.TEXT}) + } +} diff --git a/lib/migrations/20180209120907-longtext-of-authorship.js b/lib/migrations/20180209120907-longtext-of-authorship.js deleted file mode 100644 index 04810009e6..0000000000 --- a/lib/migrations/20180209120907-longtext-of-authorship.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -module.exports = { - up: async function (queryInterface, Sequelize) { - await queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT('long') }) - await queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT('long') }) - }, - - down: async function (queryInterface, Sequelize) { - await queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT }) - await queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT }) - } -} diff --git a/lib/migrations/20180209120907-longtext-of-authorship.ts b/lib/migrations/20180209120907-longtext-of-authorship.ts new file mode 100644 index 0000000000..b69714aed4 --- /dev/null +++ b/lib/migrations/20180209120907-longtext-of-authorship.ts @@ -0,0 +1,11 @@ +export = { + up: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'authorship', {type: Sequelize.TEXT('long')}) + await queryInterface.changeColumn('Revisions', 'authorship', {type: Sequelize.TEXT('long')}) + }, + + down: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'authorship', {type: Sequelize.TEXT}) + await queryInterface.changeColumn('Revisions', 'authorship', {type: Sequelize.TEXT}) + } +} diff --git a/lib/migrations/20180306150303-fix-enum.js b/lib/migrations/20180306150303-fix-enum.js deleted file mode 100644 index 54bf1515a0..0000000000 --- a/lib/migrations/20180306150303-fix-enum.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' - -module.exports = { - up: async function (queryInterface, Sequelize) { - await queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private') }) - }, - - down: async function (queryInterface, Sequelize) { - await queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'locked', 'private') }) - } -} diff --git a/lib/migrations/20180306150303-fix-enum.ts b/lib/migrations/20180306150303-fix-enum.ts new file mode 100644 index 0000000000..e98d732ace --- /dev/null +++ b/lib/migrations/20180306150303-fix-enum.ts @@ -0,0 +1,9 @@ +export = { + up: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'permission', {type: Sequelize.ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private')}) + }, + + down: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'permission', {type: Sequelize.ENUM('freely', 'editable', 'locked', 'private')}) + } +} diff --git a/lib/migrations/20180326103000-use-text-in-tokens.js b/lib/migrations/20180326103000-use-text-in-tokens.ts similarity index 94% rename from lib/migrations/20180326103000-use-text-in-tokens.js rename to lib/migrations/20180326103000-use-text-in-tokens.ts index f950774780..81c47fc1d5 100644 --- a/lib/migrations/20180326103000-use-text-in-tokens.js +++ b/lib/migrations/20180326103000-use-text-in-tokens.ts @@ -1,6 +1,4 @@ -'use strict' - -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.changeColumn('Users', 'accessToken', { type: Sequelize.TEXT diff --git a/lib/migrations/20180525153000-user-add-delete-token.js b/lib/migrations/20180525153000-user-add-delete-token.ts similarity index 90% rename from lib/migrations/20180525153000-user-add-delete-token.js rename to lib/migrations/20180525153000-user-add-delete-token.ts index 642fa5d43c..769a39f389 100644 --- a/lib/migrations/20180525153000-user-add-delete-token.js +++ b/lib/migrations/20180525153000-user-add-delete-token.ts @@ -1,5 +1,4 @@ -'use strict' -module.exports = { +export = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Users', 'deleteToken', { type: Sequelize.UUID, diff --git a/lib/migrations/20200104215332-remove-temp-table.js b/lib/migrations/20200104215332-remove-temp-table.ts similarity index 94% rename from lib/migrations/20200104215332-remove-temp-table.js rename to lib/migrations/20200104215332-remove-temp-table.ts index eb743337d4..82711b1727 100644 --- a/lib/migrations/20200104215332-remove-temp-table.js +++ b/lib/migrations/20200104215332-remove-temp-table.ts @@ -1,6 +1,4 @@ -'use strict' - -module.exports = { +export = { up: (queryInterface, Sequelize) => { return queryInterface.dropTable('Temp') /* From ebd815662f5075ce852deecfffe6267ba7381d1b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:00:39 +0800 Subject: [PATCH 073/167] ts: lib/auth/facebook/index.js Signed-off-by: Raccoon --- lib/auth/facebook/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/facebook/index.ts b/lib/auth/facebook/index.ts index 0c0adbd158..485364407a 100644 --- a/lib/auth/facebook/index.ts +++ b/lib/auth/facebook/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import passport from "passport"; +import * as passport from "passport"; import {Strategy as FacebookStrategy} from "passport-facebook"; import * as config from "../../config"; From 9a8d0391fc70cf5d7e02e7477a6b0e4c6747b629 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:00:57 +0800 Subject: [PATCH 074/167] ts: lib/auth/twitter/index.js Signed-off-by: Raccoon --- lib/auth/twitter/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/twitter/index.ts b/lib/auth/twitter/index.ts index e9d50eb6f4..1275d80fab 100644 --- a/lib/auth/twitter/index.ts +++ b/lib/auth/twitter/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import passport from "passport"; +import * as passport from "passport"; import {Strategy as TwitterStrategy} from "passport-twitter"; import * as config from "../../config"; From 30c5197794d37651f8c192ff8f10de03a0134a55 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:01:18 +0800 Subject: [PATCH 075/167] ts: lib/auth/twitter/index.js Signed-off-by: Raccoon --- lib/auth/twitter/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/twitter/index.ts b/lib/auth/twitter/index.ts index 1275d80fab..6238521617 100644 --- a/lib/auth/twitter/index.ts +++ b/lib/auth/twitter/index.ts @@ -6,7 +6,7 @@ import * as config from "../../config"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const twitterAuth = Router() -export = module.exports +export = twitterAuth passport.use(new TwitterStrategy({ consumerKey: config.twitter.consumerKey, From a4c8a26ae9501db81fa7026faeef261459f05677 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:01:47 +0800 Subject: [PATCH 076/167] ts: lib/auth/mattermost/index.js Signed-off-by: Raccoon --- lib/auth/mattermost/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/mattermost/index.ts b/lib/auth/mattermost/index.ts index c456f6225a..f7d74f5cfe 100644 --- a/lib/auth/mattermost/index.ts +++ b/lib/auth/mattermost/index.ts @@ -11,7 +11,7 @@ import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const mattermostAuth = Router() -export = module.exports +export = mattermostAuth const mattermostClient = new MattermostClient() From 1af9e912c6c36e938cbf511011272ac77167b533 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:02:09 +0800 Subject: [PATCH 077/167] ts: lib/auth/dropbox/index.js Signed-off-by: Raccoon --- lib/auth/dropbox/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/dropbox/index.ts b/lib/auth/dropbox/index.ts index ae3be792d5..d6541b65f6 100644 --- a/lib/auth/dropbox/index.ts +++ b/lib/auth/dropbox/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import passport from "passport"; +import * as passport from "passport"; import {Strategy as DropboxStrategy} from "passport-dropbox-oauth2"; import * as config from "../../config"; From 6a30382c1b621059ba8c05f9dc2d04a1c8acf020 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:02:48 +0800 Subject: [PATCH 078/167] change default sequelizerc Signed-off-by: Raccoon --- .sequelizerc.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.sequelizerc.example b/.sequelizerc.example index e7a489e659..d5d6bb653c 100644 --- a/.sequelizerc.example +++ b/.sequelizerc.example @@ -1,9 +1,9 @@ const path = require('path') -const config = require('./lib/config') +const config = require('./dist/config') module.exports = { config: path.resolve('config.js'), - 'migrations-path': path.resolve('lib', 'migrations'), - 'models-path': path.resolve('lib', 'models'), + 'migrations-path': path.resolve('dist', 'migrations'), + 'models-path': path.resolve('dist', 'models'), url: config.dbURL } From 79a427e616643bcf1845c507d5dc30f7890674c4 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:04:46 +0800 Subject: [PATCH 079/167] ts: lib/models/author.js Signed-off-by: Raccoon --- lib/models/{author.js => author.ts} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename lib/models/{author.js => author.ts} (87%) diff --git a/lib/models/author.js b/lib/models/author.ts similarity index 87% rename from lib/models/author.js rename to lib/models/author.ts index e65791cb5f..0039eb5f35 100644 --- a/lib/models/author.js +++ b/lib/models/author.ts @@ -1,8 +1,7 @@ -'use strict' // external modules -var Sequelize = require('sequelize') +import * as Sequelize from "sequelize"; -module.exports = function (sequelize, DataTypes) { +export = function (sequelize, DataTypes) { var Author = sequelize.define('Author', { id: { type: Sequelize.INTEGER, From 492a7ac44694e890fad2213f16d7f17d168c7e11 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:06:23 +0800 Subject: [PATCH 080/167] ts: lib/models/user.js Signed-off-by: Raccoon --- lib/models/{user.js => user.ts} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename lib/models/{user.js => user.ts} (94%) diff --git a/lib/models/user.js b/lib/models/user.ts similarity index 94% rename from lib/models/user.js rename to lib/models/user.ts index f2e50b5a6a..e8fb6b55d9 100644 --- a/lib/models/user.js +++ b/lib/models/user.ts @@ -1,13 +1,13 @@ 'use strict' // external modules -var Sequelize = require('sequelize') -var Scrypt = require('scrypt-kdf') +import * as Sequelize from "sequelize"; +import * as Scrypt from "scrypt-kdf"; // core -var logger = require('../logger') -var { generateAvatarURL } = require('../letter-avatars') +import * as logger from "../logger"; +import {generateAvatarURL} from "../letter-avatars"; -module.exports = function (sequelize, DataTypes) { +export = function (sequelize, DataTypes) { var User = sequelize.define('User', { id: { type: DataTypes.UUID, @@ -118,7 +118,7 @@ module.exports = function (sequelize, DataTypes) { const photoURL = new URL(profile.photos && profile.photos[0] ? profile.photos[0].value : `https://avatars.githubusercontent.com/u/${profile.id}`) - photoURL.searchParams.set('s', bigger ? 400 : 96) + photoURL.searchParams.set('s', (bigger ? 400 : 96).toString()) photo = photoURL.toString() break case 'gitlab': From 8d248ff09cdcd32b1ce2c77c844fbc30d1529b0d Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:07:38 +0800 Subject: [PATCH 081/167] ts: lib/models/revision.js Signed-off-by: Raccoon --- lib/models/{revision.js => revision.ts} | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) rename lib/models/{revision.js => revision.ts} (95%) diff --git a/lib/models/revision.js b/lib/models/revision.ts similarity index 95% rename from lib/models/revision.js rename to lib/models/revision.ts index 5f91b7d876..3550666e50 100644 --- a/lib/models/revision.js +++ b/lib/models/revision.ts @@ -1,23 +1,22 @@ -'use strict' // external modules -var Sequelize = require('sequelize') -var async = require('async') -var moment = require('moment') -var childProcess = require('child_process') -var shortId = require('shortid') -var path = require('path') -var util = require('util') - -var Op = Sequelize.Op +import * as Sequelize from "sequelize"; +import * as async from "async"; +import * as moment from "moment"; +import * as childProcess from "child_process"; +import * as shortId from "shortid"; +import * as path from "path"; +import * as util from "util"; // core -var config = require('../config') -var logger = require('../logger') +import * as config from "../config"; +import * as logger from "../logger"; + +var Op = Sequelize.Op var dmpWorker = createDmpWorker() var dmpCallbackCache = {} -function createDmpWorker () { +function createDmpWorker() { var worker = childProcess.fork(path.resolve(__dirname, '../workers/dmpWorker.js'), { stdio: 'ignore' }) @@ -44,7 +43,7 @@ function createDmpWorker () { return worker } -function sendDmpWorker (data, callback) { +function sendDmpWorker(data, callback) { if (!dmpWorker) dmpWorker = createDmpWorker() var cacheKey = Date.now() + '_' + shortId.generate() dmpCallbackCache[cacheKey] = callback From bc8ad1cbff4c8990c6f2df1ec2cc48a1b1c9ffbf Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:10:03 +0800 Subject: [PATCH 082/167] ts: lib/models/note.js Signed-off-by: Raccoon --- lib/models/{note.js => note.ts} | 97 +++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 35 deletions(-) rename lib/models/{note.js => note.ts} (91%) diff --git a/lib/models/note.js b/lib/models/note.ts similarity index 91% rename from lib/models/note.js rename to lib/models/note.ts index 790dee6d79..9ce37803ab 100644 --- a/lib/models/note.js +++ b/lib/models/note.ts @@ -1,32 +1,31 @@ -'use strict' // external modules -var fs = require('fs') -var path = require('path') -var LZString = require('@hackmd/lz-string') -var base64url = require('base64url') -var md = require('markdown-it')() -var metaMarked = require('@hackmd/meta-marked') -var cheerio = require('cheerio') -var shortId = require('shortid') -var Sequelize = require('sequelize') -var async = require('async') -var moment = require('moment') -var DiffMatchPatch = require('@hackmd/diff-match-patch') -var dmp = new DiffMatchPatch() - -const { stripTags } = require('../string') +import * as fs from "fs"; +import * as path from "path"; +import * as LZString from "@hackmd/lz-string"; +import base64url from "base64url"; +import * as markdown_it from "markdown-it"; +import * as metaMarked from "@hackmd/meta-marked"; +import * as cheerio from "cheerio"; +import * as shortId from "shortid"; +import * as Sequelize from "sequelize"; +import * as async from "async"; +import * as moment from "moment"; +import * as DiffMatchPatch from "@hackmd/diff-match-patch"; // core -var config = require('../config') -var logger = require('../logger') +import * as config from "../config"; +import * as logger from "../logger"; +import {stripTags} from "../string"; // ot -var ot = require('../ot') +import * as ot from "../ot"; +var md = markdown_it() +var dmp = new DiffMatchPatch() // permission types var permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private'] -module.exports = function (sequelize, DataTypes) { +export = function (sequelize, DataTypes) { var Note = sequelize.define('Note', { id: { type: DataTypes.UUID, @@ -186,7 +185,11 @@ module.exports = function (sequelize, DataTypes) { Note.checkNoteIdValid = function (id) { var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i var result = id.match(uuidRegex) - if (result && result.length === 1) { return true } else { return false } + if (result && result.length === 1) { + return true + } else { + return false + } } Note.parseNoteIdAsync = function (noteId) { return new Promise((resolve, reject) => { @@ -199,7 +202,7 @@ module.exports = function (sequelize, DataTypes) { }) } - async function syncNote (noteInFS, note) { + async function syncNote(noteInFS, note) { const contentLength = noteInFS.content.length let note2 = await note.update({ @@ -276,7 +279,11 @@ module.exports = function (sequelize, DataTypes) { // try to parse note id by LZString Base64 try { var id = LZString.decompressFromBase64(noteId) - if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { return _callback(null, null) } + if (id && Note.checkNoteIdValid(id)) { + return callback(null, id) + } else { + return _callback(null, null) + } } catch (err) { if (err.message === 'Cannot read property \'charAt\' of undefined') { logger.warning('Looks like we can not decode "' + noteId + '" with LZString. Can be ignored.') @@ -290,7 +297,11 @@ module.exports = function (sequelize, DataTypes) { // try to parse note id by base64url try { var id = Note.decodeNoteId(noteId) - if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { return _callback(null, null) } + if (id && Note.checkNoteIdValid(id)) { + return callback(null, id) + } else { + return _callback(null, null) + } } catch (err) { logger.error(err) return _callback(null, null) @@ -344,7 +355,9 @@ module.exports = function (sequelize, DataTypes) { title = meta.title } else { var h1s = $('h1') - if (h1s.length > 0 && h1s.first().text().split('\n').length === 1) { title = stripTags(h1s.first().text()) } + if (h1s.length > 0 && h1s.first().text().split('\n').length === 1) { + title = stripTags(h1s.first().text()) + } } if (!title) title = 'Untitled' return title @@ -393,7 +406,9 @@ module.exports = function (sequelize, DataTypes) { break } } - if (!found) { tags.push(rawtags[i]) } + if (!found) { + tags.push(rawtags[i]) + } } return tags } @@ -412,14 +427,26 @@ module.exports = function (sequelize, DataTypes) { return obj } Note.parseMeta = function (meta) { - var _meta = {} + var _meta: any = {} if (meta) { - if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { _meta.title = meta.title } - if (meta.description && (typeof meta.description === 'string' || typeof meta.description === 'number')) { _meta.description = meta.description } - if (meta.robots && (typeof meta.robots === 'string' || typeof meta.robots === 'number')) { _meta.robots = meta.robots } - if (meta.GA && (typeof meta.GA === 'string' || typeof meta.GA === 'number')) { _meta.GA = meta.GA } - if (meta.disqus && (typeof meta.disqus === 'string' || typeof meta.disqus === 'number')) { _meta.disqus = meta.disqus } - if (meta.slideOptions && (typeof meta.slideOptions === 'object')) { _meta.slideOptions = meta.slideOptions } + if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { + _meta.title = meta.title + } + if (meta.description && (typeof meta.description === 'string' || typeof meta.description === 'number')) { + _meta.description = meta.description + } + if (meta.robots && (typeof meta.robots === 'string' || typeof meta.robots === 'number')) { + _meta.robots = meta.robots + } + if (meta.GA && (typeof meta.GA === 'string' || typeof meta.GA === 'number')) { + _meta.GA = meta.GA + } + if (meta.disqus && (typeof meta.disqus === 'string' || typeof meta.disqus === 'number')) { + _meta.disqus = meta.disqus + } + if (meta.slideOptions && (typeof meta.slideOptions === 'object')) { + _meta.slideOptions = meta.slideOptions + } } return _meta } @@ -584,7 +611,7 @@ module.exports = function (sequelize, DataTypes) { return operations } - function readFileSystemNote (filePath) { + function readFileSystemNote(filePath) { const fsModifiedTime = moment(fs.statSync(filePath).mtime) const content = fs.readFileSync(filePath, 'utf8') @@ -595,7 +622,7 @@ module.exports = function (sequelize, DataTypes) { } } - function shouldSyncNote (note, noteInFS) { + function shouldSyncNote(note, noteInFS) { const dbModifiedTime = moment(note.lastchangeAt || note.createdAt) return noteInFS.lastchangeAt.isAfter(dbModifiedTime) && note.content !== noteInFS.content } From 8ba97c36df6cd968f82cb6c59bac6106331b200c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:12:58 +0800 Subject: [PATCH 083/167] ts: lib/models/index.js Signed-off-by: Raccoon --- lib/models/{index.js => index.ts} | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) rename lib/models/{index.js => index.ts} (78%) diff --git a/lib/models/index.js b/lib/models/index.ts similarity index 78% rename from lib/models/index.js rename to lib/models/index.ts index 88c1b1689a..c43347e1ce 100644 --- a/lib/models/index.js +++ b/lib/models/index.ts @@ -1,13 +1,12 @@ -'use strict' // external modules -var fs = require('fs') -var path = require('path') -var Sequelize = require('sequelize') -const { cloneDeep } = require('lodash') +import * as fs from "fs"; +import * as path from "path"; +import {Sequelize} from "sequelize"; +import {cloneDeep} from "lodash"; // core -var config = require('../config') -var logger = require('../logger') +import * as config from "../config"; +import * as logger from "../logger"; var dbconfig = cloneDeep(config.db) dbconfig.logging = config.debug ? (data) => { @@ -25,20 +24,22 @@ if (config.dbURL) { // [Postgres] Handling NULL bytes // https://github.com/sequelize/sequelize/issues/6485 -function stripNullByte (value) { +function stripNullByte(value) { value = '' + value // eslint-disable-next-line no-control-regex return value ? value.replace(/\u0000/g, '') : value } + sequelize.stripNullByte = stripNullByte -function processData (data, _default, process) { +function processData(data, _default, process) { if (data === undefined) return data else return data === null ? _default : (process ? process(data) : data) } + sequelize.processData = processData -var db = {} +var db: any = {} fs.readdirSync(__dirname) .filter(function (file) { @@ -58,4 +59,4 @@ Object.keys(db).forEach(function (modelName) { db.sequelize = sequelize db.Sequelize = Sequelize -module.exports = db +export = db From b0b079a33a8b05ec52f4ee0a425a68da898c4d25 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 08:18:35 +0800 Subject: [PATCH 084/167] migrate to use ot.js Signed-off-by: Raccoon --- lib/models/note.ts | 2 +- lib/ot/client.js | 312 ------------------ lib/ot/editor-socketio-server.js | 164 ---------- lib/ot/index.js | 8 - lib/ot/selection.js | 117 ------- lib/ot/server.js | 52 --- lib/ot/simple-text-operation.js | 188 ----------- lib/ot/text-operation.js | 530 ------------------------------- lib/ot/wrapped-operation.js | 80 ----- lib/realtime/realtime.ts | 2 +- package-lock.json | 4 + package.json | 1 + 12 files changed, 7 insertions(+), 1453 deletions(-) delete mode 100755 lib/ot/client.js delete mode 100755 lib/ot/editor-socketio-server.js delete mode 100644 lib/ot/index.js delete mode 100644 lib/ot/selection.js delete mode 100644 lib/ot/server.js delete mode 100644 lib/ot/simple-text-operation.js delete mode 100644 lib/ot/text-operation.js delete mode 100644 lib/ot/wrapped-operation.js diff --git a/lib/models/note.ts b/lib/models/note.ts index 9ce37803ab..182f08f620 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -18,7 +18,7 @@ import * as logger from "../logger"; import {stripTags} from "../string"; // ot -import * as ot from "../ot"; +import * as ot from "ot"; var md = markdown_it() var dmp = new DiffMatchPatch() diff --git a/lib/ot/client.js b/lib/ot/client.js deleted file mode 100755 index 7ee19fdc28..0000000000 --- a/lib/ot/client.js +++ /dev/null @@ -1,312 +0,0 @@ -// translation of https://github.com/djspiewak/cccp/blob/master/agent/src/main/scala/com/codecommit/cccp/agent/state.scala - -if (typeof ot === 'undefined') { - var ot = {}; -} - -ot.Client = (function (global) { - 'use strict'; - - // Client constructor - function Client (revision) { - this.revision = revision; // the next expected revision number - this.setState(synchronized_); // start state - } - - Client.prototype.setState = function (state) { - this.state = state; - }; - - // Call this method when the user changes the document. - Client.prototype.applyClient = function (operation) { - this.setState(this.state.applyClient(this, operation)); - }; - - // Call this method with a new operation from the server - Client.prototype.applyServer = function (revision, operation) { - this.setState(this.state.applyServer(this, revision, operation)); - }; - - Client.prototype.applyOperations = function (head, operations) { - this.setState(this.state.applyOperations(this, head, operations)); - }; - - Client.prototype.serverAck = function (revision) { - this.setState(this.state.serverAck(this, revision)); - }; - - Client.prototype.serverReconnect = function () { - if (typeof this.state.resend === 'function') { this.state.resend(this); } - }; - - // Transforms a selection from the latest known server state to the current - // client state. For example, if we get from the server the information that - // another user's cursor is at position 3, but the server hasn't yet received - // our newest operation, an insertion of 5 characters at the beginning of the - // document, the correct position of the other user's cursor in our current - // document is 8. - Client.prototype.transformSelection = function (selection) { - return this.state.transformSelection(selection); - }; - - // Override this method. - Client.prototype.sendOperation = function (revision, operation) { - throw new Error("sendOperation must be defined in child class"); - }; - - // Override this method. - Client.prototype.applyOperation = function (operation) { - throw new Error("applyOperation must be defined in child class"); - }; - - - // In the 'Synchronized' state, there is no pending operation that the client - // has sent to the server. - function Synchronized () {} - Client.Synchronized = Synchronized; - - Synchronized.prototype.applyClient = function (client, operation) { - // When the user makes an edit, send the operation to the server and - // switch to the 'AwaitingConfirm' state - client.sendOperation(client.revision, operation); - return new AwaitingConfirm(operation); - }; - - Synchronized.prototype.applyServer = function (client, revision, operation) { - if (revision - client.revision > 1) { - throw new Error("Invalid revision."); - } - client.revision = revision; - // When we receive a new operation from the server, the operation can be - // simply applied to the current document - client.applyOperation(operation); - return this; - }; - - Synchronized.prototype.serverAck = function (client, revision) { - throw new Error("There is no pending operation."); - }; - - // Nothing to do because the latest server state and client state are the same. - Synchronized.prototype.transformSelection = function (x) { return x; }; - - // Singleton - var synchronized_ = new Synchronized(); - - - // In the 'AwaitingConfirm' state, there's one operation the client has sent - // to the server and is still waiting for an acknowledgement. - function AwaitingConfirm (outstanding) { - // Save the pending operation - this.outstanding = outstanding; - } - Client.AwaitingConfirm = AwaitingConfirm; - - AwaitingConfirm.prototype.applyClient = function (client, operation) { - // When the user makes an edit, don't send the operation immediately, - // instead switch to 'AwaitingWithBuffer' state - return new AwaitingWithBuffer(this.outstanding, operation); - }; - - AwaitingConfirm.prototype.applyServer = function (client, revision, operation) { - if (revision - client.revision > 1) { - throw new Error("Invalid revision."); - } - client.revision = revision; - // This is another client's operation. Visualization: - // - // /\ - // this.outstanding / \ operation - // / \ - // \ / - // pair[1] \ / pair[0] (new outstanding) - // (can be applied \/ - // to the client's - // current document) - var pair = operation.constructor.transform(this.outstanding, operation); - client.applyOperation(pair[1]); - return new AwaitingConfirm(pair[0]); - }; - - AwaitingConfirm.prototype.serverAck = function (client, revision) { - if (revision - client.revision > 1) { - return new Stale(this.outstanding, client, revision).getOperations(); - } - client.revision = revision; - // The client's operation has been acknowledged - // => switch to synchronized state - return synchronized_; - }; - - AwaitingConfirm.prototype.transformSelection = function (selection) { - return selection.transform(this.outstanding); - }; - - AwaitingConfirm.prototype.resend = function (client) { - // The confirm didn't come because the client was disconnected. - // Now that it has reconnected, we resend the outstanding operation. - client.sendOperation(client.revision, this.outstanding); - }; - - - // In the 'AwaitingWithBuffer' state, the client is waiting for an operation - // to be acknowledged by the server while buffering the edits the user makes - function AwaitingWithBuffer (outstanding, buffer) { - // Save the pending operation and the user's edits since then - this.outstanding = outstanding; - this.buffer = buffer; - } - Client.AwaitingWithBuffer = AwaitingWithBuffer; - - AwaitingWithBuffer.prototype.applyClient = function (client, operation) { - // Compose the user's changes onto the buffer - var newBuffer = this.buffer.compose(operation); - return new AwaitingWithBuffer(this.outstanding, newBuffer); - }; - - AwaitingWithBuffer.prototype.applyServer = function (client, revision, operation) { - if (revision - client.revision > 1) { - throw new Error("Invalid revision."); - } - client.revision = revision; - // Operation comes from another client - // - // /\ - // this.outstanding / \ operation - // / \ - // /\ / - // this.buffer / \* / pair1[0] (new outstanding) - // / \/ - // \ / - // pair2[1] \ / pair2[0] (new buffer) - // the transformed \/ - // operation -- can - // be applied to the - // client's current - // document - // - // * pair1[1] - var transform = operation.constructor.transform; - var pair1 = transform(this.outstanding, operation); - var pair2 = transform(this.buffer, pair1[1]); - client.applyOperation(pair2[1]); - return new AwaitingWithBuffer(pair1[0], pair2[0]); - }; - - AwaitingWithBuffer.prototype.serverAck = function (client, revision) { - if (revision - client.revision > 1) { - return new StaleWithBuffer(this.outstanding, this.buffer, client, revision).getOperations(); - } - client.revision = revision; - // The pending operation has been acknowledged - // => send buffer - client.sendOperation(client.revision, this.buffer); - return new AwaitingConfirm(this.buffer); - }; - - AwaitingWithBuffer.prototype.transformSelection = function (selection) { - return selection.transform(this.outstanding).transform(this.buffer); - }; - - AwaitingWithBuffer.prototype.resend = function (client) { - // The confirm didn't come because the client was disconnected. - // Now that it has reconnected, we resend the outstanding operation. - client.sendOperation(client.revision, this.outstanding); - }; - - - function Stale(acknowlaged, client, revision) { - this.acknowlaged = acknowlaged; - this.client = client; - this.revision = revision; - } - Client.Stale = Stale; - - Stale.prototype.applyClient = function (client, operation) { - return new StaleWithBuffer(this.acknowlaged, operation, client, this.revision); - }; - - Stale.prototype.applyServer = function (client, revision, operation) { - throw new Error("Ignored server-side change."); - }; - - Stale.prototype.applyOperations = function (client, head, operations) { - var transform = this.acknowlaged.constructor.transform; - for (var i = 0; i < operations.length; i++) { - var op = ot.TextOperation.fromJSON(operations[i]); - var pair = transform(this.acknowlaged, op); - client.applyOperation(pair[1]); - this.acknowlaged = pair[0]; - } - client.revision = this.revision; - return synchronized_; - }; - - Stale.prototype.serverAck = function (client, revision) { - throw new Error("There is no pending operation."); - }; - - Stale.prototype.transformSelection = function (selection) { - return selection; - }; - - Stale.prototype.getOperations = function () { - this.client.getOperations(this.client.revision, this.revision - 1); // acknowlaged is the one at revision - return this; - }; - - - function StaleWithBuffer(acknowlaged, buffer, client, revision) { - this.acknowlaged = acknowlaged; - this.buffer = buffer; - this.client = client; - this.revision = revision; - } - Client.StaleWithBuffer = StaleWithBuffer; - - StaleWithBuffer.prototype.applyClient = function (client, operation) { - var buffer = this.buffer.compose(operation); - return new StaleWithBuffer(this.acknowlaged, buffer, client, this.revision); - }; - - StaleWithBuffer.prototype.applyServer = function (client, revision, operation) { - throw new Error("Ignored server-side change."); - }; - - StaleWithBuffer.prototype.applyOperations = function (client, head, operations) { - var transform = this.acknowlaged.constructor.transform; - for (var i = 0; i < operations.length; i++) { - var op = ot.TextOperation.fromJSON(operations[i]); - var pair1 = transform(this.acknowlaged, op); - var pair2 = transform(this.buffer, pair1[1]); - client.applyOperation(pair2[1]); - this.acknowlaged = pair1[0]; - this.buffer = pair2[0]; - } - client.revision = this.revision; - client.sendOperation(client.revision, this.buffer); - return new AwaitingConfirm(this.buffer); - }; - - StaleWithBuffer.prototype.serverAck = function (client, revision) { - throw new Error("There is no pending operation."); - }; - - StaleWithBuffer.prototype.transformSelection = function (selection) { - return selection; - }; - - StaleWithBuffer.prototype.getOperations = function () { - this.client.getOperations(this.client.revision, this.revision - 1); // acknowlaged is the one at revision - return this; - }; - - - return Client; - -}(this)); - -if (typeof module === 'object') { - module.exports = ot.Client; -} - diff --git a/lib/ot/editor-socketio-server.js b/lib/ot/editor-socketio-server.js deleted file mode 100755 index 5014ac8d26..0000000000 --- a/lib/ot/editor-socketio-server.js +++ /dev/null @@ -1,164 +0,0 @@ -'use strict'; - -var EventEmitter = require('events').EventEmitter; -var TextOperation = require('./text-operation'); -var WrappedOperation = require('./wrapped-operation'); -var Server = require('./server'); -var Selection = require('./selection'); -var util = require('util'); - -var logger = require('../logger'); - -function EditorSocketIOServer(document, operations, docId, mayWrite, operationCallback) { - EventEmitter.call(this); - Server.call(this, document, operations); - this.users = {}; - this.docId = docId; - this.mayWrite = mayWrite || function (_, cb) { - cb(true); - }; - this.operationCallback = operationCallback; -} - -util.inherits(EditorSocketIOServer, Server); -extend(EditorSocketIOServer.prototype, EventEmitter.prototype); - -function extend(target, source) { - for (var key in source) { - if (source.hasOwnProperty(key)) { - target[key] = source[key]; - } - } -} - -EditorSocketIOServer.prototype.addClient = function (socket) { - var self = this; - socket.join(this.docId); - var docOut = { - str: this.document, - revision: this.operations.length, - clients: this.users - }; - socket.emit('doc', docOut); - socket.on('operation', function (revision, operation, selection) { - socket.origin = 'operation'; - self.mayWrite(socket, function (mayWrite) { - if (!mayWrite) { - logger.info("User doesn't have the right to edit."); - return; - } - try { - self.onOperation(socket, revision, operation, selection); - if (typeof self.operationCallback === 'function') - self.operationCallback(socket, operation); - } catch (err) { - setTimeout(function() { - var docOut = { - str: self.document, - revision: self.operations.length, - clients: self.users, - force: true - }; - socket.emit('doc', docOut); - }, 100); - } - }); - }); - socket.on('get_operations', function (base, head) { - self.onGetOperations(socket, base, head); - }); - socket.on('selection', function (obj) { - socket.origin = 'selection'; - self.mayWrite(socket, function (mayWrite) { - if (!mayWrite) { - logger.info("User doesn't have the right to edit."); - return; - } - self.updateSelection(socket, obj && Selection.fromJSON(obj)); - }); - }); - socket.on('disconnect', function () { - logger.debug("Disconnect"); - socket.leave(self.docId); - self.onDisconnect(socket); - /* - if (socket.manager && socket.manager.sockets.clients(self.docId).length === 0) { - self.emit('empty-room'); - } - */ - }); -}; - -EditorSocketIOServer.prototype.onOperation = function (socket, revision, operation, selection) { - var wrapped; - try { - wrapped = new WrappedOperation( - TextOperation.fromJSON(operation), - selection && Selection.fromJSON(selection) - ); - } catch (exc) { - logger.error("Invalid operation received: "); - logger.error(exc); - throw new Error(exc); - } - - try { - var clientId = socket.id; - var wrappedPrime = this.receiveOperation(revision, wrapped); - if(!wrappedPrime) return; - logger.debug("new operation: " + JSON.stringify(wrapped)); - this.getClient(clientId).selection = wrappedPrime.meta; - revision = this.operations.length; - socket.emit('ack', revision); - socket.broadcast.in(this.docId).emit( - 'operation', clientId, revision, - wrappedPrime.wrapped.toJSON(), wrappedPrime.meta - ); - //set document is dirty - this.isDirty = true; - } catch (exc) { - logger.error(exc); - throw new Error(exc); - } -}; - -EditorSocketIOServer.prototype.onGetOperations = function (socket, base, head) { - var operations = this.operations.slice(base, head).map(function (op) { - return op.wrapped.toJSON(); - }); - socket.emit('operations', head, operations); -}; - -EditorSocketIOServer.prototype.updateSelection = function (socket, selection) { - var clientId = socket.id; - if (selection) { - this.getClient(clientId).selection = selection; - } else { - delete this.getClient(clientId).selection; - } - socket.broadcast.to(this.docId).emit('selection', clientId, selection); -}; - -EditorSocketIOServer.prototype.setName = function (socket, name) { - var clientId = socket.id; - this.getClient(clientId).name = name; - socket.broadcast.to(this.docId).emit('set_name', clientId, name); -}; - -EditorSocketIOServer.prototype.setColor = function (socket, color) { - var clientId = socket.id; - this.getClient(clientId).color = color; - socket.broadcast.to(this.docId).emit('set_color', clientId, color); -}; - -EditorSocketIOServer.prototype.getClient = function (clientId) { - return this.users[clientId] || (this.users[clientId] = {}); -}; - -EditorSocketIOServer.prototype.onDisconnect = function (socket) { - var clientId = socket.id; - delete this.users[clientId]; - socket.broadcast.to(this.docId).emit('client_left', clientId); -}; - -module.exports = EditorSocketIOServer; diff --git a/lib/ot/index.js b/lib/ot/index.js deleted file mode 100644 index fcc94c11b8..0000000000 --- a/lib/ot/index.js +++ /dev/null @@ -1,8 +0,0 @@ -exports.version = '0.0.15'; - -exports.TextOperation = require('./text-operation'); -exports.SimpleTextOperation = require('./simple-text-operation'); -exports.Client = require('./client'); -exports.Server = require('./server'); -exports.Selection = require('./selection'); -exports.EditorSocketIOServer = require('./editor-socketio-server'); diff --git a/lib/ot/selection.js b/lib/ot/selection.js deleted file mode 100644 index 72bf8bd653..0000000000 --- a/lib/ot/selection.js +++ /dev/null @@ -1,117 +0,0 @@ -if (typeof ot === 'undefined') { - // Export for browsers - var ot = {}; -} - -ot.Selection = (function (global) { - 'use strict'; - - var TextOperation = global.ot ? global.ot.TextOperation : require('./text-operation'); - - // Range has `anchor` and `head` properties, which are zero-based indices into - // the document. The `anchor` is the side of the selection that stays fixed, - // `head` is the side of the selection where the cursor is. When both are - // equal, the range represents a cursor. - function Range (anchor, head) { - this.anchor = anchor; - this.head = head; - } - - Range.fromJSON = function (obj) { - return new Range(obj.anchor, obj.head); - }; - - Range.prototype.equals = function (other) { - return this.anchor === other.anchor && this.head === other.head; - }; - - Range.prototype.isEmpty = function () { - return this.anchor === this.head; - }; - - Range.prototype.transform = function (other) { - function transformIndex (index) { - var newIndex = index; - var ops = other.ops; - for (var i = 0, l = other.ops.length; i < l; i++) { - if (TextOperation.isRetain(ops[i])) { - index -= ops[i]; - } else if (TextOperation.isInsert(ops[i])) { - newIndex += ops[i].length; - } else { - newIndex -= Math.min(index, -ops[i]); - index += ops[i]; - } - if (index < 0) { break; } - } - return newIndex; - } - - var newAnchor = transformIndex(this.anchor); - if (this.anchor === this.head) { - return new Range(newAnchor, newAnchor); - } - return new Range(newAnchor, transformIndex(this.head)); - }; - - // A selection is basically an array of ranges. Every range represents a real - // selection or a cursor in the document (when the start position equals the - // end position of the range). The array must not be empty. - function Selection (ranges) { - this.ranges = ranges || []; - } - - Selection.Range = Range; - - // Convenience method for creating selections only containing a single cursor - // and no real selection range. - Selection.createCursor = function (position) { - return new Selection([new Range(position, position)]); - }; - - Selection.fromJSON = function (obj) { - var objRanges = obj.ranges || obj; - for (var i = 0, ranges = []; i < objRanges.length; i++) { - ranges[i] = Range.fromJSON(objRanges[i]); - } - return new Selection(ranges); - }; - - Selection.prototype.equals = function (other) { - if (this.position !== other.position) { return false; } - if (this.ranges.length !== other.ranges.length) { return false; } - // FIXME: Sort ranges before comparing them? - for (var i = 0; i < this.ranges.length; i++) { - if (!this.ranges[i].equals(other.ranges[i])) { return false; } - } - return true; - }; - - Selection.prototype.somethingSelected = function () { - for (var i = 0; i < this.ranges.length; i++) { - if (!this.ranges[i].isEmpty()) { return true; } - } - return false; - }; - - // Return the more current selection information. - Selection.prototype.compose = function (other) { - return other; - }; - - // Update the selection with respect to an operation. - Selection.prototype.transform = function (other) { - for (var i = 0, newRanges = []; i < this.ranges.length; i++) { - newRanges[i] = this.ranges[i].transform(other); - } - return new Selection(newRanges); - }; - - return Selection; - -}(this)); - -// Export for CommonJS -if (typeof module === 'object') { - module.exports = ot.Selection; -} diff --git a/lib/ot/server.js b/lib/ot/server.js deleted file mode 100644 index 30ebeac968..0000000000 --- a/lib/ot/server.js +++ /dev/null @@ -1,52 +0,0 @@ -var config = require('../config'); - -if (typeof ot === 'undefined') { - var ot = {}; -} - -ot.Server = (function (global) { - 'use strict'; - - // Constructor. Takes the current document as a string and optionally the array - // of all operations. - function Server (document, operations) { - this.document = document; - this.operations = operations || []; - } - - // Call this method whenever you receive an operation from a client. - Server.prototype.receiveOperation = function (revision, operation) { - if (revision < 0 || this.operations.length < revision) { - throw new Error("operation revision not in history"); - } - // Find all operations that the client didn't know of when it sent the - // operation ... - var concurrentOperations = this.operations.slice(revision); - - // ... and transform the operation against all these operations ... - var transform = operation.constructor.transform; - for (var i = 0; i < concurrentOperations.length; i++) { - operation = transform(operation, concurrentOperations[i])[0]; - } - - // ... and apply that on the document. - var newDocument = operation.apply(this.document); - // ignore if exceed the max length of document - if(newDocument.length > config.documentMaxLength && newDocument.length > this.document.length) - return; - this.document = newDocument; - // Store operation in history. - this.operations.push(operation); - - // It's the caller's responsibility to send the operation to all connected - // clients and an acknowledgement to the creator. - return operation; - }; - - return Server; - -}(this)); - -if (typeof module === 'object') { - module.exports = ot.Server; -} \ No newline at end of file diff --git a/lib/ot/simple-text-operation.js b/lib/ot/simple-text-operation.js deleted file mode 100644 index 6db296e024..0000000000 --- a/lib/ot/simple-text-operation.js +++ /dev/null @@ -1,188 +0,0 @@ -if (typeof ot === 'undefined') { - // Export for browsers - var ot = {}; -} - -ot.SimpleTextOperation = (function (global) { - - var TextOperation = global.ot ? global.ot.TextOperation : require('./text-operation'); - - function SimpleTextOperation () {} - - - // Insert the string `str` at the zero-based `position` in the document. - function Insert (str, position) { - if (!this || this.constructor !== SimpleTextOperation) { - // => function was called without 'new' - return new Insert(str, position); - } - this.str = str; - this.position = position; - } - - Insert.prototype = new SimpleTextOperation(); - SimpleTextOperation.Insert = Insert; - - Insert.prototype.toString = function () { - return 'Insert(' + JSON.stringify(this.str) + ', ' + this.position + ')'; - }; - - Insert.prototype.equals = function (other) { - return other instanceof Insert && - this.str === other.str && - this.position === other.position; - }; - - Insert.prototype.apply = function (doc) { - return doc.slice(0, this.position) + this.str + doc.slice(this.position); - }; - - - // Delete `count` many characters at the zero-based `position` in the document. - function Delete (count, position) { - if (!this || this.constructor !== SimpleTextOperation) { - return new Delete(count, position); - } - this.count = count; - this.position = position; - } - - Delete.prototype = new SimpleTextOperation(); - SimpleTextOperation.Delete = Delete; - - Delete.prototype.toString = function () { - return 'Delete(' + this.count + ', ' + this.position + ')'; - }; - - Delete.prototype.equals = function (other) { - return other instanceof Delete && - this.count === other.count && - this.position === other.position; - }; - - Delete.prototype.apply = function (doc) { - return doc.slice(0, this.position) + doc.slice(this.position + this.count); - }; - - - // An operation that does nothing. This is needed for the result of the - // transformation of two deletions of the same character. - function Noop () { - if (!this || this.constructor !== SimpleTextOperation) { return new Noop(); } - } - - Noop.prototype = new SimpleTextOperation(); - SimpleTextOperation.Noop = Noop; - - Noop.prototype.toString = function () { - return 'Noop()'; - }; - - Noop.prototype.equals = function (other) { return other instanceof Noop; }; - - Noop.prototype.apply = function (doc) { return doc; }; - - var noop = new Noop(); - - - SimpleTextOperation.transform = function (a, b) { - if (a instanceof Noop || b instanceof Noop) { return [a, b]; } - - if (a instanceof Insert && b instanceof Insert) { - if (a.position < b.position || (a.position === b.position && a.str < b.str)) { - return [a, new Insert(b.str, b.position + a.str.length)]; - } - if (a.position > b.position || (a.position === b.position && a.str > b.str)) { - return [new Insert(a.str, a.position + b.str.length), b]; - } - return [noop, noop]; - } - - if (a instanceof Insert && b instanceof Delete) { - if (a.position <= b.position) { - return [a, new Delete(b.count, b.position + a.str.length)]; - } - if (a.position >= b.position + b.count) { - return [new Insert(a.str, a.position - b.count), b]; - } - // Here, we have to delete the inserted string of operation a. - // That doesn't preserve the intention of operation a, but it's the only - // thing we can do to get a valid transform function. - return [noop, new Delete(b.count + a.str.length, b.position)]; - } - - if (a instanceof Delete && b instanceof Insert) { - if (a.position >= b.position) { - return [new Delete(a.count, a.position + b.str.length), b]; - } - if (a.position + a.count <= b.position) { - return [a, new Insert(b.str, b.position - a.count)]; - } - // Same problem as above. We have to delete the string that was inserted - // in operation b. - return [new Delete(a.count + b.str.length, a.position), noop]; - } - - if (a instanceof Delete && b instanceof Delete) { - if (a.position === b.position) { - if (a.count === b.count) { - return [noop, noop]; - } else if (a.count < b.count) { - return [noop, new Delete(b.count - a.count, b.position)]; - } - return [new Delete(a.count - b.count, a.position), noop]; - } - if (a.position < b.position) { - if (a.position + a.count <= b.position) { - return [a, new Delete(b.count, b.position - a.count)]; - } - if (a.position + a.count >= b.position + b.count) { - return [new Delete(a.count - b.count, a.position), noop]; - } - return [ - new Delete(b.position - a.position, a.position), - new Delete(b.position + b.count - (a.position + a.count), a.position) - ]; - } - if (a.position > b.position) { - if (a.position >= b.position + b.count) { - return [new Delete(a.count, a.position - b.count), b]; - } - if (a.position + a.count <= b.position + b.count) { - return [noop, new Delete(b.count - a.count, b.position)]; - } - return [ - new Delete(a.position + a.count - (b.position + b.count), b.position), - new Delete(a.position - b.position, b.position) - ]; - } - } - }; - - // Convert a normal, composable `TextOperation` into an array of - // `SimpleTextOperation`s. - SimpleTextOperation.fromTextOperation = function (operation) { - var simpleOperations = []; - var index = 0; - for (var i = 0; i < operation.ops.length; i++) { - var op = operation.ops[i]; - if (TextOperation.isRetain(op)) { - index += op; - } else if (TextOperation.isInsert(op)) { - simpleOperations.push(new Insert(op, index)); - index += op.length; - } else { - simpleOperations.push(new Delete(Math.abs(op), index)); - } - } - return simpleOperations; - }; - - - return SimpleTextOperation; -})(this); - -// Export for CommonJS -if (typeof module === 'object') { - module.exports = ot.SimpleTextOperation; -} \ No newline at end of file diff --git a/lib/ot/text-operation.js b/lib/ot/text-operation.js deleted file mode 100644 index d5468497ed..0000000000 --- a/lib/ot/text-operation.js +++ /dev/null @@ -1,530 +0,0 @@ -if (typeof ot === 'undefined') { - // Export for browsers - var ot = {}; -} - -ot.TextOperation = (function () { - 'use strict'; - - // Constructor for new operations. - function TextOperation () { - if (!this || this.constructor !== TextOperation) { - // => function was called without 'new' - return new TextOperation(); - } - - // When an operation is applied to an input string, you can think of this as - // if an imaginary cursor runs over the entire string and skips over some - // parts, deletes some parts and inserts characters at some positions. These - // actions (skip/delete/insert) are stored as an array in the "ops" property. - this.ops = []; - // An operation's baseLength is the length of every string the operation - // can be applied to. - this.baseLength = 0; - // The targetLength is the length of every string that results from applying - // the operation on a valid input string. - this.targetLength = 0; - } - - TextOperation.prototype.equals = function (other) { - if (this.baseLength !== other.baseLength) { return false; } - if (this.targetLength !== other.targetLength) { return false; } - if (this.ops.length !== other.ops.length) { return false; } - for (var i = 0; i < this.ops.length; i++) { - if (this.ops[i] !== other.ops[i]) { return false; } - } - return true; - }; - - // Operation are essentially lists of ops. There are three types of ops: - // - // * Retain ops: Advance the cursor position by a given number of characters. - // Represented by positive ints. - // * Insert ops: Insert a given string at the current cursor position. - // Represented by strings. - // * Delete ops: Delete the next n characters. Represented by negative ints. - - var isRetain = TextOperation.isRetain = function (op) { - return typeof op === 'number' && op > 0; - }; - - var isInsert = TextOperation.isInsert = function (op) { - return typeof op === 'string'; - }; - - var isDelete = TextOperation.isDelete = function (op) { - return typeof op === 'number' && op < 0; - }; - - - // After an operation is constructed, the user of the library can specify the - // actions of an operation (skip/insert/delete) with these three builder - // methods. They all return the operation for convenient chaining. - - // Skip over a given number of characters. - TextOperation.prototype.retain = function (n) { - if (typeof n !== 'number') { - throw new Error("retain expects an integer"); - } - if (n === 0) { return this; } - this.baseLength += n; - this.targetLength += n; - if (isRetain(this.ops[this.ops.length-1])) { - // The last op is a retain op => we can merge them into one op. - this.ops[this.ops.length-1] += n; - } else { - // Create a new op. - this.ops.push(n); - } - return this; - }; - - // Insert a string at the current position. - TextOperation.prototype.insert = function (str) { - if (typeof str !== 'string') { - throw new Error("insert expects a string"); - } - if (str === '') { return this; } - this.targetLength += str.length; - var ops = this.ops; - if (isInsert(ops[ops.length-1])) { - // Merge insert op. - ops[ops.length-1] += str; - } else if (isDelete(ops[ops.length-1])) { - // It doesn't matter when an operation is applied whether the operation - // is delete(3), insert("something") or insert("something"), delete(3). - // Here we enforce that in this case, the insert op always comes first. - // This makes all operations that have the same effect when applied to - // a document of the right length equal in respect to the `equals` method. - if (isInsert(ops[ops.length-2])) { - ops[ops.length-2] += str; - } else { - ops[ops.length] = ops[ops.length-1]; - ops[ops.length-2] = str; - } - } else { - ops.push(str); - } - return this; - }; - - // Delete a string at the current position. - TextOperation.prototype['delete'] = function (n) { - if (typeof n === 'string') { n = n.length; } - if (typeof n !== 'number') { - throw new Error("delete expects an integer or a string"); - } - if (n === 0) { return this; } - if (n > 0) { n = -n; } - this.baseLength -= n; - if (isDelete(this.ops[this.ops.length-1])) { - this.ops[this.ops.length-1] += n; - } else { - this.ops.push(n); - } - return this; - }; - - // Tests whether this operation has no effect. - TextOperation.prototype.isNoop = function () { - return this.ops.length === 0 || (this.ops.length === 1 && isRetain(this.ops[0])); - }; - - // Pretty printing. - TextOperation.prototype.toString = function () { - // map: build a new array by applying a function to every element in an old - // array. - var map = Array.prototype.map || function (fn) { - var arr = this; - var newArr = []; - for (var i = 0, l = arr.length; i < l; i++) { - newArr[i] = fn(arr[i]); - } - return newArr; - }; - return map.call(this.ops, function (op) { - if (isRetain(op)) { - return "retain " + op; - } else if (isInsert(op)) { - return "insert '" + op + "'"; - } else { - return "delete " + (-op); - } - }).join(', '); - }; - - // Converts operation into a JSON value. - TextOperation.prototype.toJSON = function () { - return this.ops; - }; - - // Converts a plain JS object into an operation and validates it. - TextOperation.fromJSON = function (ops) { - var o = new TextOperation(); - for (var i = 0, l = ops.length; i < l; i++) { - var op = ops[i]; - if (isRetain(op)) { - o.retain(op); - } else if (isInsert(op)) { - o.insert(op); - } else if (isDelete(op)) { - o['delete'](op); - } else { - throw new Error("unknown operation: " + JSON.stringify(op)); - } - } - return o; - }; - - // Apply an operation to a string, returning a new string. Throws an error if - // there's a mismatch between the input string and the operation. - TextOperation.prototype.apply = function (str) { - var operation = this; - if (str.length !== operation.baseLength) { - throw new Error("The operation's base length must be equal to the string's length."); - } - var newStr = [], j = 0; - var strIndex = 0; - var ops = this.ops; - for (var i = 0, l = ops.length; i < l; i++) { - var op = ops[i]; - if (isRetain(op)) { - if (strIndex + op > str.length) { - throw new Error("Operation can't retain more characters than are left in the string."); - } - // Copy skipped part of the old string. - newStr[j++] = str.slice(strIndex, strIndex + op); - strIndex += op; - } else if (isInsert(op)) { - // Insert string. - newStr[j++] = op; - } else { // delete op - strIndex -= op; - } - } - if (strIndex !== str.length) { - throw new Error("The operation didn't operate on the whole string."); - } - return newStr.join(''); - }; - - // Computes the inverse of an operation. The inverse of an operation is the - // operation that reverts the effects of the operation, e.g. when you have an - // operation 'insert("hello "); skip(6);' then the inverse is 'delete("hello "); - // skip(6);'. The inverse should be used for implementing undo. - TextOperation.prototype.invert = function (str) { - var strIndex = 0; - var inverse = new TextOperation(); - var ops = this.ops; - for (var i = 0, l = ops.length; i < l; i++) { - var op = ops[i]; - if (isRetain(op)) { - inverse.retain(op); - strIndex += op; - } else if (isInsert(op)) { - inverse['delete'](op.length); - } else { // delete op - inverse.insert(str.slice(strIndex, strIndex - op)); - strIndex -= op; - } - } - return inverse; - }; - - // Compose merges two consecutive operations into one operation, that - // preserves the changes of both. Or, in other words, for each input string S - // and a pair of consecutive operations A and B, - // apply(apply(S, A), B) = apply(S, compose(A, B)) must hold. - TextOperation.prototype.compose = function (operation2) { - var operation1 = this; - if (operation1.targetLength !== operation2.baseLength) { - throw new Error("The base length of the second operation has to be the target length of the first operation"); - } - - var operation = new TextOperation(); // the combined operation - var ops1 = operation1.ops, ops2 = operation2.ops; // for fast access - var i1 = 0, i2 = 0; // current index into ops1 respectively ops2 - var op1 = ops1[i1++], op2 = ops2[i2++]; // current ops - while (true) { - // Dispatch on the type of op1 and op2 - if (typeof op1 === 'undefined' && typeof op2 === 'undefined') { - // end condition: both ops1 and ops2 have been processed - break; - } - - if (isDelete(op1)) { - operation['delete'](op1); - op1 = ops1[i1++]; - continue; - } - if (isInsert(op2)) { - operation.insert(op2); - op2 = ops2[i2++]; - continue; - } - - if (typeof op1 === 'undefined') { - throw new Error("Cannot compose operations: first operation is too short."); - } - if (typeof op2 === 'undefined') { - throw new Error("Cannot compose operations: first operation is too long."); - } - - if (isRetain(op1) && isRetain(op2)) { - if (op1 > op2) { - operation.retain(op2); - op1 = op1 - op2; - op2 = ops2[i2++]; - } else if (op1 === op2) { - operation.retain(op1); - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - operation.retain(op1); - op2 = op2 - op1; - op1 = ops1[i1++]; - } - } else if (isInsert(op1) && isDelete(op2)) { - if (op1.length > -op2) { - op1 = op1.slice(-op2); - op2 = ops2[i2++]; - } else if (op1.length === -op2) { - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - op2 = op2 + op1.length; - op1 = ops1[i1++]; - } - } else if (isInsert(op1) && isRetain(op2)) { - if (op1.length > op2) { - operation.insert(op1.slice(0, op2)); - op1 = op1.slice(op2); - op2 = ops2[i2++]; - } else if (op1.length === op2) { - operation.insert(op1); - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - operation.insert(op1); - op2 = op2 - op1.length; - op1 = ops1[i1++]; - } - } else if (isRetain(op1) && isDelete(op2)) { - if (op1 > -op2) { - operation['delete'](op2); - op1 = op1 + op2; - op2 = ops2[i2++]; - } else if (op1 === -op2) { - operation['delete'](op2); - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - operation['delete'](op1); - op2 = op2 + op1; - op1 = ops1[i1++]; - } - } else { - throw new Error( - "This shouldn't happen: op1: " + - JSON.stringify(op1) + ", op2: " + - JSON.stringify(op2) - ); - } - } - return operation; - }; - - function getSimpleOp (operation, fn) { - var ops = operation.ops; - var isRetain = TextOperation.isRetain; - switch (ops.length) { - case 1: - return ops[0]; - case 2: - return isRetain(ops[0]) ? ops[1] : (isRetain(ops[1]) ? ops[0] : null); - case 3: - if (isRetain(ops[0]) && isRetain(ops[2])) { return ops[1]; } - } - return null; - } - - function getStartIndex (operation) { - if (isRetain(operation.ops[0])) { return operation.ops[0]; } - return 0; - } - - // When you use ctrl-z to undo your latest changes, you expect the program not - // to undo every single keystroke but to undo your last sentence you wrote at - // a stretch or the deletion you did by holding the backspace key down. This - // This can be implemented by composing operations on the undo stack. This - // method can help decide whether two operations should be composed. It - // returns true if the operations are consecutive insert operations or both - // operations delete text at the same position. You may want to include other - // factors like the time since the last change in your decision. - TextOperation.prototype.shouldBeComposedWith = function (other) { - if (this.isNoop() || other.isNoop()) { return true; } - - var startA = getStartIndex(this), startB = getStartIndex(other); - var simpleA = getSimpleOp(this), simpleB = getSimpleOp(other); - if (!simpleA || !simpleB) { return false; } - - if (isInsert(simpleA) && isInsert(simpleB)) { - return startA + simpleA.length === startB; - } - - if (isDelete(simpleA) && isDelete(simpleB)) { - // there are two possibilities to delete: with backspace and with the - // delete key. - return (startB - simpleB === startA) || startA === startB; - } - - return false; - }; - - // Decides whether two operations should be composed with each other - // if they were inverted, that is - // `shouldBeComposedWith(a, b) = shouldBeComposedWithInverted(b^{-1}, a^{-1})`. - TextOperation.prototype.shouldBeComposedWithInverted = function (other) { - if (this.isNoop() || other.isNoop()) { return true; } - - var startA = getStartIndex(this), startB = getStartIndex(other); - var simpleA = getSimpleOp(this), simpleB = getSimpleOp(other); - if (!simpleA || !simpleB) { return false; } - - if (isInsert(simpleA) && isInsert(simpleB)) { - return startA + simpleA.length === startB || startA === startB; - } - - if (isDelete(simpleA) && isDelete(simpleB)) { - return startB - simpleB === startA; - } - - return false; - }; - - // Transform takes two operations A and B that happened concurrently and - // produces two operations A' and B' (in an array) such that - // `apply(apply(S, A), B') = apply(apply(S, B), A')`. This function is the - // heart of OT. - TextOperation.transform = function (operation1, operation2) { - if (operation1.baseLength !== operation2.baseLength) { - throw new Error("Both operations have to have the same base length"); - } - - var operation1prime = new TextOperation(); - var operation2prime = new TextOperation(); - var ops1 = operation1.ops, ops2 = operation2.ops; - var i1 = 0, i2 = 0; - var op1 = ops1[i1++], op2 = ops2[i2++]; - while (true) { - // At every iteration of the loop, the imaginary cursor that both - // operation1 and operation2 have that operates on the input string must - // have the same position in the input string. - - if (typeof op1 === 'undefined' && typeof op2 === 'undefined') { - // end condition: both ops1 and ops2 have been processed - break; - } - - // next two cases: one or both ops are insert ops - // => insert the string in the corresponding prime operation, skip it in - // the other one. If both op1 and op2 are insert ops, prefer op1. - if (isInsert(op1)) { - operation1prime.insert(op1); - operation2prime.retain(op1.length); - op1 = ops1[i1++]; - continue; - } - if (isInsert(op2)) { - operation1prime.retain(op2.length); - operation2prime.insert(op2); - op2 = ops2[i2++]; - continue; - } - - if (typeof op1 === 'undefined') { - throw new Error("Cannot compose operations: first operation is too short."); - } - if (typeof op2 === 'undefined') { - throw new Error("Cannot compose operations: first operation is too long."); - } - - var minl; - if (isRetain(op1) && isRetain(op2)) { - // Simple case: retain/retain - if (op1 > op2) { - minl = op2; - op1 = op1 - op2; - op2 = ops2[i2++]; - } else if (op1 === op2) { - minl = op2; - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - minl = op1; - op2 = op2 - op1; - op1 = ops1[i1++]; - } - operation1prime.retain(minl); - operation2prime.retain(minl); - } else if (isDelete(op1) && isDelete(op2)) { - // Both operations delete the same string at the same position. We don't - // need to produce any operations, we just skip over the delete ops and - // handle the case that one operation deletes more than the other. - if (-op1 > -op2) { - op1 = op1 - op2; - op2 = ops2[i2++]; - } else if (op1 === op2) { - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - op2 = op2 - op1; - op1 = ops1[i1++]; - } - // next two cases: delete/retain and retain/delete - } else if (isDelete(op1) && isRetain(op2)) { - if (-op1 > op2) { - minl = op2; - op1 = op1 + op2; - op2 = ops2[i2++]; - } else if (-op1 === op2) { - minl = op2; - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - minl = -op1; - op2 = op2 + op1; - op1 = ops1[i1++]; - } - operation1prime['delete'](minl); - } else if (isRetain(op1) && isDelete(op2)) { - if (op1 > -op2) { - minl = -op2; - op1 = op1 + op2; - op2 = ops2[i2++]; - } else if (op1 === -op2) { - minl = op1; - op1 = ops1[i1++]; - op2 = ops2[i2++]; - } else { - minl = op1; - op2 = op2 + op1; - op1 = ops1[i1++]; - } - operation2prime['delete'](minl); - } else { - throw new Error("The two operations aren't compatible"); - } - } - - return [operation1prime, operation2prime]; - }; - - return TextOperation; - -}()); - -// Export for CommonJS -if (typeof module === 'object') { - module.exports = ot.TextOperation; -} \ No newline at end of file diff --git a/lib/ot/wrapped-operation.js b/lib/ot/wrapped-operation.js deleted file mode 100644 index 91050f4ed0..0000000000 --- a/lib/ot/wrapped-operation.js +++ /dev/null @@ -1,80 +0,0 @@ -if (typeof ot === 'undefined') { - // Export for browsers - var ot = {}; -} - -ot.WrappedOperation = (function (global) { - 'use strict'; - - // A WrappedOperation contains an operation and corresponing metadata. - function WrappedOperation (operation, meta) { - this.wrapped = operation; - this.meta = meta; - } - - WrappedOperation.prototype.apply = function () { - return this.wrapped.apply.apply(this.wrapped, arguments); - }; - - WrappedOperation.prototype.invert = function () { - var meta = this.meta; - return new WrappedOperation( - this.wrapped.invert.apply(this.wrapped, arguments), - meta && typeof meta === 'object' && typeof meta.invert === 'function' ? - meta.invert.apply(meta, arguments) : meta - ); - }; - - // Copy all properties from source to target. - function copy (source, target) { - for (var key in source) { - if (source.hasOwnProperty(key)) { - target[key] = source[key]; - } - } - } - - function composeMeta (a, b) { - if (a && typeof a === 'object') { - if (typeof a.compose === 'function') { return a.compose(b); } - var meta = {}; - copy(a, meta); - copy(b, meta); - return meta; - } - return b; - } - - WrappedOperation.prototype.compose = function (other) { - return new WrappedOperation( - this.wrapped.compose(other.wrapped), - composeMeta(this.meta, other.meta) - ); - }; - - function transformMeta (meta, operation) { - if (meta && typeof meta === 'object') { - if (typeof meta.transform === 'function') { - return meta.transform(operation); - } - } - return meta; - } - - WrappedOperation.transform = function (a, b) { - var transform = a.wrapped.constructor.transform; - var pair = transform(a.wrapped, b.wrapped); - return [ - new WrappedOperation(pair[0], transformMeta(a.meta, b.wrapped)), - new WrappedOperation(pair[1], transformMeta(b.meta, a.wrapped)) - ]; - }; - - return WrappedOperation; - -}(this)); - -// Export for CommonJS -if (typeof module === 'object') { - module.exports = ot.WrappedOperation; -} \ No newline at end of file diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index b2cf97a054..99423789ec 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -15,7 +15,7 @@ import * as history from "../history"; import * as models from "../models"; // ot -import * as ot from "../ot"; +import * as ot from "ot"; import {ProcessQueue} from "./processQueue"; import {RealtimeClientConnection} from "./realtimeClientConnection"; diff --git a/package-lock.json b/package-lock.json index e8c61da7ce..f29de14962 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11739,6 +11739,10 @@ "os-tmpdir": "^1.0.0" } }, + "ot": { + "version": "git+https://github.com/hackmdio/ot.js.git#cc1f3383e70b58ffe7f0da3c3b10ece0f606dc09", + "from": "git+https://github.com/hackmdio/ot.js.git#cc1f338" + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", diff --git a/package.json b/package.json index b6d9d9773e..606480a47b 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "morgan": "~1.9.1", "mysql": "~2.17.1", "mysql2": "^2.0.1", + "ot": "git+https://github.com/hackmdio/ot.js.git#cc1f338", "passport": "~0.4.0", "passport-bitbucket-oauth2": "~0.1.2", "passport-dropbox-oauth2": "~1.1.0", From 99e38d4cda0f03144791a25a5457dc266a7007b6 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 09:17:12 +0800 Subject: [PATCH 085/167] migrate to use ot.js - fix test Signed-off-by: Raccoon --- package.json | 1 - test/realtime/utils.js | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 606480a47b..79fda31b1d 100644 --- a/package.json +++ b/package.json @@ -236,7 +236,6 @@ "ignore": [ "/public/build", "/public/vendor", - "/lib/ot", "webpack.*" ] }, diff --git a/test/realtime/utils.js b/test/realtime/utils.js index ca02b24292..93ab2f152c 100644 --- a/test/realtime/utils.js +++ b/test/realtime/utils.js @@ -5,7 +5,7 @@ const path = require('path') function makeMockSocket (headers, query) { const broadCastChannelCache = {} - return { + const fakesocket = { id: Math.round(Math.random() * 10000), request: { user: {} @@ -14,8 +14,6 @@ function makeMockSocket (headers, query) { headers: Object.assign({}, headers), query: Object.assign({}, query) }, - on: sinon.fake(), - emit: sinon.fake(), broadCastChannelCache: {}, broadcast: { to: (channel) => { @@ -31,6 +29,10 @@ function makeMockSocket (headers, query) { disconnect: sinon.fake(), rooms: [] } + fakesocket.on = sinon.fake.returns(fakesocket) + fakesocket.emit = sinon.fake.returns(fakesocket) + fakesocket.join = sinon.fake.returns(fakesocket) + return fakesocket } function removeModuleFromRequireCache (modulePath) { From e29eec01965884572ffdbb5730be5ba836322a02 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 09:17:36 +0800 Subject: [PATCH 086/167] ts: realtimeClientConnection.ts Signed-off-by: Raccoon --- lib/realtime/realtimeClientConnection.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index 3d48f15fcb..4035c8b76d 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -244,5 +244,3 @@ export class RealtimeClientConnection { this.realtime.queueForDisconnect(this.socket) } } - -exports.RealtimeClientConnection = RealtimeClientConnection From 301771037c60b8279e65800a90855937b0ff7aad Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 09:19:57 +0800 Subject: [PATCH 087/167] fix: realtime ts lint Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 99423789ec..e3b3f815d6 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -89,7 +89,7 @@ export function emitCheck(note) { export var users = {} export var notes = {} -export function getNotePool() { +export function getNotePool(): any { return notes } From 11fd1e72a114317567942b16fb74b43cc7413d2f Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 11:58:52 +0800 Subject: [PATCH 088/167] fix minio ts error Signed-off-by: Raccoon --- lib/imageRouter/minio.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/imageRouter/minio.ts b/lib/imageRouter/minio.ts index 3432e5e3d2..ec5da79dc0 100644 --- a/lib/imageRouter/minio.ts +++ b/lib/imageRouter/minio.ts @@ -35,7 +35,9 @@ export function uploadImage(imagePath, callback) { const key = path.join('uploads', path.basename(imagePath)) const protocol = config.minio.secure ? 'https' : 'http' - minioClient.putObject(config.s3bucket, key, buffer, buffer.length, getImageMimeType(imagePath), function (err, data) { + minioClient.putObject(config.s3bucket, key, buffer, buffer.length, { + ContentType: getImageMimeType(imagePath) + }, function (err, data) { if (err) { callback(err, null) return From 70ed184d1498180ba1bd4193c64a965caafd979e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 10:12:36 +0800 Subject: [PATCH 089/167] ts to es2019 Signed-off-by: Raccoon --- tsconfig.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index a66e06779a..1741b9e9ca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,11 @@ { "compileOnSave": true, "compilerOptions": { - "allowJs": true, - "target": "ES5", + "allowJs": false, + "target": "ES2019", "outDir": "./dist/", - "allowSyntheticDefaultImports": true + "module": "CommonJS", + "moduleResolution": "Node" }, "include": [ "./lib/**/*" From da08b3686a9fc2e9b9f57c61005ceaeb5a486ca0 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 09:18:03 +0800 Subject: [PATCH 090/167] test case use dist build Signed-off-by: Raccoon --- test/auth/oauth2/strategy.test.js | 2 +- test/connectionQueue.test.js | 2 +- test/csp.js | 32 +++++++++---------- test/letter-avatars.js | 8 ++--- test/realtime/cleanDanglingUser.test.js | 18 +++++------ test/realtime/connection.test.js | 18 +++++------ test/realtime/dirtyNoteUpdate.test.js | 14 ++++---- test/realtime/disconnect-process.test.js | 12 +++---- test/realtime/extractNoteIdFromSocket.test.js | 16 +++++----- test/realtime/ifMayEdit.test.js | 18 +++++------ test/realtime/parseNoteIdFromSocket.test.js | 30 ++++++++--------- test/realtime/realtime.test.js | 10 +++--- test/realtime/saveRevisionJob.test.js | 22 ++++++------- test/realtime/socket-events.test.js | 16 +++++----- test/realtime/updateNote.test.js | 26 +++++++-------- test/realtime/utils.js | 3 +- 16 files changed, 124 insertions(+), 123 deletions(-) diff --git a/test/auth/oauth2/strategy.test.js b/test/auth/oauth2/strategy.test.js index 4902b04023..2ee08e3b0e 100644 --- a/test/auth/oauth2/strategy.test.js +++ b/test/auth/oauth2/strategy.test.js @@ -4,7 +4,7 @@ const assert = require('assert') const chance = require('chance')() -const { extractProfileAttribute } = require('../../../lib/auth/oauth2/strategy') +const { extractProfileAttribute } = require('../../../dist/auth/oauth2/strategy') describe('OAuth2CustomStrategy', function () { describe('#extractProfileAttribute', function () { diff --git a/test/connectionQueue.test.js b/test/connectionQueue.test.js index 326b511080..882fdb86f1 100644 --- a/test/connectionQueue.test.js +++ b/test/connectionQueue.test.js @@ -4,7 +4,7 @@ const assert = require('assert') const sinon = require('sinon') -const { ProcessQueue } = require('../lib/realtime/processQueue') +const { ProcessQueue } = require('../dist/realtime/processQueue') describe('ProcessQueue', function () { let clock diff --git a/test/csp.js b/test/csp.js index 3352a19981..c938e8bddc 100644 --- a/test/csp.js +++ b/test/csp.js @@ -11,7 +11,7 @@ describe('Content security policies', function () { let defaultConfig, csp before(function () { - csp = require('../lib/csp') + csp = require('../dist/csp') }) beforeEach(function () { @@ -32,21 +32,21 @@ describe('Content security policies', function () { }) afterEach(function () { - mock.stop('../lib/config') - csp = mock.reRequire('../lib/csp') + mock.stop('../dist/config') + csp = mock.reRequire('../dist/csp') }) after(function () { mock.stopAll() - csp = mock.reRequire('../lib/csp') + csp = mock.reRequire('../dist/csp') }) // beginnging Tests it('Disable CDN', function () { const testconfig = defaultConfig testconfig.useCDN = false - mock('../lib/config', testconfig) - csp = mock.reRequire('../lib/csp') + mock('../dist/config', testconfig) + csp = mock.reRequire('../dist/csp') assert(!csp.computeDirectives().scriptSrc.includes('https://cdnjs.cloudflare.com')) assert(!csp.computeDirectives().scriptSrc.includes('https://cdn.jsdelivr.net')) @@ -61,8 +61,8 @@ describe('Content security policies', function () { it('Disable Google Analytics', function () { const testconfig = defaultConfig testconfig.csp.addGoogleAnalytics = false - mock('../lib/config', testconfig) - csp = mock.reRequire('../lib/csp') + mock('../dist/config', testconfig) + csp = mock.reRequire('../dist/csp') assert(!csp.computeDirectives().scriptSrc.includes('https://www.google-analytics.com')) }) @@ -70,8 +70,8 @@ describe('Content security policies', function () { it('Disable Disqus', function () { const testconfig = defaultConfig testconfig.csp.addDisqus = false - mock('../lib/config', testconfig) - csp = mock.reRequire('../lib/csp') + mock('../dist/config', testconfig) + csp = mock.reRequire('../dist/csp') assert(!csp.computeDirectives().scriptSrc.includes('https://disqus.com')) assert(!csp.computeDirectives().scriptSrc.includes('https://*.disqus.com')) @@ -83,16 +83,16 @@ describe('Content security policies', function () { it('Set ReportURI', function () { const testconfig = defaultConfig testconfig.csp.reportURI = 'https://example.com/reportURI' - mock('../lib/config', testconfig) - csp = mock.reRequire('../lib/csp') + mock('../dist/config', testconfig) + csp = mock.reRequire('../dist/csp') assert.strictEqual(csp.computeDirectives().reportUri, 'https://example.com/reportURI') }) it('Set own directives', function () { const testconfig = defaultConfig - mock('../lib/config', defaultConfig) - csp = mock.reRequire('../lib/csp') + mock('../dist/config', defaultConfig) + csp = mock.reRequire('../dist/csp') const unextendedCSP = csp.computeDirectives() testconfig.csp.directives = { defaultSrc: ['https://default.example.com'], @@ -105,8 +105,8 @@ describe('Content security policies', function () { childSrc: ['https://child.example.com'], connectSrc: ['https://connect.example.com'] } - mock('../lib/config', testconfig) - csp = mock.reRequire('../lib/csp') + mock('../dist/config', testconfig) + csp = mock.reRequire('../dist/csp') const variations = ['default', 'script', 'img', 'style', 'font', 'object', 'media', 'child', 'connect'] diff --git a/test/letter-avatars.js b/test/letter-avatars.js index 24bc5a3a37..823c370aca 100644 --- a/test/letter-avatars.js +++ b/test/letter-avatars.js @@ -14,8 +14,8 @@ describe('generateAvatarURL() gravatar enabled', function () { serverURL: 'http://localhost:3000', port: 3000 } - mock('../lib/config', testconfig) - avatars = mock.reRequire('../lib/letter-avatars') + mock('../dist/config', testconfig) + avatars = mock.reRequire('../dist/letter-avatars') }) it('should return correct urls', function () { @@ -37,8 +37,8 @@ describe('generateAvatarURL() gravatar disabled', function () { serverURL: 'http://localhost:3000', port: 3000 } - mock('../lib/config', testconfig) - avatars = mock.reRequire('../lib/letter-avatars') + mock('../dist/config', testconfig) + avatars = mock.reRequire('../dist/letter-avatars') }) it('should return correct urls', function () { diff --git a/test/realtime/cleanDanglingUser.test.js b/test/realtime/cleanDanglingUser.test.js index 576ee7112f..19df1626a0 100644 --- a/test/realtime/cleanDanglingUser.test.js +++ b/test/realtime/cleanDanglingUser.test.js @@ -10,34 +10,34 @@ describe('cleanDanglingUser', function () { let clock beforeEach(() => { clock = sinon.useFakeTimers() - mock('../../lib/processQueue', require('../testDoubles/ProcessQueueFake')) - mock('../../lib/logger', { + mock('../../dist/processQueue', require('../testDoubles/ProcessQueueFake')) + mock('../../dist/logger', { error: () => {}, info: () => {} }) - mock('../../lib/history', {}) - mock('../../lib/models', { + mock('../../dist/history', {}) + mock('../../dist/models', { Revision: { saveAllNotesRevision: () => { } } }) - mock('../../lib/config', { + mock('../../dist/config', { debug: true }) - mock('../../lib/realtimeUpdateDirtyNoteJob', require('../testDoubles/realtimeJobStub')) - mock('../../lib/realtimeSaveRevisionJob', require('../testDoubles/realtimeJobStub')) + mock('../../dist/realtimeUpdateDirtyNoteJob', require('../testDoubles/realtimeJobStub')) + mock('../../dist/realtimeSaveRevisionJob', require('../testDoubles/realtimeJobStub')) }) afterEach(() => { clock.restore() - removeModuleFromRequireCache('../../lib/realtime/realtime') + removeModuleFromRequireCache('../../dist/realtime/realtime') mock.stopAll() sinon.restore() }) it('should call queueForDisconnectSpy when user is dangling', (done) => { - const realtime = require('../../lib/realtime/realtime') + const realtime = require('../../dist/realtime/realtime') const queueForDisconnectSpy = sinon.spy(realtime, 'queueForDisconnect') realtime.io = { to: sinon.stub().callsFake(function () { diff --git a/test/realtime/connection.test.js b/test/realtime/connection.test.js index bba201cac3..80736e17fd 100644 --- a/test/realtime/connection.test.js +++ b/test/realtime/connection.test.js @@ -23,15 +23,15 @@ describe('realtime#connection', function () { User: {}, Author: {} } - mock('../../lib/logger', createFakeLogger()) - mock('../../lib/history', {}) - mock('../../lib/models', modelStub) - mock('../../lib/config', {}) - mock('../../lib/realtimeUpdateDirtyNoteJob', realtimeJobStub) - mock('../../lib/realtimeCleanDanglingUserJob', realtimeJobStub) - mock('../../lib/realtimeSaveRevisionJob', realtimeJobStub) - mock('../../lib/ot', require('../testDoubles/otFake')) - realtime = require('../../lib/realtime/realtime') + mock('../../dist/logger', createFakeLogger()) + mock('../../dist/history', {}) + mock('../../dist/models', modelStub) + mock('../../dist/config', {}) + mock('../../dist/realtimeUpdateDirtyNoteJob', realtimeJobStub) + mock('../../dist/realtimeCleanDanglingUserJob', realtimeJobStub) + mock('../../dist/realtimeSaveRevisionJob', realtimeJobStub) + mock('../../dist/ot', require('../testDoubles/otFake')) + realtime = require('../../dist/realtime/realtime') }) afterEach(() => { diff --git a/test/realtime/dirtyNoteUpdate.test.js b/test/realtime/dirtyNoteUpdate.test.js index 7da1c7f4a1..31ce7d10db 100644 --- a/test/realtime/dirtyNoteUpdate.test.js +++ b/test/realtime/dirtyNoteUpdate.test.js @@ -15,19 +15,19 @@ describe('realtime#update note is dirty timer', function () { clock = sinon.useFakeTimers({ toFake: ['setInterval'] }) - mock('../../lib/logger', { + mock('../../dist/logger', { error: () => { } }) - mock('../../lib/history', {}) - mock('../../lib/models', { + mock('../../dist/history', {}) + mock('../../dist/models', { Revision: { saveAllNotesRevision: () => { } } }) - mock('../../lib/config', {}) - realtime = require('../../lib/realtime/realtime') + mock('../../dist/config', {}) + realtime = require('../../dist/realtime/realtime') realtime.io = { to: sinon.stub().callsFake(function () { @@ -39,8 +39,8 @@ describe('realtime#update note is dirty timer', function () { }) afterEach(() => { - removeModuleFromRequireCache('../../lib/realtime/realtimeUpdateDirtyNoteJob') - removeModuleFromRequireCache('../../lib/realtime/realtime') + removeModuleFromRequireCache('../../dist/realtime/realtimeUpdateDirtyNoteJob') + removeModuleFromRequireCache('../../dist/realtime/realtime') mock.stopAll() clock.restore() }) diff --git a/test/realtime/disconnect-process.test.js b/test/realtime/disconnect-process.test.js index 8a04d8945b..81e320ddc6 100644 --- a/test/realtime/disconnect-process.test.js +++ b/test/realtime/disconnect-process.test.js @@ -15,20 +15,20 @@ describe('realtime#disconnect', function () { let client beforeEach(() => { - mock('../../lib/logger', { + mock('../../dist/logger', { error: () => { } }) - mock('../../lib/history', {}) - mock('../../lib/models', { + mock('../../dist/history', {}) + mock('../../dist/models', { Revision: { saveAllNotesRevision: () => { } } }) - mock('../../lib/config', {}) + mock('../../dist/config', {}) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') updateNoteStub = sinon.stub(realtime, 'updateNote').callsFake((note, callback) => { callback(null, note) }) @@ -60,7 +60,7 @@ describe('realtime#disconnect', function () { }) afterEach(() => { - removeModuleFromRequireCache('../../lib/realtime/realtime') + removeModuleFromRequireCache('../../dist/realtime/realtime') mock.stopAll() sinon.restore() }) diff --git a/test/realtime/extractNoteIdFromSocket.test.js b/test/realtime/extractNoteIdFromSocket.test.js index 99b2c92712..018d03f663 100644 --- a/test/realtime/extractNoteIdFromSocket.test.js +++ b/test/realtime/extractNoteIdFromSocket.test.js @@ -8,20 +8,20 @@ const { makeMockSocket } = require('./utils') describe('realtime#extractNoteIdFromSocket', function () { beforeEach(() => { - mock('../../lib/logger', {}) - mock('../../lib/history', {}) - mock('../../lib/models', {}) + mock('../../dist/logger', {}) + mock('../../dist/history', {}) + mock('../../dist/models', {}) }) afterEach(() => { - delete require.cache[require.resolve('../../lib/realtime/realtime')] + delete require.cache[require.resolve('../../dist/realtime/realtime')] mock.stopAll() }) describe('urlPath not set', function () { beforeEach(() => { - mock('../../lib/config', {}) - realtime = require('../../lib/realtime/realtime') + mock('../../dist/config', {}) + realtime = require('../../dist/realtime/realtime') }) let realtime @@ -73,10 +73,10 @@ describe('realtime#extractNoteIdFromSocket', function () { it('return noteId from old method (referer) and urlPath set', function () { // Arrange const urlPath = 'hello' - mock('../../lib/config', { + mock('../../dist/config', { urlPath: urlPath }) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') const incomingNoteId = 'myNoteId' const incomingSocket = makeMockSocket({ referer: `https://localhost:3000/${urlPath}/${incomingNoteId}` diff --git a/test/realtime/ifMayEdit.test.js b/test/realtime/ifMayEdit.test.js index 957a0e6513..1ab56543ae 100644 --- a/test/realtime/ifMayEdit.test.js +++ b/test/realtime/ifMayEdit.test.js @@ -13,12 +13,12 @@ describe('realtime#ifMayEdit', function () { let modelsStub beforeEach(() => { removeLibModuleCache() - mock('../../lib/config', {}) - mock('../../lib/logger', createFakeLogger()) - mock('../../lib/models', modelsStub) - mock('../../lib/realtimeUpdateDirtyNoteJob', realtimeJobStub) - mock('../../lib/realtimeCleanDanglingUserJob', realtimeJobStub) - mock('../../lib/realtimeSaveRevisionJob', realtimeJobStub) + mock('../../dist/config', {}) + mock('../../dist/logger', createFakeLogger()) + mock('../../dist/models', modelsStub) + mock('../../dist/realtimeUpdateDirtyNoteJob', realtimeJobStub) + mock('../../dist/realtimeCleanDanglingUserJob', realtimeJobStub) + mock('../../dist/realtimeSaveRevisionJob', realtimeJobStub) }) afterEach(() => { @@ -81,7 +81,7 @@ describe('realtime#ifMayEdit', function () { client.request.user.id = noteOwnerId } client.noteId = noteId - const realtime = require('../../lib/realtime/realtime') + const realtime = require('../../dist/realtime/realtime') realtime.getNotePool()[noteId] = note const callback = sinon.stub() realtime.ifMayEdit(client, callback) @@ -98,7 +98,7 @@ describe('realtime#ifMayEdit', function () { client.noteId = noteId const callback = sinon.stub() client.origin = 'operation' - const realtime = require('../../lib/realtime/realtime') + const realtime = require('../../dist/realtime/realtime') realtime.getNotePool()[noteId] = note realtime.ifMayEdit(client, callback) assert(callback.calledOnce) @@ -116,7 +116,7 @@ describe('realtime#ifMayEdit', function () { client.request.user.id = loggedInUserId const callback = sinon.stub() client.origin = 'operation' - const realtime = require('../../lib/realtime/realtime') + const realtime = require('../../dist/realtime/realtime') realtime.getNotePool()[noteId] = note realtime.ifMayEdit(client, callback) assert(callback.calledOnce) diff --git a/test/realtime/parseNoteIdFromSocket.test.js b/test/realtime/parseNoteIdFromSocket.test.js index 6ed7b1292d..99861b1221 100644 --- a/test/realtime/parseNoteIdFromSocket.test.js +++ b/test/realtime/parseNoteIdFromSocket.test.js @@ -10,25 +10,25 @@ describe('realtime#parseNoteIdFromSocketAsync', function () { let realtime beforeEach(() => { - mock('../../lib/logger', {}) - mock('../../lib/history', {}) - mock('../../lib/models', { + mock('../../dist/logger', {}) + mock('../../dist/history', {}) + mock('../../dist/models', { Note: { parseNoteId: function (noteId, callback) { callback(null, noteId) } } }) - mock('../../lib/config', {}) + mock('../../dist/config', {}) }) afterEach(() => { - removeModuleFromRequireCache('../../lib/realtime/realtime') + removeModuleFromRequireCache('../../dist/realtime/realtime') mock.stopAll() }) it('should return null when socket not send noteId', async function () { - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') const mockSocket = makeMockSocket() try { const notes = await realtime.parseNoteIdFromSocketAsync(mockSocket) @@ -40,7 +40,7 @@ describe('realtime#parseNoteIdFromSocketAsync', function () { describe('noteId exists', function () { beforeEach(() => { - mock('../../lib/models', { + mock('../../dist/models', { Note: { parseNoteId: function (noteId, callback) { callback(null, noteId) @@ -49,12 +49,12 @@ describe('realtime#parseNoteIdFromSocketAsync', function () { }) }) it('should return noteId when noteId exists', async function () { - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') const noteId = '123456' const mockSocket = makeMockSocket(undefined, { noteId: noteId }) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') let parsedNoteId try { parsedNoteId = await realtime.parseNoteIdFromSocketAsync(mockSocket) @@ -67,7 +67,7 @@ describe('realtime#parseNoteIdFromSocketAsync', function () { describe('noteId not exists', function () { beforeEach(() => { - mock('../../lib/models', { + mock('../../dist/models', { Note: { parseNoteId: function (noteId, callback) { callback(null, null) @@ -76,12 +76,12 @@ describe('realtime#parseNoteIdFromSocketAsync', function () { }) }) it('should return null when noteId not exists', async function () { - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') const noteId = '123456' const mockSocket = makeMockSocket(undefined, { noteId: noteId }) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') const parsedNoteId = await realtime.parseNoteIdFromSocketAsync(mockSocket) assert(parsedNoteId === null) }) @@ -89,7 +89,7 @@ describe('realtime#parseNoteIdFromSocketAsync', function () { describe('parse note error', function () { beforeEach(() => { - mock('../../lib/models', { + mock('../../dist/models', { Note: { parseNoteId: function (noteId, callback) { /* eslint-disable-next-line */ @@ -99,12 +99,12 @@ describe('realtime#parseNoteIdFromSocketAsync', function () { }) }) it('should return error when noteId parse error', async function () { - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') const noteId = '123456' const mockSocket = makeMockSocket(undefined, { noteId: noteId }) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') try { await realtime.parseNoteIdFromSocketAsync(mockSocket) } catch (err) { diff --git a/test/realtime/realtime.test.js b/test/realtime/realtime.test.js index b4c713b469..94503bfce8 100644 --- a/test/realtime/realtime.test.js +++ b/test/realtime/realtime.test.js @@ -39,18 +39,18 @@ describe('realtime', function () { let realtime beforeEach(() => { - mock('../../lib/logger', { + mock('../../dist/logger', { error: () => { } }) - mock('../../lib/history', {}) - mock('../../lib/models', { + mock('../../dist/history', {}) + mock('../../dist/models', { Note: { parseNoteTitle: (data) => (data) } }) - mock('../../lib/config', {}) - realtime = require('../../lib/realtime/realtime') + mock('../../dist/config', {}) + realtime = require('../../dist/realtime/realtime') }) Object.keys(viewPermission).forEach(function (permission) { diff --git a/test/realtime/saveRevisionJob.test.js b/test/realtime/saveRevisionJob.test.js index 0a5bab0b16..6e712eeb8b 100644 --- a/test/realtime/saveRevisionJob.test.js +++ b/test/realtime/saveRevisionJob.test.js @@ -18,24 +18,24 @@ describe('save revision job', function () { } } clock = sinon.useFakeTimers() - mock('../../lib/processQueue', require('../testDoubles/ProcessQueueFake')) - mock('../../lib/logger', { + mock('../../dist/processQueue', require('../testDoubles/ProcessQueueFake')) + mock('../../dist/logger', { error: () => {}, info: () => {} }) - mock('../../lib/history', {}) - mock('../../lib/models', mockModels) - mock('../../lib/config', { + mock('../../dist/history', {}) + mock('../../dist/models', mockModels) + mock('../../dist/config', { debug: true }) - mock('../../lib/realtimeUpdateDirtyNoteJob', require('../testDoubles/realtimeJobStub')) - mock('../../lib/realtimeCleanDanglingUserJob', require('../testDoubles/realtimeJobStub')) + mock('../../dist/realtimeUpdateDirtyNoteJob', require('../testDoubles/realtimeJobStub')) + mock('../../dist/realtimeCleanDanglingUserJob', require('../testDoubles/realtimeJobStub')) }) afterEach(() => { clock.restore() - removeModuleFromRequireCache('../../lib/realtime/realtime') - removeModuleFromRequireCache('../../lib/realtime/realtimeSaveRevisionJob') + removeModuleFromRequireCache('../../dist/realtime/realtime') + removeModuleFromRequireCache('../../dist/realtime/realtimeSaveRevisionJob') mock.stopAll() sinon.restore() }) @@ -44,7 +44,7 @@ describe('save revision job', function () { mockModels.Revision.saveAllNotesRevision.callsFake((callback) => { callback(null, []) }) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') clock.tick(5 * 60 * 1000) clock.restore() setTimeout(() => { @@ -58,7 +58,7 @@ describe('save revision job', function () { mockModels.Revision.saveAllNotesRevision.callsFake((callback) => { callback(null, [1]) }) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') clock.tick(5 * 60 * 1000) clock.restore() setTimeout(() => { diff --git a/test/realtime/socket-events.test.js b/test/realtime/socket-events.test.js index 4c577c60e4..b4743a910d 100644 --- a/test/realtime/socket-events.test.js +++ b/test/realtime/socket-events.test.js @@ -66,17 +66,17 @@ describe('realtime#socket event', function () { private: 'private' } } - mock('../../lib/logger', { + mock('../../dist/logger', { error: () => { }, info: () => { } }) - mock('../../lib/history', {}) - mock('../../lib/models', modelsMock) - mock('../../lib/config', configMock) - mock('../../lib/ot', require('../testDoubles/otFake')) - realtime = require('../../lib/realtime/realtime') + mock('../../dist/history', {}) + mock('../../dist/models', modelsMock) + mock('../../dist/config', configMock) + mock('ot', require('../testDoubles/otFake')) + realtime = require('../../dist/realtime/realtime') // get all socket event handler clientSocket = makeMockSocket(null, { @@ -122,8 +122,8 @@ describe('realtime#socket event', function () { }) afterEach(function () { - removeModuleFromRequireCache('../../lib/realtime/realtime') - removeModuleFromRequireCache('../../lib/realtime/realtimeClientConnection') + removeModuleFromRequireCache('../../dist/realtime/realtime') + removeModuleFromRequireCache('../../dist/realtime/realtimeClientConnection') mock.stopAll() sinon.restore() clock.restore() diff --git a/test/realtime/updateNote.test.js b/test/realtime/updateNote.test.js index 95b3721e3d..f125e74fd6 100644 --- a/test/realtime/updateNote.test.js +++ b/test/realtime/updateNote.test.js @@ -30,12 +30,12 @@ describe('realtime#updateNote', function () { } } - mock('../../lib/config', {}) - mock('../../lib/logger', createFakeLogger()) - mock('../../lib/models', modelsStub) - mock('../../lib/realtimeUpdateDirtyNoteJob', realtimeJobStub) - mock('../../lib/realtimeCleanDanglingUserJob', realtimeJobStub) - // mock('../../lib/realtimeSaveRevisionJob', realtimeJobStub) + mock('../../dist/config', {}) + mock('../../dist/logger', createFakeLogger()) + mock('../../dist/models', modelsStub) + mock('../../dist/realtimeUpdateDirtyNoteJob', realtimeJobStub) + mock('../../dist/realtimeCleanDanglingUserJob', realtimeJobStub) + // mock('../../dist/realtimeSaveRevisionJob', realtimeJobStub) }) afterEach(() => { @@ -47,7 +47,7 @@ describe('realtime#updateNote', function () { it('should save history to each edited user', function (done) { modelsStub.Note.findOne.returns(Promise.resolve({})) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') const updateHistoryStub = sinon.stub(realtime, 'updateHistory') const callback = sinon.stub() @@ -86,7 +86,7 @@ describe('realtime#updateNote', function () { name: 'User 01' }) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') realtime.updateNote(note, callback) clock.restore() @@ -125,7 +125,7 @@ describe('realtime#updateNote', function () { }) clock.tick(1000) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') realtime.updateNote(note, callback) setTimeout(() => { assert(note.lastchangeuserprofile.name === 'User 01') @@ -159,7 +159,7 @@ describe('realtime#updateNote', function () { }) clock.tick(1000) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') realtime.updateNote(note, callback) setTimeout(() => { assert(modelsStub.User.findOne.callCount === 0) @@ -196,7 +196,7 @@ describe('realtime#updateNote', function () { }) clock.tick(1000) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') realtime.updateNote(note, callback) setTimeout(() => { assert(modelsStub.User.findOne.callCount === 0) @@ -233,7 +233,7 @@ describe('realtime#updateNote', function () { }) clock.tick(1000) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') realtime.updateNote(note, callback) setTimeout(() => { assert(modelsStub.User.findOne.called) @@ -272,7 +272,7 @@ describe('realtime#updateNote', function () { }) clock.tick(1000) - realtime = require('../../lib/realtime/realtime') + realtime = require('../../dist/realtime/realtime') realtime.updateNote(note, callback) setTimeout(() => { assert(note.lastchangeuserprofile.name === 'User 01') diff --git a/test/realtime/utils.js b/test/realtime/utils.js index 93ab2f152c..461ab2d207 100644 --- a/test/realtime/utils.js +++ b/test/realtime/utils.js @@ -38,8 +38,9 @@ function makeMockSocket (headers, query) { function removeModuleFromRequireCache (modulePath) { delete require.cache[require.resolve(modulePath)] } + function removeLibModuleCache () { - const libPath = path.resolve(path.join(__dirname, '../../lib')) + const libPath = path.resolve(path.join(__dirname, '../../dist')) Object.keys(require.cache).forEach(key => { if (key.startsWith(libPath)) { delete require.cache[require.resolve(key)] From 725ba147d3f308ae5bc7f5c60b562768a081421e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 09:28:15 +0800 Subject: [PATCH 091/167] enable noImplicitReturns Signed-off-by: Raccoon --- lib/models/revision.ts | 3 ++- lib/realtime/realtime.ts | 9 ++++++--- lib/realtime/realtimeCleanDanglingUserJob.ts | 4 +++- lib/realtime/realtimeSaveRevisionJob.ts | 4 +++- lib/workers/dmpWorker.ts | 17 ++++++++++++----- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/models/revision.ts b/lib/models/revision.ts index 3550666e50..fa49c85191 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -23,7 +23,8 @@ function createDmpWorker() { if (config.debug) logger.info('dmp worker process started') worker.on('message', function (data) { if (!data || !data.msg || !data.cacheKey) { - return logger.error('dmp worker error: not enough data on message') + logger.error('dmp worker error: not enough data on message') + return } var cacheKey = data.cacheKey switch (data.msg) { diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index e3b3f815d6..dfc613fd18 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -533,7 +533,10 @@ export function queueForDisconnect(socket) { if (Object.keys(note.users).length === 0) { if (note.server.isDirty) { exports.updateNote(note, function (err, _note) { - if (err) return logger.error('disconnect note failed: ' + err) + if (err) { + logger.error('disconnect note failed: ' + err) + return + } // clear server before delete to avoid memory leaks note.server.document = '' note.server.operations = [] @@ -657,7 +660,7 @@ function operationCallback(socket, operation) { } // TODO: test it -export function updateHistory(userId, note, time) { +export function updateHistory(userId, note, time?: any) { var noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) if (note.server) history.updateHistory(userId, noteId, note.server.document, time) } @@ -687,7 +690,7 @@ function getUniqueColorPerNote(noteId, maxAttempt = 10) { function queueForConnect(socket) { connectProcessQueue.push(socket.id, async function () { try { - const noteId = await exports.parseNoteIdFromSocketAsync(socket) + const noteId = await exports.parseNoteIdFromSocketAsync(socket) as string if (!noteId) { return exports.failConnection(404, 'note id not found', socket) } diff --git a/lib/realtime/realtimeCleanDanglingUserJob.ts b/lib/realtime/realtimeCleanDanglingUserJob.ts index 1a75f6c2c2..da2bbf2d65 100644 --- a/lib/realtime/realtimeCleanDanglingUserJob.ts +++ b/lib/realtime/realtimeCleanDanglingUserJob.ts @@ -45,7 +45,9 @@ export class CleanDanglingUserJob { } return callback(null, null) }, function (err) { - if (err) return logger.error('cleaner error', err) + if (err) { + logger.error('cleaner error', err) + } }) } } diff --git a/lib/realtime/realtimeSaveRevisionJob.ts b/lib/realtime/realtimeSaveRevisionJob.ts index 1803885161..723e963dff 100644 --- a/lib/realtime/realtimeSaveRevisionJob.ts +++ b/lib/realtime/realtimeSaveRevisionJob.ts @@ -30,7 +30,9 @@ export class SaveRevisionJob { saveRevision() { if (this.getSaverSleep()) return models.Revision.saveAllNotesRevision((err, notes) => { - if (err) return logger.error('revision saver failed: ' + err) + if (err) { + logger.error('revision saver failed: ' + err) + } if (notes && notes.length <= 0) { this.setSaverSleep(true) } diff --git a/lib/workers/dmpWorker.ts b/lib/workers/dmpWorker.ts index 459b1835dd..4254982d3b 100644 --- a/lib/workers/dmpWorker.ts +++ b/lib/workers/dmpWorker.ts @@ -8,12 +8,14 @@ import * as logger from "../logger"; var dmp = new DiffMatchPatch() process.on('message', function (data) { if (!data || !data.msg || !data.cacheKey) { - return logger.error('dmp worker error: not enough data') + logger.error('dmp worker error: not enough data') + return null } switch (data.msg) { case 'create patch': if (!Object.hasOwnProperty.call(data, 'lastDoc') || !Object.hasOwnProperty.call(data, 'currDoc')) { - return logger.error('dmp worker error: not enough data on create patch') + logger.error('dmp worker error: not enough data on create patch') + return null } try { var patch = createPatch(data.lastDoc, data.currDoc) @@ -52,9 +54,10 @@ process.on('message', function (data) { } break } + return null }) -function createPatch (lastDoc, currDoc) { +function createPatch(lastDoc, currDoc) { var msStart = (new Date()).getTime() var diff = dmp.diff_main(lastDoc, currDoc) var patch = dmp.patch_make(lastDoc, diff) @@ -67,7 +70,7 @@ function createPatch (lastDoc, currDoc) { return patch } -function getRevision (revisions, count) { +function getRevision(revisions, count) { var msStart = (new Date()).getTime() var startContent = null var lastPatch = [] @@ -91,7 +94,11 @@ function getRevision (revisions, count) { for (let i = 0, l = applyPatches.length; i < l; i++) { for (let j = 0, m = applyPatches[i].diffs.length; j < m; j++) { var diff = applyPatches[i].diffs[j] - if (diff[0] === DiffMatchPatch.DIFF_INSERT) { diff[0] = DiffMatchPatch.DIFF_DELETE } else if (diff[0] === DiffMatchPatch.DIFF_DELETE) { diff[0] = DiffMatchPatch.DIFF_INSERT } + if (diff[0] === DiffMatchPatch.DIFF_INSERT) { + diff[0] = DiffMatchPatch.DIFF_DELETE + } else if (diff[0] === DiffMatchPatch.DIFF_DELETE) { + diff[0] = DiffMatchPatch.DIFF_INSERT + } } } } else { From 4d2579f11448667f988aef480aea3d7ad41202fc Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 09:39:53 +0800 Subject: [PATCH 092/167] add lint Signed-off-by: Raccoon --- lib/.eslintrc.json | 11 + package-lock.json | 1283 ++++++++++++++++++++++++++++++++++++++++---- package.json | 5 +- 3 files changed, 1193 insertions(+), 106 deletions(-) create mode 100644 lib/.eslintrc.json diff --git a/lib/.eslintrc.json b/lib/.eslintrc.json new file mode 100644 index 0000000000..1271afd45e --- /dev/null +++ b/lib/.eslintrc.json @@ -0,0 +1,11 @@ +{ + "root": false, + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ] +} diff --git a/package-lock.json b/package-lock.json index f29de14962..15408581c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -654,6 +654,12 @@ } } }, + "@babel/helper-validator-identifier": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", + "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "dev": true + }, "@babel/highlight": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", @@ -785,6 +791,83 @@ "integrity": "sha512-GcIY79elgB+azP74j8vqkiXz8xLFfIzbQJdlwOPisgbKT00tviJQuEghOXSMVxJ00HoYJbGswr4kcllUc4xCcg==", "dev": true }, + "@eslint/eslintrc": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "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" + } + }, + "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" + } + }, + "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 + }, + "globals": { + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "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 + }, + "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" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, "@hackmd/codemirror": { "version": "5.57.7", "resolved": "https://registry.npmjs.org/@hackmd/codemirror/-/codemirror-5.57.7.tgz", @@ -876,6 +959,32 @@ "tar": "^5.0.5" } }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", + "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, "@passport-next/passport-openid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@passport-next/passport-openid/-/passport-openid-1.0.0.tgz", @@ -1323,6 +1432,12 @@ "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz", "integrity": "sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ==" }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, "@types/keygrip": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz", @@ -1441,6 +1556,254 @@ "@types/node": "*" } }, + "@typescript-eslint/eslint-plugin": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.1.tgz", + "integrity": "sha512-aoIusj/8CR+xDWmZxARivZjbMBQTT9dImUtdZ8tVCVRXgBUuuZyM5Of5A9D9arQPxbi/0rlJLcuArclz/rCMJw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.26.1", + "@typescript-eslint/scope-manager": "4.26.1", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.21", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "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.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "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" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.1.tgz", + "integrity": "sha512-sQHBugRhrXzRCs9PaGg6rowie4i8s/iD/DpTB+EXte8OMDfdCG5TvO73XlO9Wc/zi0uyN4qOmX9hIjQEyhnbmQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.26.1", + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/typescript-estree": "4.26.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "@typescript-eslint/parser": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.26.1.tgz", + "integrity": "sha512-q7F3zSo/nU6YJpPJvQveVlIIzx9/wu75lr6oDbDzoeIRWxpoc/HQ43G4rmMoCc5my/3uSj2VEpg/D83LYZF5HQ==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.26.1", + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/typescript-estree": "4.26.1", + "debug": "^4.3.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" + } + } + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.26.1.tgz", + "integrity": "sha512-TW1X2p62FQ8Rlne+WEShyd7ac2LA6o27S9i131W4NwDSfyeVlQWhw8ylldNNS8JG6oJB9Ha9Xyc+IUcqipvheQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/visitor-keys": "4.26.1" + } + }, + "@typescript-eslint/types": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.26.1.tgz", + "integrity": "sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.1.tgz", + "integrity": "sha512-l3ZXob+h0NQzz80lBGaykdScYaiEbFqznEs99uwzm8fPHhDjwaBFfQkjUC/slw6Sm7npFL8qrGEAMxcfBsBJUg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/visitor-keys": "4.26.1", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "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" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "globby": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "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" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.1.tgz", + "integrity": "sha512-IGouNSSd+6x/fHtYRyLOM6/C+QxMDzWlDtN41ea+flWuSF9g02iqcIlX8wM53JkfljoIjP0U+yp7SiTS1onEkw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.26.1", + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -1678,9 +2041,9 @@ } }, "acorn-jsx": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", - "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", + "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 }, "acorn-walk": { @@ -1811,6 +2174,12 @@ "emoji-regex": "~6.1.0" } }, + "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-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -2090,9 +2459,9 @@ "dev": true }, "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, "async": { @@ -3831,9 +4200,9 @@ } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "clipboard": { @@ -5823,6 +6192,15 @@ } } }, + "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" + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -6062,68 +6440,221 @@ } }, "eslint": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.1.0.tgz", - "integrity": "sha512-QhrbdRD7ofuV09IuE2ySWBz0FyXCq0rriLTZXZqaWSI79CVtHVRdkFuFTViiqzZhkCgfOh9USpriuGN2gIpZDQ==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.2", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^6.0.0", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^11.7.0", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.4.1", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { - "debug": { + "@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/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "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" + } + }, + "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 + } + } + }, + "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 + }, + "chalk": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", "dev": true, "requires": { - "ms": "^2.1.1" + "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" + } + }, + "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" + } + } + } + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "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.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "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 + }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, + "globals": { + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -6131,19 +6662,136 @@ "dev": true }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "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" } }, + "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" + } + }, + "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" + } + }, + "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" + } + }, + "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 + }, + "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 + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "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" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } } @@ -6391,13 +7039,32 @@ "dev": true }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "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.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" + }, + "dependencies": { + "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 + } + } + } } }, "eslint-utils": { @@ -6501,20 +7168,26 @@ } }, "espree": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", - "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "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.1.0", - "acorn-jsx": "^5.1.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" }, "dependencies": { "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "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 } } @@ -6534,12 +7207,20 @@ } }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "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": { @@ -6920,6 +7601,74 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "fast-json-patch": { "version": "3.0.0-1", "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.0.0-1.tgz", @@ -6948,6 +7697,15 @@ "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", "dev": true }, + "fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fault": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/fault/-/fault-1.0.4.tgz", @@ -6991,12 +7749,12 @@ } }, "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "requires": { - "flat-cache": "^2.0.1" + "flat-cache": "^3.0.4" } }, "file-loader": { @@ -7102,20 +7860,30 @@ } }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "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": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", "dev": true }, "flowchart.js": { @@ -9890,6 +10658,12 @@ "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=" }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, "lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", @@ -9985,6 +10759,12 @@ "lodash._reinterpolate": "^3.0.0" } }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, "lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", @@ -10481,6 +11261,12 @@ "source-map": "^0.6.1" } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, "mermaid": { "version": "8.6.4", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.6.4.tgz", @@ -12315,6 +13101,12 @@ } } }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", @@ -14083,6 +14875,12 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "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 + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -14185,6 +14983,12 @@ "any-promise": "^1.3.0" } }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "reveal.js": { "version": "3.9.2", "resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-3.9.2.tgz", @@ -14223,13 +15027,10 @@ } }, "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true }, "run-parallel": { "version": "1.1.9", @@ -14253,9 +15054,9 @@ "dev": true }, "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -14642,14 +15443,46 @@ "dev": true }, "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "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": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "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 + } } }, "slugify": { @@ -15052,6 +15885,165 @@ "eslint-plugin-react": "~7.14.2", "eslint-plugin-standard": "~4.0.0", "standard-engine": "~11.0.1" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "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" + } + }, + "eslint": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.1.0.tgz", + "integrity": "sha512-QhrbdRD7ofuV09IuE2ySWBz0FyXCq0rriLTZXZqaWSI79CVtHVRdkFuFTViiqzZhkCgfOh9USpriuGN2gIpZDQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^6.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.4.1", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "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 + }, + "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" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + } } }, "standard-engine": { @@ -15279,9 +16271,9 @@ "dev": true }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "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 }, "structured-source": { @@ -15411,15 +16403,81 @@ "dev": true }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", "dev": true, "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ajv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", + "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 + }, + "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 + }, + "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 + }, + "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 + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "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" + } + } } }, "tapable": { @@ -15925,6 +16983,15 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -16417,9 +17484,9 @@ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, "validate-npm-package-license": { @@ -17701,6 +18768,12 @@ "@types/node": "*" } }, + "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": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", diff --git a/package.json b/package.json index 79fda31b1d..7a39b83829 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "webpack --config webpack.prod.js --display errors-only -p", "dev": "webpack --config webpack.dev.js --progress --colors --watch", "doctoc": "doctoc --title='# Table of Contents' README.md", - "lint": "standard", + "lint": "standard && eslint lib/**", "jsonlint": "find . -type f -not -ipath \"./node_modules/*\" -not -ipath \"./.vscode/*\" \\( -name \"*.json\" -o -name \"*.json.*\" \\) | xargs -n 1 -I{} -- bash -c 'echo {}; jq . {} > /dev/null;'", "start": "sequelize db:migrate && node app.js", "mocha": "mocha --require intelli-espower-loader --exit ./test --recursive", @@ -117,6 +117,8 @@ "@types/node": "~12.20.15", "@types/passport-google-oauth20": "^2.0.8", "@types/qs": "^6.9.6", + "@typescript-eslint/eslint-plugin": "^4.26.1", + "@typescript-eslint/parser": "^4.26.1", "acorn": "~6.1.1", "babel-core": "~6.26.3", "babel-loader": "~7.1.4", @@ -133,6 +135,7 @@ "dictionary-en-gb": "^2.2.2", "doctoc": "~1.4.0", "ejs-loader": "~0.3.1", + "eslint": "^7.28.0", "exports-loader": "~0.7.0", "expose-loader": "~0.7.5", "file-loader": "~2.0.0", From 48b783734891dd10fd461ff6339a9e8c968818f7 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 09:41:45 +0800 Subject: [PATCH 093/167] fix: incorrect logic Signed-off-by: Raccoon --- lib/migrations/20160607060246-support-revision.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/migrations/20160607060246-support-revision.ts b/lib/migrations/20160607060246-support-revision.ts index c61032353a..3dda6a6fb2 100644 --- a/lib/migrations/20160607060246-support-revision.ts +++ b/lib/migrations/20160607060246-support-revision.ts @@ -15,8 +15,7 @@ export = { updatedAt: Sequelize.DATE }) }).catch(function (error) { - // @ts-ignore - if (error.message === 'SQLITE_ERROR: duplicate column name: savedAt' | error.message === "ER_DUP_FIELDNAME: Duplicate column name 'savedAt'" || error.message === 'column "savedAt" of relation "Notes" already exists') { + if (error.message === 'SQLITE_ERROR: duplicate column name: savedAt' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'savedAt'" || error.message === 'column "savedAt" of relation "Notes" already exists') { console.log('Migration has already run… ignoring.') } else { throw error From 5128815543569090b89afa22d5e91a322b410c6f Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 10:08:49 +0800 Subject: [PATCH 094/167] fix all eslint error Signed-off-by: Raccoon --- lib/auth/index.ts | 14 +++++++ lib/auth/ldap/index.ts | 10 ++--- lib/auth/openid/index.ts | 4 +- lib/auth/saml/index.ts | 10 ++--- lib/auth/utils.ts | 12 +++--- lib/config/index.ts | 10 ++++- lib/config/utils.ts | 2 +- lib/csp.ts | 26 ++++++------- lib/history/index.ts | 23 ++++++------ lib/homepage/index.ts | 1 + lib/imageRouter/azure.ts | 2 +- lib/imageRouter/index.ts | 7 ++-- lib/logger.ts | 2 +- lib/metrics.ts | 3 +- lib/models/author.ts | 2 +- lib/models/index.ts | 8 ++-- lib/models/note.ts | 70 +++++++++++++++++------------------ lib/models/revision.ts | 34 ++++++++--------- lib/models/user.ts | 7 ++-- lib/note/index.ts | 1 + lib/note/noteActions.ts | 1 + lib/realtime/realtime.ts | 57 ++++++++++++++-------------- lib/response.ts | 80 ++++++++++++++++++++-------------------- lib/routes.ts | 2 + lib/workers/dmpWorker.ts | 37 ++++++++++--------- package-lock.json | 6 +++ package.json | 1 + 27 files changed, 235 insertions(+), 197 deletions(-) diff --git a/lib/auth/index.ts b/lib/auth/index.ts index 6280a90d47..abbb19ddf3 100644 --- a/lib/auth/index.ts +++ b/lib/auth/index.ts @@ -22,6 +22,7 @@ passport.deserializeUser(function (id, done) { }).then(function (user) { // Don't die on non-existent user if (user == null) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore return done(null, false, {message: 'Invalid UserID'}) } @@ -34,18 +35,31 @@ passport.deserializeUser(function (id, done) { }) }) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isFacebookEnable) authRouter.use(require('./facebook')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isTwitterEnable) authRouter.use(require('./twitter')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isGitHubEnable) authRouter.use(require('./github')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isBitbucketEnable) authRouter.use(require('./bitbucket')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isGitLabEnable) authRouter.use(require('./gitlab')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isMattermostEnable) authRouter.use(require('./mattermost')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isDropboxEnable) authRouter.use(require('./dropbox')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isGoogleEnable) authRouter.use(require('./google')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isLDAPEnable) authRouter.use(require('./ldap')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isSAMLEnable) authRouter.use(require('./saml')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isOAuth2Enable) authRouter.use(require('./oauth2')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isEmailEnable) authRouter.use(require('./email')) +// eslint-disable-next-line @typescript-eslint/no-var-requires if (config.isOpenIDEnable) authRouter.use(require('./openid')) // logout diff --git a/lib/auth/ldap/index.ts b/lib/auth/ldap/index.ts index 60b29d1a59..ad01716a9c 100644 --- a/lib/auth/ldap/index.ts +++ b/lib/auth/ldap/index.ts @@ -23,7 +23,7 @@ passport.use(new LDAPStrategy({ tlsOptions: config.ldap.tlsOptions || null } }, function (user, done) { - var uuid = user.uidNumber || user.uid || user.sAMAccountName || undefined + let uuid = user.uidNumber || user.uid || user.sAMAccountName || undefined if (config.ldap.useridField && user[config.ldap.useridField]) { uuid = user[config.ldap.useridField] } @@ -35,12 +35,12 @@ passport.use(new LDAPStrategy({ '"useridField" option in ldap settings.') } - var username = uuid + let username = uuid if (config.ldap.usernameField && user[config.ldap.usernameField]) { username = user[config.ldap.usernameField] } - var profile = { + const profile = { id: 'LDAP-' + uuid, username: username, displayName: user.displayName, @@ -49,7 +49,7 @@ passport.use(new LDAPStrategy({ profileUrl: null, provider: 'ldap' } - var stringifiedProfile = JSON.stringify(profile) + const stringifiedProfile = JSON.stringify(profile) models.User.findOrCreate({ where: { profileid: profile.id.toString() @@ -59,7 +59,7 @@ passport.use(new LDAPStrategy({ } }).spread(function (user, created) { if (user) { - var needSave = false + let needSave = false if (user.profile !== stringifiedProfile) { user.profile = stringifiedProfile needSave = true diff --git a/lib/auth/openid/index.ts b/lib/auth/openid/index.ts index e3ba293039..57164ec08d 100644 --- a/lib/auth/openid/index.ts +++ b/lib/auth/openid/index.ts @@ -16,7 +16,7 @@ passport.use(new OpenIDStrategy({ realm: config.serverURL, profile: true }, function (openid, profile, done) { - var stringifiedProfile = JSON.stringify(profile) + const stringifiedProfile = JSON.stringify(profile) models.User.findOrCreate({ where: { profileid: openid @@ -26,7 +26,7 @@ passport.use(new OpenIDStrategy({ } }).spread(function (user, created) { if (user) { - var needSave = false + let needSave = false if (user.profile !== stringifiedProfile) { user.profile = stringifiedProfile needSave = true diff --git a/lib/auth/saml/index.ts b/lib/auth/saml/index.ts index 60a80e84b1..171f5e736f 100644 --- a/lib/auth/saml/index.ts +++ b/lib/auth/saml/index.ts @@ -25,7 +25,7 @@ passport.use(new SamlStrategy({ }, function (user, done) { // check authorization if needed if (config.saml.externalGroups && config.saml.groupAttribute) { - var externalGroups = intersection(config.saml.externalGroups, user[config.saml.groupAttribute]) + const externalGroups = intersection(config.saml.externalGroups, user[config.saml.groupAttribute]) if (externalGroups.length > 0) { logger.error('saml permission denied: ' + externalGroups.join(', ')) return done('Permission denied', null) @@ -38,8 +38,8 @@ passport.use(new SamlStrategy({ } } // user creation - var uuid = user[config.saml.attribute.id] || user.nameID - var profile = { + const uuid = user[config.saml.attribute.id] || user.nameID + const profile = { provider: 'saml', id: 'SAML-' + uuid, username: user[config.saml.attribute.username] || user.nameID, @@ -48,7 +48,7 @@ passport.use(new SamlStrategy({ if (profile.emails.length === 0 && config.saml.identifierFormat === 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress') { profile.emails.push(user.nameID) } - var stringifiedProfile = JSON.stringify(profile) + const stringifiedProfile = JSON.stringify(profile) models.User.findOrCreate({ where: { profileid: profile.id.toString() @@ -58,7 +58,7 @@ passport.use(new SamlStrategy({ } }).spread(function (user, created) { if (user) { - var needSave = false + let needSave = false if (user.profile !== stringifiedProfile) { user.profile = stringifiedProfile needSave = true diff --git a/lib/auth/utils.ts b/lib/auth/utils.ts index 3d65fe5a5f..162b4aff8f 100644 --- a/lib/auth/utils.ts +++ b/lib/auth/utils.ts @@ -7,11 +7,11 @@ import * as logger from "../logger"; export function setReturnToFromReferer(req) { if (!req.session) req.session = {} - var referer = req.get('referer') - var nextURL + const referer = req.get('referer') + let nextURL if (referer) { try { - var refererSearchParams = new URLSearchParams(new URL(referer).search) + const refererSearchParams = new URLSearchParams(new URL(referer).search) nextURL = refererSearchParams.get('next') } catch (err) { logger.warn(err) @@ -19,7 +19,7 @@ export function setReturnToFromReferer(req) { } if (nextURL) { - var isRelativeNextURL = nextURL.indexOf('://') === -1 && !nextURL.startsWith('//') + const isRelativeNextURL = nextURL.indexOf('://') === -1 && !nextURL.startsWith('//') if (isRelativeNextURL) { req.session.returnTo = (new URL(nextURL, config.serverURL)).toString() } else { @@ -31,7 +31,7 @@ export function setReturnToFromReferer(req) { } export function passportGeneralCallback(accessToken, refreshToken, profile, done) { - var stringifiedProfile = JSON.stringify(profile) + const stringifiedProfile = JSON.stringify(profile) models.User.findOrCreate({ where: { profileid: profile.id.toString() @@ -43,7 +43,7 @@ export function passportGeneralCallback(accessToken, refreshToken, profile, done } }).spread(function (user, created) { if (user) { - var needSave = false + let needSave = false if (user.profile !== stringifiedProfile) { user.profile = stringifiedProfile needSave = true diff --git a/lib/config/index.ts b/lib/config/index.ts index d79eedf9e3..c12533b8a8 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -15,6 +15,7 @@ const debugConfig = { } // Get version string from package.json +// eslint-disable-next-line @typescript-eslint/no-var-requires const {version, repository} = require(path.join(appRootPath, 'package.json')) const commitID = getGitCommit(appRootPath) @@ -30,14 +31,19 @@ const packageConfig = { const configFilePath = path.resolve(appRootPath, process.env.CMD_CONFIG_FILE || 'config.json') +// eslint-disable-next-line @typescript-eslint/no-var-requires const fileConfig = fs.existsSync(configFilePath) ? require(configFilePath)[env] : undefined +// eslint-disable-next-line @typescript-eslint/no-var-requires let config: any = require('./default') +// eslint-disable-next-line @typescript-eslint/no-var-requires merge(config, require('./defaultSSL')) merge(config, debugConfig) merge(config, packageConfig) merge(config, fileConfig) +// eslint-disable-next-line @typescript-eslint/no-var-requires merge(config, require('./environment')) +// eslint-disable-next-line @typescript-eslint/no-var-requires merge(config, require('./dockerSecret')) if (['debug', 'verbose', 'info', 'warn', 'error'].includes(config.loglevel)) { @@ -86,9 +92,9 @@ config.isStandardHTTPPort = (function isStandardHTTPPort() { // cache serverURL config.serverURL = (function getserverurl() { - var url = '' + let url = '' if (config.domain) { - var protocol = config.protocolUseSSL ? 'https://' : 'http://' + const protocol = config.protocolUseSSL ? 'https://' : 'http://' url = protocol + config.domain if (config.urlAddPort) { if (!config.isStandardHTTPPort || !config.isStandardHTTPsPort) { diff --git a/lib/config/utils.ts b/lib/config/utils.ts index a6ef36714a..20d8dcf84e 100644 --- a/lib/config/utils.ts +++ b/lib/config/utils.ts @@ -8,7 +8,7 @@ export function toBooleanConfig(configValue) { return configValue } -export function toArrayConfig(configValue, separator: string = ',', fallback ?: any) { +export function toArrayConfig(configValue, separator = ',', fallback ?: any) { if (configValue && typeof configValue === 'string') { return (configValue.split(separator).map(arrayItem => arrayItem.trim())) } diff --git a/lib/csp.ts b/lib/csp.ts index bc960a7d6a..4122bc5373 100644 --- a/lib/csp.ts +++ b/lib/csp.ts @@ -1,9 +1,9 @@ import * as config from "./config"; import * as uuid from "uuid"; -var CspStrategy: any = {} +const CspStrategy: any = {} -var defaultDirectives = { +const defaultDirectives = { defaultSrc: ['\'self\''], scriptSrc: ['\'self\'', 'vimeo.com', 'https://gist.github.com', 'www.slideshare.net', 'https://query.yahooapis.com', '\'unsafe-eval\''], // ^ TODO: Remove unsafe-eval - webpack script-loader issues https://github.com/hackmdio/codimd/issues/594 @@ -16,28 +16,28 @@ var defaultDirectives = { connectSrc: ['*'] } -var dropboxDirectives = { +const dropboxDirectives = { scriptSrc: ['https://www.dropbox.com'] } -var cdnDirectives = { +const cdnDirectives = { scriptSrc: ['https://cdnjs.cloudflare.com', 'https://cdn.jsdelivr.net', 'https://cdn.mathjax.org'], styleSrc: ['https://cdnjs.cloudflare.com', 'https://cdn.jsdelivr.net', 'https://fonts.googleapis.com'], fontSrc: ['https://cdnjs.cloudflare.com', 'https://fonts.gstatic.com'] } -var disqusDirectives = { +const disqusDirectives = { scriptSrc: ['https://disqus.com', 'https://*.disqus.com', 'https://*.disquscdn.com'], styleSrc: ['https://*.disquscdn.com'], fontSrc: ['https://*.disquscdn.com'] } -var googleAnalyticsDirectives = { +const googleAnalyticsDirectives = { scriptSrc: ['https://www.google-analytics.com'] } CspStrategy.computeDirectives = function () { - var directives = {} + const directives = {} mergeDirectives(directives, config.csp.directives) mergeDirectivesIf(config.csp.addDefaults, directives, defaultDirectives) mergeDirectivesIf(config.useCDN, directives, cdnDirectives) @@ -53,10 +53,10 @@ CspStrategy.computeDirectives = function () { } function mergeDirectives(existingDirectives, newDirectives) { - for (var propertyName in newDirectives) { - var newDirective = newDirectives[propertyName] + for (const propertyName in newDirectives) { + const newDirective = newDirectives[propertyName] if (newDirective) { - var existingDirective = existingDirectives[propertyName] || [] + const existingDirective = existingDirectives[propertyName] || [] existingDirectives[propertyName] = existingDirective.concat(newDirective) } } @@ -86,10 +86,10 @@ function getCspNonce(req, res) { function addUpgradeUnsafeRequestsOptionTo(directives) { if (config.csp.upgradeInsecureRequests === 'auto' && config.useSSL) { directives.upgradeInsecureRequests = true - } else { // @ts-ignore + } else { if (config.csp.upgradeInsecureRequests === true) { - directives.upgradeInsecureRequests = true - } + directives.upgradeInsecureRequests = true + } } } diff --git a/lib/history/index.ts b/lib/history/index.ts index 537a547181..8d171b5a89 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -16,7 +16,7 @@ function getHistory (userid, callback) { if (!user) { return callback(null, null) } - var history : [] | {} = [] + let history: any = [] if (user.history) { history = JSON.parse(user.history) // migrate LZString encoded note id to base64url encoded note id @@ -78,8 +78,8 @@ export function updateHistory (userid, noteId, document?: string, time?: any) { if (!history[noteId]) { history[noteId] = {} } - var noteHistory = history[noteId] - var noteInfo = models.Note.parseNoteInfo(document) + const noteHistory = history[noteId] + const noteInfo = models.Note.parseNoteInfo(document) noteHistory.id = noteId noteHistory.text = noteInfo.title noteHistory.time = time || Date.now() @@ -94,18 +94,18 @@ export function updateHistory (userid, noteId, document?: string, time?: any) { } function parseHistoryToArray (history) { - var _history = [] + const _history = [] Object.keys(history).forEach(function (key) { - var item = history[key] + const item = history[key] _history.push(item) }) return _history } function parseHistoryToObject (history) { - var _history = {} - for (var i = 0, l = history.length; i < l; i++) { - var item = history[i] + const _history = {} + for (let i = 0, l = history.length; i < l; i++) { + const item = history[i] _history[item.id] = item } return _history @@ -127,12 +127,13 @@ export function historyGet (req, res) { export function historyPost (req, res) { if (req.isAuthenticated()) { - var noteId = req.params.noteId + const noteId = req.params.noteId if (!noteId) { if (typeof req.body.history === 'undefined') return response.errorBadRequest(req, res) if (config.debug) { logger.info('SERVER received history from [' + req.user.id + ']: ' + req.body.history) } + let history = null try { - var history = JSON.parse(req.body.history) + history = JSON.parse(req.body.history) } catch (err) { return response.errorBadRequest(req, res) } @@ -168,7 +169,7 @@ export function historyPost (req, res) { export function historyDelete (req, res) { if (req.isAuthenticated()) { - var noteId = req.params.noteId + const noteId = req.params.noteId if (!noteId) { setHistory(req.user.id, [], function (err, count) { if (err) return response.errorInternalError(req, res) diff --git a/lib/homepage/index.ts b/lib/homepage/index.ts index 8d4d526219..c963003b98 100644 --- a/lib/homepage/index.ts +++ b/lib/homepage/index.ts @@ -1,6 +1,7 @@ import * as fs from 'fs' import * as path from 'path' import * as config from '../config' +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import {User} from '../models' import * as logger from '../logger' diff --git a/lib/imageRouter/azure.ts b/lib/imageRouter/azure.ts index 379074066f..8e47ee566d 100644 --- a/lib/imageRouter/azure.ts +++ b/lib/imageRouter/azure.ts @@ -17,7 +17,7 @@ export function uploadImage(imagePath, callback) { return } - var azureBlobService = azure.createBlobService(config.azure.connectionString) + const azureBlobService = azure.createBlobService(config.azure.connectionString) azureBlobService.createContainerIfNotExists(config.azure.container, {publicAccessLevel: 'blob'}, function (err, result, response) { if (err) { diff --git a/lib/imageRouter/index.ts b/lib/imageRouter/index.ts index 0ff7980b10..cb95aeb915 100644 --- a/lib/imageRouter/index.ts +++ b/lib/imageRouter/index.ts @@ -1,5 +1,6 @@ import * as fs from "fs"; import * as path from "path"; +import {noop} from 'lodash' import {Router} from "express"; import * as formidable from "formidable"; @@ -26,7 +27,7 @@ function checkImageValid(filepath) { // upload image imageRouter.post('/uploadimage', function (req, res) { - var form = new formidable.IncomingForm() + const form = new formidable.IncomingForm() form.keepExtensions = true @@ -42,11 +43,11 @@ imageRouter.post('/uploadimage', function (req, res) { return response.errorForbidden(req, res) } + // eslint-disable-next-line @typescript-eslint/no-var-requires const uploadProvider = require('./' + config.imageUploadType) uploadProvider.uploadImage(files.image.path, function (err, url) { // remove temporary upload file, and ignore any error - fs.unlink(files.image.path, () => { - }) + fs.unlink(files.image.path, noop) if (err !== null) { logger.error(err) return res.status(500).end('upload image error') diff --git a/lib/logger.ts b/lib/logger.ts index fa2927e864..aa3b2cb77c 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -5,7 +5,7 @@ type CodiMDLogger = Logger & { setLevel?: (string) => void } -let logger: CodiMDLogger = createLogger({ +const logger: CodiMDLogger = createLogger({ level: 'debug', format: format.combine( format.uncolorize(), diff --git a/lib/metrics.ts b/lib/metrics.ts index e3e03928a5..79e4dacf47 100644 --- a/lib/metrics.ts +++ b/lib/metrics.ts @@ -2,7 +2,8 @@ import {Router} from "express"; import {wrap} from "./utils"; // load controller -const statusController = require('./status') +import * as statusController from "./status"; + const appRouter = Router() // register route diff --git a/lib/models/author.ts b/lib/models/author.ts index 0039eb5f35..a79bf269db 100644 --- a/lib/models/author.ts +++ b/lib/models/author.ts @@ -2,7 +2,7 @@ import * as Sequelize from "sequelize"; export = function (sequelize, DataTypes) { - var Author = sequelize.define('Author', { + const Author = sequelize.define('Author', { id: { type: Sequelize.INTEGER, primaryKey: true, diff --git a/lib/models/index.ts b/lib/models/index.ts index c43347e1ce..e847549317 100644 --- a/lib/models/index.ts +++ b/lib/models/index.ts @@ -8,12 +8,12 @@ import {cloneDeep} from "lodash"; import * as config from "../config"; import * as logger from "../logger"; -var dbconfig = cloneDeep(config.db) +const dbconfig = cloneDeep(config.db) dbconfig.logging = config.debug ? (data) => { logger.info(data) } : false -var sequelize = null +let sequelize = null // Heroku specific if (config.dbURL) { @@ -39,14 +39,14 @@ function processData(data, _default, process) { sequelize.processData = processData -var db: any = {} +const db: any = {} fs.readdirSync(__dirname) .filter(function (file) { return (file.indexOf('.') !== 0) && (file !== 'index.js') }) .forEach(function (file) { - var model = sequelize.import(path.join(__dirname, file)) + const model = sequelize.import(path.join(__dirname, file)) db[model.name] = model }) diff --git a/lib/models/note.ts b/lib/models/note.ts index 182f08f620..73f84c51a4 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -20,13 +20,13 @@ import {stripTags} from "../string"; // ot import * as ot from "ot"; -var md = markdown_it() -var dmp = new DiffMatchPatch() +const md = markdown_it() +const dmp = new DiffMatchPatch() // permission types -var permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private'] +const permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private'] export = function (sequelize, DataTypes) { - var Note = sequelize.define('Note', { + const Note = sequelize.define('Note', { id: { type: DataTypes.UUID, primaryKey: true, @@ -183,8 +183,8 @@ export = function (sequelize, DataTypes) { return idParts.join('-') } Note.checkNoteIdValid = function (id) { - var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i - var result = id.match(uuidRegex) + const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i + const result = id.match(uuidRegex) if (result && result.length === 1) { return true } else { @@ -278,7 +278,7 @@ export = function (sequelize, DataTypes) { } // try to parse note id by LZString Base64 try { - var id = LZString.decompressFromBase64(noteId) + const id = LZString.decompressFromBase64(noteId) if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { @@ -296,7 +296,7 @@ export = function (sequelize, DataTypes) { parseNoteIdByBase64Url: function (_callback) { // try to parse note id by base64url try { - var id = Note.decodeNoteId(noteId) + const id = Note.decodeNoteId(noteId) if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { @@ -337,24 +337,24 @@ export = function (sequelize, DataTypes) { }) } Note.parseNoteInfo = function (body) { - var parsed = Note.extractMeta(body) - var $ = cheerio.load(md.render(parsed.markdown)) + const parsed = Note.extractMeta(body) + const $ = cheerio.load(md.render(parsed.markdown)) return { title: Note.extractNoteTitle(parsed.meta, $), tags: Note.extractNoteTags(parsed.meta, $) } } Note.parseNoteTitle = function (body) { - var parsed = Note.extractMeta(body) - var $ = cheerio.load(md.render(parsed.markdown)) + const parsed = Note.extractMeta(body) + const $ = cheerio.load(md.render(parsed.markdown)) return Note.extractNoteTitle(parsed.meta, $) } Note.extractNoteTitle = function (meta, $) { - var title = '' + let title = '' if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { title = meta.title } else { - var h1s = $('h1') + const h1s = $('h1') if (h1s.length > 0 && h1s.first().text().split('\n').length === 1) { title = stripTags(h1s.first().text()) } @@ -373,9 +373,9 @@ export = function (sequelize, DataTypes) { return title } Note.extractNoteTags = function (meta, $) { - var tags = [] - var rawtags = [] - var metaTags + const tags = [] + const rawtags = [] + let metaTags if (meta.tags && (typeof meta.tags === 'string' || typeof meta.tags === 'number')) { metaTags = ('' + meta.tags).split(',') } else if (meta.tags && (Array.isArray(meta.tags))) { @@ -383,23 +383,23 @@ export = function (sequelize, DataTypes) { } if (metaTags) { for (let i = 0; i < metaTags.length; i++) { - var text = metaTags[i].trim() + const text = metaTags[i].trim() if (text) rawtags.push(text) } } else { - var h6s = $('h6') + const h6s = $('h6') h6s.each(function (key, value) { if (/^tags/gmi.test($(value).text())) { - var codes = $(value).find('code') + const codes = $(value).find('code') for (let i = 0; i < codes.length; i++) { - var text = stripTags($(codes[i]).text().trim()) + const text = stripTags($(codes[i]).text().trim()) if (text) rawtags.push(text) } } }) } for (let i = 0; i < rawtags.length; i++) { - var found = false + let found = false for (let j = 0; j < tags.length; j++) { if (tags[j] === rawtags[i]) { found = true @@ -413,7 +413,7 @@ export = function (sequelize, DataTypes) { return tags } Note.extractMeta = function (content) { - var obj = null + let obj = null try { obj = metaMarked(content) if (!obj.markdown) obj.markdown = '' @@ -427,7 +427,7 @@ export = function (sequelize, DataTypes) { return obj } Note.parseMeta = function (meta) { - var _meta: any = {} + const _meta: any = {} if (meta) { if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { _meta.title = meta.title @@ -451,10 +451,10 @@ export = function (sequelize, DataTypes) { return _meta } Note.updateAuthorshipByOperation = function (operation, userId, authorships) { - var index = 0 - var timestamp = Date.now() + let index = 0 + const timestamp = Date.now() for (let i = 0; i < operation.length; i++) { - var op = operation[i] + const op = operation[i] if (ot.TextOperation.isRetain(op)) { index += op } else if (ot.TextOperation.isInsert(op)) { @@ -552,13 +552,13 @@ export = function (sequelize, DataTypes) { return authorships } Note.transformPatchToOperations = function (patch, contentLength) { - var operations = [] + const operations = [] if (patch.length > 0) { // calculate original content length for (let j = patch.length - 1; j >= 0; j--) { - var p = patch[j] + const p = patch[j] for (let i = 0; i < p.diffs.length; i++) { - var diff = p.diffs[i] + const diff = p.diffs[i] switch (diff[0]) { case 1: // insert contentLength -= diff[1].length @@ -570,13 +570,13 @@ export = function (sequelize, DataTypes) { } } // generate operations - var bias = 0 - var lengthBias = 0 + let bias = 0 + let lengthBias = 0 for (let j = 0; j < patch.length; j++) { - var operation = [] + const operation = [] const p = patch[j] - var currIndex = p.start1 - var currLength = contentLength - bias + let currIndex = p.start1 + const currLength = contentLength - bias for (let i = 0; i < p.diffs.length; i++) { const diff = p.diffs[i] switch (diff[0]) { diff --git a/lib/models/revision.ts b/lib/models/revision.ts index fa49c85191..aa3a3202c4 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -11,13 +11,13 @@ import * as util from "util"; import * as config from "../config"; import * as logger from "../logger"; -var Op = Sequelize.Op +const Op = Sequelize.Op -var dmpWorker = createDmpWorker() -var dmpCallbackCache = {} +let dmpWorker = createDmpWorker() +const dmpCallbackCache = {} function createDmpWorker() { - var worker = childProcess.fork(path.resolve(__dirname, '../workers/dmpWorker.js'), { + const worker = childProcess.fork(path.resolve(__dirname, '../workers/dmpWorker.js'), { stdio: 'ignore' }) if (config.debug) logger.info('dmp worker process started') @@ -26,7 +26,7 @@ function createDmpWorker() { logger.error('dmp worker error: not enough data on message') return } - var cacheKey = data.cacheKey + const cacheKey = data.cacheKey switch (data.msg) { case 'error': dmpCallbackCache[cacheKey](data.error, null) @@ -46,7 +46,7 @@ function createDmpWorker() { function sendDmpWorker(data, callback) { if (!dmpWorker) dmpWorker = createDmpWorker() - var cacheKey = Date.now() + '_' + shortId.generate() + const cacheKey = Date.now() + '_' + shortId.generate() dmpCallbackCache[cacheKey] = callback data = Object.assign(data, { cacheKey: cacheKey @@ -55,7 +55,7 @@ function sendDmpWorker(data, callback) { } module.exports = function (sequelize, DataTypes) { - var Revision = sequelize.define('Revision', { + const Revision = sequelize.define('Revision', { id: { type: DataTypes.UUID, primaryKey: true, @@ -118,9 +118,9 @@ module.exports = function (sequelize, DataTypes) { }, order: [['createdAt', 'DESC']] }).then(function (revisions) { - var data = [] - for (var i = 0, l = revisions.length; i < l; i++) { - var revision = revisions[i] + const data = [] + for (let i = 0, l = revisions.length; i < l; i++) { + const revision = revisions[i] data.push({ time: moment(revision.createdAt).valueOf(), length: revision.length @@ -201,12 +201,12 @@ module.exports = function (sequelize, DataTypes) { } }).then(function (notes) { if (notes.length <= 0) return callback(null, notes) - var savedNotes = [] + const savedNotes = [] async.each(notes, function (note, _callback) { // revision saving policy: note not been modified for 5 mins or not save for 10 mins if (note.lastchangeAt && note.savedAt) { - var lastchangeAt = moment(note.lastchangeAt) - var savedAt = moment(note.savedAt) + const lastchangeAt = moment(note.lastchangeAt) + const savedAt = moment(note.savedAt) if (moment().isAfter(lastchangeAt.add(5, 'minutes'))) { savedNotes.push(note) Revision.saveNoteRevision(note, _callback) @@ -225,7 +225,7 @@ module.exports = function (sequelize, DataTypes) { return callback(err, null) } // return null when no notes need saving at this moment but have delayed tasks to be done - var result = ((savedNotes.length === 0) && (notes.length > savedNotes.length)) ? null : savedNotes + const result = ((savedNotes.length === 0) && (notes.length > savedNotes.length)) ? null : savedNotes return callback(null, result) }) }).catch(function (err) { @@ -252,9 +252,9 @@ module.exports = function (sequelize, DataTypes) { return callback(err, null) }) } else { - var latestRevision = revisions[0] - var lastContent = latestRevision.content || latestRevision.lastContent - var content = note.content + const latestRevision = revisions[0] + const lastContent = latestRevision.content || latestRevision.lastContent + const content = note.content sendDmpWorker({ msg: 'create patch', lastDoc: lastContent, diff --git a/lib/models/user.ts b/lib/models/user.ts index e8fb6b55d9..0ae0a807c4 100644 --- a/lib/models/user.ts +++ b/lib/models/user.ts @@ -8,7 +8,7 @@ import * as logger from "../logger"; import {generateAvatarURL} from "../letter-avatars"; export = function (sequelize, DataTypes) { - var User = sequelize.define('User', { + const User = sequelize.define('User', { id: { type: DataTypes.UUID, primaryKey: true, @@ -102,7 +102,7 @@ export = function (sequelize, DataTypes) { return profile } User.parsePhotoByProfile = function (profile, bigger) { - var photo = null + let photo = null switch (profile.provider) { case 'facebook': photo = 'https://graph.facebook.com/' + profile.id + '/picture' @@ -114,13 +114,14 @@ export = function (sequelize, DataTypes) { if (bigger) photo += '?size=original' else photo += '?size=bigger' break - case 'github': + case 'github': { const photoURL = new URL(profile.photos && profile.photos[0] ? profile.photos[0].value : `https://avatars.githubusercontent.com/u/${profile.id}`) photoURL.searchParams.set('s', (bigger ? 400 : 96).toString()) photo = photoURL.toString() break + } case 'gitlab': photo = profile.avatarUrl if (photo) { diff --git a/lib/note/index.ts b/lib/note/index.ts index 4c4cb2af59..b426cf065c 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -1,6 +1,7 @@ import * as config from "../config"; import * as logger from "../logger"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import {Note, Revision, User} from "../models"; diff --git a/lib/note/noteActions.ts b/lib/note/noteActions.ts index f44b0189e4..b3849a3191 100644 --- a/lib/note/noteActions.ts +++ b/lib/note/noteActions.ts @@ -9,6 +9,7 @@ import * as moment from "moment"; import * as config from "../config"; import * as logger from "../logger"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import {Note, Revision} from "../models"; import {errorInternalError, errorNotFound} from "../response"; diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index dfc613fd18..0ce8a21f8f 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -25,8 +25,8 @@ import {SaveRevisionJob} from "./realtimeSaveRevisionJob"; const chance = new Chance() -export let io = null -export let maintenance = true +export const io = null +export const maintenance = true // public const connectProcessQueue = new ProcessQueue({}) @@ -49,7 +49,7 @@ export function onAuthorizeFail(data, message, error, accept) { // secure the origin by the cookie export function secure(socket, next) { try { - var handshakeData = socket.request + const handshakeData = socket.request if (handshakeData.headers.cookie) { handshakeData.cookie = cookie.parse(handshakeData.headers.cookie) handshakeData.sessionID = cookieParser.signedCookie(handshakeData.cookie[config.sessionName], config.sessionSecret) @@ -74,7 +74,7 @@ export function secure(socket, next) { // TODO: only use in `updateDirtyNote` // TODO: test it export function emitCheck(note) { - var out = { + const out = { title: note.title, updatetime: note.updatetime, lastchangeuser: note.lastchangeuser, @@ -86,8 +86,8 @@ export function emitCheck(note) { } // actions -export var users = {} -export var notes = {} +export const users = {} +export const notes = {} export function getNotePool(): any { return notes @@ -241,11 +241,11 @@ async function _updateNoteAsync(note) { export function getStatus() { return models.Note.count() .then(function (notecount) { - var distinctaddresses = [] - var regaddresses = [] - var distinctregaddresses = [] + const distinctaddresses = [] + const regaddresses = [] + const distinctregaddresses = [] Object.keys(users).forEach(function (key) { - var user = users[key] + const user = users[key] if (!user) return let found = false for (let i = 0; i < distinctaddresses.length; i++) { @@ -316,6 +316,7 @@ function parseUrl(data) { return url.parse(data) } } catch (e) { + // just ignore } return null } @@ -374,16 +375,16 @@ export async function parseNoteIdFromSocketAsync(socket) { // TODO: test it export function emitOnlineUsers(socket) { - var noteId = socket.noteId + const noteId = socket.noteId if (!noteId || !notes[noteId]) return - var users = [] + const users = [] Object.keys(notes[noteId].users).forEach(function (key) { - var user = notes[noteId].users[key] + const user = notes[noteId].users[key] if (user) { users.push(buildUserOutData(user)) } }) - var out = { + const out = { users: users } io.to(noteId).emit('online users', out) @@ -391,19 +392,19 @@ export function emitOnlineUsers(socket) { // TODO: test it export function emitUserStatus(socket) { - var noteId = socket.noteId - var user = users[socket.id] + const noteId = socket.noteId + const user = users[socket.id] if (!noteId || !notes[noteId] || !user) return - var out = buildUserOutData(user) + const out = buildUserOutData(user) socket.broadcast.to(noteId).emit('user status', out) } // TODO: test it export function emitRefresh(socket) { - var noteId = socket.noteId + const noteId = socket.noteId if (!noteId || !notes[noteId]) return - var note = notes[noteId] - var out = { + const note = notes[noteId] + const out = { title: note.title, docmaxlength: config.documentMaxLength, owner: note.owner, @@ -554,7 +555,7 @@ export function queueForDisconnect(socket) { } export function buildUserOutData(user) { - var out = { + const out = { id: user.id, login: user.login, userid: user.userid, @@ -572,7 +573,7 @@ export function buildUserOutData(user) { export function updateUserData(socket, user) { // retrieve user data from passport if (socket.request.user && socket.request.user.logged_in) { - var profile = models.User.getProfile(socket.request.user) + const profile = models.User.getProfile(socket.request.user) user.photo = profile.photo user.name = profile.name user.userid = socket.request.user.id @@ -618,13 +619,13 @@ export function ifMayEdit(socket, callback) { // TODO: test it function operationCallback(socket, operation) { - var noteId = socket.noteId + const noteId = socket.noteId if (!noteId || !notes[noteId]) return - var note = notes[noteId] - var userId = null + const note = notes[noteId] + let userId = null // save authors if (socket.request.user && socket.request.user.logged_in) { - var user = users[socket.id] + const user = users[socket.id] if (!user) return userId = socket.request.user.id if (!note.authors[userId]) { @@ -661,7 +662,7 @@ function operationCallback(socket, operation) { // TODO: test it export function updateHistory(userId, note, time?: any) { - var noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) + const noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) if (note.server) history.updateHistory(userId, noteId, note.server.document, time) } @@ -698,7 +699,7 @@ function queueForConnect(socket) { socket.noteId = noteId // initialize user data // random color - var color = getUniqueColorPerNote(noteId) + const color = getUniqueColorPerNote(noteId) // create user data users[socket.id] = { id: socket.id, diff --git a/lib/response.ts b/lib/response.ts index 046a56a091..e046ffd8da 100644 --- a/lib/response.ts +++ b/lib/response.ts @@ -12,7 +12,7 @@ export function errorForbidden(req, res) { if (req.user) { responseError(res, '403', 'Forbidden', 'oh no.') } else { - var nextURL = new URL('', config.serverURL) + const nextURL = new URL('', config.serverURL) nextURL.search = (new URLSearchParams({next: req.originalUrl})).toString() req.flash('error', 'You are not allowed to access this page. Maybe try logging in?') res.redirect(nextURL.toString()) @@ -49,10 +49,10 @@ export function responseError(res, code, detail, msg) { } export function responseCodiMD(res, note) { - var body = note.content - var extracted = models.Note.extractMeta(body) - var meta = models.Note.parseMeta(extracted.meta) - var title = models.Note.decodeTitle(note.title) + const body = note.content + const extracted = models.Note.extractMeta(body) + const meta = models.Note.parseMeta(extracted.meta) + let title = models.Note.decodeTitle(note.title) title = models.Note.generateWebTitle(meta.title || title) res.set({ 'Cache-Control': 'private', // only cache by client @@ -64,14 +64,14 @@ export function responseCodiMD(res, note) { } function updateHistory(userId, note, document, time?: any) { - var noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) + const noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) history.updateHistory(userId, noteId, document, time) logger.info('history updated') } export function newNote(req, res, next?: any) { - var owner = null - var body = '' + let owner = null + let body = '' if (req.body && req.body.length > config.documentMaxLength) { return errorTooLong(req, res) } else if (req.body) { @@ -128,8 +128,8 @@ export function checkViewPermission(req, note) { } function findNote(req, res, callback, include?: any) { - var noteId = req.params.noteId - var id = req.params.noteId || req.params.shortid + const noteId = req.params.noteId + const id = req.params.noteId || req.params.shortid models.Note.parseNoteId(id, function (err, _id) { if (err) { logger.error(err) @@ -162,9 +162,9 @@ function findNote(req, res, callback, include?: any) { } function actionDownload(req, res, note) { - var body = note.content - var title = models.Note.decodeTitle(note.title) - var filename = title + const body = note.content + const title = models.Note.decodeTitle(note.title) + let filename = title filename = encodeURIComponent(filename) res.set({ 'Access-Control-Allow-Origin': '*', // allow CORS as API @@ -180,7 +180,7 @@ function actionDownload(req, res, note) { export function publishNoteActions(req, res, next) { findNote(req, res, function (note) { - var action = req.params.action + const action = req.params.action switch (action) { case 'download': actionDownload(req, res, note) @@ -197,7 +197,7 @@ export function publishNoteActions(req, res, next) { export function publishSlideActions(req, res, next) { findNote(req, res, function (note) { - var action = req.params.action + const action = req.params.action switch (action) { case 'edit': res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id))) @@ -210,9 +210,9 @@ export function publishSlideActions(req, res, next) { } export function githubActions(req, res, next) { - var noteId = req.params.noteId + const noteId = req.params.noteId findNote(req, res, function (note) { - var action = req.params.action + const action = req.params.action switch (action) { case 'gist': githubActionGist(req, res, note) @@ -225,36 +225,36 @@ export function githubActions(req, res, next) { } function githubActionGist(req, res, note) { - var code = req.query.code - var state = req.query.state + const code = req.query.code + const state = req.query.state if (!code || !state) { return errorForbidden(req, res) } else { - var data = { + const data = { client_id: config.github.clientID, client_secret: config.github.clientSecret, code: code, state: state } - var authUrl = 'https://github.com/login/oauth/access_token' + const authUrl = 'https://github.com/login/oauth/access_token' request({ url: authUrl, method: 'POST', json: data }, function (error, httpResponse, body) { if (!error && httpResponse.statusCode === 200) { - var accessToken = body.access_token + const accessToken = body.access_token if (accessToken) { - var content = note.content - var title = models.Note.decodeTitle(note.title) - var filename = title.replace('/', ' ') + '.md' - var gist = { + const content = note.content + const title = models.Note.decodeTitle(note.title) + const filename = title.replace('/', ' ') + '.md' + const gist = { files: {} } gist.files[filename] = { content: content } - var gistUrl = 'https://api.github.com/gists' + const gistUrl = 'https://api.github.com/gists'; request({ url: gistUrl, headers: { @@ -282,9 +282,9 @@ function githubActionGist(req, res, note) { } export function gitlabActions(req, res, next) { - var noteId = req.params.noteId + const noteId = req.params.noteId findNote(req, res, function (note) { - var action = req.params.action + const action = req.params.action switch (action) { case 'projects': gitlabActionProjects(req, res, note) @@ -306,7 +306,7 @@ function gitlabActionProjects(req, res, note) { if (!user) { return errorNotFound(req, res) } - var ret: any = {baseURL: config.gitlab.baseURL, version: config.gitlab.version} + const ret: any = {baseURL: config.gitlab.baseURL, version: config.gitlab.version} ret.accesstoken = user.accessToken ret.profileid = user.profileid request( @@ -330,7 +330,7 @@ function gitlabActionProjects(req, res, note) { } export function showPublishSlide(req, res, next) { - var include = [{ + const include = [{ model: models.User, as: 'owner' }, { @@ -339,7 +339,7 @@ export function showPublishSlide(req, res, next) { }] findNote(req, res, function (note) { // force to use short id - var shortid = req.params.shortid + const shortid = req.params.shortid if ((note.alias && shortid !== note.alias) || (!note.alias && shortid !== note.shortid)) { return res.redirect(config.serverURL + '/p/' + (note.alias || note.shortid)) } @@ -347,15 +347,15 @@ export function showPublishSlide(req, res, next) { if (!note) { return errorNotFound(req, res) } - var body = note.content - var extracted = models.Note.extractMeta(body) - var markdown = extracted.markdown - var meta = models.Note.parseMeta(extracted.meta) - var createtime = note.createdAt - var updatetime = note.lastchangeAt - var title = models.Note.decodeTitle(note.title) + const body = note.content + const extracted = models.Note.extractMeta(body) + const markdown = extracted.markdown + const meta = models.Note.parseMeta(extracted.meta) + const createtime = note.createdAt + const updatetime = note.lastchangeAt + let title = models.Note.decodeTitle(note.title) title = models.Note.generateWebTitle(meta.title || title) - var data = { + const data = { title: title, description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null), viewcount: note.viewcount, diff --git a/lib/routes.ts b/lib/routes.ts index 9f62914032..8b4694c04e 100644 --- a/lib/routes.ts +++ b/lib/routes.ts @@ -30,6 +30,7 @@ appRouter.get('/500', errorPageController.errorInternalError) appRouter.get('/config', statusController.getConfig) // register auth module +// eslint-disable-next-line @typescript-eslint/no-var-requires appRouter.use(require('./auth')) // get history @@ -56,6 +57,7 @@ appRouter.get('/me/export', userController.exportMyData) appRouter.get('/user/:username/avatar.svg', userController.getMyAvatar) // register image upload module +// eslint-disable-next-line @typescript-eslint/no-var-requires appRouter.use(require('./imageRouter')) // get new note diff --git a/lib/workers/dmpWorker.ts b/lib/workers/dmpWorker.ts index 4254982d3b..6b1b82920a 100644 --- a/lib/workers/dmpWorker.ts +++ b/lib/workers/dmpWorker.ts @@ -5,7 +5,7 @@ import * as DiffMatchPatch from "@hackmd/diff-match-patch"; import * as config from "../config"; import * as logger from "../logger"; -var dmp = new DiffMatchPatch() +const dmp = new DiffMatchPatch() process.on('message', function (data) { if (!data || !data.msg || !data.cacheKey) { logger.error('dmp worker error: not enough data') @@ -18,7 +18,7 @@ process.on('message', function (data) { return null } try { - var patch = createPatch(data.lastDoc, data.currDoc) + const patch = createPatch(data.lastDoc, data.currDoc) process.send({ msg: 'check', result: patch, @@ -38,7 +38,7 @@ process.on('message', function (data) { return logger.error('dmp worker error: not enough data on get revision') } try { - var result = getRevision(data.revisions, data.count) + const result = getRevision(data.revisions, data.count) process.send({ msg: 'check', result: result, @@ -58,11 +58,11 @@ process.on('message', function (data) { }) function createPatch(lastDoc, currDoc) { - var msStart = (new Date()).getTime() - var diff = dmp.diff_main(lastDoc, currDoc) - var patch = dmp.patch_make(lastDoc, diff) + const msStart = (new Date()).getTime() + const diff = dmp.diff_main(lastDoc, currDoc) + let patch = dmp.patch_make(lastDoc, diff) patch = dmp.patch_toText(patch) - var msEnd = (new Date()).getTime() + const msEnd = (new Date()).getTime() if (config.debug) { logger.info(patch) logger.info((msEnd - msStart) + 'ms') @@ -71,11 +71,11 @@ function createPatch(lastDoc, currDoc) { } function getRevision(revisions, count) { - var msStart = (new Date()).getTime() - var startContent = null - var lastPatch = [] - var applyPatches = [] - var authorship = [] + const msStart = (new Date()).getTime() + let startContent = null + let lastPatch = [] + let applyPatches = [] + let authorship = [] if (count <= Math.round(revisions.length / 2)) { // start from top to target for (let i = 0; i < count; i++) { @@ -93,7 +93,7 @@ function getRevision(revisions, count) { // swap DIFF_INSERT and DIFF_DELETE to achieve unpatching for (let i = 0, l = applyPatches.length; i < l; i++) { for (let j = 0, m = applyPatches[i].diffs.length; j < m; j++) { - var diff = applyPatches[i].diffs[j] + const diff = applyPatches[i].diffs[j] if (diff[0] === DiffMatchPatch.DIFF_INSERT) { diff[0] = DiffMatchPatch.DIFF_DELETE } else if (diff[0] === DiffMatchPatch.DIFF_DELETE) { @@ -103,8 +103,8 @@ function getRevision(revisions, count) { } } else { // start from bottom to target - var l = revisions.length - 1 - for (var i = l; i >= count - 1; i--) { + const l = revisions.length - 1 + for (let i = l; i >= count - 1; i--) { const revision = revisions[i] if (i === l) { startContent = revision.lastContent @@ -118,17 +118,18 @@ function getRevision(revisions, count) { authorship = revision.authorship } } + let finalContent = "" try { - var finalContent = dmp.patch_apply(applyPatches, startContent)[0] + finalContent = dmp.patch_apply(applyPatches, startContent)[0] } catch (err) { throw new Error(err) } - var data = { + const data = { content: finalContent, patch: dmp.patch_fromText(lastPatch), authorship: authorship } - var msEnd = (new Date()).getTime() + const msEnd = (new Date()).getTime() if (config.debug) { logger.info((msEnd - msStart) + 'ms') } diff --git a/package-lock.json b/package-lock.json index 15408581c3..57b1edd33f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1473,6 +1473,12 @@ "@types/node": "*" } }, + "@types/lodash": { + "version": "4.14.170", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", + "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==", + "dev": true + }, "@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", diff --git a/package.json b/package.json index 7a39b83829..b4d3c62877 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,7 @@ "@susisu/mte-kernel": "^2.1.0", "@types/express": "4.17.9", "@types/express-flash": "0.0.2", + "@types/lodash": "^4.14.170", "@types/minio": "^7.0.7", "@types/node": "~12.20.15", "@types/passport-google-oauth20": "^2.0.8", From a10263b13e60ba069dd31d8dc2a4b1cd66de347a Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 11:58:35 +0800 Subject: [PATCH 095/167] upgrade sequelize Signed-off-by: Raccoon --- lib/auth/email/index.ts | 2 +- package-lock.json | 20 +++++++++++++------- package.json | 5 +++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/auth/email/index.ts b/lib/auth/email/index.ts index 28295e0775..8ee746d3fc 100644 --- a/lib/auth/email/index.ts +++ b/lib/auth/email/index.ts @@ -1,6 +1,6 @@ import {Router} from "express"; import * as passport from "passport"; -import * as validator from "validator"; +import validator from "validator"; import {Strategy as LocalStrategy} from 'passport-local'; import * as config from '../../config'; diff --git a/package-lock.json b/package-lock.json index 57b1edd33f..1b150c15bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1562,6 +1562,12 @@ "@types/node": "*" } }, + "@types/validator": { + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.1.4.tgz", + "integrity": "sha512-19C02B8mr53HufY7S+HO/EHBD7a/R22IwEwyqiHaR19iwL37dN3o0M8RianVInfSSqP7InVSg/o0mUATM4JWsQ==", + "dev": true + }, "@typescript-eslint/eslint-plugin": { "version": "4.26.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.1.tgz", @@ -15203,9 +15209,9 @@ "integrity": "sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4=" }, "sequelize": { - "version": "5.21.3", - "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-5.21.3.tgz", - "integrity": "sha512-ptdeAxwTY0zbj7AK8m+SH3z52uHVrt/qmOTSIGo/kyfnSp3h5HeKlywkJf5GEk09kuRrPHfWARVSXH1W3IGU7g==", + "version": "5.22.4", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-5.22.4.tgz", + "integrity": "sha512-xFQQ38HPg7EyDRDA+NdzMSRWbo9m6Z/RxpjnkBl3ggyQG+jRrup48x0jaw4Ox42h56wFnXOBC2NZOkTJfZeWCw==", "requires": { "bluebird": "^3.5.0", "cls-bluebird": "^2.1.0", @@ -15225,11 +15231,11 @@ }, "dependencies": { "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "semver": { diff --git a/package.json b/package.json index b4d3c62877..c4ba941401 100644 --- a/package.json +++ b/package.json @@ -95,8 +95,8 @@ "readline-sync": "~1.4.7", "request": "~2.88.0", "scrypt-kdf": "^2.0.1", - "sequelize": "5.21.3", - "sequelize-cli": "~5.5.1", + "sequelize": "5.22.4", + "sequelize-cli": "5.5.1", "shortid": "~2.2.14", "socket.io": "~2.2.0", "toobusy-js": "~0.5.1", @@ -118,6 +118,7 @@ "@types/node": "~12.20.15", "@types/passport-google-oauth20": "^2.0.8", "@types/qs": "^6.9.6", + "@types/validator": "^13.1.4", "@typescript-eslint/eslint-plugin": "^4.26.1", "@typescript-eslint/parser": "^4.26.1", "acorn": "~6.1.1", From 74f9e57148cb1b871b11d033a99ca9641df87ac3 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 13:18:51 +0800 Subject: [PATCH 096/167] ot server patch Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 0ce8a21f8f..4ea4b3f03a 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -479,6 +479,10 @@ function buildAuthorProfilesFromNote(noteAuthors) { function makeNewServerNote(note) { const authors = buildAuthorProfilesFromNote(note.authors) + const otServer = new ot.EditorSocketIOServer(note.content, [], note.id, ifMayEdit, operationCallback) + otServer.debug = config.debug + otServer.setLogger(logger) + otServer.setDocumentMaxLength(config.documentmaxlength) return { id: note.id, @@ -494,7 +498,7 @@ function makeNewServerNote(note) { tempUsers: {}, createtime: moment(note.createdAt).valueOf(), updatetime: moment(note.lastchangeAt).valueOf(), - server: new ot.EditorSocketIOServer(note.content, [], note.id, ifMayEdit, operationCallback), + server: otServer, authors: authors, authorship: note.authorship } @@ -652,6 +656,7 @@ function operationCallback(socket, operation) { return logger.error('operation callback failed: ' + err) }) } + note.server.isDirty = true note.tempUsers[userId] = Date.now() } // save authorship - use timer here because it's an O(n) complexity algorithm From f04e63279c335201561a1481d1f47c04d895212c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 13:30:27 +0800 Subject: [PATCH 097/167] limit model should be .js files Signed-off-by: Raccoon --- lib/models/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/index.ts b/lib/models/index.ts index e847549317..1eb0adf576 100644 --- a/lib/models/index.ts +++ b/lib/models/index.ts @@ -43,7 +43,7 @@ const db: any = {} fs.readdirSync(__dirname) .filter(function (file) { - return (file.indexOf('.') !== 0) && (file !== 'index.js') + return (file.indexOf('.') !== 0) && (file !== 'index.js') && file.endsWith('.js') }) .forEach(function (file) { const model = sequelize.import(path.join(__dirname, file)) From 6f93e43978576b4358a29292469fa05f1609d3f5 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 13:54:19 +0800 Subject: [PATCH 098/167] move app.js to lib/ update Signed-off-by: Raccoon --- .gitignore | 1 + app.js | 330 +---------------- lib/app.ts | 343 ++++++++++++++++++ lib/metrics.ts | 2 +- lib/middleware/checkURIValid.ts | 2 +- lib/middleware/codiMDVersion.ts | 2 +- .../redirectWithoutTrailingSlashes.ts | 2 +- lib/middleware/tooBusy.ts | 2 +- lib/realtime/realtime.ts | 12 +- lib/routes.ts | 2 +- package.json | 2 +- 11 files changed, 362 insertions(+), 338 deletions(-) create mode 100644 lib/app.ts diff --git a/.gitignore b/.gitignore index 0aaa5f0d30..0ca470118f 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ public/uploads/* .vscode/settings.json /dist +lib/**/*.js diff --git a/app.js b/app.js index 402b5c06b0..632a013b4a 100644 --- a/app.js +++ b/app.js @@ -1,331 +1,3 @@ 'use strict' -// app -// external modules -var express = require('express') -var ejs = require('ejs') -var passport = require('passport') -var methodOverride = require('method-override') -var cookieParser = require('cookie-parser') -var session = require('express-session') -var SequelizeStore = require('connect-session-sequelize')(session.Store) -var fs = require('fs') -var path = require('path') - -var morgan = require('morgan') -var passportSocketIo = require('passport.socketio') -var helmet = require('helmet') -var i18n = require('i18n') -var flash = require('connect-flash') -var apiMetrics = require('prometheus-api-metrics') - -// core -var config = require('./dist/config') -var logger = require('./dist/logger') -var response = require('./dist/response') -var models = require('./dist/models') -var csp = require('./dist/csp') -const { Environment } = require('./dist/config/enum') - -const { versionCheckMiddleware, checkVersion } = require('./dist/web/middleware/checkVersion') - -function createHttpServer () { - if (config.useSSL) { - const ca = (function () { - let i, len - const results = [] - for (i = 0, len = config.sslCAPath.length; i < len; i++) { - results.push(fs.readFileSync(config.sslCAPath[i], 'utf8')) - } - return results - })() - const options = { - key: fs.readFileSync(config.sslKeyPath, 'utf8'), - cert: fs.readFileSync(config.sslCertPath, 'utf8'), - ca: ca, - dhparam: fs.readFileSync(config.dhParamPath, 'utf8'), - requestCert: false, - rejectUnauthorized: false - } - return require('https').createServer(options, app) - } else { - return require('http').createServer(app) - } -} - -// server setup -var app = express() -var server = createHttpServer() - -// API and process monitoring with Prometheus for Node.js micro-service -app.use(apiMetrics({ - metricsPath: '/metrics/router', - excludeRoutes: ['/metrics/codimd'] -})) - -// logger -app.use(morgan('combined', { - stream: logger.stream -})) - -// socket io -var io = require('socket.io')(server) -io.engine.ws = new (require('ws').Server)({ - noServer: true, - perMessageDeflate: false -}) - -// others -var realtime = require('./dist/realtime/realtime.js') - -// assign socket io to realtime -realtime.io = io - -// methodOverride -app.use(methodOverride('_method')) - -// session store -var sessionStore = new SequelizeStore({ - db: models.sequelize -}) - -// use hsts to tell https users stick to this -if (config.hsts.enable) { - app.use(helmet.hsts({ - maxAge: config.hsts.maxAgeSeconds, - includeSubdomains: config.hsts.includeSubdomains, - preload: config.hsts.preload - })) -} else if (config.useSSL) { - logger.info('Consider enabling HSTS for extra security:') - logger.info('https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security') -} - -// Add referrer policy to improve privacy -app.use( - helmet.referrerPolicy({ - policy: 'same-origin' - }) -) - -// Generate a random nonce per request, for CSP with inline scripts -app.use(csp.addNonceToLocals) - -// use Content-Security-Policy to limit XSS, dangerous plugins, etc. -// https://helmetjs.github.io/docs/csp/ -if (config.csp.enable) { - app.use(helmet.contentSecurityPolicy({ - directives: csp.computeDirectives() - })) -} else { - logger.info('Content-Security-Policy is disabled. This may be a security risk.') -} - -i18n.configure({ - locales: ['en', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da', 'ko', 'id', 'sr'], - cookie: 'locale', - directory: path.join(__dirname, '/locales'), - updateFiles: config.updateI18nFiles -}) - -app.use(cookieParser()) - -app.use(i18n.init) - -// routes without sessions -// static files -app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime, index: false })) -app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { maxAge: config.staticCacheTime })) -app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { maxAge: config.staticCacheTime })) -app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), { maxAge: config.staticCacheTime })) -app.use(require('./dist/metrics').router) - -// session -app.use(session({ - name: config.sessionName, - secret: config.sessionSecret, - resave: false, // don't save session if unmodified - saveUninitialized: true, // always create session to ensure the origin - rolling: true, // reset maxAge on every response - cookie: { - maxAge: config.sessionLife - }, - store: sessionStore -})) - -// session resumption -var tlsSessionStore = {} -server.on('newSession', function (id, data, cb) { - tlsSessionStore[id.toString('hex')] = data - cb() -}) -server.on('resumeSession', function (id, cb) { - cb(null, tlsSessionStore[id.toString('hex')] || null) -}) - -// middleware which blocks requests when we're too busy -app.use(require('./dist/middleware/tooBusy')) - -app.use(flash()) - -// passport -app.use(passport.initialize()) -app.use(passport.session()) - -// check uri is valid before going further -app.use(require('./dist/middleware/checkURIValid')) -// redirect url without trailing slashes -app.use(require('./dist/middleware/redirectWithoutTrailingSlashes')) -app.use(require('./dist/middleware/codiMDVersion')) - -if (config.autoVersionCheck && process.env.NODE_ENV === Environment.production) { - checkVersion(app) - app.use(versionCheckMiddleware) -} - -// routes need sessions -// template files -app.set('views', config.viewPath) -// set render engine -app.engine('ejs', ejs.renderFile) -// set view engine -app.set('view engine', 'ejs') -// set generally available variables for all views -app.locals.useCDN = config.useCDN -app.locals.serverURL = config.serverURL -app.locals.sourceURL = config.sourceURL -app.locals.privacyPolicyURL = config.privacyPolicyURL -app.locals.allowAnonymous = config.allowAnonymous -app.locals.allowAnonymousEdits = config.allowAnonymousEdits -app.locals.permission = config.permission -app.locals.allowPDFExport = config.allowPDFExport -app.locals.authProviders = { - facebook: config.isFacebookEnable, - twitter: config.isTwitterEnable, - github: config.isGitHubEnable, - bitbucket: config.isBitbucketEnable, - gitlab: config.isGitLabEnable, - mattermost: config.isMattermostEnable, - dropbox: config.isDropboxEnable, - google: config.isGoogleEnable, - ldap: config.isLDAPEnable, - ldapProviderName: config.ldap.providerName, - saml: config.isSAMLEnable, - oauth2: config.isOAuth2Enable, - oauth2ProviderName: config.oauth2.providerName, - openID: config.isOpenIDEnable, - email: config.isEmailEnable, - allowEmailRegister: config.allowEmailRegister -} -app.locals.versionInfo = { - latest: true, - versionItem: null -} - -// Export/Import menu items -app.locals.enableDropBoxSave = config.isDropboxEnable -app.locals.enableGitHubGist = config.isGitHubEnable -app.locals.enableGitlabSnippets = config.isGitlabSnippetsEnable - -app.use(require('./dist/routes').router) - -// response not found if no any route matxches -app.get('*', function (req, res) { - response.errorNotFound(req, res) -}) - -// socket.io secure -io.use(realtime.secure) -// socket.io auth -io.use(passportSocketIo.authorize({ - cookieParser: cookieParser, - key: config.sessionName, - secret: config.sessionSecret, - store: sessionStore, - success: realtime.onAuthorizeSuccess, - fail: realtime.onAuthorizeFail -})) -// socket.io heartbeat -io.set('heartbeat interval', config.heartbeatInterval) -io.set('heartbeat timeout', config.heartbeatTimeout) -// socket.io connection -io.sockets.on('connection', realtime.connection) - -// listen -function startListen () { - var address - var listenCallback = function () { - var schema = config.useSSL ? 'HTTPS' : 'HTTP' - logger.info('%s Server listening at %s', schema, address) - realtime.maintenance = false - } - - // use unix domain socket if 'path' is specified - if (config.path) { - address = config.path - server.listen(config.path, listenCallback) - } else { - address = config.host + ':' + config.port - server.listen(config.port, config.host, listenCallback) - } -} - -// sync db then start listen -models.sequelize.sync().then(function () { - // check if realtime is ready - if (realtime.isReady()) { - models.Revision.checkAllNotesRevision(function (err, notes) { - if (err) throw new Error(err) - if (!notes || notes.length <= 0) return startListen() - }) - } else { - throw new Error('server still not ready after db synced') - } -}).catch(err => { - logger.error('Can\'t sync database') - logger.error(err.stack) - logger.error('Process will exit now.') - process.exit(1) -}) - -// log uncaught exception -process.on('uncaughtException', function (err) { - logger.error('An uncaught exception has occured.') - logger.error(err) - console.error(err) - logger.error('Process will exit now.') - process.exit(1) -}) - -// install exit handler -function handleTermSignals () { - logger.info('CodiMD has been killed by signal, try to exit gracefully...') - realtime.maintenance = true - realtime.terminate() - // disconnect all socket.io clients - Object.keys(io.sockets.sockets).forEach(function (key) { - var socket = io.sockets.sockets[key] - // notify client server going into maintenance status - socket.emit('maintenance') - setTimeout(function () { - socket.disconnect(true) - }, 0) - }) - var checkCleanTimer = setInterval(function () { - if (realtime.isReady()) { - models.Revision.checkAllNotesRevision(function (err, notes) { - if (err) return logger.error(err) - if (!notes || notes.length <= 0) { - clearInterval(checkCleanTimer) - return process.exit(0) - } - }) - } - }, 100) - setTimeout(() => { - process.exit(1) - }, 5000) -} -process.on('SIGINT', handleTermSignals) -process.on('SIGTERM', handleTermSignals) -process.on('SIGQUIT', handleTermSignals) +require('./dist/app.js') diff --git a/lib/app.ts b/lib/app.ts new file mode 100644 index 0000000000..5bc25c38c7 --- /dev/null +++ b/lib/app.ts @@ -0,0 +1,343 @@ +// app +// external modules +import * as express from "express"; +import * as ejs from "ejs"; +import * as passport from "passport"; +import * as methodOverride from "method-override"; +import * as cookieParser from "cookie-parser"; +import * as session from "express-session"; +import * as fs from "fs"; +import * as path from "path"; +import * as morgan from "morgan"; +import * as helmet from "helmet"; +import * as i18n from "i18n"; +import * as flash from "connect-flash"; +import {expressMiddleware as expressPrometheusMetricsMiddleware} from "prometheus-api-metrics"; +import * as connectSessionSequelize from 'connect-session-sequelize' +import * as passportSocketIo from 'passport.socketio' +import * as SocketIo from 'socket.io' +import {Server as WsServer} from 'ws' +// core +import * as config from "./config"; +import * as logger from "./logger"; +import * as response from "./response"; +import * as models from "./models"; +import * as csp from "./csp"; +import {Environment} from "./config/enum"; + +import {checkVersion, versionCheckMiddleware} from "./web/middleware/checkVersion"; +import TooBusyMiddleware from './middleware/tooBusy' +import CheckURIValidMiddleware from './middleware/checkURIValid' +import RedirectWithoutTrailingSlashesMiddleware from './middleware/redirectWithoutTrailingSlashes' +import CodiMDVersionMiddleware from './middleware/codiMDVersion' + +import {router as MetricsRouter} from './metrics' +import {router as MainRouter} from './routes' + +import * as realtime from './realtime/realtime' + +const SequelizeStore = connectSessionSequelize(session.Store) + +function createHttpServer() { + if (config.useSSL) { + const ca = (function () { + let i, len + const results = [] + for (i = 0, len = config.sslCAPath.length; i < len; i++) { + results.push(fs.readFileSync(config.sslCAPath[i], 'utf8')) + } + return results + })() + const options = { + key: fs.readFileSync(config.sslKeyPath, 'utf8'), + cert: fs.readFileSync(config.sslCertPath, 'utf8'), + ca: ca, + dhparam: fs.readFileSync(config.dhParamPath, 'utf8'), + requestCert: false, + rejectUnauthorized: false + } + // eslint-disable-next-line @typescript-eslint/no-var-requires + return require('https').createServer(options, app) + } else { + // eslint-disable-next-line @typescript-eslint/no-var-requires + return require('http').createServer(app) + } +} + +// server setup +const app = express() +const server = createHttpServer() + +// API and process monitoring with Prometheus for Node.js micro-service +app.use(expressPrometheusMetricsMiddleware({ + metricsPath: '/metrics/router', + excludeRoutes: ['/metrics/codimd'] +})) + +// logger +app.use(morgan('combined', { + stream: logger.stream +})) + +// socket io + + +const io = SocketIo(server) +io.engine.ws = new WsServer({ + noServer: true, + perMessageDeflate: false +}) + +// others + +// assign socket io to realtime +realtime.setSocketIo(io) + +// methodOverride +app.use(methodOverride('_method')) + +// session store +const sessionStore = new SequelizeStore({ + db: models.sequelize +}) + +// use hsts to tell https users stick to this +if (config.hsts.enable) { + app.use(helmet.hsts({ + maxAge: config.hsts.maxAgeSeconds, + includeSubdomains: config.hsts.includeSubdomains, + preload: config.hsts.preload + })) +} else if (config.useSSL) { + logger.info('Consider enabling HSTS for extra security:') + logger.info('https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security') +} + +// Add referrer policy to improve privacy +app.use( + helmet.referrerPolicy({ + policy: 'same-origin' + }) +) + +// Generate a random nonce per request, for CSP with inline scripts +app.use(csp.addNonceToLocals) + +// use Content-Security-Policy to limit XSS, dangerous plugins, etc. +// https://helmetjs.github.io/docs/csp/ +if (config.csp.enable) { + app.use(helmet.contentSecurityPolicy({ + directives: csp.computeDirectives() + })) +} else { + logger.info('Content-Security-Policy is disabled. This may be a security risk.') +} + +i18n.configure({ + locales: ['en', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da', 'ko', 'id', 'sr'], + cookie: 'locale', + directory: path.join(__dirname, '/locales'), + updateFiles: config.updateI18nFiles +}) + +app.use(cookieParser()) + +app.use(i18n.init) + +// routes without sessions +// static files +app.use('/', express.static(path.join(__dirname, '/public'), {maxAge: config.staticCacheTime, index: false})) +app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), {maxAge: config.staticCacheTime})) +app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), {maxAge: config.staticCacheTime})) +app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), {maxAge: config.staticCacheTime})) +app.use(MetricsRouter) + +// session +app.use(session({ + name: config.sessionName, + secret: config.sessionSecret, + resave: false, // don't save session if unmodified + saveUninitialized: true, // always create session to ensure the origin + rolling: true, // reset maxAge on every response + cookie: { + maxAge: config.sessionLife + }, + store: sessionStore +})) + +// session resumption +const tlsSessionStore = {} +server.on('newSession', function (id: Buffer, data, cb) { + tlsSessionStore[id.toString('hex')] = data + cb() +}) +server.on('resumeSession', function (id: Buffer, cb) { + cb(null, tlsSessionStore[id.toString('hex')] || null) +}) + +// middleware which blocks requests when we're too busy +app.use(TooBusyMiddleware) + +app.use(flash()) + +// passport +app.use(passport.initialize()) +app.use(passport.session()) + +// check uri is valid before going further +app.use(CheckURIValidMiddleware) +// redirect url without trailing slashes +app.use(RedirectWithoutTrailingSlashesMiddleware) +app.use(CodiMDVersionMiddleware) + +if (config.autoVersionCheck && process.env.NODE_ENV === Environment.production) { + checkVersion(app) + app.use(versionCheckMiddleware) +} + +// routes need sessions +// template files +app.set('views', config.viewPath) +// set render engine +app.engine('ejs', ejs.renderFile) +// set view engine +app.set('view engine', 'ejs') +// set generally available variables for all views +app.locals.useCDN = config.useCDN +app.locals.serverURL = config.serverURL +app.locals.sourceURL = config.sourceURL +app.locals.privacyPolicyURL = config.privacyPolicyURL +app.locals.allowAnonymous = config.allowAnonymous +app.locals.allowAnonymousEdits = config.allowAnonymousEdits +app.locals.permission = config.permission +app.locals.allowPDFExport = config.allowPDFExport +app.locals.authProviders = { + facebook: config.isFacebookEnable, + twitter: config.isTwitterEnable, + github: config.isGitHubEnable, + bitbucket: config.isBitbucketEnable, + gitlab: config.isGitLabEnable, + mattermost: config.isMattermostEnable, + dropbox: config.isDropboxEnable, + google: config.isGoogleEnable, + ldap: config.isLDAPEnable, + ldapProviderName: config.ldap.providerName, + saml: config.isSAMLEnable, + oauth2: config.isOAuth2Enable, + oauth2ProviderName: config.oauth2.providerName, + openID: config.isOpenIDEnable, + email: config.isEmailEnable, + allowEmailRegister: config.allowEmailRegister +} +app.locals.versionInfo = { + latest: true, + versionItem: null +} + +// Export/Import menu items +app.locals.enableDropBoxSave = config.isDropboxEnable +app.locals.enableGitHubGist = config.isGitHubEnable +app.locals.enableGitlabSnippets = config.isGitlabSnippetsEnable + +app.use(MainRouter) + +// response not found if no any route matxches +app.get('*', function (req, res) { + response.errorNotFound(req, res) +}) + +// socket.io secure +io.use(realtime.secure) +// socket.io auth +io.use(passportSocketIo.authorize({ + cookieParser: cookieParser, + key: config.sessionName, + secret: config.sessionSecret, + store: sessionStore, + success: realtime.onAuthorizeSuccess, + fail: realtime.onAuthorizeFail +})) +// socket.io heartbeat +io.set('heartbeat interval', config.heartbeatInterval) +io.set('heartbeat timeout', config.heartbeatTimeout) +// socket.io connection +io.sockets.on('connection', realtime.connection) + +// listen +function startListen() { + let address + const listenCallback = function () { + const schema = config.useSSL ? 'HTTPS' : 'HTTP' + logger.info('%s Server listening at %s', schema, address) + realtime.setMaintenance(false) + } + + // use unix domain socket if 'path' is specified + if (config.path) { + address = config.path + server.listen(config.path, listenCallback) + } else { + address = config.host + ':' + config.port + server.listen(config.port, config.host, listenCallback) + } +} + +// sync db then start listen +models.sequelize.sync().then(function () { + // check if realtime is ready + if (realtime.isReady()) { + models.Revision.checkAllNotesRevision(function (err, notes) { + if (err) throw new Error(err) + if (!notes || notes.length <= 0) return startListen() + }) + } else { + throw new Error('server still not ready after db synced') + } +}).catch(err => { + logger.error('Can\'t sync database') + logger.error(err.stack) + logger.error('Process will exit now.') + process.exit(1) +}) + +// log uncaught exception +process.on('uncaughtException', function (err) { + logger.error('An uncaught exception has occured.') + logger.error(err) + console.error(err) + logger.error('Process will exit now.') + process.exit(1) +}) + +// install exit handler +function handleTermSignals() { + logger.info('CodiMD has been killed by signal, try to exit gracefully...') + realtime.setMaintenance(true) + realtime.terminate() + // disconnect all socket.io clients + Object.keys(io.sockets.sockets).forEach(function (key) { + const socket = io.sockets.sockets[key] + // notify client server going into maintenance status + socket.emit('maintenance') + setTimeout(function () { + socket.disconnect(true) + }, 0) + }) + const checkCleanTimer = setInterval(function () { + if (realtime.isReady()) { + models.Revision.checkAllNotesRevision(function (err, notes) { + if (err) return logger.error(err) + if (!notes || notes.length <= 0) { + clearInterval(checkCleanTimer) + return process.exit(0) + } + }) + } + }, 100) + setTimeout(() => { + process.exit(1) + }, 5000) +} +process.on('SIGINT', handleTermSignals) +process.on('SIGTERM', handleTermSignals) +process.on('SIGQUIT', handleTermSignals) diff --git a/lib/metrics.ts b/lib/metrics.ts index 79e4dacf47..a252864dd3 100644 --- a/lib/metrics.ts +++ b/lib/metrics.ts @@ -10,4 +10,4 @@ const appRouter = Router() appRouter.get('/status', wrap(statusController.getStatus)) appRouter.get('/metrics/codimd', wrap(statusController.getMetrics)) -exports.router = appRouter +export const router = appRouter diff --git a/lib/middleware/checkURIValid.ts b/lib/middleware/checkURIValid.ts index 4d9814a4da..e2dd33ea4a 100644 --- a/lib/middleware/checkURIValid.ts +++ b/lib/middleware/checkURIValid.ts @@ -1,7 +1,7 @@ import * as logger from '../logger' import * as response from "../response"; -export = function (req, res, next) { +export default function (req, res, next) { try { decodeURIComponent(req.path) } catch (err) { diff --git a/lib/middleware/codiMDVersion.ts b/lib/middleware/codiMDVersion.ts index b51823b37f..fc1cfec094 100644 --- a/lib/middleware/codiMDVersion.ts +++ b/lib/middleware/codiMDVersion.ts @@ -1,7 +1,7 @@ import * as config from "../config"; import {Request, Response} from "express"; -export = function (req: Request, res: Response, next) { +export default function (req: Request, res: Response, next) { res.set({ 'CodiMD-Version': config.version }) diff --git a/lib/middleware/redirectWithoutTrailingSlashes.ts b/lib/middleware/redirectWithoutTrailingSlashes.ts index 6412e5d33d..54a46054ed 100644 --- a/lib/middleware/redirectWithoutTrailingSlashes.ts +++ b/lib/middleware/redirectWithoutTrailingSlashes.ts @@ -2,7 +2,7 @@ import {Request, Response} from "express"; import * as config from "../config"; -export = function (req: Request, res: Response, next) { +export default function (req: Request, res: Response, next) { if (req.method === 'GET' && req.path.substr(-1) === '/' && req.path.length > 1) { const queryString = req.url.slice(req.path.length) const urlPath = req.path.slice(0, -1) diff --git a/lib/middleware/tooBusy.ts b/lib/middleware/tooBusy.ts index 42b759c43c..3642900b62 100644 --- a/lib/middleware/tooBusy.ts +++ b/lib/middleware/tooBusy.ts @@ -5,7 +5,7 @@ import * as response from "../response"; toobusy.maxLag(config.responseMaxLag) -export = function (req, res, next) { +export default function (req, res, next) { if (toobusy()) { response.errorServiceUnavailable(req, res) } else { diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 4ea4b3f03a..8a11986713 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -25,8 +25,16 @@ import {SaveRevisionJob} from "./realtimeSaveRevisionJob"; const chance = new Chance() -export const io = null -export const maintenance = true +export let io = null +export let maintenance = true + +export function setSocketIo(socketIO) { + io = socketIO +} + +export function setMaintenance(isMaintenance) { + maintenance = isMaintenance +} // public const connectProcessQueue = new ProcessQueue({}) diff --git a/lib/routes.ts b/lib/routes.ts index 8b4694c04e..938ac783ac 100644 --- a/lib/routes.ts +++ b/lib/routes.ts @@ -85,4 +85,4 @@ appRouter.get('/:noteId/:action', noteController.noteActions) // note actions with action id appRouter.get('/:noteId/:action/:actionId', noteController.noteActions) -exports.router = appRouter +export const router = appRouter diff --git a/package.json b/package.json index c4ba941401..1d4c68fab9 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "webpack --config webpack.prod.js --display errors-only -p", "dev": "webpack --config webpack.dev.js --progress --colors --watch", "doctoc": "doctoc --title='# Table of Contents' README.md", - "lint": "standard && eslint lib/**", + "lint": "standard ./public && eslint --quiet lib/**/*.ts lib/app.ts", "jsonlint": "find . -type f -not -ipath \"./node_modules/*\" -not -ipath \"./.vscode/*\" \\( -name \"*.json\" -o -name \"*.json.*\" \\) | xargs -n 1 -I{} -- bash -c 'echo {}; jq . {} > /dev/null;'", "start": "sequelize db:migrate && node app.js", "mocha": "mocha --require intelli-espower-loader --exit ./test --recursive", From 67491af2a119965c81d7e253e5d1b684f407a04f Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 14:03:57 +0800 Subject: [PATCH 099/167] fix: public path Signed-off-by: Raccoon --- lib/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app.ts b/lib/app.ts index 5bc25c38c7..6072407df3 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -146,7 +146,7 @@ app.use(i18n.init) // routes without sessions // static files -app.use('/', express.static(path.join(__dirname, '/public'), {maxAge: config.staticCacheTime, index: false})) +app.use('/', express.static(path.join(__dirname, '../public'), {maxAge: config.staticCacheTime, index: false})) app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), {maxAge: config.staticCacheTime})) app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), {maxAge: config.staticCacheTime})) app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), {maxAge: config.staticCacheTime})) From 019196484ae2fdeed16cfa3b382af4e13244c798 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 14:04:07 +0800 Subject: [PATCH 100/167] use new parameter in hsts Signed-off-by: Raccoon --- lib/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app.ts b/lib/app.ts index 6072407df3..8ac6836e6e 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -105,7 +105,7 @@ const sessionStore = new SequelizeStore({ if (config.hsts.enable) { app.use(helmet.hsts({ maxAge: config.hsts.maxAgeSeconds, - includeSubdomains: config.hsts.includeSubdomains, + includeSubDomains: config.hsts.includeSubdomains, preload: config.hsts.preload })) } else if (config.useSSL) { From 72ca90aae29328b731c5e9889d8176d3fb4a05ca Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 14:06:43 +0800 Subject: [PATCH 101/167] upgrade winston Signed-off-by: Raccoon --- package-lock.json | 142 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 77 insertions(+), 67 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b150c15bd..f4e75253f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -791,6 +791,16 @@ "integrity": "sha512-GcIY79elgB+azP74j8vqkiXz8xLFfIzbQJdlwOPisgbKT00tviJQuEghOXSMVxJ00HoYJbGswr4kcllUc4xCcg==", "dev": true }, + "@dabh/diagnostics": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", + "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", + "requires": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, "@eslint/eslintrc": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", @@ -4320,11 +4330,6 @@ "simple-swizzle": "^0.2.2" } }, - "colornames": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz", - "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=" - }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -5665,16 +5670,6 @@ "repeating": "^2.0.0" } }, - "diagnostics": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", - "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", - "requires": { - "colorspace": "1.1.x", - "enabled": "1.0.x", - "kuler": "1.0.x" - } - }, "dictionary-de": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dictionary-de/-/dictionary-de-2.0.3.tgz", @@ -6054,12 +6049,9 @@ } }, "enabled": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", - "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", - "requires": { - "env-variable": "0.0.x" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" }, "encodeurl": { "version": "1.0.2", @@ -6227,11 +6219,6 @@ "he": "^1.1.1" } }, - "env-variable": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.6.tgz", - "integrity": "sha512-bHz59NlBbtS0NhftmR8+ExBEekE7br0e01jw+kk0NDro7TtZzBYZ5ScGPs3OmwnpyfHTHOtr1Y6uedCdrIldtg==" - }, "errlop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/errlop/-/errlop-2.0.0.tgz", @@ -7741,9 +7728,9 @@ "integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==" }, "fecha": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", - "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", + "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" }, "figgy-pudding": { "version": "3.5.1", @@ -7928,6 +7915,11 @@ "readable-stream": "^2.3.6" } }, + "fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -10429,12 +10421,9 @@ } }, "kuler": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz", - "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", - "requires": { - "colornames": "^1.1.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" }, "last-call-webpack-plugin": { "version": "3.0.0", @@ -10789,13 +10778,13 @@ "dev": true }, "logform": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz", - "integrity": "sha512-+lZh4OpERDBLqjiwDLpAWNQu6KMjnlXH2ByZwCuSqVPJletw0kTWJf5CgSNAUKn1KUkv3m2cUz/LK8zyEy7wzQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz", + "integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==", "requires": { "colors": "^1.2.1", "fast-safe-stringify": "^2.0.4", - "fecha": "^2.3.3", + "fecha": "^4.2.0", "ms": "^2.1.1", "triple-beam": "^1.3.0" } @@ -12404,9 +12393,12 @@ } }, "one-time": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz", - "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "requires": { + "fn.name": "1.x.x" + } }, "onetime": { "version": "2.0.1", @@ -18706,33 +18698,30 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "winston": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz", - "integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz", + "integrity": "sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==", "requires": { - "async": "^2.6.1", - "diagnostics": "^1.1.1", - "is-stream": "^1.1.0", - "logform": "^2.1.1", - "one-time": "0.0.4", - "readable-stream": "^3.1.1", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.1.0", + "is-stream": "^2.0.0", + "logform": "^2.2.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", - "winston-transport": "^4.3.0" + "winston-transport": "^4.4.0" }, "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, "readable-stream": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", - "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -18742,12 +18731,33 @@ } }, "winston-transport": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz", - "integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz", + "integrity": "sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==", "requires": { - "readable-stream": "^2.3.6", + "readable-stream": "^2.3.7", "triple-beam": "^1.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "with-open-file": { diff --git a/package.json b/package.json index 1d4c68fab9..091d485054 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "toobusy-js": "~0.5.1", "uuid": "~3.3.2", "validator": "~11.1.0", - "winston": "~3.2.1", + "winston": "3.3.3", "ws": "~7.1.1" }, "devDependencies": { From 6d512c0cc3f97255a6c0c91627d31caf8b56bc2b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 14:29:32 +0800 Subject: [PATCH 102/167] adjust logger Signed-off-by: Raccoon --- lib/logger.ts | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/logger.ts b/lib/logger.ts index aa3b2cb77c..fd636e4bb8 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -5,15 +5,26 @@ type CodiMDLogger = Logger & { setLevel?: (string) => void } -const logger: CodiMDLogger = createLogger({ - level: 'debug', - format: format.combine( - format.uncolorize(), +let defaultFormatter = format.combine( + format.timestamp(), + format.splat(), + format.json() +) +if (process.env.NODE_ENV === 'development' || !process.env.NODE_ENV) { + defaultFormatter = format.combine( format.timestamp(), format.align(), format.splat(), + format.prettyPrint(), + format.colorize(), + format.errors({stack: true}), format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`) - ), + ) +} + +const logger: CodiMDLogger = createLogger({ + level: 'debug', + format: defaultFormatter, transports: [ new transports.Console({ handleExceptions: true From 8fb31bd018fa21f25111796145b1a2a9eb4502d8 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 14:54:58 +0800 Subject: [PATCH 103/167] upgrade morgan to 1.10 Signed-off-by: Raccoon --- package-lock.json | 19 +++++++++++++------ package.json | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index f4e75253f4..d17b7b7468 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11697,15 +11697,22 @@ } }, "morgan": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", - "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", "requires": { - "basic-auth": "~2.0.0", + "basic-auth": "~2.0.1", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "~2.0.0", "on-finished": "~2.3.0", - "on-headers": "~1.0.1" + "on-headers": "~1.0.2" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + } } }, "move-concurrently": { diff --git a/package.json b/package.json index 091d485054..78d5384565 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "minimist": "~1.2.0", "minio": "^7.0.12", "moment": "~2.24.0", - "morgan": "~1.9.1", + "morgan": "1.10.0", "mysql": "~2.17.1", "mysql2": "^2.0.1", "ot": "git+https://github.com/hackmdio/ot.js.git#cc1f338", From 41f0e6104943207874b123560592d97acc638cd2 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 14:55:33 +0800 Subject: [PATCH 104/167] use winston.http to log morgan, and adjust development output Signed-off-by: Raccoon --- lib/app.ts | 6 ++++-- lib/config/default.ts | 2 +- lib/config/index.ts | 4 ++-- lib/logger.ts | 13 ++++++++----- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/app.ts b/lib/app.ts index 8ac6836e6e..602c797d5b 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -75,8 +75,9 @@ app.use(expressPrometheusMetricsMiddleware({ })) // logger -app.use(morgan('combined', { - stream: logger.stream +const morganLogType = config.env === config.Environment.development ? 'dev' : 'combined' +app.use(morgan(morganLogType, { + stream: logger.morganLog, })) // socket io @@ -338,6 +339,7 @@ function handleTermSignals() { process.exit(1) }, 5000) } + process.on('SIGINT', handleTermSignals) process.on('SIGTERM', handleTermSignals) process.on('SIGQUIT', handleTermSignals) diff --git a/lib/config/default.ts b/lib/config/default.ts index ab292e17c1..8f3de324c1 100644 --- a/lib/config/default.ts +++ b/lib/config/default.ts @@ -5,7 +5,7 @@ const defaultConfig = { urlPath: '', host: '0.0.0.0', port: 3000, - loglevel: 'info', + loglevel: 'http', urlAddPort: false, allowOrigin: ['localhost'], useSSL: false, diff --git a/lib/config/index.ts b/lib/config/index.ts index c12533b8a8..2489a5717c 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -46,7 +46,7 @@ merge(config, require('./environment')) // eslint-disable-next-line @typescript-eslint/no-var-requires merge(config, require('./dockerSecret')) -if (['debug', 'verbose', 'info', 'warn', 'error'].includes(config.loglevel)) { +if (['debug', 'verbose', 'http', 'info', 'warn', 'error'].includes(config.loglevel)) { logger.setLevel(config.loglevel) } else { logger.error('Selected loglevel %s doesn\'t exist, using default level \'debug\'. Available options: debug, verbose, info, warn, error', config.loglevel) @@ -213,7 +213,7 @@ config.tmpPath = path.resolve(appRootPath, config.tmpPath) config.defaultNotePath = path.resolve(appRootPath, config.defaultNotePath) config.docsPath = path.resolve(appRootPath, config.docsPath) config.uploadsPath = path.resolve(appRootPath, config.uploadsPath) - +config.env = env // make config readonly config = deepFreeze(config) as any diff --git a/lib/logger.ts b/lib/logger.ts index fd636e4bb8..22e3df22ac 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -1,7 +1,10 @@ import {createLogger, format, transports, Logger} from "winston"; + type CodiMDLogger = Logger & { - stream: any + morganLog?: { + write: (message: string) => void + } setLevel?: (string) => void } @@ -23,7 +26,6 @@ if (process.env.NODE_ENV === 'development' || !process.env.NODE_ENV) { } const logger: CodiMDLogger = createLogger({ - level: 'debug', format: defaultFormatter, transports: [ new transports.Console({ @@ -33,9 +35,10 @@ const logger: CodiMDLogger = createLogger({ exitOnError: false }) -logger.stream = { - write: function (message, encoding) { - logger.info(message) +// for morgan used +logger.morganLog = { + write: buffer => { + logger.http(buffer.trim()) } } From f73e72b865f6c95cff1fdd23115dec5a4b8c3738 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 15:25:25 +0800 Subject: [PATCH 105/167] fix: i18n path Signed-off-by: Raccoon --- lib/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app.ts b/lib/app.ts index 602c797d5b..9f612c5f4a 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -137,7 +137,7 @@ if (config.csp.enable) { i18n.configure({ locales: ['en', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da', 'ko', 'id', 'sr'], cookie: 'locale', - directory: path.join(__dirname, '/locales'), + directory: path.join(__dirname, '../locales'), updateFiles: config.updateI18nFiles }) From aaf019e2b4ebbee46fe9b67866d08822de7ba33b Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 15:36:32 +0800 Subject: [PATCH 106/167] enable esModuleInterop Signed-off-by: Raccoon --- lib/app.ts | 31 ++++++++++---------- lib/auth/bitbucket/index.ts | 2 +- lib/auth/dropbox/index.ts | 2 +- lib/auth/email/index.ts | 2 +- lib/auth/facebook/index.ts | 2 +- lib/auth/github/index.ts | 2 +- lib/auth/gitlab/index.ts | 4 +-- lib/auth/google/index.ts | 2 +- lib/auth/index.ts | 2 +- lib/auth/ldap/index.ts | 4 +-- lib/auth/mattermost/index.ts | 2 +- lib/auth/oauth2/index.ts | 2 +- lib/auth/openid/index.ts | 2 +- lib/auth/saml/index.ts | 2 +- lib/auth/twitter/index.ts | 2 +- lib/config/index.ts | 2 +- lib/csp.ts | 2 +- lib/history/index.ts | 2 +- lib/imageRouter/azure.ts | 2 +- lib/imageRouter/imgur.ts | 2 +- lib/imageRouter/index.ts | 8 ++--- lib/imageRouter/lutim.ts | 2 +- lib/imageRouter/minio.ts | 2 +- lib/letter-avatars.ts | 2 +- lib/middleware/tooBusy.ts | 2 +- lib/models/author.ts | 3 +- lib/models/note.ts | 20 ++++++------- lib/models/revision.ts | 6 ++-- lib/models/user.ts | 2 +- lib/note/noteActions.ts | 8 ++--- lib/realtime/realtime.ts | 14 ++++----- lib/realtime/realtimeCleanDanglingUserJob.ts | 2 +- lib/realtime/realtimeUpdateDirtyNoteJob.ts | 2 +- lib/routes.ts | 2 +- lib/user/index.ts | 4 +-- lib/utils.ts | 4 +-- lib/web/middleware/checkVersion.ts | 2 +- lib/workers/dmpWorker.ts | 2 +- tsconfig.json | 2 +- 39 files changed, 81 insertions(+), 81 deletions(-) diff --git a/lib/app.ts b/lib/app.ts index 9f612c5f4a..fb264c05f5 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -1,21 +1,22 @@ // app // external modules -import * as express from "express"; -import * as ejs from "ejs"; -import * as passport from "passport"; -import * as methodOverride from "method-override"; -import * as cookieParser from "cookie-parser"; -import * as session from "express-session"; -import * as fs from "fs"; -import * as path from "path"; -import * as morgan from "morgan"; -import * as helmet from "helmet"; -import * as i18n from "i18n"; -import * as flash from "connect-flash"; +import fs from "fs"; +import path from "path"; + +import express from "express"; +import ejs from "ejs"; +import passport from "passport"; +import methodOverride from "method-override"; +import cookieParser from "cookie-parser"; +import session from "express-session"; +import morgan from "morgan"; +import helmet from "helmet"; +import i18n from "i18n"; +import flash from "connect-flash"; import {expressMiddleware as expressPrometheusMetricsMiddleware} from "prometheus-api-metrics"; -import * as connectSessionSequelize from 'connect-session-sequelize' -import * as passportSocketIo from 'passport.socketio' -import * as SocketIo from 'socket.io' +import connectSessionSequelize from 'connect-session-sequelize' +import passportSocketIo from 'passport.socketio' +import SocketIo from 'socket.io' import {Server as WsServer} from 'ws' // core import * as config from "./config"; diff --git a/lib/auth/bitbucket/index.ts b/lib/auth/bitbucket/index.ts index a70710290a..24d7828215 100644 --- a/lib/auth/bitbucket/index.ts +++ b/lib/auth/bitbucket/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as BitbucketStrategy} from "passport-bitbucket-oauth2"; import * as config from "../../config"; diff --git a/lib/auth/dropbox/index.ts b/lib/auth/dropbox/index.ts index d6541b65f6..ae3be792d5 100644 --- a/lib/auth/dropbox/index.ts +++ b/lib/auth/dropbox/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as DropboxStrategy} from "passport-dropbox-oauth2"; import * as config from "../../config"; diff --git a/lib/auth/email/index.ts b/lib/auth/email/index.ts index 8ee746d3fc..fb6da6c445 100644 --- a/lib/auth/email/index.ts +++ b/lib/auth/email/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import validator from "validator"; import {Strategy as LocalStrategy} from 'passport-local'; diff --git a/lib/auth/facebook/index.ts b/lib/auth/facebook/index.ts index 485364407a..0c0adbd158 100644 --- a/lib/auth/facebook/index.ts +++ b/lib/auth/facebook/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as FacebookStrategy} from "passport-facebook"; import * as config from "../../config"; diff --git a/lib/auth/github/index.ts b/lib/auth/github/index.ts index 2f3acab388..0c1f1f471c 100644 --- a/lib/auth/github/index.ts +++ b/lib/auth/github/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as GithubStrategy} from "passport-github"; import * as config from "../../config"; import * as response from "../../response"; diff --git a/lib/auth/gitlab/index.ts b/lib/auth/gitlab/index.ts index b4c1afea9a..0b2c580a04 100644 --- a/lib/auth/gitlab/index.ts +++ b/lib/auth/gitlab/index.ts @@ -1,11 +1,11 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as GitlabStrategy} from "passport-gitlab2"; import * as config from "../../config"; import * as response from "../../response"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; -import * as HttpsProxyAgent from "https-proxy-agent"; +import HttpsProxyAgent from "https-proxy-agent"; const gitlabAuth = Router() export = gitlabAuth diff --git a/lib/auth/google/index.ts b/lib/auth/google/index.ts index cf0d1ac2b4..2e70eea5f0 100644 --- a/lib/auth/google/index.ts +++ b/lib/auth/google/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as GoogleStrategy} from "passport-google-oauth20"; import * as config from "../../config"; diff --git a/lib/auth/index.ts b/lib/auth/index.ts index abbb19ddf3..0a93a4b342 100644 --- a/lib/auth/index.ts +++ b/lib/auth/index.ts @@ -1,6 +1,6 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import * as config from "../config"; import * as logger from "../logger"; import * as models from "../models"; diff --git a/lib/auth/ldap/index.ts b/lib/auth/ldap/index.ts index ad01716a9c..42796aaf04 100644 --- a/lib/auth/ldap/index.ts +++ b/lib/auth/ldap/index.ts @@ -1,6 +1,6 @@ import {Router} from "express"; -import * as passport from "passport"; -import * as LDAPStrategy from "passport-ldapauth"; +import passport from "passport"; +import LDAPStrategy from "passport-ldapauth"; import * as config from "../../config"; import * as models from "../../models"; diff --git a/lib/auth/mattermost/index.ts b/lib/auth/mattermost/index.ts index f7d74f5cfe..f8fe11c2c5 100644 --- a/lib/auth/mattermost/index.ts +++ b/lib/auth/mattermost/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; require('babel-polyfill') require('isomorphic-fetch') diff --git a/lib/auth/oauth2/index.ts b/lib/auth/oauth2/index.ts index 6ea8aa32f7..9e9fb97bb3 100644 --- a/lib/auth/oauth2/index.ts +++ b/lib/auth/oauth2/index.ts @@ -1,5 +1,5 @@ import {Router} from 'express' -import * as passport from 'passport' +import passport from 'passport' import * as config from '../../config' import {passportGeneralCallback, setReturnToFromReferer} from '../utils' diff --git a/lib/auth/openid/index.ts b/lib/auth/openid/index.ts index 57164ec08d..5155d16fe7 100644 --- a/lib/auth/openid/index.ts +++ b/lib/auth/openid/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as OpenIDStrategy} from "@passport-next/passport-openid"; import * as config from "../../config"; diff --git a/lib/auth/saml/index.ts b/lib/auth/saml/index.ts index 171f5e736f..66a9da315b 100644 --- a/lib/auth/saml/index.ts +++ b/lib/auth/saml/index.ts @@ -1,6 +1,6 @@ import * as fs from "fs"; import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as SamlStrategy} from "passport-saml"; import * as config from "../../config"; diff --git a/lib/auth/twitter/index.ts b/lib/auth/twitter/index.ts index 6238521617..197d11f8b1 100644 --- a/lib/auth/twitter/index.ts +++ b/lib/auth/twitter/index.ts @@ -1,5 +1,5 @@ import {Router} from "express"; -import * as passport from "passport"; +import passport from "passport"; import {Strategy as TwitterStrategy} from "passport-twitter"; import * as config from "../../config"; diff --git a/lib/config/index.ts b/lib/config/index.ts index 2489a5717c..cf87474de2 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -2,7 +2,7 @@ import * as crypto from "crypto"; import * as fs from "fs"; import * as path from "path"; import {merge} from "lodash"; -import * as deepFreeze from "deep-freeze"; +import deepFreeze from "deep-freeze"; import {Environment, Permission} from "./enum"; import * as logger from "../logger"; diff --git a/lib/csp.ts b/lib/csp.ts index 4122bc5373..13851fa5d3 100644 --- a/lib/csp.ts +++ b/lib/csp.ts @@ -1,5 +1,5 @@ import * as config from "./config"; -import * as uuid from "uuid"; +import uuid from "uuid"; const CspStrategy: any = {} diff --git a/lib/history/index.ts b/lib/history/index.ts index 8d171b5a89..43efc5d2be 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -1,6 +1,6 @@ // history // external modules -import * as LZString from '@hackmd/lz-string' +import LZString from '@hackmd/lz-string' import * as models from '../models' import * as logger from '../logger' diff --git a/lib/imageRouter/azure.ts b/lib/imageRouter/azure.ts index 8e47ee566d..6084720fc2 100644 --- a/lib/imageRouter/azure.ts +++ b/lib/imageRouter/azure.ts @@ -1,7 +1,7 @@ 'use strict' import * as path from "path"; -import * as azure from "azure-storage"; +import azure from "azure-storage"; import * as config from "../config"; import * as logger from "../logger"; diff --git a/lib/imageRouter/imgur.ts b/lib/imageRouter/imgur.ts index 46869f2b82..e3bcd3d85d 100644 --- a/lib/imageRouter/imgur.ts +++ b/lib/imageRouter/imgur.ts @@ -1,5 +1,5 @@ 'use strict' -import * as imgur from "@hackmd/imgur"; +import imgur from "@hackmd/imgur"; import * as config from "../config"; import * as logger from "../logger"; diff --git a/lib/imageRouter/index.ts b/lib/imageRouter/index.ts index cb95aeb915..55d173afc9 100644 --- a/lib/imageRouter/index.ts +++ b/lib/imageRouter/index.ts @@ -3,10 +3,10 @@ import * as path from "path"; import {noop} from 'lodash' import {Router} from "express"; -import * as formidable from "formidable"; -import * as readChunk from "read-chunk"; -import * as imageType from "image-type"; -import * as mime from "mime-types"; +import formidable from "formidable"; +import readChunk from "read-chunk"; +import imageType from "image-type"; +import mime from "mime-types"; import * as config from "../config"; import * as logger from "../logger"; diff --git a/lib/imageRouter/lutim.ts b/lib/imageRouter/lutim.ts index 112ed1e5c4..dcd3216ffb 100644 --- a/lib/imageRouter/lutim.ts +++ b/lib/imageRouter/lutim.ts @@ -1,4 +1,4 @@ -import * as lutim from "lutim"; +import lutim from "lutim"; import * as config from "../config"; import * as logger from "../logger"; diff --git a/lib/imageRouter/minio.ts b/lib/imageRouter/minio.ts index ec5da79dc0..5786b43d0d 100644 --- a/lib/imageRouter/minio.ts +++ b/lib/imageRouter/minio.ts @@ -1,7 +1,7 @@ import * as fs from "fs"; import * as path from "path"; -import * as Minio from "minio"; +import Minio from "minio"; import * as config from "../config"; import {getImageMimeType} from "../utils"; diff --git a/lib/letter-avatars.ts b/lib/letter-avatars.ts index 811c41db4b..fb617553f0 100644 --- a/lib/letter-avatars.ts +++ b/lib/letter-avatars.ts @@ -1,6 +1,6 @@ // external modules import * as crypto from "crypto"; -import * as randomcolor from "randomcolor"; +import randomcolor from "randomcolor"; import * as config from "./config"; diff --git a/lib/middleware/tooBusy.ts b/lib/middleware/tooBusy.ts index 3642900b62..9f4099a843 100644 --- a/lib/middleware/tooBusy.ts +++ b/lib/middleware/tooBusy.ts @@ -1,4 +1,4 @@ -import * as toobusy from "toobusy-js"; +import toobusy from "toobusy-js"; import * as config from "../config"; import * as response from "../response"; diff --git a/lib/models/author.ts b/lib/models/author.ts index a79bf269db..67742b9396 100644 --- a/lib/models/author.ts +++ b/lib/models/author.ts @@ -1,10 +1,9 @@ // external modules -import * as Sequelize from "sequelize"; export = function (sequelize, DataTypes) { const Author = sequelize.define('Author', { id: { - type: Sequelize.INTEGER, + type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true }, diff --git a/lib/models/note.ts b/lib/models/note.ts index 73f84c51a4..d2f75e0da5 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -1,16 +1,16 @@ // external modules import * as fs from "fs"; import * as path from "path"; -import * as LZString from "@hackmd/lz-string"; +import LZString from "@hackmd/lz-string"; import base64url from "base64url"; -import * as markdown_it from "markdown-it"; -import * as metaMarked from "@hackmd/meta-marked"; -import * as cheerio from "cheerio"; -import * as shortId from "shortid"; +import markdownIt from "markdown-it"; +import metaMarked from "@hackmd/meta-marked"; +import cheerio from "cheerio"; +import shortId from "shortid"; import * as Sequelize from "sequelize"; -import * as async from "async"; -import * as moment from "moment"; -import * as DiffMatchPatch from "@hackmd/diff-match-patch"; +import async from "async"; +import moment from "moment"; +import DiffMatchPatch from "@hackmd/diff-match-patch"; // core import * as config from "../config"; @@ -18,9 +18,9 @@ import * as logger from "../logger"; import {stripTags} from "../string"; // ot -import * as ot from "ot"; +import ot from "ot"; -const md = markdown_it() +const md = markdownIt() const dmp = new DiffMatchPatch() // permission types const permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private'] diff --git a/lib/models/revision.ts b/lib/models/revision.ts index aa3a3202c4..ba105327a6 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -1,9 +1,9 @@ // external modules import * as Sequelize from "sequelize"; -import * as async from "async"; -import * as moment from "moment"; +import async from "async"; +import moment from "moment"; import * as childProcess from "child_process"; -import * as shortId from "shortid"; +import shortId from "shortid"; import * as path from "path"; import * as util from "util"; diff --git a/lib/models/user.ts b/lib/models/user.ts index 0ae0a807c4..f02106a042 100644 --- a/lib/models/user.ts +++ b/lib/models/user.ts @@ -2,7 +2,7 @@ // external modules import * as Sequelize from "sequelize"; -import * as Scrypt from "scrypt-kdf"; +import Scrypt from "scrypt-kdf"; // core import * as logger from "../logger"; import {generateAvatarURL} from "../letter-avatars"; diff --git a/lib/note/noteActions.ts b/lib/note/noteActions.ts index b3849a3191..5d8a0af09e 100644 --- a/lib/note/noteActions.ts +++ b/lib/note/noteActions.ts @@ -1,10 +1,10 @@ import * as fs from "fs"; import * as path from "path"; -import * as markdownpdf from "markdown-pdf"; -import * as shortId from "shortid"; -import * as querystring from "querystring"; -import * as moment from "moment"; +import markdownpdf from "markdown-pdf"; +import shortId from "shortid"; +import querystring from "querystring"; +import moment from "moment"; // const { Pandoc } = require('@hackmd/pandoc.js') import * as config from "../config"; diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 8a11986713..7d306a7626 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -1,11 +1,11 @@ // realtime // external modules -import * as cookie from "cookie"; -import * as cookieParser from "cookie-parser"; -import * as url from "url"; -import * as randomcolor from "randomcolor"; -import * as Chance from "chance"; -import * as moment from "moment"; +import cookie from "cookie"; +import cookieParser from "cookie-parser"; +import url from "url"; +import randomcolor from "randomcolor"; +import Chance from "chance"; +import moment from "moment"; import {get} from "lodash"; // core @@ -15,7 +15,7 @@ import * as history from "../history"; import * as models from "../models"; // ot -import * as ot from "ot"; +import ot from "ot"; import {ProcessQueue} from "./processQueue"; import {RealtimeClientConnection} from "./realtimeClientConnection"; diff --git a/lib/realtime/realtimeCleanDanglingUserJob.ts b/lib/realtime/realtimeCleanDanglingUserJob.ts index da2bbf2d65..5b864b305d 100644 --- a/lib/realtime/realtimeCleanDanglingUserJob.ts +++ b/lib/realtime/realtimeCleanDanglingUserJob.ts @@ -1,6 +1,6 @@ 'use strict' -import * as async from "async"; +import async from "async"; import * as config from "../config"; import * as logger from "../logger"; diff --git a/lib/realtime/realtimeUpdateDirtyNoteJob.ts b/lib/realtime/realtimeUpdateDirtyNoteJob.ts index 2225d3ca6b..bc30a608a5 100644 --- a/lib/realtime/realtimeUpdateDirtyNoteJob.ts +++ b/lib/realtime/realtimeUpdateDirtyNoteJob.ts @@ -1,4 +1,4 @@ -import * as moment from "moment"; +import moment from "moment"; import * as config from "../config"; import * as logger from "../logger"; diff --git a/lib/routes.ts b/lib/routes.ts index 938ac783ac..a32da08f31 100644 --- a/lib/routes.ts +++ b/lib/routes.ts @@ -10,7 +10,7 @@ import * as userController from "./user"; import * as noteController from "./note"; import * as response from "./response"; -import * as bodyParser from "body-parser"; +import bodyParser from "body-parser"; const appRouter = Router() diff --git a/lib/user/index.ts b/lib/user/index.ts index ca8799e604..3bcfe8938b 100644 --- a/lib/user/index.ts +++ b/lib/user/index.ts @@ -1,5 +1,5 @@ -import * as archiver from 'archiver' -import * as async from 'async' +import archiver from 'archiver' +import async from 'async' import * as response from '../response' import * as config from '../config' import * as models from '../models' diff --git a/lib/utils.ts b/lib/utils.ts index 17fea0afe3..3c48a679e8 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -1,8 +1,8 @@ import * as fs from "fs"; import * as path from "path"; -import * as mime from "mime-types"; -import * as bodyParser from "body-parser"; +import mime from "mime-types"; +import bodyParser from "body-parser"; export function isSQLite(sequelize) { return sequelize.options.dialect === 'sqlite' diff --git a/lib/web/middleware/checkVersion.ts b/lib/web/middleware/checkVersion.ts index 75a6e25189..5f7d70cd8a 100644 --- a/lib/web/middleware/checkVersion.ts +++ b/lib/web/middleware/checkVersion.ts @@ -1,6 +1,6 @@ import {promisify} from "util"; -import * as request from "request"; +import request from "request"; import * as logger from "../../logger"; import * as config from "../../config"; diff --git a/lib/workers/dmpWorker.ts b/lib/workers/dmpWorker.ts index 6b1b82920a..0e31426cd5 100644 --- a/lib/workers/dmpWorker.ts +++ b/lib/workers/dmpWorker.ts @@ -1,6 +1,6 @@ 'use strict' // external modules -import * as DiffMatchPatch from "@hackmd/diff-match-patch"; +import DiffMatchPatch from "@hackmd/diff-match-patch"; // core import * as config from "../config"; import * as logger from "../logger"; diff --git a/tsconfig.json b/tsconfig.json index 1741b9e9ca..9cd1a8128d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "target": "ES2019", "outDir": "./dist/", "module": "CommonJS", - "moduleResolution": "Node" + "esModuleInterop": true }, "include": [ "./lib/**/*" From d1a440e7bd7f7027972383a5bbe4227351d72a89 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 15:36:46 +0800 Subject: [PATCH 107/167] refactor logger export Signed-off-by: Raccoon --- lib/app.ts | 2 +- lib/auth/email/index.ts | 2 +- lib/auth/index.ts | 2 +- lib/auth/ldap/index.ts | 2 +- lib/auth/openid/index.ts | 2 +- lib/auth/saml/index.ts | 2 +- lib/auth/utils.ts | 2 +- lib/config/index.ts | 2 +- lib/history/index.ts | 2 +- lib/homepage/index.ts | 2 +- lib/imageRouter/azure.ts | 2 +- lib/imageRouter/filesystem.ts | 2 +- lib/imageRouter/imgur.ts | 2 +- lib/imageRouter/index.ts | 2 +- lib/imageRouter/lutim.ts | 2 +- lib/imageRouter/minio.ts | 2 +- lib/imageRouter/s3.ts | 2 +- lib/logger.ts | 5 +++-- lib/middleware/checkURIValid.ts | 2 +- lib/models/index.ts | 2 +- lib/models/note.ts | 2 +- lib/models/revision.ts | 2 +- lib/models/user.ts | 2 +- lib/note/index.ts | 2 +- lib/note/noteActions.ts | 2 +- lib/realtime/realtime.ts | 2 +- lib/realtime/realtimeCleanDanglingUserJob.ts | 2 +- lib/realtime/realtimeClientConnection.ts | 2 +- lib/realtime/realtimeSaveRevisionJob.ts | 2 +- lib/realtime/realtimeUpdateDirtyNoteJob.ts | 2 +- lib/response.ts | 2 +- lib/user/index.ts | 2 +- lib/web/middleware/checkVersion.ts | 2 +- lib/workers/dmpWorker.ts | 2 +- 34 files changed, 36 insertions(+), 35 deletions(-) diff --git a/lib/app.ts b/lib/app.ts index fb264c05f5..2973cc0b2a 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -20,7 +20,7 @@ import SocketIo from 'socket.io' import {Server as WsServer} from 'ws' // core import * as config from "./config"; -import * as logger from "./logger"; +import {logger} from "./logger"; import * as response from "./response"; import * as models from "./models"; import * as csp from "./csp"; diff --git a/lib/auth/email/index.ts b/lib/auth/email/index.ts index fb6da6c445..c0f0de624a 100644 --- a/lib/auth/email/index.ts +++ b/lib/auth/email/index.ts @@ -5,7 +5,7 @@ import {Strategy as LocalStrategy} from 'passport-local'; import * as config from '../../config'; import * as models from '../../models'; -import * as logger from "../../logger"; +import {logger} from "../../logger"; import {setReturnToFromReferer} from "../utils"; import {urlencodedParser} from "../../utils"; import * as response from "../../response"; diff --git a/lib/auth/index.ts b/lib/auth/index.ts index 0a93a4b342..4ba572afb9 100644 --- a/lib/auth/index.ts +++ b/lib/auth/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; import * as models from "../models"; const authRouter = Router() diff --git a/lib/auth/ldap/index.ts b/lib/auth/ldap/index.ts index 42796aaf04..137ab9c846 100644 --- a/lib/auth/ldap/index.ts +++ b/lib/auth/ldap/index.ts @@ -4,7 +4,7 @@ import LDAPStrategy from "passport-ldapauth"; import * as config from "../../config"; import * as models from "../../models"; -import * as logger from "../../logger"; +import {logger} from "../../logger"; import * as response from "../../response"; import {setReturnToFromReferer} from "../utils"; import {urlencodedParser} from "../../utils"; diff --git a/lib/auth/openid/index.ts b/lib/auth/openid/index.ts index 5155d16fe7..0bcc1270f8 100644 --- a/lib/auth/openid/index.ts +++ b/lib/auth/openid/index.ts @@ -4,7 +4,7 @@ import {Strategy as OpenIDStrategy} from "@passport-next/passport-openid"; import * as config from "../../config"; import * as models from "../../models"; -import * as logger from "../../logger"; +import {logger} from "../../logger"; import {urlencodedParser} from "../../utils"; import {setReturnToFromReferer} from "../utils"; diff --git a/lib/auth/saml/index.ts b/lib/auth/saml/index.ts index 66a9da315b..e66cd2d667 100644 --- a/lib/auth/saml/index.ts +++ b/lib/auth/saml/index.ts @@ -5,7 +5,7 @@ import {Strategy as SamlStrategy} from "passport-saml"; import * as config from "../../config"; import * as models from "../../models"; -import * as logger from "../../logger"; +import {logger} from "../../logger"; import {urlencodedParser} from "../../utils"; const intersection = function (array1, array2) { diff --git a/lib/auth/utils.ts b/lib/auth/utils.ts index 162b4aff8f..fe09a6f832 100644 --- a/lib/auth/utils.ts +++ b/lib/auth/utils.ts @@ -2,7 +2,7 @@ import * as models from "../models"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; export function setReturnToFromReferer(req) { if (!req.session) req.session = {} diff --git a/lib/config/index.ts b/lib/config/index.ts index cf87474de2..53b3ef28ca 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -5,7 +5,7 @@ import {merge} from "lodash"; import deepFreeze from "deep-freeze"; import {Environment, Permission} from "./enum"; -import * as logger from "../logger"; +import {logger} from "../logger"; import {getGitCommit, getGitHubURL} from "./utils"; const appRootPath = path.resolve(__dirname, '../../') diff --git a/lib/history/index.ts b/lib/history/index.ts index 43efc5d2be..902578186d 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -3,7 +3,7 @@ import LZString from '@hackmd/lz-string' import * as models from '../models' -import * as logger from '../logger' +import {logger} from '../logger' import * as config from '../config' import * as response from '../response' diff --git a/lib/homepage/index.ts b/lib/homepage/index.ts index c963003b98..8fe6a36d5f 100644 --- a/lib/homepage/index.ts +++ b/lib/homepage/index.ts @@ -4,7 +4,7 @@ import * as config from '../config' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import {User} from '../models' -import * as logger from '../logger' +import {logger} from '../logger' import {Request, Response} from "express"; diff --git a/lib/imageRouter/azure.ts b/lib/imageRouter/azure.ts index 6084720fc2..66e8ce1eb8 100644 --- a/lib/imageRouter/azure.ts +++ b/lib/imageRouter/azure.ts @@ -4,7 +4,7 @@ import * as path from "path"; import azure from "azure-storage"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { diff --git a/lib/imageRouter/filesystem.ts b/lib/imageRouter/filesystem.ts index 4c0233d2db..f7b8ebc515 100644 --- a/lib/imageRouter/filesystem.ts +++ b/lib/imageRouter/filesystem.ts @@ -6,7 +6,7 @@ import * as crypto from "crypto"; import {URL} from "url"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; /** * generate a random filename for uploaded image diff --git a/lib/imageRouter/imgur.ts b/lib/imageRouter/imgur.ts index e3bcd3d85d..c36902c509 100644 --- a/lib/imageRouter/imgur.ts +++ b/lib/imageRouter/imgur.ts @@ -2,7 +2,7 @@ import imgur from "@hackmd/imgur"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; export function uploadImage(imagePath, callback) { if (!imagePath || typeof imagePath !== 'string') { diff --git a/lib/imageRouter/index.ts b/lib/imageRouter/index.ts index 55d173afc9..1896cb6941 100644 --- a/lib/imageRouter/index.ts +++ b/lib/imageRouter/index.ts @@ -9,7 +9,7 @@ import imageType from "image-type"; import mime from "mime-types"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; import * as response from "../response"; const imageRouter = Router() diff --git a/lib/imageRouter/lutim.ts b/lib/imageRouter/lutim.ts index dcd3216ffb..3c57ef2959 100644 --- a/lib/imageRouter/lutim.ts +++ b/lib/imageRouter/lutim.ts @@ -1,7 +1,7 @@ import lutim from "lutim"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; export function uploadImage(imagePath, callback) { diff --git a/lib/imageRouter/minio.ts b/lib/imageRouter/minio.ts index 5786b43d0d..6fd61a50c7 100644 --- a/lib/imageRouter/minio.ts +++ b/lib/imageRouter/minio.ts @@ -5,7 +5,7 @@ import Minio from "minio"; import * as config from "../config"; import {getImageMimeType} from "../utils"; -import * as logger from "../logger"; +import {logger} from "../logger"; const minioClient = new Minio.Client({ endPoint: config.minio.endPoint, diff --git a/lib/imageRouter/s3.ts b/lib/imageRouter/s3.ts index 4752555090..48c1b66820 100644 --- a/lib/imageRouter/s3.ts +++ b/lib/imageRouter/s3.ts @@ -6,7 +6,7 @@ import {PutObjectCommand, PutObjectInput} from "@aws-sdk/client-s3-node/commands import * as config from "../config"; import {getImageMimeType} from "../utils"; -import * as logger from "../logger"; +import {logger} from "../logger"; const credentials = { diff --git a/lib/logger.ts b/lib/logger.ts index 22e3df22ac..7efe0a7b56 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -1,3 +1,4 @@ +// Do not require any relative module in this file, will caused circular dependencies. import {createLogger, format, transports, Logger} from "winston"; @@ -25,7 +26,7 @@ if (process.env.NODE_ENV === 'development' || !process.env.NODE_ENV) { ) } -const logger: CodiMDLogger = createLogger({ +export const logger: CodiMDLogger = createLogger({ format: defaultFormatter, transports: [ new transports.Console({ @@ -46,4 +47,4 @@ logger.setLevel = function (level) { logger.level = level } -export = logger +export default logger diff --git a/lib/middleware/checkURIValid.ts b/lib/middleware/checkURIValid.ts index e2dd33ea4a..ba74390324 100644 --- a/lib/middleware/checkURIValid.ts +++ b/lib/middleware/checkURIValid.ts @@ -1,4 +1,4 @@ -import * as logger from '../logger' +import {logger} from '../logger' import * as response from "../response"; export default function (req, res, next) { diff --git a/lib/models/index.ts b/lib/models/index.ts index 1eb0adf576..46093fcb68 100644 --- a/lib/models/index.ts +++ b/lib/models/index.ts @@ -6,7 +6,7 @@ import {cloneDeep} from "lodash"; // core import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; const dbconfig = cloneDeep(config.db) dbconfig.logging = config.debug ? (data) => { diff --git a/lib/models/note.ts b/lib/models/note.ts index d2f75e0da5..2ddbe06603 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -14,7 +14,7 @@ import DiffMatchPatch from "@hackmd/diff-match-patch"; // core import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; import {stripTags} from "../string"; // ot diff --git a/lib/models/revision.ts b/lib/models/revision.ts index ba105327a6..03855b0092 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -9,7 +9,7 @@ import * as util from "util"; // core import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; const Op = Sequelize.Op diff --git a/lib/models/user.ts b/lib/models/user.ts index f02106a042..356d70e5bd 100644 --- a/lib/models/user.ts +++ b/lib/models/user.ts @@ -4,7 +4,7 @@ import * as Sequelize from "sequelize"; import Scrypt from "scrypt-kdf"; // core -import * as logger from "../logger"; +import {logger} from "../logger"; import {generateAvatarURL} from "../letter-avatars"; export = function (sequelize, DataTypes) { diff --git a/lib/note/index.ts b/lib/note/index.ts index b426cf065c..940dce5650 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -1,5 +1,5 @@ import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/lib/note/noteActions.ts b/lib/note/noteActions.ts index 5d8a0af09e..d6f1549d01 100644 --- a/lib/note/noteActions.ts +++ b/lib/note/noteActions.ts @@ -8,7 +8,7 @@ import moment from "moment"; // const { Pandoc } = require('@hackmd/pandoc.js') import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import {Note, Revision} from "../models"; diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 7d306a7626..e071479d52 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -10,7 +10,7 @@ import {get} from "lodash"; // core import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; import * as history from "../history"; import * as models from "../models"; diff --git a/lib/realtime/realtimeCleanDanglingUserJob.ts b/lib/realtime/realtimeCleanDanglingUserJob.ts index 5b864b305d..30e308951b 100644 --- a/lib/realtime/realtimeCleanDanglingUserJob.ts +++ b/lib/realtime/realtimeCleanDanglingUserJob.ts @@ -3,7 +3,7 @@ import async from "async"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; /** * clean when user not in any rooms or user not in connected list diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index 4035c8b76d..adb2ff7af3 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -4,7 +4,7 @@ import {get} from "lodash"; import * as config from "../config"; import * as models from "../models"; -import * as logger from "../logger"; +import {logger} from "../logger"; export class RealtimeClientConnection { private socket: any; diff --git a/lib/realtime/realtimeSaveRevisionJob.ts b/lib/realtime/realtimeSaveRevisionJob.ts index 723e963dff..eef22c78e2 100644 --- a/lib/realtime/realtimeSaveRevisionJob.ts +++ b/lib/realtime/realtimeSaveRevisionJob.ts @@ -1,7 +1,7 @@ 'use strict' import * as models from "../models"; -import * as logger from "../logger"; +import {logger} from "../logger"; /** * clean when user not in any rooms or user not in connected list diff --git a/lib/realtime/realtimeUpdateDirtyNoteJob.ts b/lib/realtime/realtimeUpdateDirtyNoteJob.ts index bc30a608a5..e6175ed4b4 100644 --- a/lib/realtime/realtimeUpdateDirtyNoteJob.ts +++ b/lib/realtime/realtimeUpdateDirtyNoteJob.ts @@ -1,7 +1,7 @@ import moment from "moment"; import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; export class UpdateDirtyNoteJob { private realtime: any; diff --git a/lib/response.ts b/lib/response.ts index e046ffd8da..285bf7072f 100644 --- a/lib/response.ts +++ b/lib/response.ts @@ -3,7 +3,7 @@ import * as request from "request"; // core import * as config from "./config"; -import * as logger from "./logger"; +import {logger} from "./logger"; import * as models from "./models"; import * as utils from "./utils"; import * as history from "./history"; diff --git a/lib/user/index.ts b/lib/user/index.ts index 3bcfe8938b..ffc145287d 100644 --- a/lib/user/index.ts +++ b/lib/user/index.ts @@ -3,7 +3,7 @@ import async from 'async' import * as response from '../response' import * as config from '../config' import * as models from '../models' -import * as logger from '../logger' +import {logger} from '../logger' import { generateAvatar } from '../letter-avatars' export async function getMe (req, res) { diff --git a/lib/web/middleware/checkVersion.ts b/lib/web/middleware/checkVersion.ts index 5f7d70cd8a..afc722c7a5 100644 --- a/lib/web/middleware/checkVersion.ts +++ b/lib/web/middleware/checkVersion.ts @@ -2,7 +2,7 @@ import {promisify} from "util"; import request from "request"; -import * as logger from "../../logger"; +import {logger} from "../../logger"; import * as config from "../../config"; let lastCheckAt diff --git a/lib/workers/dmpWorker.ts b/lib/workers/dmpWorker.ts index 0e31426cd5..8faf97c65f 100644 --- a/lib/workers/dmpWorker.ts +++ b/lib/workers/dmpWorker.ts @@ -3,7 +3,7 @@ import DiffMatchPatch from "@hackmd/diff-match-patch"; // core import * as config from "../config"; -import * as logger from "../logger"; +import {logger} from "../logger"; const dmp = new DiffMatchPatch() process.on('message', function (data) { From db55d00823dc716c148794dea184250659c911c4 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 18:32:47 +0800 Subject: [PATCH 108/167] refactor: use config insted of * as config config Signed-off-by: Raccoon --- lib/app.ts | 2 +- lib/auth/bitbucket/index.ts | 2 +- lib/auth/dropbox/index.ts | 2 +- lib/auth/email/index.ts | 2 +- lib/auth/facebook/index.ts | 2 +- lib/auth/github/index.ts | 2 +- lib/auth/gitlab/index.ts | 2 +- lib/auth/google/index.ts | 2 +- lib/auth/index.ts | 2 +- lib/auth/ldap/index.ts | 2 +- lib/auth/mattermost/index.ts | 2 +- lib/auth/oauth2/index.ts | 2 +- lib/auth/oauth2/strategy.ts | 2 +- lib/auth/openid/index.ts | 2 +- lib/auth/saml/index.ts | 2 +- lib/auth/twitter/index.ts | 2 +- lib/auth/utils.ts | 2 +- lib/csp.ts | 2 +- lib/errorPage/index.ts | 2 +- lib/history/index.ts | 2 +- lib/homepage/index.ts | 2 +- lib/imageRouter/azure.ts | 2 +- lib/imageRouter/filesystem.ts | 2 +- lib/imageRouter/imgur.ts | 2 +- lib/imageRouter/index.ts | 2 +- lib/imageRouter/lutim.ts | 2 +- lib/imageRouter/minio.ts | 2 +- lib/imageRouter/s3.ts | 2 +- lib/letter-avatars.ts | 2 +- lib/middleware/codiMDVersion.ts | 2 +- lib/middleware/redirectWithoutTrailingSlashes.ts | 2 +- lib/middleware/tooBusy.ts | 2 +- lib/models/index.ts | 2 +- lib/models/note.ts | 2 +- lib/models/revision.ts | 2 +- lib/note/index.ts | 2 +- lib/note/noteActions.ts | 2 +- lib/realtime/realtime.ts | 2 +- lib/realtime/realtimeCleanDanglingUserJob.ts | 2 +- lib/realtime/realtimeClientConnection.ts | 2 +- lib/realtime/realtimeUpdateDirtyNoteJob.ts | 2 +- lib/response.ts | 2 +- lib/status/index.ts | 2 +- lib/user/index.ts | 2 +- lib/web/middleware/checkVersion.ts | 2 +- lib/workers/dmpWorker.ts | 2 +- 46 files changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/app.ts b/lib/app.ts index 2973cc0b2a..2997eb34e2 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -19,7 +19,7 @@ import passportSocketIo from 'passport.socketio' import SocketIo from 'socket.io' import {Server as WsServer} from 'ws' // core -import * as config from "./config"; +import config from "./config"; import {logger} from "./logger"; import * as response from "./response"; import * as models from "./models"; diff --git a/lib/auth/bitbucket/index.ts b/lib/auth/bitbucket/index.ts index 24d7828215..238451fe5e 100644 --- a/lib/auth/bitbucket/index.ts +++ b/lib/auth/bitbucket/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as BitbucketStrategy} from "passport-bitbucket-oauth2"; -import * as config from "../../config"; +import config from "../../config"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const bitbucketAuth = Router() diff --git a/lib/auth/dropbox/index.ts b/lib/auth/dropbox/index.ts index ae3be792d5..028d7ed089 100644 --- a/lib/auth/dropbox/index.ts +++ b/lib/auth/dropbox/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as DropboxStrategy} from "passport-dropbox-oauth2"; -import * as config from "../../config"; +import config from "../../config"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const dropboxAuth = Router() diff --git a/lib/auth/email/index.ts b/lib/auth/email/index.ts index c0f0de624a..cd98acb813 100644 --- a/lib/auth/email/index.ts +++ b/lib/auth/email/index.ts @@ -3,8 +3,8 @@ import passport from "passport"; import validator from "validator"; import {Strategy as LocalStrategy} from 'passport-local'; -import * as config from '../../config'; import * as models from '../../models'; +import config from '../../config'; import {logger} from "../../logger"; import {setReturnToFromReferer} from "../utils"; import {urlencodedParser} from "../../utils"; diff --git a/lib/auth/facebook/index.ts b/lib/auth/facebook/index.ts index 0c0adbd158..6f67677b8b 100644 --- a/lib/auth/facebook/index.ts +++ b/lib/auth/facebook/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as FacebookStrategy} from "passport-facebook"; -import * as config from "../../config"; +import config from "../../config"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const facebookAuth = Router() diff --git a/lib/auth/github/index.ts b/lib/auth/github/index.ts index 0c1f1f471c..7c0125eaf2 100644 --- a/lib/auth/github/index.ts +++ b/lib/auth/github/index.ts @@ -1,7 +1,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as GithubStrategy} from "passport-github"; -import * as config from "../../config"; +import config from "../../config"; import * as response from "../../response"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; import {URL} from "url"; diff --git a/lib/auth/gitlab/index.ts b/lib/auth/gitlab/index.ts index 0b2c580a04..54cb85751f 100644 --- a/lib/auth/gitlab/index.ts +++ b/lib/auth/gitlab/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as GitlabStrategy} from "passport-gitlab2"; -import * as config from "../../config"; +import config from "../../config"; import * as response from "../../response"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; import HttpsProxyAgent from "https-proxy-agent"; diff --git a/lib/auth/google/index.ts b/lib/auth/google/index.ts index 2e70eea5f0..ce9143e0f7 100644 --- a/lib/auth/google/index.ts +++ b/lib/auth/google/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as GoogleStrategy} from "passport-google-oauth20"; -import * as config from "../../config"; +import config from "../../config"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const googleAuth = module.exports = Router() diff --git a/lib/auth/index.ts b/lib/auth/index.ts index 4ba572afb9..d981c1f541 100644 --- a/lib/auth/index.ts +++ b/lib/auth/index.ts @@ -1,7 +1,7 @@ import {Router} from "express"; import passport from "passport"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; import * as models from "../models"; diff --git a/lib/auth/ldap/index.ts b/lib/auth/ldap/index.ts index 137ab9c846..b08037da6b 100644 --- a/lib/auth/ldap/index.ts +++ b/lib/auth/ldap/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import LDAPStrategy from "passport-ldapauth"; -import * as config from "../../config"; +import config from "../../config"; import * as models from "../../models"; import {logger} from "../../logger"; import * as response from "../../response"; diff --git a/lib/auth/mattermost/index.ts b/lib/auth/mattermost/index.ts index f8fe11c2c5..c6974d5431 100644 --- a/lib/auth/mattermost/index.ts +++ b/lib/auth/mattermost/index.ts @@ -6,7 +6,7 @@ require('isomorphic-fetch') import MattermostClient from "mattermost-redux/client/client4"; import {Strategy as OAuthStrategy} from "passport-oauth2"; -import * as config from "../../config"; +import config from "../../config"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; diff --git a/lib/auth/oauth2/index.ts b/lib/auth/oauth2/index.ts index 9e9fb97bb3..3404ff1f17 100644 --- a/lib/auth/oauth2/index.ts +++ b/lib/auth/oauth2/index.ts @@ -1,7 +1,7 @@ import {Router} from 'express' import passport from 'passport' -import * as config from '../../config' +import config from '../../config' import {passportGeneralCallback, setReturnToFromReferer} from '../utils' import {OAuth2CustomStrategy} from './strategy' diff --git a/lib/auth/oauth2/strategy.ts b/lib/auth/oauth2/strategy.ts index 839567403f..33c165c580 100644 --- a/lib/auth/oauth2/strategy.ts +++ b/lib/auth/oauth2/strategy.ts @@ -1,5 +1,5 @@ import {InternalOAuthError, Strategy} from "passport-oauth2"; -import * as config from "../../config"; +import config from "../../config"; export function parseProfile (data) { const username = extractProfileAttribute(data, config.oauth2.userProfileUsernameAttr) diff --git a/lib/auth/openid/index.ts b/lib/auth/openid/index.ts index 0bcc1270f8..734697989a 100644 --- a/lib/auth/openid/index.ts +++ b/lib/auth/openid/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as OpenIDStrategy} from "@passport-next/passport-openid"; -import * as config from "../../config"; +import config from "../../config"; import * as models from "../../models"; import {logger} from "../../logger"; import {urlencodedParser} from "../../utils"; diff --git a/lib/auth/saml/index.ts b/lib/auth/saml/index.ts index e66cd2d667..3e50b083b5 100644 --- a/lib/auth/saml/index.ts +++ b/lib/auth/saml/index.ts @@ -3,7 +3,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as SamlStrategy} from "passport-saml"; -import * as config from "../../config"; +import config from "../../config"; import * as models from "../../models"; import {logger} from "../../logger"; import {urlencodedParser} from "../../utils"; diff --git a/lib/auth/twitter/index.ts b/lib/auth/twitter/index.ts index 197d11f8b1..a9b3491b25 100644 --- a/lib/auth/twitter/index.ts +++ b/lib/auth/twitter/index.ts @@ -2,7 +2,7 @@ import {Router} from "express"; import passport from "passport"; import {Strategy as TwitterStrategy} from "passport-twitter"; -import * as config from "../../config"; +import config from "../../config"; import {passportGeneralCallback, setReturnToFromReferer} from "../utils"; const twitterAuth = Router() diff --git a/lib/auth/utils.ts b/lib/auth/utils.ts index fe09a6f832..3528de9cd4 100644 --- a/lib/auth/utils.ts +++ b/lib/auth/utils.ts @@ -1,7 +1,7 @@ 'use strict' import * as models from "../models"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; export function setReturnToFromReferer(req) { diff --git a/lib/csp.ts b/lib/csp.ts index 13851fa5d3..ee7d56b1c6 100644 --- a/lib/csp.ts +++ b/lib/csp.ts @@ -1,4 +1,4 @@ -import * as config from "./config"; +import config from "./config"; import uuid from "uuid"; const CspStrategy: any = {} diff --git a/lib/errorPage/index.ts b/lib/errorPage/index.ts index 03aced89fc..b6c91d0bbc 100644 --- a/lib/errorPage/index.ts +++ b/lib/errorPage/index.ts @@ -1,4 +1,4 @@ -import * as config from "../config"; +import config from "../config"; import {responseError} from "../response"; diff --git a/lib/history/index.ts b/lib/history/index.ts index 902578186d..04f6abaa8a 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -4,7 +4,7 @@ import LZString from '@hackmd/lz-string' import * as models from '../models' import {logger} from '../logger' -import * as config from '../config' +import config from '../config' import * as response from '../response' function getHistory (userid, callback) { diff --git a/lib/homepage/index.ts b/lib/homepage/index.ts index 8fe6a36d5f..a16c116781 100644 --- a/lib/homepage/index.ts +++ b/lib/homepage/index.ts @@ -1,6 +1,6 @@ import * as fs from 'fs' import * as path from 'path' -import * as config from '../config' +import config from '../config' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import {User} from '../models' diff --git a/lib/imageRouter/azure.ts b/lib/imageRouter/azure.ts index 66e8ce1eb8..bc601659e2 100644 --- a/lib/imageRouter/azure.ts +++ b/lib/imageRouter/azure.ts @@ -3,7 +3,7 @@ import * as path from "path"; import azure from "azure-storage"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; export function uploadImage(imagePath, callback) { diff --git a/lib/imageRouter/filesystem.ts b/lib/imageRouter/filesystem.ts index f7b8ebc515..c1a08183d3 100644 --- a/lib/imageRouter/filesystem.ts +++ b/lib/imageRouter/filesystem.ts @@ -5,7 +5,7 @@ import * as path from "path"; import * as crypto from "crypto"; import {URL} from "url"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; /** diff --git a/lib/imageRouter/imgur.ts b/lib/imageRouter/imgur.ts index c36902c509..58902bcf3c 100644 --- a/lib/imageRouter/imgur.ts +++ b/lib/imageRouter/imgur.ts @@ -1,7 +1,7 @@ 'use strict' import imgur from "@hackmd/imgur"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; export function uploadImage(imagePath, callback) { diff --git a/lib/imageRouter/index.ts b/lib/imageRouter/index.ts index 1896cb6941..500ea52c04 100644 --- a/lib/imageRouter/index.ts +++ b/lib/imageRouter/index.ts @@ -8,7 +8,7 @@ import readChunk from "read-chunk"; import imageType from "image-type"; import mime from "mime-types"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; import * as response from "../response"; diff --git a/lib/imageRouter/lutim.ts b/lib/imageRouter/lutim.ts index 3c57ef2959..67fa6214f5 100644 --- a/lib/imageRouter/lutim.ts +++ b/lib/imageRouter/lutim.ts @@ -1,6 +1,6 @@ import lutim from "lutim"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; diff --git a/lib/imageRouter/minio.ts b/lib/imageRouter/minio.ts index 6fd61a50c7..f8c36ba8ac 100644 --- a/lib/imageRouter/minio.ts +++ b/lib/imageRouter/minio.ts @@ -3,7 +3,7 @@ import * as path from "path"; import Minio from "minio"; -import * as config from "../config"; +import config from "../config"; import {getImageMimeType} from "../utils"; import {logger} from "../logger"; diff --git a/lib/imageRouter/s3.ts b/lib/imageRouter/s3.ts index 48c1b66820..03ceea797f 100644 --- a/lib/imageRouter/s3.ts +++ b/lib/imageRouter/s3.ts @@ -4,7 +4,7 @@ import * as path from "path"; import {S3Client} from "@aws-sdk/client-s3-node/S3Client"; import {PutObjectCommand, PutObjectInput} from "@aws-sdk/client-s3-node/commands/PutObjectCommand"; -import * as config from "../config"; +import config from "../config"; import {getImageMimeType} from "../utils"; import {logger} from "../logger"; diff --git a/lib/letter-avatars.ts b/lib/letter-avatars.ts index fb617553f0..320331ed0e 100644 --- a/lib/letter-avatars.ts +++ b/lib/letter-avatars.ts @@ -2,7 +2,7 @@ import * as crypto from "crypto"; import randomcolor from "randomcolor"; -import * as config from "./config"; +import config from "./config"; // core export function generateAvatar(name) { diff --git a/lib/middleware/codiMDVersion.ts b/lib/middleware/codiMDVersion.ts index fc1cfec094..154fa1d393 100644 --- a/lib/middleware/codiMDVersion.ts +++ b/lib/middleware/codiMDVersion.ts @@ -1,4 +1,4 @@ -import * as config from "../config"; +import config from "../config"; import {Request, Response} from "express"; export default function (req: Request, res: Response, next) { diff --git a/lib/middleware/redirectWithoutTrailingSlashes.ts b/lib/middleware/redirectWithoutTrailingSlashes.ts index 54a46054ed..6b26378c84 100644 --- a/lib/middleware/redirectWithoutTrailingSlashes.ts +++ b/lib/middleware/redirectWithoutTrailingSlashes.ts @@ -1,6 +1,6 @@ import {Request, Response} from "express"; -import * as config from "../config"; +import config from "../config"; export default function (req: Request, res: Response, next) { if (req.method === 'GET' && req.path.substr(-1) === '/' && req.path.length > 1) { diff --git a/lib/middleware/tooBusy.ts b/lib/middleware/tooBusy.ts index 9f4099a843..f66ab7174e 100644 --- a/lib/middleware/tooBusy.ts +++ b/lib/middleware/tooBusy.ts @@ -1,6 +1,6 @@ import toobusy from "toobusy-js"; -import * as config from "../config"; +import config from "../config"; import * as response from "../response"; toobusy.maxLag(config.responseMaxLag) diff --git a/lib/models/index.ts b/lib/models/index.ts index 46093fcb68..5819f1d2b5 100644 --- a/lib/models/index.ts +++ b/lib/models/index.ts @@ -5,7 +5,7 @@ import {Sequelize} from "sequelize"; import {cloneDeep} from "lodash"; // core -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; const dbconfig = cloneDeep(config.db) diff --git a/lib/models/note.ts b/lib/models/note.ts index 2ddbe06603..ba0356c496 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -13,7 +13,7 @@ import moment from "moment"; import DiffMatchPatch from "@hackmd/diff-match-patch"; // core -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; import {stripTags} from "../string"; diff --git a/lib/models/revision.ts b/lib/models/revision.ts index 03855b0092..2ce0420f04 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -8,10 +8,10 @@ import * as path from "path"; import * as util from "util"; // core -import * as config from "../config"; import {logger} from "../logger"; const Op = Sequelize.Op +import config from "../config"; let dmpWorker = createDmpWorker() const dmpCallbackCache = {} diff --git a/lib/note/index.ts b/lib/note/index.ts index 940dce5650..a8490aed42 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -1,4 +1,4 @@ -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/lib/note/noteActions.ts b/lib/note/noteActions.ts index d6f1549d01..734bfdb6cf 100644 --- a/lib/note/noteActions.ts +++ b/lib/note/noteActions.ts @@ -7,7 +7,7 @@ import querystring from "querystring"; import moment from "moment"; // const { Pandoc } = require('@hackmd/pandoc.js') -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index e071479d52..3fcac84296 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -9,7 +9,7 @@ import moment from "moment"; import {get} from "lodash"; // core -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; import * as history from "../history"; import * as models from "../models"; diff --git a/lib/realtime/realtimeCleanDanglingUserJob.ts b/lib/realtime/realtimeCleanDanglingUserJob.ts index 30e308951b..c5ea6f3911 100644 --- a/lib/realtime/realtimeCleanDanglingUserJob.ts +++ b/lib/realtime/realtimeCleanDanglingUserJob.ts @@ -2,7 +2,7 @@ import async from "async"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; /** diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index adb2ff7af3..d41d278715 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -2,7 +2,7 @@ import {get} from "lodash"; -import * as config from "../config"; +import config from "../config"; import * as models from "../models"; import {logger} from "../logger"; diff --git a/lib/realtime/realtimeUpdateDirtyNoteJob.ts b/lib/realtime/realtimeUpdateDirtyNoteJob.ts index e6175ed4b4..25065af6fa 100644 --- a/lib/realtime/realtimeUpdateDirtyNoteJob.ts +++ b/lib/realtime/realtimeUpdateDirtyNoteJob.ts @@ -1,6 +1,6 @@ import moment from "moment"; -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; export class UpdateDirtyNoteJob { diff --git a/lib/response.ts b/lib/response.ts index 285bf7072f..cb5ddcbf03 100644 --- a/lib/response.ts +++ b/lib/response.ts @@ -2,7 +2,7 @@ // external modules import * as request from "request"; // core -import * as config from "./config"; +import config from "./config"; import {logger} from "./logger"; import * as models from "./models"; import * as utils from "./utils"; diff --git a/lib/status/index.ts b/lib/status/index.ts index cc53b5ca63..deb695373a 100644 --- a/lib/status/index.ts +++ b/lib/status/index.ts @@ -1,6 +1,6 @@ import * as realtime from "../realtime/realtime"; -import * as config from "../config"; +import config from "../config"; export async function getStatus(req, res) { diff --git a/lib/user/index.ts b/lib/user/index.ts index ffc145287d..cc4bb42490 100644 --- a/lib/user/index.ts +++ b/lib/user/index.ts @@ -1,8 +1,8 @@ import archiver from 'archiver' import async from 'async' import * as response from '../response' -import * as config from '../config' import * as models from '../models' +import config from '../config' import {logger} from '../logger' import { generateAvatar } from '../letter-avatars' diff --git a/lib/web/middleware/checkVersion.ts b/lib/web/middleware/checkVersion.ts index afc722c7a5..72df085f53 100644 --- a/lib/web/middleware/checkVersion.ts +++ b/lib/web/middleware/checkVersion.ts @@ -3,7 +3,7 @@ import {promisify} from "util"; import request from "request"; import {logger} from "../../logger"; -import * as config from "../../config"; +import config from "../../config"; let lastCheckAt diff --git a/lib/workers/dmpWorker.ts b/lib/workers/dmpWorker.ts index 8faf97c65f..982555bb3f 100644 --- a/lib/workers/dmpWorker.ts +++ b/lib/workers/dmpWorker.ts @@ -2,7 +2,7 @@ // external modules import DiffMatchPatch from "@hackmd/diff-match-patch"; // core -import * as config from "../config"; +import config from "../config"; import {logger} from "../logger"; const dmp = new DiffMatchPatch() From 638a8872c8661e9f73ef96dc1f9a135cccf764e1 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 03:48:50 +0800 Subject: [PATCH 109/167] refactor: use strong type in models export missing Signed-off-by: Raccoon --- lib/app.ts | 5 +- lib/models/author.ts | 53 ++-- lib/models/baseModel.ts | 22 ++ lib/models/index.ts | 39 +-- lib/models/note.ts | 351 +++++++++++++----------- lib/models/revision.ts | 201 ++++++-------- lib/models/user.ts | 304 ++++++++++++-------- lib/note/index.ts | 3 +- lib/realtime/realtimeSaveRevisionJob.ts | 3 +- lib/response.ts | 3 +- lib/services/note.ts | 115 ++++++++ 11 files changed, 648 insertions(+), 451 deletions(-) create mode 100644 lib/models/baseModel.ts create mode 100644 lib/services/note.ts diff --git a/lib/app.ts b/lib/app.ts index 2997eb34e2..f1f2820a01 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -25,6 +25,7 @@ import * as response from "./response"; import * as models from "./models"; import * as csp from "./csp"; import {Environment} from "./config/enum"; +import {checkAllNotesRevision} from "./services/note"; import {checkVersion, versionCheckMiddleware} from "./web/middleware/checkVersion"; import TooBusyMiddleware from './middleware/tooBusy' @@ -288,7 +289,7 @@ function startListen() { models.sequelize.sync().then(function () { // check if realtime is ready if (realtime.isReady()) { - models.Revision.checkAllNotesRevision(function (err, notes) { + checkAllNotesRevision(function (err, notes) { if (err) throw new Error(err) if (!notes || notes.length <= 0) return startListen() }) @@ -327,7 +328,7 @@ function handleTermSignals() { }) const checkCleanTimer = setInterval(function () { if (realtime.isReady()) { - models.Revision.checkAllNotesRevision(function (err, notes) { + checkAllNotesRevision(function (err, notes) { if (err) return logger.error(err) if (!notes || notes.length <= 0) { clearInterval(checkCleanTimer) diff --git a/lib/models/author.ts b/lib/models/author.ts index 67742b9396..3d0efd187d 100644 --- a/lib/models/author.ts +++ b/lib/models/author.ts @@ -1,25 +1,40 @@ // external modules -export = function (sequelize, DataTypes) { - const Author = sequelize.define('Author', { - id: { - type: DataTypes.INTEGER, - primaryKey: true, - autoIncrement: true - }, - color: { - type: DataTypes.STRING - } - }, { - indexes: [ +import {Model, DataTypes} from "sequelize"; + +export interface AuthorAttributes { + id: string + color: string +} + +export class Author extends Model implements AuthorAttributes { + color: string; + id: string; + + static initialize(sequelize): void { + Author.init( { - unique: true, - fields: ['noteId', 'userId'] - } - ] - }) + id: { + type: DataTypes.INTEGER, + primaryKey: true, + autoIncrement: true + }, + color: { + type: DataTypes.STRING + } + }, + { + sequelize, + indexes: [ + { + unique: true, + fields: ['noteId', 'userId'] + } + ] + }) + } - Author.associate = function (models) { + static associate(models: any): void { Author.belongsTo(models.Note, { foreignKey: 'noteId', as: 'note', @@ -35,6 +50,4 @@ export = function (sequelize, DataTypes) { hooks: true }) } - - return Author } diff --git a/lib/models/baseModel.ts b/lib/models/baseModel.ts new file mode 100644 index 0000000000..6880edcb08 --- /dev/null +++ b/lib/models/baseModel.ts @@ -0,0 +1,22 @@ +import {Sequelize, Model} from "sequelize"; + +export type MySequelize = Sequelize & { + processData?: any + stripNullByte?: any +} + +export type BaseModel = { + name: string; + initialize(sequelize: Sequelize): void + associate(models: any): void +} + +export function StaticImplements(t: T) { + return t; +} + +export interface BaseModelStatic extends Model { + initialize(sequelize: Sequelize): void + + associate(models: any): void +} diff --git a/lib/models/index.ts b/lib/models/index.ts index 5819f1d2b5..2a6ebaec97 100644 --- a/lib/models/index.ts +++ b/lib/models/index.ts @@ -1,13 +1,24 @@ // external modules import * as fs from "fs"; import * as path from "path"; -import {Sequelize} from "sequelize"; +import {Model, Sequelize} from "sequelize"; import {cloneDeep} from "lodash"; // core import config from "../config"; import {logger} from "../logger"; + +import {BaseModel} from "./baseModel"; + +import {Author, AuthorAttributes} from './author' +import {User, UserAttributes} from './user' +import {Revision, RevisionAttributes} from "./revision"; +import {Note, NoteAttributes} from './note' + +export {Author, User, Revision, Note} +export {AuthorAttributes, UserAttributes, RevisionAttributes, NoteAttributes} + const dbconfig = cloneDeep(config.db) dbconfig.logging = config.debug ? (data) => { logger.info(data) @@ -41,22 +52,16 @@ sequelize.processData = processData const db: any = {} -fs.readdirSync(__dirname) - .filter(function (file) { - return (file.indexOf('.') !== 0) && (file !== 'index.js') && file.endsWith('.js') - }) - .forEach(function (file) { - const model = sequelize.import(path.join(__dirname, file)) - db[model.name] = model - }) - -Object.keys(db).forEach(function (modelName) { - if ('associate' in db[modelName]) { - db[modelName].associate(db) +const models: BaseModel[] = [User, Note, Author, Revision] + +models.forEach(m => { + m.initialize(sequelize) + db[m.name] = m +}) +models.forEach(m => { + if ('associate' in m) { + m.associate(db) } }) -db.sequelize = sequelize -db.Sequelize = Sequelize - -export = db +export {sequelize} diff --git a/lib/models/note.ts b/lib/models/note.ts index ba0356c496..b8265df518 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -1,140 +1,163 @@ // external modules -import * as fs from "fs"; -import * as path from "path"; +import DiffMatchPatch from "@hackmd/diff-match-patch"; import LZString from "@hackmd/lz-string"; -import base64url from "base64url"; -import markdownIt from "markdown-it"; import metaMarked from "@hackmd/meta-marked"; -import cheerio from "cheerio"; -import shortId from "shortid"; -import * as Sequelize from "sequelize"; import async from "async"; +import base64url from "base64url"; +import cheerio from "cheerio"; +import * as fs from "fs"; +import markdownIt from "markdown-it"; import moment from "moment"; -import DiffMatchPatch from "@hackmd/diff-match-patch"; + +// ot +import ot from "ot"; +import * as path from "path"; +import {DataTypes, Model} from "sequelize"; +import shortId from "shortid"; // core import config from "../config"; import {logger} from "../logger"; +import {createNoteWithRevision, syncNote} from "../services/note"; import {stripTags} from "../string"; - -// ot -import ot from "ot"; +import {MySequelize} from "./baseModel"; const md = markdownIt() -const dmp = new DiffMatchPatch() +export const dmp = new DiffMatchPatch() // permission types const permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private'] -export = function (sequelize, DataTypes) { - const Note = sequelize.define('Note', { - id: { - type: DataTypes.UUID, - primaryKey: true, - defaultValue: Sequelize.UUIDV4 - }, - shortid: { - type: DataTypes.STRING, - unique: true, - allowNull: false, - defaultValue: shortId.generate - }, - alias: { - type: DataTypes.STRING, - unique: true - }, - permission: { - type: DataTypes.ENUM, - values: permissionTypes - }, - viewcount: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: 0 - }, - title: { - type: DataTypes.TEXT, - get: function () { - return sequelize.processData(this.getDataValue('title'), '') +export interface NoteAttributes { + id?: string + shortid?: string + alias?: string + permission?: string + viewcount?: number + title?: string + content?: string + authorship?: string + lastchangeAt?: Date + savedAt?: Date + + ownerId?: string +} + +export class Note extends Model implements NoteAttributes { + alias: string; + authorship: string; + content: string; + id: string; + lastchangeAt: Date; + permission: string; + savedAt: Date; + shortid: string; + title: string; + viewcount: number; + createdAt: Date + + ownerId: string + + static initialize(sequelize: MySequelize): void { + Note.init({ + id: { + type: DataTypes.UUID, + primaryKey: true, + defaultValue: DataTypes.UUIDV4 }, - set: function (value) { - this.setDataValue('title', sequelize.stripNullByte(value)) - } - }, - content: { - type: DataTypes.TEXT('long'), - get: function () { - return sequelize.processData(this.getDataValue('content'), '') + shortid: { + type: DataTypes.STRING, + unique: true, + allowNull: false, + defaultValue: shortId.generate }, - set: function (value) { - this.setDataValue('content', sequelize.stripNullByte(value)) - } - }, - authorship: { - type: DataTypes.TEXT('long'), - get: function () { - return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse) + alias: { + type: DataTypes.STRING, + unique: true + }, + permission: { + type: DataTypes.ENUM, + values: permissionTypes + }, + viewcount: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: 0 + }, + title: { + type: DataTypes.TEXT, + get: function () { + return sequelize.processData(this.getDataValue('title'), '') + }, + set: function (value) { + this.setDataValue('title', sequelize.stripNullByte(value)) + } + }, + content: { + type: DataTypes.TEXT({length: 'long'}), + get: function () { + return sequelize.processData(this.getDataValue('content'), '') + }, + set: function (value) { + this.setDataValue('content', sequelize.stripNullByte(value)) + } }, - set: function (value) { - this.setDataValue('authorship', JSON.stringify(value)) + authorship: { + type: DataTypes.TEXT({length: 'long'}), + get: function () { + return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse) + }, + set: function (value) { + this.setDataValue('authorship', JSON.stringify(value)) + } + }, + lastchangeAt: { + type: DataTypes.DATE + }, + savedAt: { + type: DataTypes.DATE } - }, - lastchangeAt: { - type: DataTypes.DATE - }, - savedAt: { - type: DataTypes.DATE - } - }, { - paranoid: false, - hooks: { - beforeCreate: function (note, options) { - return new Promise(function (resolve, reject) { - // if no content specified then use default note - if (!note.content) { - let filePath = config.defaultNotePath - - if (note.alias) { - const notePathInDocPath = path.join(config.docsPath, path.basename(note.alias) + '.md') - if (Note.checkFileExist(notePathInDocPath)) { - filePath = notePathInDocPath - } - } + }, { + sequelize, + paranoid: false + }) - if (Note.checkFileExist(filePath)) { - const noteInFS = readFileSystemNote(filePath) - note.title = noteInFS.title - note.content = noteInFS.content - if (filePath !== config.defaultNotePath) { - note.createdAt = noteInFS.lastchangeAt - note.lastchangeAt = noteInFS.lastchangeAt - } + Note.addHook('beforeCreate', function (note: Note): Promise { + return new Promise(function (resolve, reject) { + // if no content specified then use default note + if (!note.content) { + let filePath = config.defaultNotePath + + if (note.alias) { + const notePathInDocPath = path.join(config.docsPath, path.basename(note.alias) + '.md') + if (Note.checkFileExist(notePathInDocPath)) { + filePath = notePathInDocPath } } - // if no permission specified and have owner then give default permission in config, else default permission is freely - if (!note.permission) { - if (note.ownerId) { - note.permission = config.defaultPermission - } else { - note.permission = 'freely' + + if (Note.checkFileExist(filePath)) { + const noteInFS = readFileSystemNote(filePath) + note.title = noteInFS.title + note.content = noteInFS.content + if (filePath !== config.defaultNotePath) { + note.createdAt = noteInFS.lastchangeAt.toDate() + note.lastchangeAt = noteInFS.lastchangeAt.toDate() } } - return resolve(note) - }) - }, - afterCreate: function (note, options, callback) { - return new Promise(function (resolve, reject) { - sequelize.models.Revision.saveNoteRevision(note, function (err, revision) { - if (err) { - return reject(err) - } - return resolve(note) - }) - }) - } - } - }) + } + // if no permission specified and have owner then give default permission in config, else default permission is freely + if (!note.permission) { + if (note.ownerId) { + note.permission = config.defaultPermission + } else { + note.permission = 'freely' + } + } + return resolve() + }) + }) + } - Note.associate = function (models) { + static associate(models: any): void { Note.belongsTo(models.User, { foreignKey: 'ownerId', as: 'owner', @@ -157,20 +180,24 @@ export = function (sequelize, DataTypes) { constraints: false }) } - Note.checkFileExist = function (filePath) { + + + static checkFileExist(filePath) { try { return fs.statSync(filePath).isFile() } catch (err) { return false } } - Note.encodeNoteId = function (id) { + + static encodeNoteId(id) { // remove dashes in UUID and encode in url-safe base64 const str = id.replace(/-/g, '') const hexStr = Buffer.from(str, 'hex') return base64url.encode(hexStr) } - Note.decodeNoteId = function (encodedId) { + + static decodeNoteId(encodedId) { // decode from url-safe base64 const id = base64url.toBuffer(encodedId).toString('hex') // add dashes between the UUID string parts @@ -182,7 +209,8 @@ export = function (sequelize, DataTypes) { idParts.push(id.substr(20, 12)) return idParts.join('-') } - Note.checkNoteIdValid = function (id) { + + static checkNoteIdValid(id) { const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i const result = id.match(uuidRegex) if (result && result.length === 1) { @@ -191,7 +219,8 @@ export = function (sequelize, DataTypes) { return false } } - Note.parseNoteIdAsync = function (noteId) { + + static parseNoteIdAsync(noteId) { return new Promise((resolve, reject) => { Note.parseNoteId(noteId, (err, id) => { if (err) { @@ -202,29 +231,7 @@ export = function (sequelize, DataTypes) { }) } - async function syncNote(noteInFS, note) { - const contentLength = noteInFS.content.length - - let note2 = await note.update({ - title: noteInFS.title, - content: noteInFS.content, - lastchangeAt: noteInFS.lastchangeAt - }) - const revision = await sequelize.models.Revision.saveNoteRevisionAsync(note2) - // update authorship on after making revision of docs - const patch = dmp.patch_fromText(revision.patch) - const operations = Note.transformPatchToOperations(patch, contentLength) - let authorship = note2.authorship - for (let i = 0; i < operations.length; i++) { - authorship = Note.updateAuthorshipByOperation(operations[i], null, authorship) - } - note2 = await note.update({ - authorship: authorship - }) - return note2.id - } - - Note.parseNoteId = function (noteId, callback) { + static parseNoteId(noteId, callback) { async.series({ parseNoteIdByAlias: function (_callback) { // try to parse note id by alias (e.g. doc) @@ -246,9 +253,9 @@ export = function (sequelize, DataTypes) { } } else { // create new note with alias, and will sync md file in beforeCreateHook - const note = await Note.create({ + const note = await createNoteWithRevision({ alias: noteId, - owner: null, + ownerId: null, permission: 'locked' }) return callback(null, note.id) @@ -336,7 +343,8 @@ export = function (sequelize, DataTypes) { return callback(null, null) }) } - Note.parseNoteInfo = function (body) { + + static parseNoteInfo(body) { const parsed = Note.extractMeta(body) const $ = cheerio.load(md.render(parsed.markdown)) return { @@ -344,12 +352,14 @@ export = function (sequelize, DataTypes) { tags: Note.extractNoteTags(parsed.meta, $) } } - Note.parseNoteTitle = function (body) { + + static parseNoteTitle(body) { const parsed = Note.extractMeta(body) const $ = cheerio.load(md.render(parsed.markdown)) return Note.extractNoteTitle(parsed.meta, $) } - Note.extractNoteTitle = function (meta, $) { + + static extractNoteTitle(meta, $) { let title = '' if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { title = meta.title @@ -362,17 +372,21 @@ export = function (sequelize, DataTypes) { if (!title) title = 'Untitled' return title } - Note.generateDescription = function (markdown) { + + static generateDescription(markdown) { return markdown.substr(0, 100).replace(/(?:\r\n|\r|\n)/g, ' ') } - Note.decodeTitle = function (title) { + + static decodeTitle(title) { return title || 'Untitled' } - Note.generateWebTitle = function (title) { + + static generateWebTitle(title) { title = !title || title === 'Untitled' ? 'CodiMD - Collaborative markdown notes' : title + ' - CodiMD' return title } - Note.extractNoteTags = function (meta, $) { + + static extractNoteTags(meta, $) { const tags = [] const rawtags = [] let metaTags @@ -412,7 +426,8 @@ export = function (sequelize, DataTypes) { } return tags } - Note.extractMeta = function (content) { + + static extractMeta(content) { let obj = null try { obj = metaMarked(content) @@ -426,7 +441,8 @@ export = function (sequelize, DataTypes) { } return obj } - Note.parseMeta = function (meta) { + + static parseMeta(meta) { const _meta: any = {} if (meta) { if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { @@ -450,7 +466,8 @@ export = function (sequelize, DataTypes) { } return _meta } - Note.updateAuthorshipByOperation = function (operation, userId, authorships) { + + static updateAuthorshipByOperation(operation, userId, authorships) { let index = 0 const timestamp = Date.now() for (let i = 0; i < operation.length; i++) { @@ -551,7 +568,8 @@ export = function (sequelize, DataTypes) { } return authorships } - Note.transformPatchToOperations = function (patch, contentLength) { + + static transformPatchToOperations(patch, contentLength) { const operations = [] if (patch.length > 0) { // calculate original content length @@ -610,22 +628,21 @@ export = function (sequelize, DataTypes) { } return operations } +} - function readFileSystemNote(filePath) { - const fsModifiedTime = moment(fs.statSync(filePath).mtime) - const content = fs.readFileSync(filePath, 'utf8') - - return { - lastchangeAt: fsModifiedTime, - title: Note.parseNoteTitle(content), - content: content - } - } +function readFileSystemNote(filePath) { + const fsModifiedTime = moment(fs.statSync(filePath).mtime) + const content = fs.readFileSync(filePath, 'utf8') - function shouldSyncNote(note, noteInFS) { - const dbModifiedTime = moment(note.lastchangeAt || note.createdAt) - return noteInFS.lastchangeAt.isAfter(dbModifiedTime) && note.content !== noteInFS.content + return { + lastchangeAt: fsModifiedTime, + title: Note.parseNoteTitle(content), + content: content } +} - return Note +function shouldSyncNote(note, noteInFS) { + const dbModifiedTime = moment(note.lastchangeAt || note.createdAt) + return noteInFS.lastchangeAt.isAfter(dbModifiedTime) && note.content !== noteInFS.content } + diff --git a/lib/models/revision.ts b/lib/models/revision.ts index 2ce0420f04..9b9d7e0433 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -1,5 +1,5 @@ // external modules -import * as Sequelize from "sequelize"; +import {Model, Sequelize, Op, DataTypes} from "sequelize"; import async from "async"; import moment from "moment"; import * as childProcess from "child_process"; @@ -8,10 +8,9 @@ import * as path from "path"; import * as util from "util"; // core -import {logger} from "../logger"; - -const Op = Sequelize.Op import config from "../config"; +import logger from "../logger"; +import {MySequelize} from "./baseModel"; let dmpWorker = createDmpWorker() const dmpCallbackCache = {} @@ -54,55 +53,76 @@ function sendDmpWorker(data, callback) { dmpWorker.send(data) } -module.exports = function (sequelize, DataTypes) { - const Revision = sequelize.define('Revision', { - id: { - type: DataTypes.UUID, - primaryKey: true, - defaultValue: Sequelize.UUIDV4 - }, - patch: { - type: DataTypes.TEXT('long'), - get: function () { - return sequelize.processData(this.getDataValue('patch'), '') + +export interface RevisionAttributes { + id: string + patch: string + lastContent: string + content: string + length: number + authorship: string +} + +export class Revision extends Model implements RevisionAttributes { + authorship: string; + content: string; + id: string; + lastContent: string; + length: number; + patch: string; + + public readonly createdAt ?:number + + static initialize(sequelize: MySequelize): void { + Revision.init({ + id: { + type: DataTypes.UUID, + primaryKey: true, + defaultValue: DataTypes.UUIDV4 }, - set: function (value) { - this.setDataValue('patch', sequelize.stripNullByte(value)) - } - }, - lastContent: { - type: DataTypes.TEXT('long'), - get: function () { - return sequelize.processData(this.getDataValue('lastContent'), '') + patch: { + type: DataTypes.TEXT({length: 'long'}), + get: function () { + return sequelize.processData(this.getDataValue('patch'), '') + }, + set: function (value) { + this.setDataValue('patch', sequelize.stripNullByte(value)) + } }, - set: function (value) { - this.setDataValue('lastContent', sequelize.stripNullByte(value)) - } - }, - content: { - type: DataTypes.TEXT('long'), - get: function () { - return sequelize.processData(this.getDataValue('content'), '') + lastContent: { + type: DataTypes.TEXT({length: 'long'}), + get: function () { + return sequelize.processData(this.getDataValue('lastContent'), '') + }, + set: function (value) { + this.setDataValue('lastContent', sequelize.stripNullByte(value)) + } }, - set: function (value) { - this.setDataValue('content', sequelize.stripNullByte(value)) - } - }, - length: { - type: DataTypes.INTEGER - }, - authorship: { - type: DataTypes.TEXT('long'), - get: function () { - return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse) + content: { + type: DataTypes.TEXT({length: 'long'}), + get: function () { + return sequelize.processData(this.getDataValue('content'), '') + }, + set: function (value) { + this.setDataValue('content', sequelize.stripNullByte(value)) + } + }, + length: { + type: DataTypes.INTEGER }, - set: function (value) { - this.setDataValue('authorship', value ? JSON.stringify(value) : value) + authorship: { + type: DataTypes.TEXT({length: 'long'}), + get: function () { + return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse) + }, + set: function (value: string | null) { + this.setDataValue('authorship', value ? JSON.stringify(value) : value) + } } - } - }) + }, {sequelize}) + } - Revision.associate = function (models) { + static associate(models: any): void { Revision.belongsTo(models.Note, { foreignKey: 'noteId', as: 'note', @@ -111,7 +131,9 @@ module.exports = function (sequelize, DataTypes) { hooks: true }) } - Revision.getNoteRevisions = function (note, callback) { + + + static getNoteRevisions(note, callback) { Revision.findAll({ where: { noteId: note.id @@ -131,7 +153,8 @@ module.exports = function (sequelize, DataTypes) { callback(err, null) }) } - Revision.getPatchedNoteRevisionByTime = function (note, time, callback) { + + static getPatchedNoteRevisionByTime(note, time, callback) { // find all revisions to prepare for all possible calculation Revision.findAll({ where: { @@ -148,7 +171,6 @@ module.exports = function (sequelize, DataTypes) { [Op.gte]: time } }, - order: [['createdAt', 'DESC']] }).then(function (count) { if (count <= 0) return callback(null, null) sendDmpWorker({ @@ -163,76 +185,8 @@ module.exports = function (sequelize, DataTypes) { return callback(err, null) }) } - Revision.checkAllNotesRevision = function (callback) { - Revision.saveAllNotesRevision(function (err, notes) { - if (err) return callback(err, null) - if (!notes || notes.length <= 0) { - return callback(null, notes) - } else { - Revision.checkAllNotesRevision(callback) - } - }) - } - Revision.saveAllNotesRevision = function (callback) { - sequelize.models.Note.findAll({ - // query all notes that need to save for revision - where: { - [Op.and]: [ - { - lastchangeAt: { - [Op.or]: { - [Op.eq]: null, - [Op.and]: { - [Op.ne]: null, - [Op.gt]: sequelize.col('createdAt') - } - } - } - }, - { - savedAt: { - [Op.or]: { - [Op.eq]: null, - [Op.lt]: sequelize.col('lastchangeAt') - } - } - } - ] - } - }).then(function (notes) { - if (notes.length <= 0) return callback(null, notes) - const savedNotes = [] - async.each(notes, function (note, _callback) { - // revision saving policy: note not been modified for 5 mins or not save for 10 mins - if (note.lastchangeAt && note.savedAt) { - const lastchangeAt = moment(note.lastchangeAt) - const savedAt = moment(note.savedAt) - if (moment().isAfter(lastchangeAt.add(5, 'minutes'))) { - savedNotes.push(note) - Revision.saveNoteRevision(note, _callback) - } else if (lastchangeAt.isAfter(savedAt.add(10, 'minutes'))) { - savedNotes.push(note) - Revision.saveNoteRevision(note, _callback) - } else { - return _callback(null, null) - } - } else { - savedNotes.push(note) - Revision.saveNoteRevision(note, _callback) - } - }, function (err) { - if (err) { - return callback(err, null) - } - // return null when no notes need saving at this moment but have delayed tasks to be done - const result = ((savedNotes.length === 0) && (notes.length > savedNotes.length)) ? null : savedNotes - return callback(null, result) - }) - }).catch(function (err) { - return callback(err, null) - }) - } - Revision.saveNoteRevision = function (note, callback) { + + static saveNoteRevision(note, callback) { Revision.findAll({ where: { noteId: note.id @@ -297,8 +251,10 @@ module.exports = function (sequelize, DataTypes) { return callback(err, null) }) } - Revision.saveNoteRevisionAsync = util.promisify(Revision.saveNoteRevision) - Revision.finishSaveNoteRevision = function (note, revision, callback) { + + static saveNoteRevisionAsync = util.promisify(Revision.saveNoteRevision) as (note) => Promise + + static finishSaveNoteRevision(note, revision, callback) { note.update({ savedAt: revision.updatedAt }).then(function () { @@ -308,5 +264,4 @@ module.exports = function (sequelize, DataTypes) { }) } - return Revision } diff --git a/lib/models/user.ts b/lib/models/user.ts index 356d70e5bd..40dc02088e 100644 --- a/lib/models/user.ts +++ b/lib/models/user.ts @@ -1,75 +1,113 @@ -'use strict' -// external modules -import * as Sequelize from "sequelize"; - +import {Sequelize, Model, DataTypes} from "sequelize"; import Scrypt from "scrypt-kdf"; -// core + import {logger} from "../logger"; import {generateAvatarURL} from "../letter-avatars"; -export = function (sequelize, DataTypes) { - const User = sequelize.define('User', { - id: { - type: DataTypes.UUID, - primaryKey: true, - defaultValue: Sequelize.UUIDV4 - }, - profileid: { - type: DataTypes.STRING, - unique: true - }, - profile: { - type: DataTypes.TEXT - }, - history: { - type: DataTypes.TEXT - }, - accessToken: { - type: DataTypes.TEXT - }, - refreshToken: { - type: DataTypes.TEXT - }, - deleteToken: { - type: DataTypes.UUID, - defaultValue: Sequelize.UUIDV4 - }, - email: { - type: Sequelize.TEXT, - validate: { - isEmail: true - } - }, - password: { - type: Sequelize.TEXT - } - }) - User.hashPassword = async function (plain) { - return (await Scrypt.kdf(plain, await Scrypt.pickParams(0.1))).toString('hex') - } +interface BaseProfile { + provider: string +} - User.prototype.verifyPassword = async function (attempt) { - if (await Scrypt.verify(Buffer.from(this.password, 'hex'), attempt)) { - return this - } +interface DropboxProfile extends BaseProfile { + provider: 'dropbox' + emails?: { value: string }[] +} - return false - } +interface GenericProfile extends BaseProfile { + provider: string + displayName?: string + username?: string + id?: string + photos?: { value: string }[] + avatarUrl?: string + emails?: string[] + photo?: string + email?: string +} - User.addHook('beforeCreate', async function (user) { - // only do hash when password is presented - if (user.password) { - user.password = await User.hashPassword(user.password) - } - }) - User.addHook('beforeUpdate', async function (user) { - if (user.changed('password')) { - user.password = await User.hashPassword(user.password) - } - }) +interface UserProfile { + name: string + photo: string + biggerphoto: string +} + +export interface UserAttributes { + id: string + profileid?: string + profile?: string + history?: string + accessToken?: string + refreshToken?: string + deleteToken?: string + email?: string + password?: string +} + +export class User extends Model implements UserAttributes { + accessToken: string; + deleteToken: string; + email: string; + history: string; + id: string; + password: string; + profile: string; + profileid: string; + refreshToken: string; + + static initialize(sequelize: Sequelize): void { + User.init({ + id: { + type: DataTypes.UUID, + primaryKey: true, + defaultValue: DataTypes.UUIDV4 + }, + profileid: { + type: DataTypes.STRING, + unique: true + }, + profile: { + type: DataTypes.TEXT + }, + history: { + type: DataTypes.TEXT + }, + accessToken: { + type: DataTypes.TEXT + }, + refreshToken: { + type: DataTypes.TEXT + }, + deleteToken: { + type: DataTypes.UUID, + defaultValue: DataTypes.UUIDV4 + }, + email: { + type: DataTypes.TEXT, + validate: { + isEmail: true + } + }, + password: { + type: DataTypes.TEXT + } + }, {sequelize}) + + User.addHook('beforeCreate', async function (user: User) { + // only do hash when password is presented + if (user.password) { + user.password = await User.hashPassword(user.password) + } + }) + + User.addHook('beforeUpdate', async function (user: User) { + if (user.changed('password')) { + user.password = await User.hashPassword(user.password) + } + }) + } - User.associate = function (models) { + static associate(models: any): void { User.hasMany(models.Note, { foreignKey: 'ownerId', constraints: false @@ -79,95 +117,123 @@ export = function (sequelize, DataTypes) { constraints: false }) } - User.getProfile = function (user) { - if (!user) { - return null + + static async hashPassword(plain): Promise { + return (await Scrypt.kdf(plain, await Scrypt.pickParams(0.1))).toString('hex') + } + + async verifyPassword(attempt: string): Promise { + if (await Scrypt.verify(Buffer.from(this.password, 'hex'), attempt)) { + return this } - return user.profile ? User.parseProfile(user.profile) : (user.email ? User.parseProfileByEmail(user.email) : null) + return false } - User.parseProfile = function (profile) { + + static getProfile(user): UserProfile | null { + if (!user) return null + if (user.profile) return User.parseProfile(user.profile) + if (user.email) return User.parseProfileByEmail(user.email) + return null + } + + static parseProfile(profile: string): UserProfile | null { + let parsedProfile: GenericProfile | null try { - profile = JSON.parse(profile) + parsedProfile = JSON.parse(profile) } catch (err) { logger.error(err) - profile = null + return null } - if (profile) { - profile = { - name: profile.displayName || profile.username, - photo: User.parsePhotoByProfile(profile), - biggerphoto: User.parsePhotoByProfile(profile, true) + let returnProfile: UserProfile | null = null + if (parsedProfile) { + returnProfile = { + name: parsedProfile.displayName || parsedProfile.username, + photo: User.parsePhotoByProfile(parsedProfile), + biggerphoto: User.parsePhotoByProfile(parsedProfile, true) } } - return profile + return returnProfile } - User.parsePhotoByProfile = function (profile, bigger) { + + static parsePhotoByProfile(profile: BaseProfile, bigger = false): string { let photo = null - switch (profile.provider) { - case 'facebook': - photo = 'https://graph.facebook.com/' + profile.id + '/picture' + switch ((profile as GenericProfile).provider) { + case 'facebook': { + let photo = 'https://graph.facebook.com/' + (profile as GenericProfile).id + '/picture' if (bigger) photo += '?width=400' else photo += '?width=96' - break - case 'twitter': - photo = 'https://twitter.com/' + profile.username + '/profile_image' + return photo + } + case 'twitter': { + photo = 'https://twitter.com/' + (profile as GenericProfile).username + '/profile_image' if (bigger) photo += '?size=original' else photo += '?size=bigger' - break + return photo + } case 'github': { - const photoURL = new URL(profile.photos && profile.photos[0] - ? profile.photos[0].value - : `https://avatars.githubusercontent.com/u/${profile.id}`) + const githubProfile = profile as GenericProfile + const photoURL = new URL( + githubProfile.photos && githubProfile.photos[0] ? + githubProfile.photos[0].value + : `https://avatars.githubusercontent.com/u/${githubProfile.id}`) photoURL.searchParams.set('s', (bigger ? 400 : 96).toString()) - photo = photoURL.toString() - break + return photoURL.toString() } - case 'gitlab': - photo = profile.avatarUrl + case 'gitlab': { + const gitlabProfile = profile as GenericProfile + let photo = gitlabProfile.avatarUrl if (photo) { if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400') else photo = photo.replace(/(\?s=)\d*$/i, '$196') } else { - photo = generateAvatarURL(profile.username) + photo = generateAvatarURL(gitlabProfile.username) } - break - case 'mattermost': - photo = profile.avatarUrl + return photo + } + case 'mattermost': { + const mattermostProfile = profile as GenericProfile + let photo = mattermostProfile.avatarUrl if (photo) { if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400') else photo = photo.replace(/(\?s=)\d*$/i, '$196') } else { - photo = generateAvatarURL(profile.username) + photo = generateAvatarURL(mattermostProfile.username) } - break - case 'dropbox': - photo = generateAvatarURL('', profile.emails[0].value, bigger) - break - case 'google': - photo = profile.photos[0].value - if (bigger) photo = photo.replace(/(\?sz=)\d*$/i, '$1400') - else photo = photo.replace(/(\?sz=)\d*$/i, '$196') - break - case 'ldap': - photo = generateAvatarURL(profile.username, profile.emails[0], bigger) - break - case 'saml': - photo = generateAvatarURL(profile.username, profile.emails[0], bigger) - break - case 'oauth2': - photo = profile.photo - if (!photo) photo = generateAvatarURL(profile.username, profile.email, bigger) - break + return photo + } + case 'dropbox': { + return generateAvatarURL('', (profile as DropboxProfile).emails[0].value, bigger) + } + case 'google': { + const googleProfile = profile as GenericProfile + const photo = googleProfile.photos[0].value + if (bigger) return photo.replace(/(\?sz=)\d*$/i, '$1400') + else return photo.replace(/(\?sz=)\d*$/i, '$196') + } + case 'ldap': { + const ldapProfile = profile as GenericProfile + return generateAvatarURL(ldapProfile.username, ldapProfile.emails[0], bigger) + } + case 'saml': { + const samlProfile = profile as GenericProfile + return generateAvatarURL(samlProfile.username, samlProfile.emails[0], bigger) + } + case 'oauth2': { + const oauth2Profile = profile as GenericProfile + let photo = oauth2Profile.photo + if (!photo) photo = generateAvatarURL(oauth2Profile.username, oauth2Profile.email, bigger) + return photo + } + default: + return '' } - return photo } - User.parseProfileByEmail = function (email) { + + static parseProfileByEmail(email: string): UserProfile { return { name: email.substring(0, email.lastIndexOf('@')), photo: generateAvatarURL('', email, false), biggerphoto: generateAvatarURL('', email, true) } } - - return User } diff --git a/lib/note/index.ts b/lib/note/index.ts index a8490aed42..bc996b13ff 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -8,6 +8,7 @@ import {Note, Revision, User} from "../models"; import {errorForbidden, errorInternalError, errorNotFound, newCheckViewPermission, responseCodiMD} from "../response"; import {historyDelete, updateHistory} from "../history"; +import {createNoteWithRevision} from "../services/note"; import { actionDownload, actionGist, @@ -49,7 +50,7 @@ async function createNote(userId, noteAlias) { throw new Error('can not create note') } - const note = await Note.create({ + const note = await createNoteWithRevision({ ownerId: userId, alias: noteAlias }) diff --git a/lib/realtime/realtimeSaveRevisionJob.ts b/lib/realtime/realtimeSaveRevisionJob.ts index eef22c78e2..60149db121 100644 --- a/lib/realtime/realtimeSaveRevisionJob.ts +++ b/lib/realtime/realtimeSaveRevisionJob.ts @@ -2,6 +2,7 @@ import * as models from "../models"; import {logger} from "../logger"; +import {saveAllNotesRevision} from "../services/note"; /** * clean when user not in any rooms or user not in connected list @@ -29,7 +30,7 @@ export class SaveRevisionJob { saveRevision() { if (this.getSaverSleep()) return - models.Revision.saveAllNotesRevision((err, notes) => { + saveAllNotesRevision((err, notes) => { if (err) { logger.error('revision saver failed: ' + err) } diff --git a/lib/response.ts b/lib/response.ts index cb5ddcbf03..a72bcaba4c 100644 --- a/lib/response.ts +++ b/lib/response.ts @@ -5,6 +5,7 @@ import * as request from "request"; import config from "./config"; import {logger} from "./logger"; import * as models from "./models"; +import {createNoteWithRevision} from "./services/note"; import * as utils from "./utils"; import * as history from "./history"; @@ -83,7 +84,7 @@ export function newNote(req, res, next?: any) { } else if (!config.allowAnonymous) { return errorForbidden(req, res) } - models.Note.create({ + createNoteWithRevision({ ownerId: owner, alias: req.alias ? req.alias : null, content: body diff --git a/lib/services/note.ts b/lib/services/note.ts new file mode 100644 index 0000000000..2bd99b0511 --- /dev/null +++ b/lib/services/note.ts @@ -0,0 +1,115 @@ +import DiffMatchPatch from "@hackmd/diff-match-patch"; +import async from 'async' +import moment from "moment"; +import {col, Op} from "sequelize"; +import {Note} from "../models"; +import * as models from '../models' +import {NoteAttributes} from "../models/note"; + +const dmp = new DiffMatchPatch() + +export function checkAllNotesRevision(callback) { + saveAllNotesRevision(function (err, notes) { + if (err) return callback(err, null) + if (!notes || notes.length <= 0) { + return callback(null, notes) + } else { + checkAllNotesRevision(callback) + } + }) +} + +export function saveAllNotesRevision(callback: any): void { + models.Note.findAll({ + // query all notes that need to save for revision + where: { + [Op.and]: [ + { + lastchangeAt: { + [Op.or]: { + [Op.eq]: null, + [Op.and]: { + [Op.ne]: null, + [Op.gt]: col('createdAt') + } + } + } + }, + { + savedAt: { + [Op.or]: { + [Op.eq]: null, + [Op.lt]: col('lastchangeAt') + } + } + } + ] + } + }).then(function (notes) { + if (notes.length <= 0) return callback(null, notes) + const savedNotes = [] + async.each(notes, function (note, _callback) { + // revision saving policy: note not been modified for 5 mins or not save for 10 mins + if (note.lastchangeAt && note.savedAt) { + const lastchangeAt = moment(note.lastchangeAt) + const savedAt = moment(note.savedAt) + if (moment().isAfter(lastchangeAt.add(5, 'minutes'))) { + savedNotes.push(note) + models.Revision.saveNoteRevision(note, _callback) + } else if (lastchangeAt.isAfter(savedAt.add(10, 'minutes'))) { + savedNotes.push(note) + models.Revision.saveNoteRevision(note, _callback) + } else { + return _callback(null, null) + } + } else { + savedNotes.push(note) + models.Revision.saveNoteRevision(note, _callback) + } + }, function (err) { + if (err) { + return callback(err, null) + } + // return null when no notes need saving at this moment but have delayed tasks to be done + const result = ((savedNotes.length === 0) && (notes.length > savedNotes.length)) ? null : savedNotes + return callback(null, result) + }) + }).catch(function (err) { + return callback(err, null) + }) +} + +export async function syncNote(noteInFS, note): Promise { + const contentLength = noteInFS.content.length + + let note2 = await note.update({ + title: noteInFS.title, + content: noteInFS.content, + lastchangeAt: noteInFS.lastchangeAt + }) + const revision = await models.Revision.saveNoteRevisionAsync(note2) + // update authorship on after making revision of docs + const patch = dmp.patch_fromText(revision.patch) + const operations = models.Note.transformPatchToOperations(patch, contentLength) + let authorship = note2.authorship + for (let i = 0; i < operations.length; i++) { + authorship = models.Note.updateAuthorshipByOperation(operations[i], null, authorship) + } + note2 = await note.update({ + authorship: authorship + }) + return note2.id +} + +export async function createNoteWithRevision(noteAttribute: NoteAttributes): Promise { + const note = await Note.create(noteAttribute) as Note + return new Promise((resolve, reject) => { + models.Revision.saveNoteRevision(note, function (err) { + if (err) { + reject(err) + return + } + resolve(note) + }) + }) +} From ff90fd0fe172e0de4c5240a328b6fd6ed8dac22c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 18:41:06 +0800 Subject: [PATCH 110/167] test: fix test case Signed-off-by: Raccoon --- test/realtime/cleanDanglingUser.test.js | 16 +++++++--------- test/realtime/dirtyNoteUpdate.test.js | 14 +++++--------- test/realtime/disconnect-process.test.js | 7 +++---- test/realtime/saveRevisionJob.test.js | 21 ++++++++++----------- test/realtime/socket-events.test.js | 14 +++++++------- test/testDoubles/loggerFake.js | 9 ++++++++- test/testDoubles/otFake.js | 2 ++ 7 files changed, 42 insertions(+), 41 deletions(-) diff --git a/test/realtime/cleanDanglingUser.test.js b/test/realtime/cleanDanglingUser.test.js index 19df1626a0..dc53627ba2 100644 --- a/test/realtime/cleanDanglingUser.test.js +++ b/test/realtime/cleanDanglingUser.test.js @@ -4,26 +4,24 @@ const assert = require('assert') const mock = require('mock-require') const sinon = require('sinon') +const { createFakeLogger } = require('../testDoubles/loggerFake') const { removeModuleFromRequireCache, makeMockSocket } = require('./utils') describe('cleanDanglingUser', function () { let clock beforeEach(() => { clock = sinon.useFakeTimers() + mock('../../dist/models', {}) mock('../../dist/processQueue', require('../testDoubles/ProcessQueueFake')) - mock('../../dist/logger', { - error: () => {}, - info: () => {} - }) + mock('../../dist/logger', createFakeLogger()) mock('../../dist/history', {}) - mock('../../dist/models', { - Revision: { - saveAllNotesRevision: () => { - } + mock('../../dist/services/note', { + saveAllNotesRevision: () => { } }) mock('../../dist/config', { - debug: true + debug: true, + db: {} }) mock('../../dist/realtimeUpdateDirtyNoteJob', require('../testDoubles/realtimeJobStub')) mock('../../dist/realtimeSaveRevisionJob', require('../testDoubles/realtimeJobStub')) diff --git a/test/realtime/dirtyNoteUpdate.test.js b/test/realtime/dirtyNoteUpdate.test.js index 31ce7d10db..08d73c4fd5 100644 --- a/test/realtime/dirtyNoteUpdate.test.js +++ b/test/realtime/dirtyNoteUpdate.test.js @@ -4,6 +4,7 @@ const assert = require('assert') const mock = require('mock-require') const sinon = require('sinon') +const { createFakeLogger } = require('../testDoubles/loggerFake') const { removeModuleFromRequireCache, makeMockSocket, removeLibModuleCache } = require('./utils') describe('realtime#update note is dirty timer', function () { @@ -15,16 +16,11 @@ describe('realtime#update note is dirty timer', function () { clock = sinon.useFakeTimers({ toFake: ['setInterval'] }) - mock('../../dist/logger', { - error: () => { - } - }) + mock('../../dist/logger', createFakeLogger()) mock('../../dist/history', {}) - mock('../../dist/models', { - Revision: { - saveAllNotesRevision: () => { - } - } + mock('../../dist/models', {}) + mock('../../dist/services/note', { + saveAllNotesRevision: () => {} }) mock('../../dist/config', {}) realtime = require('../../dist/realtime/realtime') diff --git a/test/realtime/disconnect-process.test.js b/test/realtime/disconnect-process.test.js index 81e320ddc6..1d88cfe9b7 100644 --- a/test/realtime/disconnect-process.test.js +++ b/test/realtime/disconnect-process.test.js @@ -19,11 +19,10 @@ describe('realtime#disconnect', function () { error: () => { } }) + mock('../../dist/models', {}) mock('../../dist/history', {}) - mock('../../dist/models', { - Revision: { - saveAllNotesRevision: () => { - } + mock('../../dist/services/note', { + saveAllNotesRevision: () => { } }) mock('../../dist/config', {}) diff --git a/test/realtime/saveRevisionJob.test.js b/test/realtime/saveRevisionJob.test.js index 6e712eeb8b..2345ba6bbe 100644 --- a/test/realtime/saveRevisionJob.test.js +++ b/test/realtime/saveRevisionJob.test.js @@ -8,23 +8,22 @@ const { removeModuleFromRequireCache, removeLibModuleCache } = require('./utils' describe('save revision job', function () { let clock - let mockModels + let noteService let realtime beforeEach(() => { removeLibModuleCache() - mockModels = { - Revision: { - saveAllNotesRevision: sinon.stub() - } - } clock = sinon.useFakeTimers() + noteService = { + saveAllNotesRevision: sinon.stub() + } mock('../../dist/processQueue', require('../testDoubles/ProcessQueueFake')) mock('../../dist/logger', { error: () => {}, info: () => {} }) mock('../../dist/history', {}) - mock('../../dist/models', mockModels) + mock('../../dist/models', { }) + mock('../../dist/services/note', noteService) mock('../../dist/config', { debug: true }) @@ -41,28 +40,28 @@ describe('save revision job', function () { }) it('should execute save revision job every 5 min', (done) => { - mockModels.Revision.saveAllNotesRevision.callsFake((callback) => { + noteService.saveAllNotesRevision.callsFake((callback) => { callback(null, []) }) realtime = require('../../dist/realtime/realtime') clock.tick(5 * 60 * 1000) clock.restore() setTimeout(() => { - assert(mockModels.Revision.saveAllNotesRevision.called) + assert(noteService.saveAllNotesRevision.called) assert(realtime.saveRevisionJob.getSaverSleep() === true) done() }, 50) }) it('should not set saverSleep when more than 1 note save revision', (done) => { - mockModels.Revision.saveAllNotesRevision.callsFake((callback) => { + noteService.saveAllNotesRevision.callsFake((callback) => { callback(null, [1]) }) realtime = require('../../dist/realtime/realtime') clock.tick(5 * 60 * 1000) clock.restore() setTimeout(() => { - assert(mockModels.Revision.saveAllNotesRevision.called) + assert(noteService.saveAllNotesRevision.called) assert(realtime.saveRevisionJob.getSaverSleep() === false) done() }, 50) diff --git a/test/realtime/socket-events.test.js b/test/realtime/socket-events.test.js index b4743a910d..60d4f5bdb6 100644 --- a/test/realtime/socket-events.test.js +++ b/test/realtime/socket-events.test.js @@ -4,6 +4,7 @@ const assert = require('assert') const mock = require('mock-require') const sinon = require('sinon') +const { createFakeLogger } = require('../testDoubles/loggerFake') const { makeMockSocket, removeModuleFromRequireCache } = require('./utils') @@ -64,16 +65,15 @@ describe('realtime#socket event', function () { locked: 'locked', protected: 'protected', private: 'private' - } - } - mock('../../dist/logger', { - error: () => { }, - info: () => { - } - }) + db: {} + } + mock('../../dist/logger', createFakeLogger()) mock('../../dist/history', {}) mock('../../dist/models', modelsMock) + mock('../../dist/services/note', { + saveAllNotesRevision: () => {} + }) mock('../../dist/config', configMock) mock('ot', require('../testDoubles/otFake')) realtime = require('../../dist/realtime/realtime') diff --git a/test/testDoubles/loggerFake.js b/test/testDoubles/loggerFake.js index c4ce9cd41b..015e59d4f2 100644 --- a/test/testDoubles/loggerFake.js +++ b/test/testDoubles/loggerFake.js @@ -8,7 +8,14 @@ function createFakeLogger () { warn: sinon.stub(), info: sinon.stub(), debug: sinon.stub(), - log: sinon.stub() + log: sinon.stub(), + logger: { + error: sinon.stub(), + warn: sinon.stub(), + info: sinon.stub(), + debug: sinon.stub(), + log: sinon.stub() + } } } diff --git a/test/testDoubles/otFake.js b/test/testDoubles/otFake.js index 9fd5d3fdbc..fa2e4ed7ae 100644 --- a/test/testDoubles/otFake.js +++ b/test/testDoubles/otFake.js @@ -12,6 +12,8 @@ class EditorSocketIOServerFake { this.setColor = sinon.stub() this.getClient = sinon.stub() this.onDisconnect = sinon.stub() + this.setLogger = sinon.stub() + this.setDocumentMaxLength = sinon.stub() } } From 6e8ff9803948b7457cc5af6a054128ec28001681 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 18:53:50 +0800 Subject: [PATCH 111/167] remove * as models Signed-off-by: Raccoon --- lib/app.ts | 6 ++-- lib/auth/email/index.ts | 6 ++-- lib/auth/index.ts | 4 +-- lib/auth/ldap/index.ts | 4 +-- lib/auth/openid/index.ts | 4 +-- lib/auth/saml/index.ts | 4 +-- lib/auth/utils.ts | 4 +-- lib/history/index.ts | 32 +++++++++-------- lib/homepage/index.ts | 2 -- lib/realtime/realtime.ts | 42 +++++++++++----------- lib/realtime/realtimeClientConnection.ts | 6 ++-- lib/realtime/realtimeSaveRevisionJob.ts | 1 - lib/response.ts | 46 ++++++++++++------------ lib/services/note.ts | 20 +++++------ lib/user/index.ts | 26 +++++++------- 15 files changed, 102 insertions(+), 105 deletions(-) diff --git a/lib/app.ts b/lib/app.ts index f1f2820a01..f5ce71d3ae 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -22,7 +22,7 @@ import {Server as WsServer} from 'ws' import config from "./config"; import {logger} from "./logger"; import * as response from "./response"; -import * as models from "./models"; +import {sequelize} from "./models"; import * as csp from "./csp"; import {Environment} from "./config/enum"; import {checkAllNotesRevision} from "./services/note"; @@ -101,7 +101,7 @@ app.use(methodOverride('_method')) // session store const sessionStore = new SequelizeStore({ - db: models.sequelize + db: sequelize }) // use hsts to tell https users stick to this @@ -286,7 +286,7 @@ function startListen() { } // sync db then start listen -models.sequelize.sync().then(function () { +sequelize.sync().then(function () { // check if realtime is ready if (realtime.isReady()) { checkAllNotesRevision(function (err, notes) { diff --git a/lib/auth/email/index.ts b/lib/auth/email/index.ts index cd98acb813..7985198205 100644 --- a/lib/auth/email/index.ts +++ b/lib/auth/email/index.ts @@ -3,8 +3,8 @@ import passport from "passport"; import validator from "validator"; import {Strategy as LocalStrategy} from 'passport-local'; -import * as models from '../../models'; import config from '../../config'; +import {User} from '../../models'; import {logger} from "../../logger"; import {setReturnToFromReferer} from "../utils"; import {urlencodedParser} from "../../utils"; @@ -19,7 +19,7 @@ passport.use(new LocalStrategy({ if (!validator.isEmail(email)) return done(null, false) try { - const user = await models.User.findOne({ + const user = await User.findOne({ where: { email: email } @@ -39,7 +39,7 @@ if (config.allowEmailRegister) { if (!req.body.email || !req.body.password) return response.errorBadRequest(req, res) if (!validator.isEmail(req.body.email)) return response.errorBadRequest(req, res) try { - const [user, created] = await models.User.findOrCreate({ + const [user, created] = await User.findOrCreate({ where: { email: req.body.email }, diff --git a/lib/auth/index.ts b/lib/auth/index.ts index d981c1f541..85c5df78d8 100644 --- a/lib/auth/index.ts +++ b/lib/auth/index.ts @@ -3,7 +3,7 @@ import {Router} from "express"; import passport from "passport"; import config from "../config"; import {logger} from "../logger"; -import * as models from "../models"; +import {User} from "../models"; const authRouter = Router() export = authRouter @@ -15,7 +15,7 @@ passport.serializeUser(function (user: any, done) { }) passport.deserializeUser(function (id, done) { - models.User.findOne({ + User.findOne({ where: { id: id } diff --git a/lib/auth/ldap/index.ts b/lib/auth/ldap/index.ts index b08037da6b..0384e8c282 100644 --- a/lib/auth/ldap/index.ts +++ b/lib/auth/ldap/index.ts @@ -3,7 +3,7 @@ import passport from "passport"; import LDAPStrategy from "passport-ldapauth"; import config from "../../config"; -import * as models from "../../models"; +import {User} from "../../models"; import {logger} from "../../logger"; import * as response from "../../response"; import {setReturnToFromReferer} from "../utils"; @@ -50,7 +50,7 @@ passport.use(new LDAPStrategy({ provider: 'ldap' } const stringifiedProfile = JSON.stringify(profile) - models.User.findOrCreate({ + User.findOrCreate({ where: { profileid: profile.id.toString() }, diff --git a/lib/auth/openid/index.ts b/lib/auth/openid/index.ts index 734697989a..60411688b4 100644 --- a/lib/auth/openid/index.ts +++ b/lib/auth/openid/index.ts @@ -3,7 +3,7 @@ import passport from "passport"; import {Strategy as OpenIDStrategy} from "@passport-next/passport-openid"; import config from "../../config"; -import * as models from "../../models"; +import {User} from "../../models"; import {logger} from "../../logger"; import {urlencodedParser} from "../../utils"; import {setReturnToFromReferer} from "../utils"; @@ -17,7 +17,7 @@ passport.use(new OpenIDStrategy({ profile: true }, function (openid, profile, done) { const stringifiedProfile = JSON.stringify(profile) - models.User.findOrCreate({ + User.findOrCreate({ where: { profileid: openid }, diff --git a/lib/auth/saml/index.ts b/lib/auth/saml/index.ts index 3e50b083b5..6fc971b0e4 100644 --- a/lib/auth/saml/index.ts +++ b/lib/auth/saml/index.ts @@ -4,7 +4,7 @@ import passport from "passport"; import {Strategy as SamlStrategy} from "passport-saml"; import config from "../../config"; -import * as models from "../../models"; +import {User} from "../../models"; import {logger} from "../../logger"; import {urlencodedParser} from "../../utils"; @@ -49,7 +49,7 @@ passport.use(new SamlStrategy({ profile.emails.push(user.nameID) } const stringifiedProfile = JSON.stringify(profile) - models.User.findOrCreate({ + User.findOrCreate({ where: { profileid: profile.id.toString() }, diff --git a/lib/auth/utils.ts b/lib/auth/utils.ts index 3528de9cd4..72f48d1974 100644 --- a/lib/auth/utils.ts +++ b/lib/auth/utils.ts @@ -1,6 +1,6 @@ 'use strict' -import * as models from "../models"; +import {User} from "../models"; import config from "../config"; import {logger} from "../logger"; @@ -32,7 +32,7 @@ export function setReturnToFromReferer(req) { export function passportGeneralCallback(accessToken, refreshToken, profile, done) { const stringifiedProfile = JSON.stringify(profile) - models.User.findOrCreate({ + User.findOrCreate({ where: { profileid: profile.id.toString() }, diff --git a/lib/history/index.ts b/lib/history/index.ts index 04f6abaa8a..ac01b7fdfa 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -2,13 +2,13 @@ // external modules import LZString from '@hackmd/lz-string' -import * as models from '../models' +import {Note, User} from '../models' import {logger} from '../logger' import config from '../config' import * as response from '../response' -function getHistory (userid, callback) { - models.User.findOne({ +function getHistory(userid, callback) { + User.findOne({ where: { id: userid } @@ -32,8 +32,8 @@ function getHistory (userid, callback) { } try { const id = LZString.decompressFromBase64(history[i].id) - if (id && models.Note.checkNoteIdValid(id)) { - history[i].id = models.Note.encodeNoteId(id) + if (id && Note.checkNoteIdValid(id)) { + history[i].id = Note.encodeNoteId(id) } } catch (err) { // most error here comes from LZString, ignore @@ -56,8 +56,8 @@ function getHistory (userid, callback) { }) } -function setHistory (userid, history, callback) { - models.User.update({ +function setHistory(userid, history, callback) { + User.update({ history: JSON.stringify(parseHistoryToArray(history)) }, { where: { @@ -71,7 +71,7 @@ function setHistory (userid, history, callback) { }) } -export function updateHistory (userid, noteId, document?: string, time?: any) { +export function updateHistory(userid, noteId, document?: string, time?: any) { if (userid && noteId && typeof document !== 'undefined') { getHistory(userid, function (err, history) { if (err || !history) return @@ -79,7 +79,7 @@ export function updateHistory (userid, noteId, document?: string, time?: any) { history[noteId] = {} } const noteHistory = history[noteId] - const noteInfo = models.Note.parseNoteInfo(document) + const noteInfo = Note.parseNoteInfo(document) noteHistory.id = noteId noteHistory.text = noteInfo.title noteHistory.time = time || Date.now() @@ -93,7 +93,7 @@ export function updateHistory (userid, noteId, document?: string, time?: any) { } } -function parseHistoryToArray (history) { +function parseHistoryToArray(history) { const _history = [] Object.keys(history).forEach(function (key) { const item = history[key] @@ -102,7 +102,7 @@ function parseHistoryToArray (history) { return _history } -function parseHistoryToObject (history) { +function parseHistoryToObject(history) { const _history = {} for (let i = 0, l = history.length; i < l; i++) { const item = history[i] @@ -111,7 +111,7 @@ function parseHistoryToObject (history) { return _history } -export function historyGet (req, res) { +export function historyGet(req, res) { if (req.isAuthenticated()) { getHistory(req.user.id, function (err, history) { if (err) return response.errorInternalError(req, res) @@ -125,12 +125,14 @@ export function historyGet (req, res) { } } -export function historyPost (req, res) { +export function historyPost(req, res) { if (req.isAuthenticated()) { const noteId = req.params.noteId if (!noteId) { if (typeof req.body.history === 'undefined') return response.errorBadRequest(req, res) - if (config.debug) { logger.info('SERVER received history from [' + req.user.id + ']: ' + req.body.history) } + if (config.debug) { + logger.info('SERVER received history from [' + req.user.id + ']: ' + req.body.history) + } let history = null try { history = JSON.parse(req.body.history) @@ -167,7 +169,7 @@ export function historyPost (req, res) { } } -export function historyDelete (req, res) { +export function historyDelete(req, res) { if (req.isAuthenticated()) { const noteId = req.params.noteId if (!noteId) { diff --git a/lib/homepage/index.ts b/lib/homepage/index.ts index a16c116781..160c03576f 100644 --- a/lib/homepage/index.ts +++ b/lib/homepage/index.ts @@ -1,8 +1,6 @@ import * as fs from 'fs' import * as path from 'path' import config from '../config' -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore import {User} from '../models' import {logger} from '../logger' import {Request, Response} from "express"; diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 3fcac84296..d12cbfa5ed 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -12,7 +12,7 @@ import {get} from "lodash"; import config from "../config"; import {logger} from "../logger"; import * as history from "../history"; -import * as models from "../models"; +import {Author, Note, User} from "../models"; // ot import ot from "ot"; @@ -163,7 +163,7 @@ export function updateNote(note, callback) { } function findNoteByIdAsync(id) { - return models.Note.findOne({ + return Note.findOne({ where: { id: id } @@ -181,13 +181,13 @@ function updateHistoryForEveryUserCollaborateNote(note) { } async function getUserProfileByIdAsync(id) { - const user = await models.User.findOne({ + const user = await User.findOne({ where: { id: id } }) if (!user) return null - return models.User.getProfile(user) + return User.getProfile(user) } class UserNotFoundException extends Error { @@ -210,7 +210,7 @@ async function getLastChangeUserProfileAsync(currentLastChangeUserId, lastChange function buildNoteUpdateData(note) { const body = note.server.document - const title = note.title = models.Note.parseNoteTitle(body) + const title = note.title = Note.parseNoteTitle(body) return { title: title, content: body, @@ -247,7 +247,7 @@ async function _updateNoteAsync(note) { // TODO: test it export function getStatus() { - return models.Note.count() + return Note.count() .then(function (notecount) { const distinctaddresses = [] const regaddresses = [] @@ -280,7 +280,7 @@ export function getStatus() { } }) - return models.User.count() + return User.count() .then(function (regcount) { return { onlineNotes: Object.keys(notes).length, @@ -324,7 +324,7 @@ function parseUrl(data) { return url.parse(data) } } catch (e) { - // just ignore + // just ignore } return null } @@ -369,7 +369,7 @@ export async function parseNoteIdFromSocketAsync(socket) { } return new Promise((resolve, reject) => { - models.Note.parseNoteId(noteId, function (err, id) { + Note.parseNoteId(noteId, function (err, id) { if (err) { reject(err) } @@ -448,21 +448,21 @@ export function checkViewPermission(req, note) { // TODO: test it async function fetchFullNoteAsync(noteId) { - return models.Note.findOne({ + return Note.findOne({ where: { id: noteId }, include: [{ - model: models.User, + model: User, as: 'owner' }, { - model: models.User, + model: User, as: 'lastchangeuser' }, { - model: models.Author, + model: Author, as: 'authors', include: [{ - model: models.User, + model: User, as: 'user' }] }] @@ -472,7 +472,7 @@ async function fetchFullNoteAsync(noteId) { function buildAuthorProfilesFromNote(noteAuthors) { const authors = {} noteAuthors.forEach((author) => { - const profile = models.User.getProfile(author.user) + const profile = User.getProfile(author.user) if (profile) { authors[author.userId] = { userid: author.userId, @@ -497,10 +497,10 @@ function makeNewServerNote(note) { alias: note.alias, title: note.title, owner: note.ownerId, - ownerprofile: note.owner ? models.User.getProfile(note.owner) : null, + ownerprofile: note.owner ? User.getProfile(note.owner) : null, permission: note.permission, lastchangeuser: note.lastchangeuserId, - lastchangeuserprofile: note.lastchangeuser ? models.User.getProfile(note.lastchangeuser) : null, + lastchangeuserprofile: note.lastchangeuser ? User.getProfile(note.lastchangeuser) : null, socks: [], users: {}, tempUsers: {}, @@ -585,7 +585,7 @@ export function buildUserOutData(user) { export function updateUserData(socket, user) { // retrieve user data from passport if (socket.request.user && socket.request.user.logged_in) { - const profile = models.User.getProfile(socket.request.user) + const profile = User.getProfile(socket.request.user) user.photo = profile.photo user.name = profile.name user.userid = socket.request.user.id @@ -641,7 +641,7 @@ function operationCallback(socket, operation) { if (!user) return userId = socket.request.user.id if (!note.authors[userId]) { - models.Author.findOrCreate({ + Author.findOrCreate({ where: { noteId: noteId, userId: userId @@ -669,13 +669,13 @@ function operationCallback(socket, operation) { } // save authorship - use timer here because it's an O(n) complexity algorithm setImmediate(function () { - note.authorship = models.Note.updateAuthorshipByOperation(operation, userId, note.authorship) + note.authorship = Note.updateAuthorshipByOperation(operation, userId, note.authorship) }) } // TODO: test it export function updateHistory(userId, note, time?: any) { - const noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) + const noteId = note.alias ? note.alias : Note.encodeNoteId(note.id) if (note.server) history.updateHistory(userId, noteId, note.server.document, time) } diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index d41d278715..611633b0d7 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -3,7 +3,7 @@ import {get} from "lodash"; import config from "../config"; -import * as models from "../models"; +import {Note} from "../models"; import {logger} from "../logger"; export class RealtimeClientConnection { @@ -92,13 +92,13 @@ export class RealtimeClientConnection { } async destroyNote(id) { - return models.Note.destroy({ + return Note.destroy({ where: {id: id} }) } async changeNotePermission(newPermission) { - const [changedRows] = await models.Note.update({ + const [changedRows] = await Note.update({ permission: newPermission }, { where: { diff --git a/lib/realtime/realtimeSaveRevisionJob.ts b/lib/realtime/realtimeSaveRevisionJob.ts index 60149db121..f6e8640298 100644 --- a/lib/realtime/realtimeSaveRevisionJob.ts +++ b/lib/realtime/realtimeSaveRevisionJob.ts @@ -1,6 +1,5 @@ 'use strict' -import * as models from "../models"; import {logger} from "../logger"; import {saveAllNotesRevision} from "../services/note"; diff --git a/lib/response.ts b/lib/response.ts index a72bcaba4c..db455f8b52 100644 --- a/lib/response.ts +++ b/lib/response.ts @@ -4,7 +4,7 @@ import * as request from "request"; // core import config from "./config"; import {logger} from "./logger"; -import * as models from "./models"; +import {Note, User} from "./models"; import {createNoteWithRevision} from "./services/note"; import * as utils from "./utils"; import * as history from "./history"; @@ -51,10 +51,10 @@ export function responseError(res, code, detail, msg) { export function responseCodiMD(res, note) { const body = note.content - const extracted = models.Note.extractMeta(body) - const meta = models.Note.parseMeta(extracted.meta) - let title = models.Note.decodeTitle(note.title) - title = models.Note.generateWebTitle(meta.title || title) + const extracted = Note.extractMeta(body) + const meta = Note.parseMeta(extracted.meta) + let title = Note.decodeTitle(note.title) + title = Note.generateWebTitle(meta.title || title) res.set({ 'Cache-Control': 'private', // only cache by client 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling @@ -65,7 +65,7 @@ export function responseCodiMD(res, note) { } function updateHistory(userId, note, document, time?: any) { - const noteId = note.alias ? note.alias : models.Note.encodeNoteId(note.id) + const noteId = note.alias ? note.alias : Note.encodeNoteId(note.id) history.updateHistory(userId, noteId, document, time) logger.info('history updated') } @@ -93,7 +93,7 @@ export function newNote(req, res, next?: any) { updateHistory(owner, note, body) } - return res.redirect(config.serverURL + '/' + models.Note.encodeNoteId(note.id)) + return res.redirect(config.serverURL + '/' + Note.encodeNoteId(note.id)) }).catch(function (err) { logger.error(err) return errorInternalError(req, res) @@ -131,12 +131,12 @@ export function checkViewPermission(req, note) { function findNote(req, res, callback, include?: any) { const noteId = req.params.noteId const id = req.params.noteId || req.params.shortid - models.Note.parseNoteId(id, function (err, _id) { + Note.parseNoteId(id, function (err, _id) { if (err) { logger.error(err) return errorInternalError(req, res) } - models.Note.findOne({ + Note.findOne({ where: { id: _id }, @@ -164,7 +164,7 @@ function findNote(req, res, callback, include?: any) { function actionDownload(req, res, note) { const body = note.content - const title = models.Note.decodeTitle(note.title) + const title = Note.decodeTitle(note.title) let filename = title filename = encodeURIComponent(filename) res.set({ @@ -187,7 +187,7 @@ export function publishNoteActions(req, res, next) { actionDownload(req, res, note) break case 'edit': - res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id))) + res.redirect(config.serverURL + '/' + (note.alias ? note.alias : Note.encodeNoteId(note.id))) break default: res.redirect(config.serverURL + '/s/' + note.shortid) @@ -201,7 +201,7 @@ export function publishSlideActions(req, res, next) { const action = req.params.action switch (action) { case 'edit': - res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id))) + res.redirect(config.serverURL + '/' + (note.alias ? note.alias : Note.encodeNoteId(note.id))) break default: res.redirect(config.serverURL + '/p/' + note.shortid) @@ -247,7 +247,7 @@ function githubActionGist(req, res, note) { const accessToken = body.access_token if (accessToken) { const content = note.content - const title = models.Note.decodeTitle(note.title) + const title = Note.decodeTitle(note.title) const filename = title.replace('/', ' ') + '.md' const gist = { files: {} @@ -299,7 +299,7 @@ export function gitlabActions(req, res, next) { function gitlabActionProjects(req, res, note) { if (req.isAuthenticated()) { - models.User.findOne({ + User.findOne({ where: { id: req.user.id } @@ -332,10 +332,10 @@ function gitlabActionProjects(req, res, note) { export function showPublishSlide(req, res, next) { const include = [{ - model: models.User, + model: User, as: 'owner' }, { - model: models.User, + model: User, as: 'lastchangeuser' }] findNote(req, res, function (note) { @@ -349,16 +349,16 @@ export function showPublishSlide(req, res, next) { return errorNotFound(req, res) } const body = note.content - const extracted = models.Note.extractMeta(body) + const extracted = Note.extractMeta(body) const markdown = extracted.markdown - const meta = models.Note.parseMeta(extracted.meta) + const meta = Note.parseMeta(extracted.meta) const createtime = note.createdAt const updatetime = note.lastchangeAt - let title = models.Note.decodeTitle(note.title) - title = models.Note.generateWebTitle(meta.title || title) + let title = Note.decodeTitle(note.title) + title = Note.generateWebTitle(meta.title || title) const data = { title: title, - description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null), + description: meta.description || (markdown ? Note.generateDescription(markdown) : null), viewcount: note.viewcount, createtime: createtime, updatetime: updatetime, @@ -366,9 +366,9 @@ export function showPublishSlide(req, res, next) { theme: meta.slideOptions && utils.isRevealTheme(meta.slideOptions.theme), meta: JSON.stringify(extracted.meta), owner: note.owner ? note.owner.id : null, - ownerprofile: note.owner ? models.User.getProfile(note.owner) : null, + ownerprofile: note.owner ? User.getProfile(note.owner) : null, lastchangeuser: note.lastchangeuser ? note.lastchangeuser.id : null, - lastchangeuserprofile: note.lastchangeuser ? models.User.getProfile(note.lastchangeuser) : null, + lastchangeuserprofile: note.lastchangeuser ? User.getProfile(note.lastchangeuser) : null, robots: meta.robots || false, // default allow robots GA: meta.GA, disqus: meta.disqus, diff --git a/lib/services/note.ts b/lib/services/note.ts index 2bd99b0511..6f2b2ba67a 100644 --- a/lib/services/note.ts +++ b/lib/services/note.ts @@ -2,9 +2,7 @@ import DiffMatchPatch from "@hackmd/diff-match-patch"; import async from 'async' import moment from "moment"; import {col, Op} from "sequelize"; -import {Note} from "../models"; -import * as models from '../models' -import {NoteAttributes} from "../models/note"; +import {Note, Revision, NoteAttributes} from "../models"; const dmp = new DiffMatchPatch() @@ -20,7 +18,7 @@ export function checkAllNotesRevision(callback) { } export function saveAllNotesRevision(callback: any): void { - models.Note.findAll({ + Note.findAll({ // query all notes that need to save for revision where: { [Op.and]: [ @@ -55,16 +53,16 @@ export function saveAllNotesRevision(callback: any): void { const savedAt = moment(note.savedAt) if (moment().isAfter(lastchangeAt.add(5, 'minutes'))) { savedNotes.push(note) - models.Revision.saveNoteRevision(note, _callback) + Revision.saveNoteRevision(note, _callback) } else if (lastchangeAt.isAfter(savedAt.add(10, 'minutes'))) { savedNotes.push(note) - models.Revision.saveNoteRevision(note, _callback) + Revision.saveNoteRevision(note, _callback) } else { return _callback(null, null) } } else { savedNotes.push(note) - models.Revision.saveNoteRevision(note, _callback) + Revision.saveNoteRevision(note, _callback) } }, function (err) { if (err) { @@ -87,13 +85,13 @@ export async function syncNote(noteInFS, note): Promise { content: noteInFS.content, lastchangeAt: noteInFS.lastchangeAt }) - const revision = await models.Revision.saveNoteRevisionAsync(note2) + const revision = await Revision.saveNoteRevisionAsync(note2) // update authorship on after making revision of docs const patch = dmp.patch_fromText(revision.patch) - const operations = models.Note.transformPatchToOperations(patch, contentLength) + const operations = Note.transformPatchToOperations(patch, contentLength) let authorship = note2.authorship for (let i = 0; i < operations.length; i++) { - authorship = models.Note.updateAuthorshipByOperation(operations[i], null, authorship) + authorship = Note.updateAuthorshipByOperation(operations[i], null, authorship) } note2 = await note.update({ authorship: authorship @@ -104,7 +102,7 @@ export async function syncNote(noteInFS, note): Promise { export async function createNoteWithRevision(noteAttribute: NoteAttributes): Promise { const note = await Note.create(noteAttribute) as Note return new Promise((resolve, reject) => { - models.Revision.saveNoteRevision(note, function (err) { + Revision.saveNoteRevision(note, function (err) { if (err) { reject(err) return diff --git a/lib/user/index.ts b/lib/user/index.ts index cc4bb42490..af112b8284 100644 --- a/lib/user/index.ts +++ b/lib/user/index.ts @@ -1,19 +1,19 @@ import archiver from 'archiver' import async from 'async' import * as response from '../response' -import * as models from '../models' import config from '../config' +import {Note, User} from '../models' import {logger} from '../logger' -import { generateAvatar } from '../letter-avatars' +import {generateAvatar} from '../letter-avatars' -export async function getMe (req, res) { +export async function getMe(req, res) { if (!req.isAuthenticated()) { return res.status(401).send({ status: 'forbidden' }) } - const user = await models.User.findOne({ + const user = await User.findOne({ where: { id: req.user.id } @@ -22,7 +22,7 @@ export async function getMe (req, res) { if (!user) { return response.errorNotFound(req, res) } - const profile = models.User.getProfile(user) + const profile = User.getProfile(user) res.send({ status: 'ok', @@ -32,12 +32,12 @@ export async function getMe (req, res) { }) } -export async function deleteUser (req, res) { +export async function deleteUser(req, res) { if (!req.isAuthenticated()) { return response.errorForbidden(req, res) } - const user = await models.User.findOne({ + const user = await User.findOne({ where: { id: req.user.id } @@ -55,13 +55,13 @@ export async function deleteUser (req, res) { return res.redirect(config.serverURL + '/') } -export function exportMyData (req, res) { +export function exportMyData(req, res) { if (!req.isAuthenticated()) { return response.errorForbidden(req, res) } const archive = archiver('zip', { - zlib: { level: 3 } // Sets the compression level. + zlib: {level: 3} // Sets the compression level. }) res.setHeader('Content-Type', 'application/zip') @@ -72,12 +72,12 @@ export function exportMyData (req, res) { return response.errorInternalError(req, res) }) - models.User.findOne({ + User.findOne({ where: { id: req.user.id } }).then(function (user) { - models.Note.findAll({ + Note.findAll({ where: { ownerId: user.id } @@ -98,7 +98,7 @@ export function exportMyData (req, res) { filenames[filename] = true logger.debug('Write: ' + filename) - archive.append(Buffer.from(note.content), { name: filename, date: note.lastchangeAt }) + archive.append(Buffer.from(note.content), {name: filename, date: note.lastchangeAt}) callback(null, null) }, function (err) { if (err) { @@ -114,7 +114,7 @@ export function exportMyData (req, res) { }) } -export function getMyAvatar (req, res) { +export function getMyAvatar(req, res) { res.setHeader('Content-Type', 'image/svg+xml') res.setHeader('Cache-Control', 'public, max-age=86400') res.send(generateAvatar(req.params.username)) From cb1f2637807c5f315a535cb0c4a7ad0489f55396 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 18:54:01 +0800 Subject: [PATCH 112/167] format Signed-off-by: Raccoon --- lib/auth/github/index.ts | 2 +- lib/auth/oauth2/strategy.ts | 9 +++++---- lib/models/revision.ts | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/auth/github/index.ts b/lib/auth/github/index.ts index 7c0125eaf2..2661ff340e 100644 --- a/lib/auth/github/index.ts +++ b/lib/auth/github/index.ts @@ -9,7 +9,7 @@ import {URL} from "url"; const githubAuth = Router() export = githubAuth -function githubUrl (path) { +function githubUrl(path) { return config.github.enterpriseURL && new URL(path, config.github.enterpriseURL).toString() } diff --git a/lib/auth/oauth2/strategy.ts b/lib/auth/oauth2/strategy.ts index 33c165c580..80fdbf21b3 100644 --- a/lib/auth/oauth2/strategy.ts +++ b/lib/auth/oauth2/strategy.ts @@ -1,7 +1,7 @@ import {InternalOAuthError, Strategy} from "passport-oauth2"; import config from "../../config"; -export function parseProfile (data) { +export function parseProfile(data) { const username = extractProfileAttribute(data, config.oauth2.userProfileUsernameAttr) const displayName = extractProfileAttribute(data, config.oauth2.userProfileDisplayNameAttr) const email = extractProfileAttribute(data, config.oauth2.userProfileEmailAttr) @@ -20,7 +20,7 @@ export function parseProfile (data) { } } -export function extractProfileAttribute (data, path) { +export function extractProfileAttribute(data, path) { if (!data) return undefined if (typeof path !== 'string') return undefined // can handle stuff like `attrs[0].name` @@ -41,7 +41,8 @@ export function extractProfileAttribute (data, path) { export class OAuth2CustomStrategy extends Strategy { private _userProfileURL: any; - constructor (options, verify) { + + constructor(options, verify) { options.customHeaders = options.customHeaders || {} super(options, verify) this.name = 'oauth2' @@ -49,7 +50,7 @@ export class OAuth2CustomStrategy extends Strategy { this._oauth2.useAuthorizationHeaderforGET(true) } - userProfile (accessToken, done) { + userProfile(accessToken, done) { this._oauth2.get(this._userProfileURL, accessToken, function (err, body, res) { if (err) { return done(new InternalOAuthError('Failed to fetch user profile', err)) diff --git a/lib/models/revision.ts b/lib/models/revision.ts index 9b9d7e0433..003303dde5 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -71,7 +71,7 @@ export class Revision extends Model implements RevisionAttri length: number; patch: string; - public readonly createdAt ?:number + public readonly createdAt ?: number static initialize(sequelize: MySequelize): void { Revision.init({ From 05cd6dd240794f7cfece736515f3b9a731ceb7ef Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 19:17:28 +0800 Subject: [PATCH 113/167] fix: heroku Signed-off-by: Raccoon --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 78d5384565..f8a830ba5f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "coverage:ci": "nyc mocha --no-color -R dot --require intelli-espower-loader --exit --recursive ./test", "test": "npm run-script lint && npm run-script jsonlint && npm run-script coverage", "test:ci": "npm run-script lint && npm run-script jsonlint && npm run-script coverage:ci", - "heroku-postbuild": "npm run build && ./bin/heroku" + "heroku-postbuild": "tsc && npm run build && ./bin/heroku" }, "dependencies": { "@aws-sdk/client-s3-node": "0.1.0-preview.2", From 3494922cdbfbc157e65725dabd1e7d085d63924f Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 19:18:27 +0800 Subject: [PATCH 114/167] fix: docker Signed-off-by: Raccoon --- deployments/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deployments/Dockerfile b/deployments/Dockerfile index 1e8e3dbbf2..32b426fc47 100644 --- a/deployments/Dockerfile +++ b/deployments/Dockerfile @@ -8,13 +8,15 @@ RUN set -xe && \ git reset --hard && \ git clean -fx && \ npm install && \ + npx tsc && \ npm run build && \ cp ./deployments/docker-entrypoint.sh ./ && \ cp .sequelizerc.example .sequelizerc && \ rm -rf .git .gitignore .travis.yml .dockerignore .editorconfig .babelrc .mailmap .sequelizerc.example \ test docs contribute \ - package-lock.json webpack.prod.js webpack.htmlexport.js webpack.dev.js webpack.common.js \ - config.json.example README.md CONTRIBUTING.md AUTHORS node_modules + webpack.prod.js webpack.htmlexport.js webpack.dev.js webpack.common.js \ + config.json.example README.md CONTRIBUTING.md AUTHORS node_modules \ + lib/ FROM $RUNTIME USER hackmd From 375de57af62e0fee77b5ce6a3de2c61782c8928c Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 12 Jun 2021 19:47:07 +0800 Subject: [PATCH 115/167] fix: guest note not save Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index d12cbfa5ed..b58e95ce0d 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -664,9 +664,9 @@ function operationCallback(socket, operation) { return logger.error('operation callback failed: ' + err) }) } - note.server.isDirty = true note.tempUsers[userId] = Date.now() } + note.server.isDirty = true // save authorship - use timer here because it's an O(n) complexity algorithm setImmediate(function () { note.authorship = Note.updateAuthorshipByOperation(operation, userId, note.authorship) From adc0a62acd8fc91bcbe444a5c40af5fe3b8fd957 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:07:39 +0800 Subject: [PATCH 116/167] lint: lib/auth/email/index.ts remove unused vars Signed-off-by: Raccoon --- lib/auth/email/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/email/index.ts b/lib/auth/email/index.ts index 7985198205..717c0d8053 100644 --- a/lib/auth/email/index.ts +++ b/lib/auth/email/index.ts @@ -35,7 +35,7 @@ passport.use(new LocalStrategy({ })) if (config.allowEmailRegister) { - emailAuth.post('/register', urlencodedParser, async function (req, res, next) { + emailAuth.post('/register', urlencodedParser, async function (req, res) { if (!req.body.email || !req.body.password) return response.errorBadRequest(req, res) if (!validator.isEmail(req.body.email)) return response.errorBadRequest(req, res) try { From 8f0337af7dcfc46ae2236397b514702a0e56594f Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:08:03 +0800 Subject: [PATCH 117/167] lint: lib/auth/ldap.index.ts remove unused vars Signed-off-by: Raccoon --- lib/auth/ldap/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/ldap/index.ts b/lib/auth/ldap/index.ts index 0384e8c282..f149dc50bb 100644 --- a/lib/auth/ldap/index.ts +++ b/lib/auth/ldap/index.ts @@ -57,7 +57,7 @@ passport.use(new LDAPStrategy({ defaults: { profile: stringifiedProfile } - }).spread(function (user, created) { + }).spread(function (user) { if (user) { let needSave = false if (user.profile !== stringifiedProfile) { From 08fb6855f9c9e8a5fb29063628422f984d8ebab5 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:09:26 +0800 Subject: [PATCH 118/167] lint: lib/auth/openid/index.ts unused vars Signed-off-by: Raccoon --- lib/auth/openid/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth/openid/index.ts b/lib/auth/openid/index.ts index 60411688b4..68bc0c2514 100644 --- a/lib/auth/openid/index.ts +++ b/lib/auth/openid/index.ts @@ -24,7 +24,7 @@ passport.use(new OpenIDStrategy({ defaults: { profile: stringifiedProfile } - }).spread(function (user, created) { + }).spread(function (user) { if (user) { let needSave = false if (user.profile !== stringifiedProfile) { From a965ba83363422c10b6c32068f9dd38e78e48fe4 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:10:13 +0800 Subject: [PATCH 119/167] lint: lib/auth/saml/index.ts remove unused vars lib/auth/saml Signed-off-by: Raccoon --- lib/auth/saml/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/auth/saml/index.ts b/lib/auth/saml/index.ts index 6fc971b0e4..f8f3a82490 100644 --- a/lib/auth/saml/index.ts +++ b/lib/auth/saml/index.ts @@ -56,7 +56,7 @@ passport.use(new SamlStrategy({ defaults: { profile: stringifiedProfile } - }).spread(function (user, created) { + }).spread(function (user) { if (user) { let needSave = false if (user.profile !== stringifiedProfile) { @@ -99,5 +99,6 @@ samlAuth.post('/auth/saml/callback', urlencodedParser, samlAuth.get('/auth/saml/metadata', function (req, res) { res.type('application/xml') + // eslint-disable-next-line res.send((passport as any)._strategy('saml').generateServiceProviderMetadata()) }) From dded39c2d4911e7d6e6a98591943b9e3127fda91 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:11:28 +0800 Subject: [PATCH 120/167] lint: lib/string.ts add typing annotate Signed-off-by: Raccoon --- lib/string.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string.ts b/lib/string.ts index 0b24a25668..a951adbd94 100644 --- a/lib/string.ts +++ b/lib/string.ts @@ -1,3 +1,3 @@ -export function stripTags(s) { +export function stripTags(s: string): string { return s.replace(RegExp(']*>', 'gi'), '') } From 5a7c38cff5b479b72f7e2a8eb7e9449812fc9db8 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:11:48 +0800 Subject: [PATCH 121/167] lint: lib/letter-avatars.ts add typing annotate Signed-off-by: Raccoon --- lib/letter-avatars.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/letter-avatars.ts b/lib/letter-avatars.ts index 320331ed0e..299e293ecb 100644 --- a/lib/letter-avatars.ts +++ b/lib/letter-avatars.ts @@ -5,7 +5,7 @@ import randomcolor from "randomcolor"; import config from "./config"; // core -export function generateAvatar(name) { +export function generateAvatar(name: string): string { const color = randomcolor({ seed: name, luminosity: 'dark' @@ -25,7 +25,7 @@ export function generateAvatar(name) { return svg } -export function generateAvatarURL(name, email = '', big = true) { +export function generateAvatarURL(name: string, email = '', big = true): string { let photo if (typeof email !== 'string') { email = '' + name + '@example.com' From ba8b1f1fe2e82d116163e5a8dc782241a36446eb Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 03:28:10 +0800 Subject: [PATCH 122/167] lint: lib/response.ts - add typing for req.user.id - add typing annotate in response.ts and fix type error in errorPage/index.ts Signed-off-by: Raccoon --- lib/errorPage/index.ts | 13 ++--- lib/response.ts | 105 +++++++++++++++++++++--------------- tsconfig.json | 3 +- typings/passport/index.d.ts | 5 ++ 4 files changed, 76 insertions(+), 50 deletions(-) create mode 100644 typings/passport/index.d.ts diff --git a/lib/errorPage/index.ts b/lib/errorPage/index.ts index b6c91d0bbc..4722034cd8 100644 --- a/lib/errorPage/index.ts +++ b/lib/errorPage/index.ts @@ -1,20 +1,21 @@ +import {Request, Response} from "express"; import config from "../config"; import {responseError} from "../response"; -export function errorForbidden(req, res) { +export function errorForbidden(req: Request, res: Response): void { if (req.user) { - return responseError(res, '403', 'Forbidden', 'oh no.') + return responseError(res, 403, 'Forbidden', 'oh no.') } req.flash('error', 'You are not allowed to access this page. Maybe try logging in?') res.redirect(config.serverURL + '/') } -export function errorNotFound(req, res) { - responseError(res, '404', 'Not Found', 'oops.') +export function errorNotFound(req: Request, res: Response): void { + responseError(res, 404, 'Not Found', 'oops.') } -export function errorInternalError(req, res) { - responseError(res, '500', 'Internal Error', 'wtf.') +export function errorInternalError(req: Request, res: Response): void { + responseError(res, 500, 'Internal Error', 'wtf.') } diff --git a/lib/response.ts b/lib/response.ts index db455f8b52..6429ae8478 100644 --- a/lib/response.ts +++ b/lib/response.ts @@ -1,6 +1,8 @@ // response // external modules import * as request from "request"; +import {Request, Response} from "express"; +import {Includeable} from "sequelize"; // core import config from "./config"; import {logger} from "./logger"; @@ -9,9 +11,9 @@ import {createNoteWithRevision} from "./services/note"; import * as utils from "./utils"; import * as history from "./history"; -export function errorForbidden(req, res) { +export function errorForbidden(req: Request, res: Response): void { if (req.user) { - responseError(res, '403', 'Forbidden', 'oh no.') + responseError(res, 403, 'Forbidden', 'oh no.') } else { const nextURL = new URL('', config.serverURL) nextURL.search = (new URLSearchParams({next: req.originalUrl})).toString() @@ -20,27 +22,27 @@ export function errorForbidden(req, res) { } } -export function errorNotFound(req, res) { - responseError(res, '404', 'Not Found', 'oops.') +export function errorNotFound(req: Request, res: Response): void { + responseError(res, 404, 'Not Found', 'oops.') } -export function errorBadRequest(req, res) { - responseError(res, '400', 'Bad Request', 'something not right.') +export function errorBadRequest(req: Request, res: Response): void { + responseError(res, 400, 'Bad Request', 'something not right.') } -export function errorTooLong(req, res) { - responseError(res, '413', 'Payload Too Large', 'Shorten your note!') +export function errorTooLong(req: Request, res: Response): void { + responseError(res, 413, 'Payload Too Large', 'Shorten your note!') } -export function errorInternalError(req, res) { - responseError(res, '500', 'Internal Error', 'wtf.') +export function errorInternalError(req: Request, res: Response): void { + responseError(res, 500, 'Internal Error', 'wtf.') } -export function errorServiceUnavailable(req, res) { +export function errorServiceUnavailable(req: Request, res: Response): void { res.status(503).send('I\'m busy right now, try again later.') } -export function responseError(res, code, detail, msg) { +export function responseError(res: Response, code: number, detail: string, msg: string): void { res.status(code).render('error.ejs', { title: code + ' ' + detail + ' ' + msg, code: code, @@ -49,7 +51,7 @@ export function responseError(res, code, detail, msg) { }) } -export function responseCodiMD(res, note) { +export function responseCodiMD(res: Response, note: Note): void { const body = note.content const extracted = Note.extractMeta(body) const meta = Note.parseMeta(extracted.meta) @@ -64,13 +66,17 @@ export function responseCodiMD(res, note) { }) } -function updateHistory(userId, note, document, time?: any) { +function updateHistory(userId, note, document, time?: number) { const noteId = note.alias ? note.alias : Note.encodeNoteId(note.id) history.updateHistory(userId, noteId, document, time) logger.info('history updated') } -export function newNote(req, res, next?: any) { +type NewNoteReq = Request & { + alias?: string +} + +export function newNote(req: NewNoteReq, res: Response): void { let owner = null let body = '' if (req.body && req.body.length > config.documentMaxLength) { @@ -100,7 +106,7 @@ export function newNote(req, res, next?: any) { }) } -export function newCheckViewPermission(note, isLogin, userId) { +export function newCheckViewPermission(note: Note, isLogin: boolean, userId: string): boolean { if (note.permission === 'private') { return note.ownerId === userId } @@ -110,25 +116,17 @@ export function newCheckViewPermission(note, isLogin, userId) { return true } -export function checkViewPermission(req, note) { +export function checkViewPermission(req: Request, note: Note): boolean { if (note.permission === 'private') { - if (!req.isAuthenticated() || note.ownerId !== req.user.id) { - return false - } else { - return true - } - } else if (note.permission === 'limited' || note.permission === 'protected') { - if (!req.isAuthenticated()) { - return false - } else { - return true - } - } else { - return true + return !(!req.isAuthenticated() || note.ownerId !== req.user.id); } + if (note.permission === 'limited' || note.permission === 'protected') { + return req.isAuthenticated(); + } + return true } -function findNote(req, res, callback, include?: any) { +function findNote(req, res, callback: (note: Note) => void, include?: Includeable[] | null) { const noteId = req.params.noteId const id = req.params.noteId || req.params.shortid Note.parseNoteId(id, function (err, _id) { @@ -164,8 +162,7 @@ function findNote(req, res, callback, include?: any) { function actionDownload(req, res, note) { const body = note.content - const title = Note.decodeTitle(note.title) - let filename = title + let filename = Note.decodeTitle(note.title) filename = encodeURIComponent(filename) res.set({ 'Access-Control-Allow-Origin': '*', // allow CORS as API @@ -179,7 +176,11 @@ function actionDownload(req, res, note) { res.send(body) } -export function publishNoteActions(req, res, next) { +interface PublishActionParams { + action: 'download' | 'edit' +} + +export function publishNoteActions(req: Request, res: Response): void { findNote(req, res, function (note) { const action = req.params.action switch (action) { @@ -196,7 +197,7 @@ export function publishNoteActions(req, res, next) { }) } -export function publishSlideActions(req, res, next) { +export function publishSlideActions(req: Request, res: Response): void { findNote(req, res, function (note) { const action = req.params.action switch (action) { @@ -210,7 +211,12 @@ export function publishSlideActions(req, res, next) { }) } -export function githubActions(req, res, next) { +interface GithubActionParams extends Record { + action: 'gist' + noteId: string +} + +export function githubActions(req: Request, res: Response): void { const noteId = req.params.noteId findNote(req, res, function (note) { const action = req.params.action @@ -225,7 +231,7 @@ export function githubActions(req, res, next) { }) } -function githubActionGist(req, res, note) { +function githubActionGist(req: Request, res: Response, note: Note) { const code = req.query.code const state = req.query.state if (!code || !state) { @@ -282,13 +288,18 @@ function githubActionGist(req, res, note) { } } -export function gitlabActions(req, res, next) { +interface GitLabParams extends Record{ + noteId: string + action: 'projects' +} + +export function gitlabActions(req: Request, res: Response): void { const noteId = req.params.noteId - findNote(req, res, function (note) { + findNote(req, res, function () { const action = req.params.action switch (action) { case 'projects': - gitlabActionProjects(req, res, note) + gitlabActionProjects(req, res) break default: res.redirect(config.serverURL + '/' + noteId) @@ -297,7 +308,15 @@ export function gitlabActions(req, res, next) { }) } -function gitlabActionProjects(req, res, note) { +interface GitLabActionResponse { + baseURL: string + version: string + accesstoken: string + profileid: string + projects?: Record +} + +function gitlabActionProjects(req: Request, res: Response) { if (req.isAuthenticated()) { User.findOne({ where: { @@ -307,7 +326,7 @@ function gitlabActionProjects(req, res, note) { if (!user) { return errorNotFound(req, res) } - const ret: any = {baseURL: config.gitlab.baseURL, version: config.gitlab.version} + const ret: Partial = {baseURL: config.gitlab.baseURL, version: config.gitlab.version} ret.accesstoken = user.accessToken ret.profileid = user.profileid request( @@ -330,7 +349,7 @@ function gitlabActionProjects(req, res, note) { } } -export function showPublishSlide(req, res, next) { +export function showPublishSlide(req: Request, res: Response): void { const include = [{ model: User, as: 'owner' diff --git a/tsconfig.json b/tsconfig.json index 9cd1a8128d..29e1f16ac8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,8 @@ "target": "ES2019", "outDir": "./dist/", "module": "CommonJS", - "esModuleInterop": true + "esModuleInterop": true, + "typeRoots": ["./typings", "./node_modules/@types"] }, "include": [ "./lib/**/*" diff --git a/typings/passport/index.d.ts b/typings/passport/index.d.ts new file mode 100644 index 0000000000..46b256861a --- /dev/null +++ b/typings/passport/index.d.ts @@ -0,0 +1,5 @@ +declare namespace Express { + export interface User { + id?: string + } +} From 7429d5eaae33be7042c64837ed6a568304178b4e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:53:25 +0800 Subject: [PATCH 123/167] lint: lib/status/index.ts add typing annotate Signed-off-by: Raccoon --- lib/status/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/status/index.ts b/lib/status/index.ts index deb695373a..4072084b00 100644 --- a/lib/status/index.ts +++ b/lib/status/index.ts @@ -1,9 +1,10 @@ +import {Request, Response} from "express"; import * as realtime from "../realtime/realtime"; import config from "../config"; -export async function getStatus(req, res) { +export async function getStatus(req: Request, res: Response): Promise { res.set({ 'Cache-Control': 'private', // only cache by client 'X-Robots-Tag': 'noindex, nofollow', // prevent crawling @@ -19,7 +20,7 @@ export async function getStatus(req, res) { } } -export async function getMetrics(req, res) { +export async function getMetrics(req: Request, res: Response): Promise { const data = await realtime.getStatus() res.set({ @@ -30,7 +31,7 @@ export async function getMetrics(req, res) { res.render('../js/lib/common/metrics.ejs', data) } -export function getConfig(req, res) { +export function getConfig(req: Request, res: Response): void { const data = { domain: config.domain, urlpath: config.urlPath, From 90ab2d0979ab364dffd02854128bd4393ef4ed90 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:53:48 +0800 Subject: [PATCH 124/167] lint: lib/csp.ts add typing annotate Signed-off-by: Raccoon --- lib/csp.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/csp.ts b/lib/csp.ts index ee7d56b1c6..23d9659c9d 100644 --- a/lib/csp.ts +++ b/lib/csp.ts @@ -1,7 +1,12 @@ +import {RequestHandler} from "express"; import config from "./config"; import uuid from "uuid"; -const CspStrategy: any = {} + +const CspStrategy: { + computeDirectives?: () => Record + addNonceToLocals?: RequestHandler +} = {} const defaultDirectives = { defaultSrc: ['\'self\''], @@ -37,7 +42,7 @@ const googleAnalyticsDirectives = { } CspStrategy.computeDirectives = function () { - const directives = {} + const directives: Record = {} mergeDirectives(directives, config.csp.directives) mergeDirectivesIf(config.csp.addDefaults, directives, defaultDirectives) mergeDirectivesIf(config.useCDN, directives, cdnDirectives) @@ -52,12 +57,14 @@ CspStrategy.computeDirectives = function () { return directives } -function mergeDirectives(existingDirectives, newDirectives) { +function mergeDirectives(existingDirectives: Record, newDirectives: Record) { for (const propertyName in newDirectives) { - const newDirective = newDirectives[propertyName] - if (newDirective) { - const existingDirective = existingDirectives[propertyName] || [] - existingDirectives[propertyName] = existingDirective.concat(newDirective) + if (Object.hasOwnProperty.call(newDirectives, propertyName)) { + const newDirective = newDirectives[propertyName] + if (newDirective) { + const existingDirective = existingDirectives[propertyName] || [] + existingDirectives[propertyName] = existingDirective.concat(newDirective) + } } } } From f08097fbbf132d94a1c0604258c1244b2a5dcfed Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:54:30 +0800 Subject: [PATCH 125/167] lint: lib/middleware add typing annotate Signed-off-by: Raccoon --- lib/middleware/checkURIValid.ts | 3 ++- lib/middleware/codiMDVersion.ts | 4 ++-- lib/middleware/redirectWithoutTrailingSlashes.ts | 4 ++-- lib/middleware/tooBusy.ts | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/middleware/checkURIValid.ts b/lib/middleware/checkURIValid.ts index ba74390324..bbdb217a67 100644 --- a/lib/middleware/checkURIValid.ts +++ b/lib/middleware/checkURIValid.ts @@ -1,7 +1,8 @@ +import {NextFunction, Request, Response} from "express"; import {logger} from '../logger' import * as response from "../response"; -export default function (req, res, next) { +export default function (req: Request, res: Response, next: NextFunction): void { try { decodeURIComponent(req.path) } catch (err) { diff --git a/lib/middleware/codiMDVersion.ts b/lib/middleware/codiMDVersion.ts index 154fa1d393..6a9d95f826 100644 --- a/lib/middleware/codiMDVersion.ts +++ b/lib/middleware/codiMDVersion.ts @@ -1,7 +1,7 @@ import config from "../config"; -import {Request, Response} from "express"; +import {NextFunction, Request, Response} from "express"; -export default function (req: Request, res: Response, next) { +export default function (req: Request, res: Response, next: NextFunction): void { res.set({ 'CodiMD-Version': config.version }) diff --git a/lib/middleware/redirectWithoutTrailingSlashes.ts b/lib/middleware/redirectWithoutTrailingSlashes.ts index 6b26378c84..9331fca1ef 100644 --- a/lib/middleware/redirectWithoutTrailingSlashes.ts +++ b/lib/middleware/redirectWithoutTrailingSlashes.ts @@ -1,8 +1,8 @@ -import {Request, Response} from "express"; +import {NextFunction, Request, Response} from "express"; import config from "../config"; -export default function (req: Request, res: Response, next) { +export default function (req: Request, res: Response, next: NextFunction): void { if (req.method === 'GET' && req.path.substr(-1) === '/' && req.path.length > 1) { const queryString = req.url.slice(req.path.length) const urlPath = req.path.slice(0, -1) diff --git a/lib/middleware/tooBusy.ts b/lib/middleware/tooBusy.ts index f66ab7174e..d245701980 100644 --- a/lib/middleware/tooBusy.ts +++ b/lib/middleware/tooBusy.ts @@ -1,3 +1,4 @@ +import {NextFunction, Request, Response} from "express"; import toobusy from "toobusy-js"; import config from "../config"; @@ -5,7 +6,7 @@ import * as response from "../response"; toobusy.maxLag(config.responseMaxLag) -export default function (req, res, next) { +export default function (req: Request, res: Response, next: NextFunction): void { if (toobusy()) { response.errorServiceUnavailable(req, res) } else { From eaf54c42397e022bf60c043cfb5e8a77d2262f7f Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 15:55:47 +0800 Subject: [PATCH 126/167] lint: lib/imageRouter - add typing annotate - remove unused vars Signed-off-by: Raccoon --- lib/imageRouter/azure.ts | 6 +++--- lib/imageRouter/filesystem.ts | 2 +- lib/imageRouter/imgur.ts | 2 +- lib/imageRouter/lutim.ts | 2 +- lib/imageRouter/minio.ts | 4 ++-- lib/imageRouter/s3.ts | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/imageRouter/azure.ts b/lib/imageRouter/azure.ts index bc601659e2..1a2df524f1 100644 --- a/lib/imageRouter/azure.ts +++ b/lib/imageRouter/azure.ts @@ -6,7 +6,7 @@ import azure from "azure-storage"; import config from "../config"; import {logger} from "../logger"; -export function uploadImage(imagePath, callback) { +export function uploadImage(imagePath: string, callback?: (err: Error | null, url ?: string) => void): void { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -19,11 +19,11 @@ export function uploadImage(imagePath, callback) { const azureBlobService = azure.createBlobService(config.azure.connectionString) - azureBlobService.createContainerIfNotExists(config.azure.container, {publicAccessLevel: 'blob'}, function (err, result, response) { + azureBlobService.createContainerIfNotExists(config.azure.container, {publicAccessLevel: 'blob'}, function (err) { if (err) { callback(new Error(err.message), null) } else { - azureBlobService.createBlockBlobFromLocalFile(config.azure.container, path.basename(imagePath), imagePath, function (err, result, response) { + azureBlobService.createBlockBlobFromLocalFile(config.azure.container, path.basename(imagePath), imagePath, function (err, result) { if (err) { callback(new Error(err.message), null) } else { diff --git a/lib/imageRouter/filesystem.ts b/lib/imageRouter/filesystem.ts index c1a08183d3..5b5fffb7dd 100644 --- a/lib/imageRouter/filesystem.ts +++ b/lib/imageRouter/filesystem.ts @@ -34,7 +34,7 @@ function pickFilename(defaultFilename) { throw new Error('file exists.') } -export function uploadImage(imagePath, callback) { +export function uploadImage(imagePath: string, callback: (err: Error | null, url?: string) => void): void { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return diff --git a/lib/imageRouter/imgur.ts b/lib/imageRouter/imgur.ts index 58902bcf3c..dd85729f69 100644 --- a/lib/imageRouter/imgur.ts +++ b/lib/imageRouter/imgur.ts @@ -4,7 +4,7 @@ import imgur from "@hackmd/imgur"; import config from "../config"; import {logger} from "../logger"; -export function uploadImage(imagePath, callback) { +export function uploadImage(imagePath: string, callback: (err: Error | null, url?: string) => void): void { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return diff --git a/lib/imageRouter/lutim.ts b/lib/imageRouter/lutim.ts index 67fa6214f5..4d4a385c3e 100644 --- a/lib/imageRouter/lutim.ts +++ b/lib/imageRouter/lutim.ts @@ -4,7 +4,7 @@ import config from "../config"; import {logger} from "../logger"; -export function uploadImage(imagePath, callback) { +export function uploadImage(imagePath: string, callback: (err: Error | null, url: string) => void): void { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return diff --git a/lib/imageRouter/minio.ts b/lib/imageRouter/minio.ts index f8c36ba8ac..f21e4f7817 100644 --- a/lib/imageRouter/minio.ts +++ b/lib/imageRouter/minio.ts @@ -15,7 +15,7 @@ const minioClient = new Minio.Client({ secretKey: config.minio.secretKey }) -export function uploadImage(imagePath, callback) { +export function uploadImage(imagePath: string, callback: (err: Error | null, url?: string) => void): void { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -37,7 +37,7 @@ export function uploadImage(imagePath, callback) { minioClient.putObject(config.s3bucket, key, buffer, buffer.length, { ContentType: getImageMimeType(imagePath) - }, function (err, data) { + }, function (err) { if (err) { callback(err, null) return diff --git a/lib/imageRouter/s3.ts b/lib/imageRouter/s3.ts index 03ceea797f..9de419a2e3 100644 --- a/lib/imageRouter/s3.ts +++ b/lib/imageRouter/s3.ts @@ -20,7 +20,7 @@ const s3 = new S3Client({ endpoint: config.s3.endpoint }) -export function uploadImage(imagePath, callback) { +export function uploadImage(imagePath: string, callback: (err: Error | null, url: string) => void): void { if (!imagePath || typeof imagePath !== 'string') { callback(new Error('Image path is missing or wrong'), null) return @@ -44,12 +44,12 @@ export function uploadImage(imagePath, callback) { } const mimeType = getImageMimeType(imagePath) if (mimeType) { - params.ContentType = mimeType + params.ContentType = mimeType as string } const command = new PutObjectCommand(params) - s3.send(command).then(data => { + s3.send(command).then(() => { let s3Endpoint = 's3.amazonaws.com' if (config.s3.endpoint) { s3Endpoint = config.s3.endpoint From 6d70f79c21676c4cf99c578e8ba412fba5e02564 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 03:28:20 +0800 Subject: [PATCH 127/167] lib/homepage/index.ts lint: lib/homepage/index.ts - add typing annotate Signed-off-by: Raccoon --- lib/homepage/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/homepage/index.ts b/lib/homepage/index.ts index 160c03576f..f10794c681 100644 --- a/lib/homepage/index.ts +++ b/lib/homepage/index.ts @@ -6,7 +6,7 @@ import {logger} from '../logger' import {Request, Response} from "express"; -export async function showIndex(req: Request, res: Response) { +export async function showIndex(req: Request, res: Response): Promise { const isLogin = req.isAuthenticated() const deleteToken = '' @@ -25,7 +25,7 @@ export async function showIndex(req: Request, res: Response) { const user = await User.findOne({ where: { - id: (req.user as any).id + id: req.user.id } }) if (user) { @@ -33,6 +33,6 @@ export async function showIndex(req: Request, res: Response) { return res.render('index.ejs', data) } - logger.error(`error: user not found with id ${(req.user as any).id}`) + logger.error(`error: user not found with id ${req.user.id}`) return res.render('index.ejs', data) } From 738a4b4ca9374d297ee3451947ec377f01743be0 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 03:45:56 +0800 Subject: [PATCH 128/167] lint: lib/history/index.ts - add History typing - add typing annotate in history/index.ts - fix incorrect argument when update history in newNote history Signed-off-by: Raccoon --- lib/history/index.ts | 38 +++++++++++++++++++++++--------------- lib/note/index.ts | 4 ++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/lib/history/index.ts b/lib/history/index.ts index ac01b7fdfa..4e0b1bf8ef 100644 --- a/lib/history/index.ts +++ b/lib/history/index.ts @@ -1,13 +1,22 @@ // history // external modules import LZString from '@hackmd/lz-string' +import {Request, Response} from "express"; import {Note, User} from '../models' import {logger} from '../logger' import config from '../config' import * as response from '../response' -function getHistory(userid, callback) { +interface History { + id?: string + text?: string + time?: Date | number + tags?: string[] + pinned?: boolean +} + +function getHistory(userid: string, callback: (err: Error | null, history: Record) => void) { User.findOne({ where: { id: userid @@ -16,11 +25,11 @@ function getHistory(userid, callback) { if (!user) { return callback(null, null) } - let history: any = [] + let history: History[] = [] if (user.history) { history = JSON.parse(user.history) // migrate LZString encoded note id to base64url encoded note id - for (let i = 0, l = (history as []).length; i < l; i++) { + for (let i = 0, l = history.length; i < l; i++) { // Calculate minimal string length for an UUID that is encoded // base64 encoded and optimize comparison by using -1 // this should make a lot of LZ-String parsing errors obsolete @@ -44,12 +53,11 @@ function getHistory(userid, callback) { } } } - history = parseHistoryToObject(history) } if (config.debug) { logger.info('read history success: ' + user.id) } - return callback(null, history) + return callback(null, parseHistoryToObject(history)) }).catch(function (err) { logger.error('read history failed: ' + err) return callback(err, null) @@ -71,7 +79,7 @@ function setHistory(userid, history, callback) { }) } -export function updateHistory(userid, noteId, document?: string, time?: any) { +export function updateHistory(userid: string, noteId: string, document?: string, time?: number): void { if (userid && noteId && typeof document !== 'undefined') { getHistory(userid, function (err, history) { if (err || !history) return @@ -84,7 +92,7 @@ export function updateHistory(userid, noteId, document?: string, time?: any) { noteHistory.text = noteInfo.title noteHistory.time = time || Date.now() noteHistory.tags = noteInfo.tags - setHistory(userid, history, function (err, count) { + setHistory(userid, history, function (err) { if (err) { logger.log(err) } @@ -102,7 +110,7 @@ function parseHistoryToArray(history) { return _history } -function parseHistoryToObject(history) { +function parseHistoryToObject(history: History[]): Record { const _history = {} for (let i = 0, l = history.length; i < l; i++) { const item = history[i] @@ -111,7 +119,7 @@ function parseHistoryToObject(history) { return _history } -export function historyGet(req, res) { +export function historyGet(req: Request, res: Response): void { if (req.isAuthenticated()) { getHistory(req.user.id, function (err, history) { if (err) return response.errorInternalError(req, res) @@ -125,7 +133,7 @@ export function historyGet(req, res) { } } -export function historyPost(req, res) { +export function historyPost(req: Request, res: Response): void { if (req.isAuthenticated()) { const noteId = req.params.noteId if (!noteId) { @@ -140,7 +148,7 @@ export function historyPost(req, res) { return response.errorBadRequest(req, res) } if (Array.isArray(history)) { - setHistory(req.user.id, history, function (err, count) { + setHistory(req.user.id, history, function (err) { if (err) return response.errorInternalError(req, res) res.end() }) @@ -155,7 +163,7 @@ export function historyPost(req, res) { if (!history[noteId]) return response.errorNotFound(req, res) if (req.body.pinned === 'true' || req.body.pinned === 'false') { history[noteId].pinned = (req.body.pinned === 'true') - setHistory(req.user.id, history, function (err, count) { + setHistory(req.user.id, history, function (err) { if (err) return response.errorInternalError(req, res) res.end() }) @@ -169,11 +177,11 @@ export function historyPost(req, res) { } } -export function historyDelete(req, res) { +export function historyDelete(req: Request, res: Response): void { if (req.isAuthenticated()) { const noteId = req.params.noteId if (!noteId) { - setHistory(req.user.id, [], function (err, count) { + setHistory(req.user.id, [], function (err) { if (err) return response.errorInternalError(req, res) res.end() }) @@ -182,7 +190,7 @@ export function historyDelete(req, res) { if (err) return response.errorInternalError(req, res) if (!history) return response.errorNotFound(req, res) delete history[noteId] - setHistory(req.user.id, history, function (err, count) { + setHistory(req.user.id, history, function (err) { if (err) return response.errorInternalError(req, res) res.end() }) diff --git a/lib/note/index.ts b/lib/note/index.ts index bc996b13ff..5719b9071e 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -56,7 +56,7 @@ async function createNote(userId, noteAlias) { }) if (userId) { - updateHistory(userId, note) + updateHistory(userId, note.id) } return note @@ -321,7 +321,7 @@ export const updateNote = async (req, res) => { } if (req.isAuthenticated()) { - updateHistory(req.user.id, noteId, content) + updateHistory(req.user.id, noteId as string, content) } Revision.saveNoteRevision(note, (err, revision) => { From 016e16968d28b52044d61c7b0ac87f30a2e2a6e0 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 03:58:14 +0800 Subject: [PATCH 129/167] lint: lib/services/note.ts - add typing annotate in checkAllNotesRevision and saveAllNotesRevision - passing string in error constructor in app.ts Signed-off-by: Raccoon --- lib/app.ts | 2 +- lib/services/note.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/app.ts b/lib/app.ts index f5ce71d3ae..270010e895 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -290,7 +290,7 @@ sequelize.sync().then(function () { // check if realtime is ready if (realtime.isReady()) { checkAllNotesRevision(function (err, notes) { - if (err) throw new Error(err) + if (err) throw new Error(err.toString()) if (!notes || notes.length <= 0) return startListen() }) } else { diff --git a/lib/services/note.ts b/lib/services/note.ts index 6f2b2ba67a..1d0c9c3f6d 100644 --- a/lib/services/note.ts +++ b/lib/services/note.ts @@ -6,7 +6,11 @@ import {Note, Revision, NoteAttributes} from "../models"; const dmp = new DiffMatchPatch() -export function checkAllNotesRevision(callback) { +interface Callback { + (err: Error | string | null, notes?: Note[] | null): void +} + +export function checkAllNotesRevision(callback: Callback): void { saveAllNotesRevision(function (err, notes) { if (err) return callback(err, null) if (!notes || notes.length <= 0) { @@ -17,7 +21,7 @@ export function checkAllNotesRevision(callback) { }) } -export function saveAllNotesRevision(callback: any): void { +export function saveAllNotesRevision(callback: Callback): void { Note.findAll({ // query all notes that need to save for revision where: { @@ -43,7 +47,7 @@ export function saveAllNotesRevision(callback: any): void { } ] } - }).then(function (notes) { + }).then(function (notes: Note[]) { if (notes.length <= 0) return callback(null, notes) const savedNotes = [] async.each(notes, function (note, _callback) { @@ -77,7 +81,7 @@ export function saveAllNotesRevision(callback: any): void { }) } -export async function syncNote(noteInFS, note): Promise { +export async function syncNote(noteInFS: Partial, note: Note): Promise { const contentLength = noteInFS.content.length let note2 = await note.update({ From a5376a472a8e8cfbb840fff98b62aa469f3b08be Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 04:04:25 +0800 Subject: [PATCH 130/167] lint: lib/auth/utils.ts - install @types/express-session for req.session - add returnTo into sessionData - add typing annotate in passportGeneralCallback and remove unused var Signed-off-by: Raccoon --- lib/auth/utils.ts | 13 ++++++++++--- package-lock.json | 9 +++++++++ package.json | 1 + typings/express-session/index.d.ts | 7 +++++++ 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 typings/express-session/index.d.ts diff --git a/lib/auth/utils.ts b/lib/auth/utils.ts index 72f48d1974..1d342c52e8 100644 --- a/lib/auth/utils.ts +++ b/lib/auth/utils.ts @@ -1,10 +1,13 @@ 'use strict' +import {Request} from "express"; import {User} from "../models"; import config from "../config"; import {logger} from "../logger"; -export function setReturnToFromReferer(req) { +export function setReturnToFromReferer(req: Request): void { + // eslint-disable-next-line + // @ts-ignore if (!req.session) req.session = {} const referer = req.get('referer') @@ -30,7 +33,11 @@ export function setReturnToFromReferer(req) { } } -export function passportGeneralCallback(accessToken, refreshToken, profile, done) { +interface Profile { + id?: string +} + +export function passportGeneralCallback(accessToken: string, refreshToken: string, profile: Profile, done: (err: Error | null, user?: User) => void): void { const stringifiedProfile = JSON.stringify(profile) User.findOrCreate({ where: { @@ -41,7 +48,7 @@ export function passportGeneralCallback(accessToken, refreshToken, profile, done accessToken: accessToken, refreshToken: refreshToken } - }).spread(function (user, created) { + }).spread(function (user) { if (user) { let needSave = false if (user.profile !== stringifiedProfile) { diff --git a/package-lock.json b/package-lock.json index d17b7b7468..7d35d6c2ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1425,6 +1425,15 @@ "@types/range-parser": "*" } }, + "@types/express-session": { + "version": "1.17.3", + "resolved": "https://registry.npmjs.org/@types/express-session/-/express-session-1.17.3.tgz", + "integrity": "sha512-57DnyxiqClXOIjoCgeKCUYfKxBPOlOY/k+l1TPK+7bSwyiPTrS5FIk1Ycql7twk4wO7P5lfOVy6akDGiaMSLfw==", + "dev": true, + "requires": { + "@types/express": "*" + } + }, "@types/fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", diff --git a/package.json b/package.json index f8a830ba5f..fd10b06b06 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,7 @@ "@susisu/mte-kernel": "^2.1.0", "@types/express": "4.17.9", "@types/express-flash": "0.0.2", + "@types/express-session": "^1.17.3", "@types/lodash": "^4.14.170", "@types/minio": "^7.0.7", "@types/node": "~12.20.15", diff --git a/typings/express-session/index.d.ts b/typings/express-session/index.d.ts new file mode 100644 index 0000000000..418fe4e844 --- /dev/null +++ b/typings/express-session/index.d.ts @@ -0,0 +1,7 @@ +declare module 'express-session' { + interface SessionData { + returnTo?: string + } +} + +export {} From bc417043eddf91f4348298140b2cb322adbf64c3 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:05:12 +0800 Subject: [PATCH 131/167] lint: lib/utils.ts - install @types/mime-types - add typing annotate Signed-off-by: Raccoon --- lib/utils.ts | 14 +++++++++----- package-lock.json | 6 ++++++ package.json | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/utils.ts b/lib/utils.ts index 3c48a679e8..c8f759a25a 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -1,26 +1,30 @@ +import {NextFunction, Request, Response} from "express"; import * as fs from "fs"; import * as path from "path"; import mime from "mime-types"; import bodyParser from "body-parser"; -export function isSQLite(sequelize) { +export function isSQLite(sequelize): boolean { return sequelize.options.dialect === 'sqlite' } -export function getImageMimeType(imagePath) { +export function getImageMimeType(imagePath: string): string | boolean { return mime.lookup(path.extname(imagePath)) } -export function isRevealTheme(theme) { +export function isRevealTheme(theme: string): string | undefined { if (fs.existsSync(path.join(__dirname, '..', 'public', 'build', 'reveal.js', 'css', 'theme', theme + '.css'))) { return theme } return undefined } -export function wrap(innerHandler) { - return (req, res, next) => innerHandler(req, res).catch(err => next(err)) +export function wrap(innerHandler: (req?: Request, res?: Response, next?: NextFunction) => Promise) { + return (req: Request, res: Response, next: NextFunction): void => { + innerHandler(req, res) + .catch(err => next(err)); + } } // create application/x-www-form-urlencoded parser diff --git a/package-lock.json b/package-lock.json index 7d35d6c2ce..6a63b600f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1503,6 +1503,12 @@ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, + "@types/mime-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.0.tgz", + "integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM=", + "dev": true + }, "@types/minio": { "version": "7.0.7", "resolved": "https://registry.npmjs.org/@types/minio/-/minio-7.0.7.tgz", diff --git a/package.json b/package.json index fd10b06b06..e684cdd650 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "@types/express-flash": "0.0.2", "@types/express-session": "^1.17.3", "@types/lodash": "^4.14.170", + "@types/mime-types": "^2.1.0", "@types/minio": "^7.0.7", "@types/node": "~12.20.15", "@types/passport-google-oauth20": "^2.0.8", From d6c9c66699018d334b79822a399c5d20bd8104c9 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 04:15:28 +0800 Subject: [PATCH 132/167] refactor: lib/models - move all interfaces to baseModel.ts - remove unused import Signed-off-by: Raccoon --- lib/models/author.ts | 6 +--- lib/models/baseModel.ts | 68 +++++++++++++++++++++++++++++++++++++++++ lib/models/index.ts | 14 ++++----- lib/models/note.ts | 17 +---------- lib/models/revision.ts | 14 ++------- lib/models/user.ts | 41 +------------------------ 6 files changed, 79 insertions(+), 81 deletions(-) diff --git a/lib/models/author.ts b/lib/models/author.ts index 3d0efd187d..406f47395a 100644 --- a/lib/models/author.ts +++ b/lib/models/author.ts @@ -1,11 +1,7 @@ // external modules import {Model, DataTypes} from "sequelize"; - -export interface AuthorAttributes { - id: string - color: string -} +import {AuthorAttributes} from "./baseModel"; export class Author extends Model implements AuthorAttributes { color: string; diff --git a/lib/models/baseModel.ts b/lib/models/baseModel.ts index 6880edcb08..76a0ef737c 100644 --- a/lib/models/baseModel.ts +++ b/lib/models/baseModel.ts @@ -20,3 +20,71 @@ export interface BaseModelStatic extends Model { associate(models: any): void } + +export interface AuthorAttributes { + id: string + color: string +} + +export interface NoteAttributes { + id?: string + shortid?: string + alias?: string + permission?: string + viewcount?: number + title?: string + content?: string + authorship?: string + lastchangeAt?: Date + savedAt?: Date + + ownerId?: string +} + +export interface RevisionAttributes { + id: string + patch: string + lastContent: string + content: string + length: number + authorship: string +} + +export interface BaseProfile { + provider: string +} + +export interface GenericProfile extends BaseProfile { + provider: string + displayName?: string + username?: string + id?: string + photos?: { value: string }[] + avatarUrl?: string + emails?: string[] + photo?: string + email?: string +} + +export interface DropboxProfile extends BaseProfile { + provider: 'dropbox' + emails?: { value: string }[] +} + +export interface UserProfile { + name: string + photo: string + biggerphoto: string +} + +export interface UserAttributes { + id: string + profileid?: string + profile?: string + history?: string + accessToken?: string + refreshToken?: string + deleteToken?: string + email?: string + password?: string +} diff --git a/lib/models/index.ts b/lib/models/index.ts index 2a6ebaec97..3790d00417 100644 --- a/lib/models/index.ts +++ b/lib/models/index.ts @@ -1,6 +1,4 @@ // external modules -import * as fs from "fs"; -import * as path from "path"; import {Model, Sequelize} from "sequelize"; import {cloneDeep} from "lodash"; @@ -9,15 +7,15 @@ import config from "../config"; import {logger} from "../logger"; -import {BaseModel} from "./baseModel"; +import {BaseModel, AuthorAttributes, NoteAttributes, RevisionAttributes, UserAttributes, GenericProfile} from "./baseModel"; -import {Author, AuthorAttributes} from './author' -import {User, UserAttributes} from './user' -import {Revision, RevisionAttributes} from "./revision"; -import {Note, NoteAttributes} from './note' +import {Author} from './author' +import {User} from './user' +import {Revision} from "./revision"; +import {Note} from './note' export {Author, User, Revision, Note} -export {AuthorAttributes, UserAttributes, RevisionAttributes, NoteAttributes} +export {AuthorAttributes, UserAttributes, RevisionAttributes, NoteAttributes, GenericProfile} const dbconfig = cloneDeep(config.db) dbconfig.logging = config.debug ? (data) => { diff --git a/lib/models/note.ts b/lib/models/note.ts index b8265df518..506f60357b 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -20,28 +20,13 @@ import config from "../config"; import {logger} from "../logger"; import {createNoteWithRevision, syncNote} from "../services/note"; import {stripTags} from "../string"; -import {MySequelize} from "./baseModel"; +import {MySequelize, NoteAttributes} from "./baseModel"; const md = markdownIt() export const dmp = new DiffMatchPatch() // permission types const permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private'] -export interface NoteAttributes { - id?: string - shortid?: string - alias?: string - permission?: string - viewcount?: number - title?: string - content?: string - authorship?: string - lastchangeAt?: Date - savedAt?: Date - - ownerId?: string -} - export class Note extends Model implements NoteAttributes { alias: string; authorship: string; diff --git a/lib/models/revision.ts b/lib/models/revision.ts index 003303dde5..2aacd05175 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -1,6 +1,5 @@ // external modules -import {Model, Sequelize, Op, DataTypes} from "sequelize"; -import async from "async"; +import {Model, Op, DataTypes} from "sequelize"; import moment from "moment"; import * as childProcess from "child_process"; import shortId from "shortid"; @@ -10,7 +9,7 @@ import * as util from "util"; // core import config from "../config"; import logger from "../logger"; -import {MySequelize} from "./baseModel"; +import {MySequelize, RevisionAttributes} from "./baseModel"; let dmpWorker = createDmpWorker() const dmpCallbackCache = {} @@ -54,15 +53,6 @@ function sendDmpWorker(data, callback) { } -export interface RevisionAttributes { - id: string - patch: string - lastContent: string - content: string - length: number - authorship: string -} - export class Revision extends Model implements RevisionAttributes { authorship: string; content: string; diff --git a/lib/models/user.ts b/lib/models/user.ts index 40dc02088e..2089b912c3 100644 --- a/lib/models/user.ts +++ b/lib/models/user.ts @@ -3,46 +3,7 @@ import Scrypt from "scrypt-kdf"; import {logger} from "../logger"; import {generateAvatarURL} from "../letter-avatars"; - - -interface BaseProfile { - provider: string -} - -interface DropboxProfile extends BaseProfile { - provider: 'dropbox' - emails?: { value: string }[] -} - -interface GenericProfile extends BaseProfile { - provider: string - displayName?: string - username?: string - id?: string - photos?: { value: string }[] - avatarUrl?: string - emails?: string[] - photo?: string - email?: string -} - -interface UserProfile { - name: string - photo: string - biggerphoto: string -} - -export interface UserAttributes { - id: string - profileid?: string - profile?: string - history?: string - accessToken?: string - refreshToken?: string - deleteToken?: string - email?: string - password?: string -} +import {BaseProfile, DropboxProfile, GenericProfile, UserAttributes, UserProfile} from "./baseModel"; export class User extends Model implements UserAttributes { accessToken: string; From c7f712d03571a2443c26c466b2fa0714b8643204 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 04:26:15 +0800 Subject: [PATCH 133/167] lint: lib/auth/oauth2/strategy.ts - add typing annotate Signed-off-by: Raccoon --- lib/auth/oauth2/strategy.ts | 40 ++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/lib/auth/oauth2/strategy.ts b/lib/auth/oauth2/strategy.ts index 80fdbf21b3..0b801ec962 100644 --- a/lib/auth/oauth2/strategy.ts +++ b/lib/auth/oauth2/strategy.ts @@ -1,11 +1,19 @@ -import {InternalOAuthError, Strategy} from "passport-oauth2"; +import {InternalOAuthError, Strategy, StrategyOptions, VerifyFunction} from "passport-oauth2"; import config from "../../config"; -export function parseProfile(data) { - const username = extractProfileAttribute(data, config.oauth2.userProfileUsernameAttr) - const displayName = extractProfileAttribute(data, config.oauth2.userProfileDisplayNameAttr) - const email = extractProfileAttribute(data, config.oauth2.userProfileEmailAttr) - const photo = extractProfileAttribute(data, config.oauth2.userProfilePhotoAttr) +interface Oauth2Profile { + id: string + username: string + displayName: string + email: string + photo: string +} + +export function parseProfile(data: Record): Oauth2Profile { + const username = extractProfileAttribute(data, config.oauth2.userProfileUsernameAttr) as string + const displayName = extractProfileAttribute(data, config.oauth2.userProfileDisplayNameAttr) as string + const email = extractProfileAttribute(data, config.oauth2.userProfileEmailAttr) as string + const photo = extractProfileAttribute(data, config.oauth2.userProfilePhotoAttr) as string if (!username) { throw new Error('cannot fetch username: please set correct CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR') @@ -20,12 +28,12 @@ export function parseProfile(data) { } } -export function extractProfileAttribute(data, path) { +export function extractProfileAttribute(data: any, path: string): string | string[] | undefined { if (!data) return undefined if (typeof path !== 'string') return undefined // can handle stuff like `attrs[0].name` - path = path.split('.') - for (const segment of path) { + const pathSegments = path.split('.') + for (const segment of pathSegments) { const m = segment.match(/([\d\w]+)\[(.*)\]/) if (!m) { data = data[segment] @@ -39,10 +47,14 @@ export function extractProfileAttribute(data, path) { return data } +interface OAuth2CustomStrategyOptions extends StrategyOptions { + userProfileURL +} + export class OAuth2CustomStrategy extends Strategy { - private _userProfileURL: any; + private readonly _userProfileURL: string; - constructor(options, verify) { + constructor(options: OAuth2CustomStrategyOptions, verify: VerifyFunction) { options.customHeaders = options.customHeaders || {} super(options, verify) this.name = 'oauth2' @@ -50,15 +62,15 @@ export class OAuth2CustomStrategy extends Strategy { this._oauth2.useAuthorizationHeaderforGET(true) } - userProfile(accessToken, done) { - this._oauth2.get(this._userProfileURL, accessToken, function (err, body, res) { + userProfile(accessToken: string, done: (err: Error | null, profile?: Oauth2Profile) => void): void { + this._oauth2.get(this._userProfileURL, accessToken, function (err, body) { if (err) { return done(new InternalOAuthError('Failed to fetch user profile', err)) } let profile, json try { - json = JSON.parse(body as any) + json = JSON.parse(body.toString()) profile = parseProfile(json) } catch (ex) { return done(new InternalOAuthError('Failed to parse user profile' + ex.toString(), null)) From d19908d46fb4034a1075a282f262369940ef2ddc Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:12:12 +0800 Subject: [PATCH 134/167] lint lib/auth/index.ts Signed-off-by: Raccoon --- lib/auth/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/auth/index.ts b/lib/auth/index.ts index 85c5df78d8..fdf086b207 100644 --- a/lib/auth/index.ts +++ b/lib/auth/index.ts @@ -8,8 +8,12 @@ import {User} from "../models"; const authRouter = Router() export = authRouter +interface PassportUser { + id?: string +} + // serialize and deserialize -passport.serializeUser(function (user: any, done) { +passport.serializeUser(function (user: PassportUser, done) { logger.info('serializeUser: ' + user.id) return done(null, user.id) }) @@ -65,7 +69,7 @@ if (config.isOpenIDEnable) authRouter.use(require('./openid')) // logout authRouter.get('/logout', function (req, res) { if (config.debug && req.isAuthenticated()) { - logger.debug('user logout: ' + (req.user as any).id) + logger.debug('user logout: ' + req.user.id) } req.logout() res.redirect(config.serverURL + '/') From e6b9ab099f8eab4f384fde02d6274aced192e642 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:12:40 +0800 Subject: [PATCH 135/167] lint lib/config Signed-off-by: Raccoon --- lib/config/dockerSecret.ts | 4 +++- lib/config/index.ts | 4 +++- lib/config/utils.ts | 14 +++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/config/dockerSecret.ts b/lib/config/dockerSecret.ts index 593fe7a2d2..ee4427610c 100644 --- a/lib/config/dockerSecret.ts +++ b/lib/config/dockerSecret.ts @@ -9,7 +9,9 @@ function getSecret(secret) { return undefined } -let dockerSecretConfig: any = {} +// eslint-disable-next-line +let dockerSecretConfig: Record = {} + if (fs.existsSync(basePath)) { dockerSecretConfig = { dbURL: getSecret('dburl'), diff --git a/lib/config/index.ts b/lib/config/index.ts index 53b3ef28ca..460d5f111c 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -34,7 +34,7 @@ const configFilePath = path.resolve(appRootPath, process.env.CMD_CONFIG_FILE || // eslint-disable-next-line @typescript-eslint/no-var-requires const fileConfig = fs.existsSync(configFilePath) ? require(configFilePath)[env] : undefined -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line let config: any = require('./default') // eslint-disable-next-line @typescript-eslint/no-var-requires merge(config, require('./defaultSSL')) @@ -214,7 +214,9 @@ config.defaultNotePath = path.resolve(appRootPath, config.defaultNotePath) config.docsPath = path.resolve(appRootPath, config.docsPath) config.uploadsPath = path.resolve(appRootPath, config.uploadsPath) config.env = env + // make config readonly +// eslint-disable-next-line config = deepFreeze(config) as any export = config diff --git a/lib/config/utils.ts b/lib/config/utils.ts index 20d8dcf84e..e026b1fbb4 100644 --- a/lib/config/utils.ts +++ b/lib/config/utils.ts @@ -1,28 +1,28 @@ import * as fs from "fs"; import * as path from "path"; -export function toBooleanConfig(configValue) { +export function toBooleanConfig(configValue: string | boolean): boolean { if (configValue && typeof configValue === 'string') { return (configValue === 'true') } - return configValue + return configValue as boolean } -export function toArrayConfig(configValue, separator = ',', fallback ?: any) { +export function toArrayConfig(configValue: string | [], separator = ',', fallback ?: string[]): string[] { if (configValue && typeof configValue === 'string') { return (configValue.split(separator).map(arrayItem => arrayItem.trim())) } return fallback } -export function toIntegerConfig(configValue) { +export function toIntegerConfig(configValue: string | number): number { if (configValue && typeof configValue === 'string') { return parseInt(configValue) } - return configValue + return configValue as number } -export function getGitCommit(repodir) { +export function getGitCommit(repodir: string): string { if (!fs.existsSync(repodir + '/.git/HEAD')) { return undefined } @@ -35,7 +35,7 @@ export function getGitCommit(repodir) { return reference } -export function getGitHubURL(repo, reference) { +export function getGitHubURL(repo: string, reference: string): string { // if it's not a github reference, we handle handle that anyway if (!repo.startsWith('https://github.com') && !repo.startsWith('git@github.com')) { return repo From 7dbb1efbd220ce55b336289bb8154997121dcabc Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 05:42:08 +0800 Subject: [PATCH 136/167] lint: lib/models - add more typing annotate - install @types/cheerio Signed-off-by: Raccoon --- lib/models/author.ts | 6 ++--- lib/models/baseModel.ts | 39 +++++++++++++++++++-------- lib/models/index.ts | 18 +++++++++---- lib/models/note.ts | 59 ++++++++++++++++++++++------------------- lib/models/revision.ts | 36 ++++++++++++++----------- lib/models/user.ts | 8 +++--- package-lock.json | 9 +++++++ package.json | 1 + 8 files changed, 111 insertions(+), 65 deletions(-) diff --git a/lib/models/author.ts b/lib/models/author.ts index 406f47395a..a882afbacd 100644 --- a/lib/models/author.ts +++ b/lib/models/author.ts @@ -1,13 +1,13 @@ // external modules import {Model, DataTypes} from "sequelize"; -import {AuthorAttributes} from "./baseModel"; +import {MySequelize, AuthorAttributes, ModelObj} from "./baseModel"; export class Author extends Model implements AuthorAttributes { color: string; id: string; - static initialize(sequelize): void { + static initialize(sequelize: MySequelize): void { Author.init( { id: { @@ -30,7 +30,7 @@ export class Author extends Model implements AuthorAttributes }) } - static associate(models: any): void { + static associate(models: ModelObj): void { Author.belongsTo(models.Note, { foreignKey: 'noteId', as: 'note', diff --git a/lib/models/baseModel.ts b/lib/models/baseModel.ts index 76a0ef737c..332ea673f2 100644 --- a/lib/models/baseModel.ts +++ b/lib/models/baseModel.ts @@ -1,24 +1,27 @@ -import {Sequelize, Model} from "sequelize"; +import {Moment} from "moment"; +import {Sequelize, Model, ModelCtor} from "sequelize"; export type MySequelize = Sequelize & { processData?: any stripNullByte?: any } -export type BaseModel = { +export type BaseModel = { name: string; initialize(sequelize: Sequelize): void - associate(models: any): void + associate(models: ModelObj): void } -export function StaticImplements(t: T) { - return t; -} - -export interface BaseModelStatic extends Model { - initialize(sequelize: Sequelize): void +export type UserModel = Model & UserAttributes +export type AuthorModel = Model & AuthorAttributes +export type RevisionModel = Model & RevisionAttributes +export type NoteModel = Model & NoteAttributes - associate(models: any): void +export type ModelObj = { + ['Author']: ModelCtor + ['Note']: ModelCtor + ['User']: ModelCtor + ['Revision']: ModelCtor } export interface AuthorAttributes { @@ -35,7 +38,7 @@ export interface NoteAttributes { title?: string content?: string authorship?: string - lastchangeAt?: Date + lastchangeAt?: Date | Moment savedAt?: Date ownerId?: string @@ -88,3 +91,17 @@ export interface UserAttributes { email?: string password?: string } + +export interface NoteMeta { + title: string + tags: string[] + + description: string + robots: string + GA: string + disqus: string + // eslint-disable-next-line + slideOptions: any + image: string +} + diff --git a/lib/models/index.ts b/lib/models/index.ts index 3790d00417..80d5d8ec31 100644 --- a/lib/models/index.ts +++ b/lib/models/index.ts @@ -1,5 +1,5 @@ // external modules -import {Model, Sequelize} from "sequelize"; +import {Sequelize} from "sequelize"; import {cloneDeep} from "lodash"; // core @@ -7,7 +7,15 @@ import config from "../config"; import {logger} from "../logger"; -import {BaseModel, AuthorAttributes, NoteAttributes, RevisionAttributes, UserAttributes, GenericProfile} from "./baseModel"; +import { + BaseModel, + AuthorAttributes, + NoteAttributes, + RevisionAttributes, + UserAttributes, + GenericProfile, + ModelObj +} from "./baseModel"; import {Author} from './author' import {User} from './user' @@ -48,9 +56,9 @@ function processData(data, _default, process) { sequelize.processData = processData -const db: any = {} +const db: Partial = {} -const models: BaseModel[] = [User, Note, Author, Revision] +const models: BaseModel[] = [User, Note, Author, Revision] models.forEach(m => { m.initialize(sequelize) @@ -58,7 +66,7 @@ models.forEach(m => { }) models.forEach(m => { if ('associate' in m) { - m.associate(db) + m.associate(db as ModelObj) } }) diff --git a/lib/models/note.ts b/lib/models/note.ts index 506f60357b..6c7cea26f3 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -7,7 +7,7 @@ import base64url from "base64url"; import cheerio from "cheerio"; import * as fs from "fs"; import markdownIt from "markdown-it"; -import moment from "moment"; +import moment, {Moment} from "moment"; // ot import ot from "ot"; @@ -20,19 +20,24 @@ import config from "../config"; import {logger} from "../logger"; import {createNoteWithRevision, syncNote} from "../services/note"; import {stripTags} from "../string"; -import {MySequelize, NoteAttributes} from "./baseModel"; +import {ModelObj, MySequelize, NoteAttributes, NoteMeta} from "./baseModel"; const md = markdownIt() export const dmp = new DiffMatchPatch() // permission types const permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private'] +interface ParsedMeta { + markdown: string, + meta: Record +} + export class Note extends Model implements NoteAttributes { alias: string; authorship: string; content: string; id: string; - lastchangeAt: Date; + lastchangeAt: Date | Moment; permission: string; savedAt: Date; shortid: string; @@ -107,7 +112,7 @@ export class Note extends Model implements NoteAttributes { }) Note.addHook('beforeCreate', function (note: Note): Promise { - return new Promise(function (resolve, reject) { + return new Promise(function (resolve) { // if no content specified then use default note if (!note.content) { let filePath = config.defaultNotePath @@ -124,8 +129,8 @@ export class Note extends Model implements NoteAttributes { note.title = noteInFS.title note.content = noteInFS.content if (filePath !== config.defaultNotePath) { - note.createdAt = noteInFS.lastchangeAt.toDate() - note.lastchangeAt = noteInFS.lastchangeAt.toDate() + note.createdAt = (noteInFS.lastchangeAt as Moment).toDate() + note.lastchangeAt = (noteInFS.lastchangeAt as Moment).toDate() } } } @@ -142,7 +147,7 @@ export class Note extends Model implements NoteAttributes { }) } - static associate(models: any): void { + static associate(models: ModelObj): void { Note.belongsTo(models.User, { foreignKey: 'ownerId', as: 'owner', @@ -167,7 +172,7 @@ export class Note extends Model implements NoteAttributes { } - static checkFileExist(filePath) { + static checkFileExist(filePath: string): boolean { try { return fs.statSync(filePath).isFile() } catch (err) { @@ -175,14 +180,14 @@ export class Note extends Model implements NoteAttributes { } } - static encodeNoteId(id) { + static encodeNoteId(id: string): string { // remove dashes in UUID and encode in url-safe base64 const str = id.replace(/-/g, '') const hexStr = Buffer.from(str, 'hex') return base64url.encode(hexStr) } - static decodeNoteId(encodedId) { + static decodeNoteId(encodedId: string): string { // decode from url-safe base64 const id = base64url.toBuffer(encodedId).toString('hex') // add dashes between the UUID string parts @@ -195,7 +200,7 @@ export class Note extends Model implements NoteAttributes { return idParts.join('-') } - static checkNoteIdValid(id) { + static checkNoteIdValid(id: string): boolean { const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i const result = id.match(uuidRegex) if (result && result.length === 1) { @@ -205,7 +210,7 @@ export class Note extends Model implements NoteAttributes { } } - static parseNoteIdAsync(noteId) { + static parseNoteIdAsync(noteId: string): Promise { return new Promise((resolve, reject) => { Note.parseNoteId(noteId, (err, id) => { if (err) { @@ -216,7 +221,7 @@ export class Note extends Model implements NoteAttributes { }) } - static parseNoteId(noteId, callback) { + static parseNoteId(noteId: string, callback: (err: Error | null, id: string) => void): void { async.series({ parseNoteIdByAlias: function (_callback) { // try to parse note id by alias (e.g. doc) @@ -320,7 +325,7 @@ export class Note extends Model implements NoteAttributes { return _callback(err, null) } } - }, function (err, result) { + }, function (err) { if (err) { logger.error(err) return callback(err, null) @@ -329,7 +334,7 @@ export class Note extends Model implements NoteAttributes { }) } - static parseNoteInfo(body) { + static parseNoteInfo(body: string): Partial { const parsed = Note.extractMeta(body) const $ = cheerio.load(md.render(parsed.markdown)) return { @@ -338,13 +343,13 @@ export class Note extends Model implements NoteAttributes { } } - static parseNoteTitle(body) { + static parseNoteTitle(body: string): string { const parsed = Note.extractMeta(body) const $ = cheerio.load(md.render(parsed.markdown)) return Note.extractNoteTitle(parsed.meta, $) } - static extractNoteTitle(meta, $) { + static extractNoteTitle(meta: Record, $: cheerio.Root): string { let title = '' if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { title = meta.title @@ -358,20 +363,20 @@ export class Note extends Model implements NoteAttributes { return title } - static generateDescription(markdown) { + static generateDescription(markdown: string): string { return markdown.substr(0, 100).replace(/(?:\r\n|\r|\n)/g, ' ') } - static decodeTitle(title) { + static decodeTitle(title: string): string { return title || 'Untitled' } - static generateWebTitle(title) { + static generateWebTitle(title: string): string { title = !title || title === 'Untitled' ? 'CodiMD - Collaborative markdown notes' : title + ' - CodiMD' return title } - static extractNoteTags(meta, $) { + static extractNoteTags(meta: Record, $: cheerio.Root): string[] { const tags = [] const rawtags = [] let metaTags @@ -412,7 +417,7 @@ export class Note extends Model implements NoteAttributes { return tags } - static extractMeta(content) { + static extractMeta(content: string): ParsedMeta { let obj = null try { obj = metaMarked(content) @@ -427,8 +432,8 @@ export class Note extends Model implements NoteAttributes { return obj } - static parseMeta(meta) { - const _meta: any = {} + static parseMeta(meta: Record): Partial { + const _meta: Partial = {} if (meta) { if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { _meta.title = meta.title @@ -452,7 +457,7 @@ export class Note extends Model implements NoteAttributes { return _meta } - static updateAuthorshipByOperation(operation, userId, authorships) { + static updateAuthorshipByOperation(operation: any, userId: string, authorships: any): any { let index = 0 const timestamp = Date.now() for (let i = 0; i < operation.length; i++) { @@ -554,7 +559,7 @@ export class Note extends Model implements NoteAttributes { return authorships } - static transformPatchToOperations(patch, contentLength) { + static transformPatchToOperations(patch: any, contentLength: number) { const operations = [] if (patch.length > 0) { // calculate original content length @@ -615,7 +620,7 @@ export class Note extends Model implements NoteAttributes { } } -function readFileSystemNote(filePath) { +function readFileSystemNote(filePath: string): Partial { const fsModifiedTime = moment(fs.statSync(filePath).mtime) const content = fs.readFileSync(filePath, 'utf8') diff --git a/lib/models/revision.ts b/lib/models/revision.ts index 2aacd05175..46747b2e0c 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -9,11 +9,16 @@ import * as util from "util"; // core import config from "../config"; import logger from "../logger"; -import {MySequelize, RevisionAttributes} from "./baseModel"; +import {MySequelize, RevisionAttributes, ModelObj, NoteModel} from "./baseModel"; let dmpWorker = createDmpWorker() const dmpCallbackCache = {} +export interface ClientRevisionData { + time: number + length: number +} + function createDmpWorker() { const worker = childProcess.fork(path.resolve(__dirname, '../workers/dmpWorker.js'), { stdio: 'ignore' @@ -62,6 +67,7 @@ export class Revision extends Model implements RevisionAttri patch: string; public readonly createdAt ?: number + public readonly updatedAt ?: number static initialize(sequelize: MySequelize): void { Revision.init({ @@ -112,7 +118,7 @@ export class Revision extends Model implements RevisionAttri }, {sequelize}) } - static associate(models: any): void { + static associate(models: ModelObj): void { Revision.belongsTo(models.Note, { foreignKey: 'noteId', as: 'note', @@ -123,14 +129,14 @@ export class Revision extends Model implements RevisionAttri } - static getNoteRevisions(note, callback) { + static getNoteRevisions(note: NoteModel, callback: (err: Error | null, data?: ClientRevisionData[]) => void): void { Revision.findAll({ where: { noteId: note.id }, order: [['createdAt', 'DESC']] - }).then(function (revisions) { - const data = [] + }).then(function (revisions: Revision[]) { + const data: ClientRevisionData[] = [] for (let i = 0, l = revisions.length; i < l; i++) { const revision = revisions[i] data.push({ @@ -144,14 +150,14 @@ export class Revision extends Model implements RevisionAttri }) } - static getPatchedNoteRevisionByTime(note, time, callback) { + static getPatchedNoteRevisionByTime(note: NoteModel, time: number | moment.Moment, callback: (err: Error | null, data?: null) => void): void { // find all revisions to prepare for all possible calculation Revision.findAll({ where: { noteId: note.id }, order: [['createdAt', 'DESC']] - }).then(function (revisions) { + }).then(function (revisions: Revision[]) { if (revisions.length <= 0) return callback(null, null) // measure target revision position Revision.count({ @@ -161,7 +167,7 @@ export class Revision extends Model implements RevisionAttri [Op.gte]: time } }, - }).then(function (count) { + }).then(function (count: number) { if (count <= 0) return callback(null, null) sendDmpWorker({ msg: 'get revision', @@ -176,13 +182,13 @@ export class Revision extends Model implements RevisionAttri }) } - static saveNoteRevision(note, callback) { + static saveNoteRevision(note: NoteModel, callback: (err: Error | null, rev?: Revision) => void): void { Revision.findAll({ where: { noteId: note.id }, order: [['createdAt', 'DESC']] - }).then(function (revisions) { + }).then(function (revisions: Revision[]) { if (revisions.length <= 0) { // if no revision available Revision.create({ @@ -190,7 +196,7 @@ export class Revision extends Model implements RevisionAttri lastContent: note.content ? note.content : '', length: note.content ? note.content.length : 0, authorship: note.authorship - }).then(function (revision) { + }).then(function (revision: Revision) { Revision.finishSaveNoteRevision(note, revision, callback) }).catch(function (err) { return callback(err, null) @@ -203,14 +209,14 @@ export class Revision extends Model implements RevisionAttri msg: 'create patch', lastDoc: lastContent, currDoc: content - }, function (err, patch) { + }, function (err: Error | null, patch: string) { if (err) logger.error('save note revision error', err) if (!patch) { // if patch is empty (means no difference) then just update the latest revision updated time latestRevision.changed('updatedAt', true) latestRevision.update({ updatedAt: Date.now() - }).then(function (revision) { + }).then(function (revision: Revision) { Revision.finishSaveNoteRevision(note, revision, callback) }).catch(function (err) { return callback(err, null) @@ -222,7 +228,7 @@ export class Revision extends Model implements RevisionAttri content: note.content, length: note.content.length, authorship: note.authorship - }).then(function (revision) { + }).then(function (revision: Revision) { // clear last revision content to reduce db size latestRevision.update({ content: null @@ -244,7 +250,7 @@ export class Revision extends Model implements RevisionAttri static saveNoteRevisionAsync = util.promisify(Revision.saveNoteRevision) as (note) => Promise - static finishSaveNoteRevision(note, revision, callback) { + static finishSaveNoteRevision(note: NoteModel, revision: Revision, callback: (err: Error | null, rev: Revision) => void): void { note.update({ savedAt: revision.updatedAt }).then(function () { diff --git a/lib/models/user.ts b/lib/models/user.ts index 2089b912c3..d8aef391bd 100644 --- a/lib/models/user.ts +++ b/lib/models/user.ts @@ -3,7 +3,7 @@ import Scrypt from "scrypt-kdf"; import {logger} from "../logger"; import {generateAvatarURL} from "../letter-avatars"; -import {BaseProfile, DropboxProfile, GenericProfile, UserAttributes, UserProfile} from "./baseModel"; +import {BaseProfile, DropboxProfile, GenericProfile, UserAttributes, UserProfile, ModelObj} from "./baseModel"; export class User extends Model implements UserAttributes { accessToken: string; @@ -68,7 +68,7 @@ export class User extends Model implements UserAttributes { }) } - static associate(models: any): void { + static associate(models: ModelObj): void { User.hasMany(models.Note, { foreignKey: 'ownerId', constraints: false @@ -79,7 +79,7 @@ export class User extends Model implements UserAttributes { }) } - static async hashPassword(plain): Promise { + static async hashPassword(plain: string): Promise { return (await Scrypt.kdf(plain, await Scrypt.pickParams(0.1))).toString('hex') } @@ -90,7 +90,7 @@ export class User extends Model implements UserAttributes { return false } - static getProfile(user): UserProfile | null { + static getProfile(user: User): UserProfile | null { if (!user) return null if (user.profile) return User.parseProfile(user.profile) if (user.email) return User.parseProfileByEmail(user.email) diff --git a/package-lock.json b/package-lock.json index 6a63b600f1..790b5c6b3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1105,6 +1105,15 @@ "@types/node": "*" } }, + "@types/cheerio": { + "version": "0.22.29", + "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.29.tgz", + "integrity": "sha512-rNX1PsrDPxiNiyLnRKiW2NXHJFHqx0Fl3J2WsZq0MTBspa/FgwlqhXJE2crIcc+/2IglLHtSWw7g053oUR8fOg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/clone": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@types/clone/-/clone-2.1.0.tgz", diff --git a/package.json b/package.json index e684cdd650..a0eab83ef2 100644 --- a/package.json +++ b/package.json @@ -111,6 +111,7 @@ "@hackmd/idle-js": "~1.0.1", "@hackmd/js-sequence-diagrams": "~0.0.1-alpha.3", "@susisu/mte-kernel": "^2.1.0", + "@types/cheerio": "^0.22.29", "@types/express": "4.17.9", "@types/express-flash": "0.0.2", "@types/express-session": "^1.17.3", From 10e5cd8de1f80a3e4c1a38b7e27d55334b7d1966 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:20:21 +0800 Subject: [PATCH 137/167] lint: lib/realtime - add JobWorker type - add typing annotate in: - realtimeUpdateDirtyNoteJob - realtimeSaveRevisionJob - realtimeClientConnection - processQueue lint: lib/realtime/realtimeCleanDanglingUserJob.ts Signed-off-by: Raccoon --- lib/realtime/jobWorker.ts | 5 ++ lib/realtime/processQueue.ts | 65 +++++++++++++++----- lib/realtime/realtimeCleanDanglingUserJob.ts | 11 ++-- lib/realtime/realtimeClientConnection.ts | 36 +++++------ lib/realtime/realtimeSaveRevisionJob.ts | 15 ++--- lib/realtime/realtimeUpdateDirtyNoteJob.ts | 11 ++-- 6 files changed, 92 insertions(+), 51 deletions(-) create mode 100644 lib/realtime/jobWorker.ts diff --git a/lib/realtime/jobWorker.ts b/lib/realtime/jobWorker.ts new file mode 100644 index 0000000000..024f50090c --- /dev/null +++ b/lib/realtime/jobWorker.ts @@ -0,0 +1,5 @@ +export interface JobWorker { + start(): void + + stop(): void +} diff --git a/lib/realtime/processQueue.ts b/lib/realtime/processQueue.ts index a048cd5aea..7438deacc6 100644 --- a/lib/realtime/processQueue.ts +++ b/lib/realtime/processQueue.ts @@ -1,4 +1,5 @@ import {EventEmitter} from "events"; +import {JobWorker} from "./jobWorker"; /** * Queuing Class for connection queuing @@ -10,22 +11,48 @@ const QueueEvent = { Finish: 'Finish' } -export class ProcessQueue extends EventEmitter { - private max: number; - private triggerTime: number; +type AsyncFunc = () => Promise +type SyncFun = () => void +type TaskFunc = AsyncFunc | SyncFun + +interface Task { + id: string + processingFunc: TaskFunc +} + + +export interface ProcessQueueOptions { + maximumLength?: number + triggerTimeInterval?: number + proactiveMode?: boolean + continuousMode?: boolean +} + +const defaultOptions: ProcessQueueOptions = { + maximumLength: 500, + triggerTimeInterval: 5000, + // execute on push + proactiveMode: true, + // execute next work on finish + continuousMode: true +} + +export class ProcessQueue extends EventEmitter implements JobWorker { + private readonly max: number; + private readonly triggerTime: number; private taskMap: Map; - public queue: any[]; + public queue: Task[]; public lock: boolean; private eventTrigger: NodeJS.Timeout; constructor({ - maximumLength = 500, - triggerTimeInterval = 5000, + maximumLength, + triggerTimeInterval, // execute on push - proactiveMode = true, + proactiveMode, // execute next work on finish - continuousMode = true - }) { + continuousMode + } = defaultOptions) { super() this.max = maximumLength this.triggerTime = triggerTimeInterval @@ -42,7 +69,7 @@ export class ProcessQueue extends EventEmitter { } } - onEventProcessFunc() { + onEventProcessFunc(): void { if (this.lock) return this.lock = true setImmediate(() => { @@ -50,21 +77,21 @@ export class ProcessQueue extends EventEmitter { }) } - start() { + start(): void { if (this.eventTrigger) return this.eventTrigger = setInterval(() => { this.emit(QueueEvent.Tick) }, this.triggerTime) } - stop() { + stop(): void { if (this.eventTrigger) { clearInterval(this.eventTrigger) this.eventTrigger = null } } - checkTaskIsInQueue(id) { + checkTaskIsInQueue(id: string): boolean { return this.taskMap.has(id) } @@ -74,7 +101,7 @@ export class ProcessQueue extends EventEmitter { * @param processingFunc {Function} * @returns {boolean} if success return true, otherwise false */ - push(id: string, processingFunc) { + push(id: string, processingFunc: TaskFunc): boolean { if (this.queue.length >= this.max) return false if (this.checkTaskIsInQueue(id)) return false const task = { @@ -88,7 +115,7 @@ export class ProcessQueue extends EventEmitter { return true } - process() { + process(): void { if (this.queue.length <= 0) { this.stop() this.lock = false @@ -104,7 +131,13 @@ export class ProcessQueue extends EventEmitter { this.emit(QueueEvent.Finish) }) } - task.processingFunc().then(finishTask).catch(finishTask) + const runFunc = task.processingFunc() as Promise; + // Wait until the promise fulfilled if processing function is a promise + if (typeof runFunc.then === 'function') { + runFunc.then(finishTask).catch(finishTask) + } else { + finishTask() + } } } diff --git a/lib/realtime/realtimeCleanDanglingUserJob.ts b/lib/realtime/realtimeCleanDanglingUserJob.ts index c5ea6f3911..7c97a7ad05 100644 --- a/lib/realtime/realtimeCleanDanglingUserJob.ts +++ b/lib/realtime/realtimeCleanDanglingUserJob.ts @@ -4,30 +4,31 @@ import async from "async"; import config from "../config"; import {logger} from "../logger"; +import {JobWorker} from "./jobWorker"; /** * clean when user not in any rooms or user not in connected list */ -export class CleanDanglingUserJob { +export class CleanDanglingUserJob implements JobWorker { private realtime: any; private timer: NodeJS.Timeout; - constructor(realtime) { + constructor(realtime: any) { this.realtime = realtime } - start() { + start(): void { if (this.timer) return this.timer = setInterval(this.cleanDanglingUser.bind(this), 60000) } - stop() { + stop(): void { if (!this.timer) return clearInterval(this.timer) this.timer = undefined } - cleanDanglingUser() { + cleanDanglingUser(): void { const users = this.realtime.getUserPool() async.each(Object.keys(users), (key, callback) => { const socket = this.realtime.io.sockets.connected[key] diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index 611633b0d7..39403c8587 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -15,7 +15,7 @@ export class RealtimeClientConnection { this.realtime = require('./realtime') } - registerEventHandler() { + registerEventHandler(): void { // received client refresh request this.socket.on('refresh', this.refreshEventHandler.bind(this)) // received user status @@ -40,27 +40,27 @@ export class RealtimeClientConnection { this.socket.on('permission', this.permissionChangeEventHandler.bind(this)) } - isUserLoggedIn() { + isUserLoggedIn(): boolean { return this.socket.request.user && this.socket.request.user.logged_in } - isNoteAndUserExists() { + isNoteAndUserExists(): boolean { const note = this.realtime.getNoteFromNotePool(this.socket.noteId) const user = this.realtime.getUserFromUserPool(this.socket.id) return note && user } - isNoteOwner() { + isNoteOwner(): boolean { const note = this.getCurrentNote() return get(note, 'owner') === this.getCurrentLoggedInUserId() } - isAnonymousEnable() { + isAnonymousEnable(): boolean { // TODO: move this method to config module return config.allowAnonymous || config.allowAnonymousEdits } - getAvailablePermissions() { + getAvailablePermissions(): string[] { // TODO: move this method to config module const availablePermission = Object.assign({}, config.permission) if (!config.allowAnonymous && !config.allowAnonymousViews) { @@ -78,7 +78,7 @@ export class RealtimeClientConnection { return this.realtime.getUserFromUserPool(this.socket.id) } - getCurrentLoggedInUserId() { + getCurrentLoggedInUserId(): string { return get(this.socket, 'request.user.id') } @@ -91,13 +91,13 @@ export class RealtimeClientConnection { return this.socket.broadcast.to(this.socket.noteId) } - async destroyNote(id) { + async destroyNote(id: string): Promise { return Note.destroy({ where: {id: id} }) } - async changeNotePermission(newPermission) { + async changeNotePermission(newPermission: string): Promise { const [changedRows] = await Note.update({ permission: newPermission }, { @@ -110,7 +110,7 @@ export class RealtimeClientConnection { } } - notifyPermissionChanged() { + notifyPermissionChanged(): void { this.realtime.io.to(this.getCurrentNote().id).emit('permission', { permission: this.getCurrentNote().permission }) @@ -128,11 +128,11 @@ export class RealtimeClientConnection { }) } - refreshEventHandler() { + refreshEventHandler(): void { this.realtime.emitRefresh(this.socket) } - checkVersionEventHandler() { + checkVersionEventHandler(): void { this.socket.emit('version', { version: config.fullversion, minimumCompatibleVersion: config.minimumCompatibleVersion @@ -152,7 +152,7 @@ export class RealtimeClientConnection { this.realtime.emitUserStatus(this.socket) } - userChangedEventHandler() { + userChangedEventHandler(): void { logger.info('user changed') const note = this.getCurrentNote() @@ -164,7 +164,7 @@ export class RealtimeClientConnection { this.realtime.emitOnlineUsers(this.socket) } - onlineUsersEventHandler() { + onlineUsersEventHandler(): void { if (!this.isNoteAndUserExists()) return const currentNote = this.getCurrentNote() @@ -193,7 +193,7 @@ export class RealtimeClientConnection { this.getNoteChannel().emit('cursor activity', out) } - cursorBlurEventHandler() { + cursorBlurEventHandler(): void { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() user.cursor = null @@ -202,7 +202,7 @@ export class RealtimeClientConnection { }) } - deleteNoteEventHandler() { + deleteNoteEventHandler(): void { // need login to do more actions if (this.isUserLoggedIn() && this.isNoteAndUserExists()) { const note = this.getCurrentNote() @@ -220,7 +220,7 @@ export class RealtimeClientConnection { } } - permissionChangeEventHandler(permission) { + permissionChangeEventHandler(permission: string): void { if (!this.isUserLoggedIn()) return if (!this.isNoteAndUserExists()) return @@ -237,7 +237,7 @@ export class RealtimeClientConnection { .catch(err => logger.error('update note permission failed: ' + err)) } - disconnectEventHandler() { + disconnectEventHandler(): void { if (this.realtime.disconnectProcessQueue.checkTaskIsInQueue(this.socket.id)) { return } diff --git a/lib/realtime/realtimeSaveRevisionJob.ts b/lib/realtime/realtimeSaveRevisionJob.ts index f6e8640298..6fce4e9f34 100644 --- a/lib/realtime/realtimeSaveRevisionJob.ts +++ b/lib/realtime/realtimeSaveRevisionJob.ts @@ -2,32 +2,33 @@ import {logger} from "../logger"; import {saveAllNotesRevision} from "../services/note"; +import {JobWorker} from "./jobWorker"; /** * clean when user not in any rooms or user not in connected list */ -export class SaveRevisionJob { +export class SaveRevisionJob implements JobWorker { private realtime: any; private saverSleep: boolean; private timer: NodeJS.Timeout; - constructor(realtime) { + constructor(realtime: any) { this.realtime = realtime this.saverSleep = false } - start() { + start(): void { if (this.timer) return this.timer = setInterval(this.saveRevision.bind(this), 5 * 60 * 1000) } - stop() { + stop(): void { if (!this.timer) return clearInterval(this.timer) this.timer = undefined } - saveRevision() { + saveRevision(): void { if (this.getSaverSleep()) return saveAllNotesRevision((err, notes) => { if (err) { @@ -39,11 +40,11 @@ export class SaveRevisionJob { }) } - getSaverSleep() { + getSaverSleep(): boolean { return this.saverSleep } - setSaverSleep(val) { + setSaverSleep(val: boolean): void { this.saverSleep = val } } diff --git a/lib/realtime/realtimeUpdateDirtyNoteJob.ts b/lib/realtime/realtimeUpdateDirtyNoteJob.ts index 25065af6fa..17fc159abd 100644 --- a/lib/realtime/realtimeUpdateDirtyNoteJob.ts +++ b/lib/realtime/realtimeUpdateDirtyNoteJob.ts @@ -2,27 +2,28 @@ import moment from "moment"; import config from "../config"; import {logger} from "../logger"; +import {JobWorker} from "./jobWorker"; -export class UpdateDirtyNoteJob { +export class UpdateDirtyNoteJob implements JobWorker { private realtime: any; private timer: NodeJS.Timeout; - constructor(realtime) { + constructor(realtime: any) { this.realtime = realtime } - start() { + start(): void { if (this.timer) return this.timer = setInterval(this.updateDirtyNotes.bind(this), 1000) } - stop() { + stop(): void { if (!this.timer) return clearInterval(this.timer) this.timer = undefined } - updateDirtyNotes() { + updateDirtyNotes(): void { const notes = this.realtime.getNotePool() Object.keys(notes).forEach((key) => { const note = notes[key] From ee04b2fb74d42d7f584a750bc431df521b1d9639 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 05:11:19 +0800 Subject: [PATCH 138/167] lint: lib/note/noteAction.ts - install @types/markdown-pdf - add typing annotate Signed-off-by: Raccoon --- lib/note/noteActions.ts | 18 +++++++++--------- package-lock.json | 6 ++++++ package.json | 1 + 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/note/noteActions.ts b/lib/note/noteActions.ts index 734bfdb6cf..5450001ad3 100644 --- a/lib/note/noteActions.ts +++ b/lib/note/noteActions.ts @@ -1,3 +1,4 @@ +import {Request, Response} from "express"; import * as fs from "fs"; import * as path from "path"; @@ -14,16 +15,15 @@ import {logger} from "../logger"; import {Note, Revision} from "../models"; import {errorInternalError, errorNotFound} from "../response"; - -export function actionPublish(req, res, note) { +export function actionPublish(req: Request, res: Response, note): void { res.redirect(config.serverURL + '/s/' + (note.alias || note.shortid)) } -export function actionSlide(req, res, note) { +export function actionSlide(req: Request, res: Response, note): void { res.redirect(config.serverURL + '/p/' + (note.alias || note.shortid)) } -export function actionDownload(req, res, note) { +export function actionDownload(req: Request, res: Response, note): void { const body = note.content const title = Note.decodeTitle(note.title) const filename = encodeURIComponent(title) @@ -39,7 +39,7 @@ export function actionDownload(req, res, note) { res.send(body) } -export function actionInfo(req, res, note) { +export function actionInfo(req: Request, res: Response, note): void { const body = note.content const extracted = Note.extractMeta(body) const markdown = extracted.markdown @@ -66,7 +66,7 @@ export function actionInfo(req, res, note) { res.send(data) } -export function actionPDF(req, res, note) { +export function actionPDF(req: Request, res: Response, note): void { const url = config.serverURL || 'http://' + req.get('host') const body = note.content const extracted = Note.extractMeta(body) @@ -119,7 +119,7 @@ const outputFormats = { docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' } -export async function actionPandoc(req, res, note) { +export async function actionPandoc(req: Request, res: Response, note): Promise { // var url = config.serverURL || 'http://' + req.get('host') // var body = note.content // var extracted = Note.extractMeta(body) @@ -162,7 +162,7 @@ export async function actionPandoc(req, res, note) { // } } -export function actionGist(req, res, note) { +export function actionGist(req: Request, res: Response, note): void { const data = { client_id: config.github.clientID, redirect_uri: config.serverURL + '/auth/github/callback/' + Note.encodeNoteId(note.id) + '/gist', @@ -173,7 +173,7 @@ export function actionGist(req, res, note) { res.redirect('https://github.com/login/oauth/authorize?' + query) } -export function actionRevision(req, res, note) { +export function actionRevision(req: Request, res: Response, note): void { const actionId = req.params.actionId if (actionId) { const time = moment(parseInt(actionId)) diff --git a/package-lock.json b/package-lock.json index 790b5c6b3e..be9e337d64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1507,6 +1507,12 @@ "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==", "dev": true }, + "@types/markdown-pdf": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/markdown-pdf/-/markdown-pdf-9.0.0.tgz", + "integrity": "sha512-T/WQ6cRAhWaxcs1HHoqMYz7ZXcA/MMjR8RrX1SY6mpmc0n/CsGzy/hvffMLaiI0L+vxsvxNNC3rB59NqxrlL2w==", + "dev": true + }, "@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", diff --git a/package.json b/package.json index a0eab83ef2..a2f3003882 100644 --- a/package.json +++ b/package.json @@ -116,6 +116,7 @@ "@types/express-flash": "0.0.2", "@types/express-session": "^1.17.3", "@types/lodash": "^4.14.170", + "@types/markdown-pdf": "^9.0.0", "@types/mime-types": "^2.1.0", "@types/minio": "^7.0.7", "@types/node": "~12.20.15", From 534492e82bd3c163be5dc55bd50bb4d5cfcc55a5 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 05:11:54 +0800 Subject: [PATCH 139/167] lint: lib/note/index.ts - add typing annotate Signed-off-by: Raccoon --- lib/note/index.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/note/index.ts b/lib/note/index.ts index 5719b9071e..09b4b291da 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -1,3 +1,4 @@ +import {Request, Response} from "express"; import config from "../config"; import {logger} from "../logger"; @@ -63,7 +64,7 @@ async function createNote(userId, noteAlias) { } // controller -export async function showNote(req, res) { +export async function showNote(req: Request, res: Response): Promise { const noteId = req.params.noteId const userId = req.user ? req.user.id : null @@ -101,7 +102,7 @@ function canViewNote(note, isLogin, userId) { return true } -export async function showPublishNote(req, res) { +export async function showPublishNote(req: Request, res: Response): Promise { const shortid = req.params.shortid const note = await getNoteById(shortid, { @@ -155,7 +156,7 @@ export async function showPublishNote(req, res) { res.render('pretty.ejs', data) } -export async function noteActions(req, res) { +export async function noteActions(req: Request, res: Response): Promise { const noteId = req.params.noteId const note = await getNoteById(noteId) @@ -231,7 +232,7 @@ async function getMyNoteList(userId, callback) { } } -export function listMyNotes(req, res) { +export function listMyNotes(req: Request, res: Response): void { if (req.isAuthenticated()) { getMyNoteList(req.user.id, (err, myNoteList) => { if (err) return errorInternalError(req, res) @@ -245,7 +246,7 @@ export function listMyNotes(req, res) { } } -export const deleteNote = async (req, res) => { +export async function deleteNote(req: Request, res: Response): Promise { if (req.isAuthenticated()) { const noteId = await Note.parseNoteIdAsync(req.params.noteId) try { @@ -279,7 +280,7 @@ export const deleteNote = async (req, res) => { } } -export const updateNote = async (req, res) => { +export async function updateNote(req: Request, res: Response): Promise { if (req.isAuthenticated() || config.allowAnonymousEdits) { const noteId = await Note.parseNoteIdAsync(req.params.noteId) try { @@ -295,7 +296,8 @@ export const updateNote = async (req, res) => { if (realtime.isNoteExistsInPool(noteId)) { logger.error('Update note failed: There are online users opening this note.') - return res.status('403').json({status: 'error', message: 'Update API can only be used when no users is online'}) + res.status(403).json({status: 'error', message: 'Update API can only be used when no users is online'}) + return } const now = Date.now() From 0427b1ba744512a0aa285c52d13cf08d5ebaddfe Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:27:28 +0800 Subject: [PATCH 140/167] web/middleware/checkVersion.ts Signed-off-by: Raccoon --- lib/web/middleware/checkVersion.ts | 7 ++++--- typings/passport/index.d.ts | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/web/middleware/checkVersion.ts b/lib/web/middleware/checkVersion.ts index 72df085f53..38f55660b8 100644 --- a/lib/web/middleware/checkVersion.ts +++ b/lib/web/middleware/checkVersion.ts @@ -1,3 +1,4 @@ +import {Application, NextFunction, Request, Response} from "express"; import {promisify} from "util"; import request from "request"; @@ -15,7 +16,7 @@ const rp = promisify(request) /** * @param {Express.Application|Express.Request} ctx */ -export async function checkVersion(ctx) { +export async function checkVersion(ctx: Request | Application):Promise { if (lastCheckAt && (lastCheckAt + CHECK_TIMEOUT > Date.now())) { return } @@ -36,7 +37,7 @@ export async function checkVersion(ctx) { return } - const locals = ctx.locals ? ctx.locals : ctx.app.locals + const locals = ctx.locals ? ctx.locals : (ctx as Request).app.locals locals.versionInfo.latest = data.latest locals.versionInfo.versionItem = data.latest ? null : data.versionItem @@ -53,7 +54,7 @@ export async function checkVersion(ctx) { } } -export function versionCheckMiddleware(req, res, next) { +export function versionCheckMiddleware(req: Request, res: Response, next: NextFunction): void { checkVersion(req) .then(() => { next() diff --git a/typings/passport/index.d.ts b/typings/passport/index.d.ts index 46b256861a..65602c881f 100644 --- a/typings/passport/index.d.ts +++ b/typings/passport/index.d.ts @@ -2,4 +2,8 @@ declare namespace Express { export interface User { id?: string } + + export interface Request { + locals?: Record + } } From fc2658b5ce9b5b048640490b537a8fbf5a4cc7a6 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:27:42 +0800 Subject: [PATCH 141/167] lint: lib/utils.ts - add options.dialect in MySequelize type Signed-off-by: Raccoon --- lib/models/baseModel.ts | 8 ++++++-- lib/utils.ts | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/models/baseModel.ts b/lib/models/baseModel.ts index 332ea673f2..b28866d059 100644 --- a/lib/models/baseModel.ts +++ b/lib/models/baseModel.ts @@ -2,8 +2,12 @@ import {Moment} from "moment"; import {Sequelize, Model, ModelCtor} from "sequelize"; export type MySequelize = Sequelize & { - processData?: any - stripNullByte?: any + //data, _default, process + processData?: (data: string | [], _default: string | [], process?: (string) => string) => void + stripNullByte?: (string) => string + options?: { + dialect?: string + } & Record } export type BaseModel = { diff --git a/lib/utils.ts b/lib/utils.ts index c8f759a25a..6a0d6986da 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -4,8 +4,9 @@ import * as path from "path"; import mime from "mime-types"; import bodyParser from "body-parser"; +import {MySequelize} from "./models/baseModel"; -export function isSQLite(sequelize): boolean { +export function isSQLite(sequelize: MySequelize): boolean { return sequelize.options.dialect === 'sqlite' } From 2944da0415152e6d2c3a30a25f5def5d96a92a9e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:29:48 +0800 Subject: [PATCH 142/167] lint: lib/realtime/realtime.ts - add typing annotate - install @types/socket.io, @types/randomcolor, @types/passport.socketio Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 72 ++++++++++++++++++------------------ package-lock.json | 47 +++++++++++++++++++++++ package.json | 3 ++ typings/socket.io/index.d.ts | 18 +++++++++ 4 files changed, 105 insertions(+), 35 deletions(-) create mode 100644 typings/socket.io/index.d.ts diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index b58e95ce0d..2ef8544311 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -7,6 +7,7 @@ import randomcolor from "randomcolor"; import Chance from "chance"; import moment from "moment"; import {get} from "lodash"; +import SocketIO from "socket.io"; // core import config from "../config"; @@ -25,14 +26,14 @@ import {SaveRevisionJob} from "./realtimeSaveRevisionJob"; const chance = new Chance() -export let io = null +export let io: SocketIO.Server = null export let maintenance = true -export function setSocketIo(socketIO) { +export function setSocketIo(socketIO: SocketIO.Server): void { io = socketIO } -export function setMaintenance(isMaintenance) { +export function setMaintenance(isMaintenance: boolean): void { maintenance = isMaintenance } @@ -44,18 +45,18 @@ const cleanDanglingUserJob = new CleanDanglingUserJob(exports) export const saveRevisionJob = new SaveRevisionJob(exports) // TODO: test it -export function onAuthorizeSuccess(data, accept) { +export function onAuthorizeSuccess(data: Record, accept: (err?: Error | null, accepted?: boolean) => void): void { accept() } // TODO: test it -export function onAuthorizeFail(data, message, error, accept) { +export function onAuthorizeFail(data: Record, message: string, error: boolean, accept: (err?: Error | null, accepted?: boolean) => void): void { accept() // accept whether authorize or not to allow anonymous usage } // TODO: test it // secure the origin by the cookie -export function secure(socket, next) { +export function secure(socket: SocketIO.Socket, next: (err?: Error | null) => void): void { try { const handshakeData = socket.request if (handshakeData.headers.cookie) { @@ -101,7 +102,7 @@ export function getNotePool(): any { return notes } -export function isNoteExistsInPool(noteId) { +export function isNoteExistsInPool(noteId: string): boolean { return !!notes[noteId] } @@ -111,15 +112,15 @@ export function addNote(note) { return true } -export function getNotePoolSize() { +export function getNotePoolSize(): number { return Object.keys(notes).length } -export function deleteNoteFromPool(noteId) { +export function deleteNoteFromPool(noteId: string): void { delete notes[noteId] } -export function deleteAllNoteFromPool() { +export function deleteAllNoteFromPool(): void { Object.keys(notes).forEach(noteId => { delete notes[noteId] }) @@ -248,7 +249,7 @@ async function _updateNoteAsync(note) { // TODO: test it export function getStatus() { return Note.count() - .then(function (notecount) { + .then(function (notecount: number) { const distinctaddresses = [] const regaddresses = [] const distinctregaddresses = [] @@ -281,7 +282,7 @@ export function getStatus() { }) return User.count() - .then(function (regcount) { + .then(function (regcount: number) { return { onlineNotes: Object.keys(notes).length, onlineUsers: Object.keys(users).length, @@ -307,7 +308,7 @@ export function getStatus() { } // TODO: test it -export function isReady() { +export function isReady(): boolean { return io && Object.keys(notes).length === 0 && Object.keys(users).length === 0 && connectProcessQueue.queue.length === 0 && !connectProcessQueue.lock && @@ -329,8 +330,8 @@ function parseUrl(data) { return null } -export function extractNoteIdFromSocket(socket) { - function extractNoteIdFromReferer(referer) { +export function extractNoteIdFromSocket(socket: SocketIO.Socket): string | null | boolean { + function extractNoteIdFromReferer(referer: string): string | null | boolean { if (referer) { const hostUrl = parseUrl(referer) if (!hostUrl) { @@ -362,14 +363,14 @@ export function extractNoteIdFromSocket(socket) { return false } -export async function parseNoteIdFromSocketAsync(socket) { +export const parseNoteIdFromSocketAsync = async function (socket: SocketIO.Socket): Promise { const noteId = extractNoteIdFromSocket(socket) if (!noteId) { return null } return new Promise((resolve, reject) => { - Note.parseNoteId(noteId, function (err, id) { + Note.parseNoteId(noteId as string, function (err, id) { if (err) { reject(err) } @@ -382,7 +383,7 @@ export async function parseNoteIdFromSocketAsync(socket) { } // TODO: test it -export function emitOnlineUsers(socket) { +export function emitOnlineUsers(socket: SocketIO.Socket): void { const noteId = socket.noteId if (!noteId || !notes[noteId]) return const users = [] @@ -399,7 +400,7 @@ export function emitOnlineUsers(socket) { } // TODO: test it -export function emitUserStatus(socket) { +export function emitUserStatus(socket: SocketIO.Socket): void { const noteId = socket.noteId const user = users[socket.id] if (!noteId || !notes[noteId] || !user) return @@ -408,7 +409,7 @@ export function emitUserStatus(socket) { } // TODO: test it -export function emitRefresh(socket) { +export function emitRefresh(socket: SocketIO.Socket): void { const noteId = socket.noteId if (!noteId || !notes[noteId]) return const note = notes[noteId] @@ -447,7 +448,7 @@ export function checkViewPermission(req, note) { } // TODO: test it -async function fetchFullNoteAsync(noteId) { +async function fetchFullNoteAsync(noteId: string): Promise { return Note.findOne({ where: { id: noteId @@ -513,16 +514,17 @@ function makeNewServerNote(note) { } // TODO: test it -export function failConnection(code, err, socket) { +export function failConnection(code: number, err: string | Error, socket: SocketIO.Socket): void { logger.error(err) // emit error info socket.emit('info', { code: code }) - return socket.disconnect(true) + socket.disconnect(true) + return } -export function queueForDisconnect(socket) { +export function queueForDisconnect(socket: SocketIO.Socket): void { disconnectProcessQueue.push(socket.id, async function () { if (users[socket.id]) { delete users[socket.id] @@ -545,7 +547,7 @@ export function queueForDisconnect(socket) { // remove note in notes if no user inside if (Object.keys(note.users).length === 0) { if (note.server.isDirty) { - exports.updateNote(note, function (err, _note) { + exports.updateNote(note, function (err) { if (err) { logger.error('disconnect note failed: ' + err) return @@ -582,7 +584,7 @@ export function buildUserOutData(user) { } // TODO: test it -export function updateUserData(socket, user) { +export function updateUserData(socket: SocketIO.Socket, user): void { // retrieve user data from passport if (socket.request.user && socket.request.user.logged_in) { const profile = User.getProfile(socket.request.user) @@ -597,7 +599,7 @@ export function updateUserData(socket, user) { } } -function canEditNote(notePermission, noteOwnerId, currentUserId) { +function canEditNote(notePermission: string, noteOwnerId: string, currentUserId: string): boolean { switch (notePermission) { case 'freely': return true @@ -613,7 +615,7 @@ function canEditNote(notePermission, noteOwnerId, currentUserId) { } } -export function ifMayEdit(socket, callback) { +export function ifMayEdit(socket: SocketIO.Socket, callback: (canEdit: boolean) => void): void { const note = getNoteFromNotePool(socket.noteId) if (!note) return const mayEdit = canEditNote(note.permission, note.owner, socket.request.user.id) @@ -630,7 +632,7 @@ export function ifMayEdit(socket, callback) { } // TODO: test it -function operationCallback(socket, operation) { +function operationCallback(socket: SocketIO.Socket, operation: any) { const noteId = socket.noteId if (!noteId || !notes[noteId]) return const note = notes[noteId] @@ -651,7 +653,7 @@ function operationCallback(socket, operation) { userId: userId, color: user.color } - }).spread(function (author, created) { + }).spread(function (author) { if (author) { note.authors[author.userId] = { userid: author.userId, @@ -674,12 +676,12 @@ function operationCallback(socket, operation) { } // TODO: test it -export function updateHistory(userId, note, time?: any) { +export function updateHistory(userId: string, note, time?: number): void { const noteId = note.alias ? note.alias : Note.encodeNoteId(note.id) if (note.server) history.updateHistory(userId, noteId, note.server.document, time) } -function getUniqueColorPerNote(noteId, maxAttempt = 10) { +function getUniqueColorPerNote(noteId: string, maxAttempt = 10): string { // random color let color = randomcolor() if (!notes[noteId]) return color @@ -701,7 +703,7 @@ function getUniqueColorPerNote(noteId, maxAttempt = 10) { return color } -function queueForConnect(socket) { +function queueForConnect(socket: SocketIO.Socket) { connectProcessQueue.push(socket.id, async function () { try { const noteId = await exports.parseNoteIdFromSocketAsync(socket) as string @@ -800,13 +802,13 @@ function queueForConnect(socket) { }) } -export function connection(socket) { +export function connection(socket: SocketIO.Socket): void { if (maintenance) return queueForConnect(socket) } // TODO: test it -export function terminate() { +export function terminate(): void { disconnectProcessQueue.stop() connectProcessQueue.stop() updateDirtyNoteJob.stop() diff --git a/package-lock.json b/package-lock.json index be9e337d64..7a40b1ec95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1404,6 +1404,15 @@ "@types/d3-selection": "*" } }, + "@types/engine.io": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@types/engine.io/-/engine.io-3.1.5.tgz", + "integrity": "sha512-DLVpLEGTEZGBXOYoYoagHSxXkDHONc0fZouF2ayw7Q18aRu1Afwci+1CFKvPpouCUOVWP+dmCaAWpQjswe7kpg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/express": { "version": "4.17.9", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.9.tgz", @@ -1577,6 +1586,18 @@ "@types/passport": "*" } }, + "@types/passport.socketio": { + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/@types/passport.socketio/-/passport.socketio-3.7.5.tgz", + "integrity": "sha512-ldYKNCHsoqD8bjvnMNgmNszGmEvWML3RPy0CNW14BAhkf3d/xSbmhKqn3qaeRWFJ/BhOgs02HWtWW4O5d5SLUA==", + "dev": true, + "requires": { + "@types/express": "*", + "@types/express-session": "*", + "@types/passport": "*", + "@types/socket.io": "2.1.13" + } + }, "@types/q": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", @@ -1588,6 +1609,12 @@ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==" }, + "@types/randomcolor": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@types/randomcolor/-/randomcolor-0.5.5.tgz", + "integrity": "sha512-PywdYff3F8lGO3BggkCXaPFH0Ue/2Y7xliihoQNkxCGPJ4w7VTMfgcmSMIE6gOVAEu9Wx42JRSuRREVG3AUrtg==", + "dev": true + }, "@types/range-parser": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", @@ -1602,6 +1629,26 @@ "@types/node": "*" } }, + "@types/socket.io": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@types/socket.io/-/socket.io-2.1.13.tgz", + "integrity": "sha512-JRgH3nCgsWel4OPANkhH8TelpXvacAJ9VeryjuqCDiaVDMpLysd6sbt0dr6Z15pqH3p2YpOT3T1C5vQ+O/7uyg==", + "dev": true, + "requires": { + "@types/engine.io": "*", + "@types/node": "*", + "@types/socket.io-parser": "*" + } + }, + "@types/socket.io-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/socket.io-parser/-/socket.io-parser-3.0.0.tgz", + "integrity": "sha512-Ry/rbTE6HQNL9eu3LpL1Ocup5VexXu1bSSGlSho/IR5LuRc8YvxwSNJ3JxqTltVJEATLbZkMQETSbxfKNgp4Ew==", + "dev": true, + "requires": { + "socket.io-parser": "*" + } + }, "@types/validator": { "version": "13.1.4", "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.1.4.tgz", diff --git a/package.json b/package.json index a2f3003882..d042668432 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,10 @@ "@types/minio": "^7.0.7", "@types/node": "~12.20.15", "@types/passport-google-oauth20": "^2.0.8", + "@types/passport.socketio": "^3.7.5", "@types/qs": "^6.9.6", + "@types/randomcolor": "^0.5.5", + "@types/socket.io": "^2.1.13", "@types/validator": "^13.1.4", "@typescript-eslint/eslint-plugin": "^4.26.1", "@typescript-eslint/parser": "^4.26.1", diff --git a/typings/socket.io/index.d.ts b/typings/socket.io/index.d.ts new file mode 100644 index 0000000000..fb6ca268a9 --- /dev/null +++ b/typings/socket.io/index.d.ts @@ -0,0 +1,18 @@ +declare namespace SocketIO { + export interface Server { + set(key: string, val: any) + } + + export interface Handshake { + query: Record<"noteId" | string, string> + headers: { + referer?: string + } | any + } + + export interface Socket { + origin?: any + noteId?: string + } + +} From 7e963e71f7d48c032e176e96a510f74d6d1a006a Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:37:04 +0800 Subject: [PATCH 143/167] lint: lib/user/index.ts - add typing annotate Signed-off-by: Raccoon --- lib/user/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/user/index.ts b/lib/user/index.ts index af112b8284..3550e549e1 100644 --- a/lib/user/index.ts +++ b/lib/user/index.ts @@ -1,16 +1,18 @@ import archiver from 'archiver' import async from 'async' +import {Request, Response} from "express"; import * as response from '../response' import config from '../config' import {Note, User} from '../models' import {logger} from '../logger' import {generateAvatar} from '../letter-avatars' -export async function getMe(req, res) { +export async function getMe(req: Request, res: Response): Promise { if (!req.isAuthenticated()) { - return res.status(401).send({ + res.status(401).send({ status: 'forbidden' }) + return } const user = await User.findOne({ @@ -32,7 +34,7 @@ export async function getMe(req, res) { }) } -export async function deleteUser(req, res) { +export async function deleteUser(req: Request, res: Response): Promise { if (!req.isAuthenticated()) { return response.errorForbidden(req, res) } @@ -55,7 +57,7 @@ export async function deleteUser(req, res) { return res.redirect(config.serverURL + '/') } -export function exportMyData(req, res) { +export function exportMyData(req: Request, res: Response): void { if (!req.isAuthenticated()) { return response.errorForbidden(req, res) } @@ -114,7 +116,7 @@ export function exportMyData(req, res) { }) } -export function getMyAvatar(req, res) { +export function getMyAvatar(req: Request, res: Response): void { res.setHeader('Content-Type', 'image/svg+xml') res.setHeader('Cache-Control', 'public, max-age=86400') res.send(generateAvatar(req.params.username)) From a095cd34484b8e09e25ddbbdfbf2874129c28a80 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 16:38:18 +0800 Subject: [PATCH 144/167] lint: lib/realtime/realtimeClientConnection - add socket type - add user status and cursor data Signed-off-by: Raccoon --- lib/realtime/realtimeClientConnection.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index 39403c8587..7938b66af3 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -1,16 +1,24 @@ 'use strict' import {get} from "lodash"; +import {Socket} from "socket.io"; import config from "../config"; import {Note} from "../models"; import {logger} from "../logger"; +export type CursorData = Record + +export interface UserStatus { + type: string + idle: boolean +} + export class RealtimeClientConnection { - private socket: any; + private socket: Socket; private realtime: any; - constructor(socket) { + constructor(socket: Socket) { this.socket = socket this.realtime = require('./realtime') } @@ -87,7 +95,7 @@ export class RealtimeClientConnection { return this.realtime.getNoteFromNotePool(this.socket.noteId) } - getNoteChannel() { + getNoteChannel(): Socket { return this.socket.broadcast.to(this.socket.noteId) } @@ -139,7 +147,7 @@ export class RealtimeClientConnection { }) } - userStatusEventHandler(data) { + userStatusEventHandler(data: UserStatus): void { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() if (config.debug) { @@ -177,7 +185,7 @@ export class RealtimeClientConnection { }) } - cursorFocusEventHandler(data) { + cursorFocusEventHandler(data: CursorData): void { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() user.cursor = data @@ -185,7 +193,7 @@ export class RealtimeClientConnection { this.getNoteChannel().emit('cursor focus', out) } - cursorActivityEventHandler(data) { + cursorActivityEventHandler(data: CursorData): void { if (!this.isNoteAndUserExists()) return const user = this.getCurrentUser() user.cursor = data From ab2ed4ab656147cbdc6b8b98d7e329d45fd00f7e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 21:47:10 +0800 Subject: [PATCH 145/167] realtime RealtimeUserData Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 2ef8544311..ba6fe25c17 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -24,6 +24,22 @@ import {UpdateDirtyNoteJob} from "./realtimeUpdateDirtyNoteJob"; import {CleanDanglingUserJob} from "./realtimeCleanDanglingUserJob"; import {SaveRevisionJob} from "./realtimeSaveRevisionJob"; + +export interface RealtimeUserData { + id?: string + color?: string + address?: string + 'user-agent'?: string + photo?: string + + cursor?: any + login?: boolean + userid?: string + name?: string + + idle?: any + type?: any +} const chance = new Chance() export let io: SocketIO.Server = null @@ -95,8 +111,8 @@ export function emitCheck(note) { } // actions -export const users = {} export const notes = {} +export const users: Record = {} export function getNotePool(): any { return notes @@ -130,11 +146,11 @@ export function getNoteFromNotePool(noteId) { return notes[noteId] } -export function getUserPool() { +export function getUserPool(): Record { return users } -export function getUserFromUserPool(userId) { +export function getUserFromUserPool(userId: string): RealtimeUserData | null { return users[userId] } From dee7bf218803d3dec6822a575be5344abb906ad5 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sun, 13 Jun 2021 21:48:03 +0800 Subject: [PATCH 146/167] realtimeClientConnection.ts add RealtimeUserData type Signed-off-by: Raccoon --- lib/realtime/realtimeClientConnection.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index 7938b66af3..c1c9ddd82c 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -6,6 +6,7 @@ import {Socket} from "socket.io"; import config from "../config"; import {Note} from "../models"; import {logger} from "../logger"; +import {RealtimeUserData} from "./realtime"; export type CursorData = Record @@ -81,7 +82,7 @@ export class RealtimeClientConnection { return availablePermission } - getCurrentUser() { + getCurrentUser(): RealtimeUserData { if (!this.socket.id) return return this.realtime.getUserFromUserPool(this.socket.id) } From 13e64b0237fe65bea1b49c8a38fa6e1e4fdbcb87 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 06:18:39 +0800 Subject: [PATCH 147/167] lint: lib/realtime/realtime - add more typing annotate - add some references to models Signed-off-by: Raccoon --- lib/models/author.ts | 5 +- lib/models/note.ts | 2 + lib/realtime/realtime.ts | 101 +++++++++++++++++---- lib/realtime/realtimeClientConnection.ts | 4 +- lib/realtime/realtimeUpdateDirtyNoteJob.ts | 6 +- 5 files changed, 94 insertions(+), 24 deletions(-) diff --git a/lib/models/author.ts b/lib/models/author.ts index a882afbacd..54d1599267 100644 --- a/lib/models/author.ts +++ b/lib/models/author.ts @@ -1,12 +1,15 @@ // external modules import {Model, DataTypes} from "sequelize"; -import {MySequelize, AuthorAttributes, ModelObj} from "./baseModel"; +import {MySequelize, AuthorAttributes, ModelObj, UserModel} from "./baseModel"; export class Author extends Model implements AuthorAttributes { color: string; id: string; + userId?: string + user?: UserModel + static initialize(sequelize: MySequelize): void { Author.init( { diff --git a/lib/models/note.ts b/lib/models/note.ts index 6c7cea26f3..a236522e1d 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -47,6 +47,8 @@ export class Note extends Model implements NoteAttributes { ownerId: string + lastchangeuserId?: string + static initialize(sequelize: MySequelize): void { Note.init({ id: { diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index ba6fe25c17..c4ae966b55 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -14,12 +14,13 @@ import config from "../config"; import {logger} from "../logger"; import * as history from "../history"; import {Author, Note, User} from "../models"; +import {UserProfile} from "../models/baseModel"; // ot import ot from "ot"; import {ProcessQueue} from "./processQueue"; -import {RealtimeClientConnection} from "./realtimeClientConnection"; +import {CursorData, RealtimeClientConnection} from "./realtimeClientConnection"; import {UpdateDirtyNoteJob} from "./realtimeUpdateDirtyNoteJob"; import {CleanDanglingUserJob} from "./realtimeCleanDanglingUserJob"; import {SaveRevisionJob} from "./realtimeSaveRevisionJob"; @@ -40,6 +41,42 @@ export interface RealtimeUserData { idle?: any type?: any } + +interface RealtimeAuthorData { + userid: string + color: string + photo: string + name: string +} + +export interface RealtimeNoteData { + id: string, + alias?: string, + title?: string, + // owner id + owner?: string, + ownerprofile?: UserProfile + permission?: string + // last change user id + lastchangeuser?: string + lastchangeuserprofile?: UserProfile + + socks: SocketIO.Socket[] + users: Record + //??? + tempUsers: any + + createtime: number + updatetime: number + + // type: ot.EditorSocketIOServer + server: any + + authors: Record + authorship: string +} + + const chance = new Chance() export let io: SocketIO.Server = null @@ -98,7 +135,7 @@ export function secure(socket: SocketIO.Socket, next: (err?: Error | null) => vo // TODO: only use in `updateDirtyNote` // TODO: test it -export function emitCheck(note) { +export function emitCheck(note: RealtimeNoteData): void { const out = { title: note.title, updatetime: note.updatetime, @@ -111,10 +148,10 @@ export function emitCheck(note) { } // actions -export const notes = {} export const users: Record = {} +export const notes: Record = {} -export function getNotePool(): any { +export function getNotePool(): Record { return notes } @@ -122,7 +159,7 @@ export function isNoteExistsInPool(noteId: string): boolean { return !!notes[noteId] } -export function addNote(note) { +export function addNote(note: RealtimeNoteData): boolean { if (exports.isNoteExistsInPool(note.id)) return false notes[note.id] = note return true @@ -142,7 +179,7 @@ export function deleteAllNoteFromPool(): void { }) } -export function getNoteFromNotePool(noteId) { +export function getNoteFromNotePool(noteId: string): RealtimeNoteData | null { return notes[noteId] } @@ -159,7 +196,7 @@ updateDirtyNoteJob.start() cleanDanglingUserJob.start() saveRevisionJob.start() -export function disconnectSocketOnNote(note) { +export function disconnectSocketOnNote(note: RealtimeNoteData): void { note.socks.forEach((sock) => { if (sock) { sock.emit('delete') @@ -170,7 +207,7 @@ export function disconnectSocketOnNote(note) { }) } -export function updateNote(note, callback) { +export function updateNote(note: RealtimeNoteData, callback: (err: Error | null, note: Note) => void): void { _updateNoteAsync(note).then(_note => { callback(null, _note) }).catch((err) => { @@ -179,7 +216,7 @@ export function updateNote(note, callback) { }) } -function findNoteByIdAsync(id) { +function findNoteByIdAsync(id: string): Promise { return Note.findOne({ where: { id: id @@ -187,7 +224,7 @@ function findNoteByIdAsync(id) { }) } -function updateHistoryForEveryUserCollaborateNote(note) { +function updateHistoryForEveryUserCollaborateNote(note: RealtimeNoteData): void { // update history to every user in this note const tempUsers = Object.assign({}, note.tempUsers) note.tempUsers = {} @@ -197,7 +234,7 @@ function updateHistoryForEveryUserCollaborateNote(note) { }) } -async function getUserProfileByIdAsync(id) { +async function getUserProfileByIdAsync(id: string): Promise { const user = await User.findOne({ where: { id: id @@ -237,7 +274,7 @@ function buildNoteUpdateData(note) { } } -async function _updateNoteAsync(note) { +async function _updateNoteAsync(note: RealtimeNoteData) { let noteModel = await findNoteByIdAsync(note.id) if (!noteModel) return null @@ -247,7 +284,7 @@ async function _updateNoteAsync(note) { note.lastchangeuserprofile = await getLastChangeUserProfileAsync( note.lastchangeuser, noteModel.lastchangeuserId, - noteModel.lastchangeuserprofile + note.lastchangeuser ) } catch (err) { if (err instanceof UserNotFoundException) { @@ -262,8 +299,22 @@ async function _updateNoteAsync(note) { return noteModel } +interface StatusData { + onlineNotes: number + onlineUsers: number + distinctOnlineUsers: number + notesCount: number + registeredUsers: number + onlineRegisteredUsers: number + distinctOnlineRegisteredUsers: number + isConnectionBusy: boolean + connectionSocketQueueLength: number + isDisconnectBusy: boolean + disconnectSocketQueueLength: number +} + // TODO: test it -export function getStatus() { +export function getStatus(): Promise { return Note.count() .then(function (notecount: number) { const distinctaddresses = [] @@ -402,7 +453,7 @@ export const parseNoteIdFromSocketAsync = async function (socket: SocketIO.Socke export function emitOnlineUsers(socket: SocketIO.Socket): void { const noteId = socket.noteId if (!noteId || !notes[noteId]) return - const users = [] + const users: RealtimeClientUserData[] = [] Object.keys(notes[noteId].users).forEach(function (key) { const user = notes[noteId].users[key] if (user) { @@ -486,10 +537,10 @@ async function fetchFullNoteAsync(noteId: string): Promise { }) } -function buildAuthorProfilesFromNote(noteAuthors) { - const authors = {} +function buildAuthorProfilesFromNote(noteAuthors: Author[]): Record { + const authors: Record = {} noteAuthors.forEach((author) => { - const profile = User.getProfile(author.user) + const profile = User.getProfile(author.user as User) if (profile) { authors[author.userId] = { userid: author.userId, @@ -584,7 +635,19 @@ export function queueForDisconnect(socket: SocketIO.Socket): void { }) } -export function buildUserOutData(user) { +interface RealtimeClientUserData { + id?: string + login?: boolean + userid?: string + photo?: string + color?: string + cursor?: CursorData + name?: string + idle?: boolean + type?: string +} + +export function buildUserOutData(user: RealtimeUserData): RealtimeClientUserData { const out = { id: user.id, login: user.login, diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index c1c9ddd82c..78939522db 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -6,7 +6,7 @@ import {Socket} from "socket.io"; import config from "../config"; import {Note} from "../models"; import {logger} from "../logger"; -import {RealtimeUserData} from "./realtime"; +import {RealtimeNoteData, RealtimeUserData} from "./realtime"; export type CursorData = Record @@ -91,7 +91,7 @@ export class RealtimeClientConnection { return get(this.socket, 'request.user.id') } - getCurrentNote() { + getCurrentNote(): RealtimeNoteData { if (!this.socket.noteId) return return this.realtime.getNoteFromNotePool(this.socket.noteId) } diff --git a/lib/realtime/realtimeUpdateDirtyNoteJob.ts b/lib/realtime/realtimeUpdateDirtyNoteJob.ts index 17fc159abd..d37583a700 100644 --- a/lib/realtime/realtimeUpdateDirtyNoteJob.ts +++ b/lib/realtime/realtimeUpdateDirtyNoteJob.ts @@ -2,7 +2,9 @@ import moment from "moment"; import config from "../config"; import {logger} from "../logger"; +import {Note} from "../models"; import {JobWorker} from "./jobWorker"; +import {RealtimeNoteData} from "./realtime"; export class UpdateDirtyNoteJob implements JobWorker { private realtime: any; @@ -34,7 +36,7 @@ export class UpdateDirtyNoteJob implements JobWorker { }) } - async updateDirtyNote(note) { + async updateDirtyNote(note: RealtimeNoteData): Promise { const notes = this.realtime.getNotePool() if (!note.server.isDirty) return @@ -66,7 +68,7 @@ export class UpdateDirtyNoteJob implements JobWorker { } } - updateNoteAsync(note): Promise { + updateNoteAsync(note: RealtimeNoteData): Promise { return new Promise((resolve, reject) => { this.realtime.updateNote(note, (err, _note) => { if (err) { From 6d04d6003e136718e2ecf5e2719dad42db298e1d Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 06:33:49 +0800 Subject: [PATCH 148/167] add .eslintignore file Signed-off-by: Raccoon --- .eslintignore | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..004fb57ec9 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,7 @@ +/dist +/public +node_modules +/test +/*.js + +lib/migrations From 075a8f9bae8fe09a94f2e30087e778a52305bda1 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 06:36:59 +0800 Subject: [PATCH 149/167] lib/auth/oauth2/strategy.ts Signed-off-by: Raccoon --- lib/auth/oauth2/strategy.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/auth/oauth2/strategy.ts b/lib/auth/oauth2/strategy.ts index 0b801ec962..0cfabf5893 100644 --- a/lib/auth/oauth2/strategy.ts +++ b/lib/auth/oauth2/strategy.ts @@ -9,7 +9,10 @@ interface Oauth2Profile { photo: string } -export function parseProfile(data: Record): Oauth2Profile { +// eslint-disable-next-line +type ProfileData = Record | string + +export function parseProfile(data: ProfileData): Oauth2Profile { const username = extractProfileAttribute(data, config.oauth2.userProfileUsernameAttr) as string const displayName = extractProfileAttribute(data, config.oauth2.userProfileDisplayNameAttr) as string const email = extractProfileAttribute(data, config.oauth2.userProfileEmailAttr) as string @@ -28,7 +31,7 @@ export function parseProfile(data: Record): Oauth2Profile { } } -export function extractProfileAttribute(data: any, path: string): string | string[] | undefined { +export function extractProfileAttribute(data: ProfileData, path: string): string | string[] | undefined { if (!data) return undefined if (typeof path !== 'string') return undefined // can handle stuff like `attrs[0].name` @@ -44,7 +47,7 @@ export function extractProfileAttribute(data: any, path: string): string | strin } if (!data) return undefined } - return data + return data as string } interface OAuth2CustomStrategyOptions extends StrategyOptions { From 9ef827f7d79a7d2cf84bca72fa242b29b1957f10 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 07:13:13 +0800 Subject: [PATCH 150/167] lint: lib/note/noteActions.ts - reactive pandoc - add typing annotate Signed-off-by: Raccoon --- lib/note/index.ts | 18 ++++---- lib/note/noteActions.ts | 100 ++++++++++++++++++++-------------------- 2 files changed, 58 insertions(+), 60 deletions(-) diff --git a/lib/note/index.ts b/lib/note/index.ts index 09b4b291da..e8f1f922dd 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -1,28 +1,29 @@ import {Request, Response} from "express"; import config from "../config"; +import {historyDelete, updateHistory} from "../history"; import {logger} from "../logger"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import {Note, Revision, User} from "../models"; +import * as realtime from "../realtime/realtime"; + import {errorForbidden, errorInternalError, errorNotFound, newCheckViewPermission, responseCodiMD} from "../response"; -import {historyDelete, updateHistory} from "../history"; import {createNoteWithRevision} from "../services/note"; import { actionDownload, actionGist, - actionInfo, actionPandoc, + actionInfo, + actionPandoc, actionPDF, actionPublish, actionRevision, actionSlide } from "./noteActions"; -import * as realtime from "../realtime/realtime"; - -async function getNoteById(noteId, {includeUser} = {includeUser: false}) { +async function getNoteById(noteId, {includeUser} = {includeUser: false}): Promise { const id = await Note.parseNoteIdAsync(noteId) const includes = [] @@ -37,13 +38,12 @@ async function getNoteById(noteId, {includeUser} = {includeUser: false}) { }) } - const note = await Note.findOne({ + return Note.findOne({ where: { id: id }, include: includes - }) - return note + }); } async function createNote(userId, noteAlias) { @@ -92,7 +92,7 @@ export async function showNote(req: Request, res: Response): Promise { return responseCodiMD(res, note) } -function canViewNote(note, isLogin, userId) { +function canViewNote(note: Note, isLogin: boolean, userId: string | null): boolean { if (note.permission === 'private') { return note.ownerId === userId } diff --git a/lib/note/noteActions.ts b/lib/note/noteActions.ts index 5450001ad3..2d08f8ec1b 100644 --- a/lib/note/noteActions.ts +++ b/lib/note/noteActions.ts @@ -6,24 +6,22 @@ import markdownpdf from "markdown-pdf"; import shortId from "shortid"; import querystring from "querystring"; import moment from "moment"; -// const { Pandoc } = require('@hackmd/pandoc.js') +import {InputFormat, OutputFormat, Pandoc} from "@hackmd/pandoc.js"; import config from "../config"; import {logger} from "../logger"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore import {Note, Revision} from "../models"; import {errorInternalError, errorNotFound} from "../response"; -export function actionPublish(req: Request, res: Response, note): void { +export function actionPublish(req: Request, res: Response, note: Note): void { res.redirect(config.serverURL + '/s/' + (note.alias || note.shortid)) } -export function actionSlide(req: Request, res: Response, note): void { +export function actionSlide(req: Request, res: Response, note: Note): void { res.redirect(config.serverURL + '/p/' + (note.alias || note.shortid)) } -export function actionDownload(req: Request, res: Response, note): void { +export function actionDownload(req: Request, res: Response, note: Note): void { const body = note.content const title = Note.decodeTitle(note.title) const filename = encodeURIComponent(title) @@ -39,7 +37,7 @@ export function actionDownload(req: Request, res: Response, note): void { res.send(body) } -export function actionInfo(req: Request, res: Response, note): void { +export function actionInfo(req: Request, res: Response, note: Note): void { const body = note.content const extracted = Note.extractMeta(body) const markdown = extracted.markdown @@ -66,7 +64,7 @@ export function actionInfo(req: Request, res: Response, note): void { res.send(data) } -export function actionPDF(req: Request, res: Response, note): void { +export function actionPDF(req: Request, res: Response, note: Note): void { const url = config.serverURL || 'http://' + req.get('host') const body = note.content const extracted = Note.extractMeta(body) @@ -119,50 +117,50 @@ const outputFormats = { docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' } -export async function actionPandoc(req: Request, res: Response, note): Promise { -// var url = config.serverURL || 'http://' + req.get('host') -// var body = note.content -// var extracted = Note.extractMeta(body) -// var content = extracted.markdown -// var title = Note.decodeTitle(note.title) -// -// if (!fs.existsSync(config.tmpPath)) { -// fs.mkdirSync(config.tmpPath) -// } -// const pandoc = new Pandoc() -// -// var path = config.tmpPath + '/' + Date.now() -// content = content.replace(/\]\(\//g, '](' + url + '/') -// -// // TODO: check export type -// const { exportType } = req.query -// -// try { -// // TODO: timeout rejection -// -// await pandoc.convertToFile(content, 'markdown', exportType, path, [ -// '--metadata', `title=${title}` -// ]) -// -// var stream = fs.createReadStream(path) -// var filename = title -// // Be careful of special characters -// filename = encodeURIComponent(filename) -// // Ideally this should strip them -// res.setHeader('Content-disposition', `attachment; filename="${filename}.${exportType}"`) -// res.setHeader('Cache-Control', 'private') -// res.setHeader('Content-Type', `${outputFormats[exportType]}; charset=UTF-8`) -// res.setHeader('X-Robots-Tag', 'noindex, nofollow') // prevent crawling -// stream.pipe(res) -// } catch (err) { -// // TODO: handle error -// res.json({ -// message: err.message -// }) -// } +export async function actionPandoc(req: Request, res: Response, note: Note): Promise { + const url = config.serverURL || 'http://' + req.get('host') + const body = note.content + const extracted = Note.extractMeta(body) + let content = extracted.markdown + const title = Note.decodeTitle(note.title) + + if (!fs.existsSync(config.tmpPath)) { + fs.mkdirSync(config.tmpPath) + } + const pandoc = new Pandoc() + + const path = config.tmpPath + '/' + Date.now() + content = content.replace(/\]\(\//g, '](' + url + '/') + + // TODO: check export type + const exportType = req.query.exportType as string + + try { + // TODO: timeout rejection + + await pandoc.convertToFile(content, InputFormat.markdown, exportType as OutputFormat, path, [ + '--metadata', `title=${title}` + ]) + + const stream = fs.createReadStream(path) + let filename = title + // Be careful of special characters + filename = encodeURIComponent(filename) + // Ideally this should strip them + res.setHeader('Content-disposition', `attachment; filename="${filename}.${exportType}"`) + res.setHeader('Cache-Control', 'private') + res.setHeader('Content-Type', `${outputFormats[exportType]}; charset=UTF-8`) + res.setHeader('X-Robots-Tag', 'noindex, nofollow') // prevent crawling + stream.pipe(res) + } catch (err) { + // TODO: handle error + res.json({ + message: err.message + }) + } } -export function actionGist(req: Request, res: Response, note): void { +export function actionGist(req: Request, res: Response, note: Note): void { const data = { client_id: config.github.clientID, redirect_uri: config.serverURL + '/auth/github/callback/' + Note.encodeNoteId(note.id) + '/gist', @@ -173,7 +171,7 @@ export function actionGist(req: Request, res: Response, note): void { res.redirect('https://github.com/login/oauth/authorize?' + query) } -export function actionRevision(req: Request, res: Response, note): void { +export function actionRevision(req: Request, res: Response, note: Note): void { const actionId = req.params.actionId if (actionId) { const time = moment(parseInt(actionId)) From 3eca23810fe2fc736d69378c2c623e12ba4ce743 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 08:04:51 +0800 Subject: [PATCH 151/167] lint: lib/workers/dmpWorker.ts - add diff-match-patch typing - add typing annotate Signed-off-by: Raccoon --- lib/workers/dmpWorker.ts | 23 +++++--- tsconfig.json | 6 ++- typings/diff-match-patch/index.d.ts | 82 +++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 typings/diff-match-patch/index.d.ts diff --git a/lib/workers/dmpWorker.ts b/lib/workers/dmpWorker.ts index 982555bb3f..825a861617 100644 --- a/lib/workers/dmpWorker.ts +++ b/lib/workers/dmpWorker.ts @@ -4,6 +4,7 @@ import DiffMatchPatch from "@hackmd/diff-match-patch"; // core import config from "../config"; import {logger} from "../logger"; +import {Revision} from "../models"; const dmp = new DiffMatchPatch() process.on('message', function (data) { @@ -57,25 +58,31 @@ process.on('message', function (data) { return null }) -function createPatch(lastDoc, currDoc) { +function createPatch(lastDoc: string, currDoc: string): string { const msStart = (new Date()).getTime() const diff = dmp.diff_main(lastDoc, currDoc) - let patch = dmp.patch_make(lastDoc, diff) - patch = dmp.patch_toText(patch) + const patch = dmp.patch_make(lastDoc, diff) + const patchText = dmp.patch_toText(patch) const msEnd = (new Date()).getTime() if (config.debug) { - logger.info(patch) + logger.info(patchText) logger.info((msEnd - msStart) + 'ms') } - return patch + return patchText } -function getRevision(revisions, count) { +interface DiffRevision { + content: string, + patch: Patch[], + authorship: string +} + +function getRevision(revisions: Revision[], count: number): DiffRevision { const msStart = (new Date()).getTime() let startContent = null - let lastPatch = [] + let lastPatch = "" let applyPatches = [] - let authorship = [] + let authorship = "" if (count <= Math.round(revisions.length / 2)) { // start from top to target for (let i = 0; i < count; i++) { diff --git a/tsconfig.json b/tsconfig.json index 29e1f16ac8..e06f932af7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,16 @@ { "compileOnSave": true, "compilerOptions": { + "baseUrl": ".", "allowJs": false, "target": "ES2019", "outDir": "./dist/", "module": "CommonJS", "esModuleInterop": true, - "typeRoots": ["./typings", "./node_modules/@types"] + "typeRoots": ["./typings", "./node_modules/@types"], + "paths": { + "@hackmd/diff-match-patch": ["./typings/diff-match-patch/"] + } }, "include": [ "./lib/**/*" diff --git a/typings/diff-match-patch/index.d.ts b/typings/diff-match-patch/index.d.ts new file mode 100644 index 0000000000..7e6b541553 --- /dev/null +++ b/typings/diff-match-patch/index.d.ts @@ -0,0 +1,82 @@ +declare global { + module diffMatchPatch { + export const DIFF_DELETE = -1; + export const DIFF_INSERT = 1; + export const DIFF_EQUAL = 0; + } + + enum DiffType { + DIFF_DELETE = -1, + DIFF_INSERT = 1, + DIFF_EQUAL = 0 + } + + type Diff = { + [0]: DiffType + [1]: string + } + + interface Patch { + diffs: Diff[]; + + start1?: number + start2?: number + + length1: number + length2: number + + toString(): string + } + + class diffMatchPatch { + diff_main(text1: string, text2: string, opt_checklines?: boolean, + opt_deadline?: number): Diff[] + + diff_cleanupSemantic(diffs: Diff[]) + + diff_cleanupEfficiency(diffs: Diff[]) + + diff_cleanupSemanticLossless(diffs: Diff[]) + + diff_levenshtein(diffs: Diff[]): number + + diff_prettyHtml(diffs: Diff[]): string + + diff_xIndex(diffs: Diff[], loc: number): number + + diff_cleanupMerge(diffs: Diff[]) + + match_main(text: string, pattern: string, loc: number): number + + diff_fromDelta(text1: string, delta: string): Diff[] + + diff_toDelta(diffs: Diff[]): string + + diff_levenshtein(diffs: Diff[]): number + + diff_text1(diffs: Diff[]): string + + diff_text2(diffs: Diff[]): string + + patch_make(a: string, opt_b: string): Patch[] + patch_make(a: Diff[]): Patch[] + patch_make(a: string, opt_b: Diff[]): Patch[] + patch_make(a: string, opt_b: string, opt_c: Diff[]): Patch[] + + patch_splitMax(patches: Patch[]) + + patch_addPadding(patches: Patch[]): string + + patch_deepCopy(patches: Patch[]): Patch[] + + patch_toText(patches: Patch[]): string + + patch_fromText(textline: string): Patch[] + + patch_apply(patches: Patch[], text: string): { + [0]: string + [1]: boolean[] + } + } +} +export = diffMatchPatch From c7b03623a9a7bc6ac8d62fde36128ac1d2ddc6a1 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 08:20:10 +0800 Subject: [PATCH 152/167] lint: lib/models/note.ts - add Authorship type Signed-off-by: Raccoon --- lib/models/baseModel.ts | 10 +++++++++- lib/models/note.ts | 32 ++++++++++++++++++-------------- lib/realtime/realtime.ts | 4 ++-- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/models/baseModel.ts b/lib/models/baseModel.ts index b28866d059..cd3223fb80 100644 --- a/lib/models/baseModel.ts +++ b/lib/models/baseModel.ts @@ -33,6 +33,14 @@ export interface AuthorAttributes { color: string } +export interface Authorship { + [0]: string // userId + [1]: number // startPos + [2]: number // endPos + [3]: number // createdAt + [4]: number // updatedAt +} + export interface NoteAttributes { id?: string shortid?: string @@ -41,7 +49,7 @@ export interface NoteAttributes { viewcount?: number title?: string content?: string - authorship?: string + authorship?: Authorship[] lastchangeAt?: Date | Moment savedAt?: Date diff --git a/lib/models/note.ts b/lib/models/note.ts index a236522e1d..c78307deef 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -20,7 +20,7 @@ import config from "../config"; import {logger} from "../logger"; import {createNoteWithRevision, syncNote} from "../services/note"; import {stripTags} from "../string"; -import {ModelObj, MySequelize, NoteAttributes, NoteMeta} from "./baseModel"; +import {Authorship, ModelObj, MySequelize, NoteAttributes, NoteMeta} from "./baseModel"; const md = markdownIt() export const dmp = new DiffMatchPatch() @@ -34,7 +34,7 @@ interface ParsedMeta { export class Note extends Model implements NoteAttributes { alias: string; - authorship: string; + authorship: Authorship[]; content: string; id: string; lastchangeAt: Date | Moment; @@ -96,9 +96,13 @@ export class Note extends Model implements NoteAttributes { authorship: { type: DataTypes.TEXT({length: 'long'}), get: function () { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore return sequelize.processData(this.getDataValue('authorship'), [], JSON.parse) }, set: function (value) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore this.setDataValue('authorship', JSON.stringify(value)) } }, @@ -459,16 +463,16 @@ export class Note extends Model implements NoteAttributes { return _meta } - static updateAuthorshipByOperation(operation: any, userId: string, authorships: any): any { + static updateAuthorshipByOperation(operation: (string|number)[], userId: string, authorships: Authorship[]): Authorship[] { let index = 0 const timestamp = Date.now() for (let i = 0; i < operation.length; i++) { const op = operation[i] if (ot.TextOperation.isRetain(op)) { - index += op + index += op as number } else if (ot.TextOperation.isInsert(op)) { const opStart = index - const opEnd = index + op.length + const opEnd = index + (op as string).length let inserted = false // authorship format: [userId, startPos, endPos, createdAt, updatedAt] if (authorships.length <= 0) authorships.push([userId, opStart, opEnd, timestamp, timestamp]) @@ -499,15 +503,15 @@ export class Note extends Model implements NoteAttributes { } } if (authorship[1] >= opStart) { - authorship[1] += op.length - authorship[2] += op.length + authorship[1] += (op as string).length + authorship[2] += (op as string).length } } } - index += op.length + index += (op as string).length } else if (ot.TextOperation.isDelete(op)) { const opStart = index - const opEnd = index - op + const opEnd = index - (op as number) if (operation.length === 1) { authorships = [] } else if (authorships.length > 0) { @@ -517,7 +521,7 @@ export class Note extends Model implements NoteAttributes { authorships.splice(j, 1) j -= 1 } else if (authorship[1] < opStart && authorship[1] < opEnd && authorship[2] > opStart && authorship[2] > opEnd) { - authorship[2] += op + authorship[2] += op as number authorship[4] = timestamp } else if (authorship[2] >= opStart && authorship[2] <= opEnd) { authorship[2] = opStart @@ -527,12 +531,12 @@ export class Note extends Model implements NoteAttributes { authorship[4] = timestamp } if (authorship[1] >= opEnd) { - authorship[1] += op - authorship[2] += op + authorship[1] += op as number + authorship[2] += op as number } } } - index += op + index += (op as number) } } // merge @@ -561,7 +565,7 @@ export class Note extends Model implements NoteAttributes { return authorships } - static transformPatchToOperations(patch: any, contentLength: number) { + static transformPatchToOperations(patch: Patch[], contentLength: number): (number | string)[][] { const operations = [] if (patch.length > 0) { // calculate original content length diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index c4ae966b55..928f79c013 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -14,7 +14,7 @@ import config from "../config"; import {logger} from "../logger"; import * as history from "../history"; import {Author, Note, User} from "../models"; -import {UserProfile} from "../models/baseModel"; +import {Authorship, UserProfile} from "../models/baseModel"; // ot import ot from "ot"; @@ -73,7 +73,7 @@ export interface RealtimeNoteData { server: any authors: Record - authorship: string + authorship: Authorship[] } From 73e322fa5e8352010681894d3f9f753253806c40 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 08:27:19 +0800 Subject: [PATCH 153/167] lint: lib/models/note.ts - add cursor and user stats type lint: lib/models/note.ts - add missing relation fields Signed-off-by: Raccoon --- lib/models/note.ts | 4 +++- lib/note/index.ts | 4 ++-- lib/realtime/realtime.ts | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/models/note.ts b/lib/models/note.ts index c78307deef..f3741140d2 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -20,7 +20,7 @@ import config from "../config"; import {logger} from "../logger"; import {createNoteWithRevision, syncNote} from "../services/note"; import {stripTags} from "../string"; -import {Authorship, ModelObj, MySequelize, NoteAttributes, NoteMeta} from "./baseModel"; +import {Authorship, ModelObj, MySequelize, NoteAttributes, NoteMeta, UserModel} from "./baseModel"; const md = markdownIt() export const dmp = new DiffMatchPatch() @@ -48,6 +48,8 @@ export class Note extends Model implements NoteAttributes { ownerId: string lastchangeuserId?: string + owner?: UserModel; + lastchangeuser?: UserModel; static initialize(sequelize: MySequelize): void { Note.init({ diff --git a/lib/note/index.ts b/lib/note/index.ts index e8f1f922dd..520bb6ceb4 100644 --- a/lib/note/index.ts +++ b/lib/note/index.ts @@ -140,9 +140,9 @@ export async function showPublishNote(req: Request, res: Response): Promise Date: Mon, 14 Jun 2021 08:34:56 +0800 Subject: [PATCH 154/167] fix: cursor data and user status Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 15 ++++++++------- lib/realtime/realtimeClientConnection.ts | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 51c2d619b1..b32fc0eab9 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -33,7 +33,7 @@ export interface RealtimeUserData { 'user-agent'?: string photo?: string - cursor?: {line: number, ch: number} + cursor?: CursorData login?: boolean userid?: string name?: string @@ -65,7 +65,7 @@ export interface RealtimeNoteData { socks: SocketIO.Socket[] users: Record //??? - tempUsers: any + tempUsers: Record createtime: number updatetime: number @@ -497,7 +497,7 @@ export function emitRefresh(socket: SocketIO.Socket): void { socket.emit('refresh', out) } -export function checkViewPermission(req, note) { +export function checkViewPermission(req, note: RealtimeNoteData) { if (note.permission === 'private') { if (req.user && req.user.logged_in && req.user.id === note.owner) { return true @@ -644,8 +644,9 @@ interface RealtimeClientUserData { color?: string cursor?: CursorData name?: string - idle?: boolean - type?: string + + idle: boolean + type: 'xs' | 'sm' | 'md' | 'lg' } export function buildUserOutData(user: RealtimeUserData): RealtimeClientUserData { @@ -664,7 +665,7 @@ export function buildUserOutData(user: RealtimeUserData): RealtimeClientUserData } // TODO: test it -export function updateUserData(socket: SocketIO.Socket, user): void { +export function updateUserData(socket: SocketIO.Socket, user: RealtimeUserData): void { // retrieve user data from passport if (socket.request.user && socket.request.user.logged_in) { const profile = User.getProfile(socket.request.user) @@ -756,7 +757,7 @@ function operationCallback(socket: SocketIO.Socket, operation: any) { } // TODO: test it -export function updateHistory(userId: string, note, time?: number): void { +export function updateHistory(userId: string, note: RealtimeNoteData, time?: number): void { const noteId = note.alias ? note.alias : Note.encodeNoteId(note.id) if (note.server) history.updateHistory(userId, noteId, note.server.document, time) } diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index 78939522db..f4414abbb5 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -8,11 +8,11 @@ import {Note} from "../models"; import {logger} from "../logger"; import {RealtimeNoteData, RealtimeUserData} from "./realtime"; -export type CursorData = Record +export type CursorData = {line: number, ch: number} export interface UserStatus { - type: string idle: boolean + type: 'xs' | 'sm' | 'md' | 'lg' } export class RealtimeClientConnection { From 1f26f6af8ea5afb7f07a93e4dd3404ad3741b4bf Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 09:02:02 +0800 Subject: [PATCH 155/167] fix: process queue default value not accept Signed-off-by: Raccoon --- lib/realtime/processQueue.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/realtime/processQueue.ts b/lib/realtime/processQueue.ts index 7438deacc6..df1e697660 100644 --- a/lib/realtime/processQueue.ts +++ b/lib/realtime/processQueue.ts @@ -46,13 +46,13 @@ export class ProcessQueue extends EventEmitter implements JobWorker { private eventTrigger: NodeJS.Timeout; constructor({ - maximumLength, - triggerTimeInterval, + maximumLength = 500, + triggerTimeInterval = 5000, // execute on push - proactiveMode, + proactiveMode = true, // execute next work on finish - continuousMode - } = defaultOptions) { + continuousMode = true + }: ProcessQueueOptions = {}) { super() this.max = maximumLength this.triggerTime = triggerTimeInterval From 3bfbcb237da3a8e475fb14a04c3ea4996da268b2 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 19:18:42 +0800 Subject: [PATCH 156/167] refactor: simplefy processQueue.ts Signed-off-by: Raccoon --- lib/realtime/processQueue.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lib/realtime/processQueue.ts b/lib/realtime/processQueue.ts index df1e697660..a9b12aebcb 100644 --- a/lib/realtime/processQueue.ts +++ b/lib/realtime/processQueue.ts @@ -20,23 +20,6 @@ interface Task { processingFunc: TaskFunc } - -export interface ProcessQueueOptions { - maximumLength?: number - triggerTimeInterval?: number - proactiveMode?: boolean - continuousMode?: boolean -} - -const defaultOptions: ProcessQueueOptions = { - maximumLength: 500, - triggerTimeInterval: 5000, - // execute on push - proactiveMode: true, - // execute next work on finish - continuousMode: true -} - export class ProcessQueue extends EventEmitter implements JobWorker { private readonly max: number; private readonly triggerTime: number; @@ -52,7 +35,7 @@ export class ProcessQueue extends EventEmitter implements JobWorker { proactiveMode = true, // execute next work on finish continuousMode = true - }: ProcessQueueOptions = {}) { + } = {}) { super() this.max = maximumLength this.triggerTime = triggerTimeInterval @@ -140,4 +123,3 @@ export class ProcessQueue extends EventEmitter implements JobWorker { } } } - From 3c370fea3e55649c17b2f3df78dc713a01218d91 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 19:20:05 +0800 Subject: [PATCH 157/167] chore: add strictBindCallApply, preserveConstEnums, noImplicitThis, strictFunctionTypes Signed-off-by: Raccoon --- tsconfig.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index e06f932af7..bbc91998dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,14 @@ "outDir": "./dist/", "module": "CommonJS", "esModuleInterop": true, + + // strict check + "strictBindCallApply": true, + "preserveConstEnums": true, + "downlevelIteration": false, + "noImplicitThis": true, + "strictFunctionTypes": true, + "typeRoots": ["./typings", "./node_modules/@types"], "paths": { "@hackmd/diff-match-patch": ["./typings/diff-match-patch/"] From d656d6363d0ceeb3e4f2c80b14727f45f655ba54 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 19:41:45 +0800 Subject: [PATCH 158/167] lint: lib/realtime - add RealtimeModule type Signed-off-by: Raccoon --- lib/realtime/realtime-types.ts | 39 ++++++++++++++++++++ lib/realtime/realtime.ts | 4 +- lib/realtime/realtimeCleanDanglingUserJob.ts | 7 ++-- lib/realtime/realtimeClientConnection.ts | 5 ++- lib/realtime/realtimeSaveRevisionJob.ts | 5 ++- lib/realtime/realtimeUpdateDirtyNoteJob.ts | 5 ++- 6 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 lib/realtime/realtime-types.ts diff --git a/lib/realtime/realtime-types.ts b/lib/realtime/realtime-types.ts new file mode 100644 index 0000000000..89a52f055e --- /dev/null +++ b/lib/realtime/realtime-types.ts @@ -0,0 +1,39 @@ +import SocketIO from "socket.io"; +import {Note} from "../models"; +import {ProcessQueue} from "./processQueue"; +import {RealtimeClientUserData, RealtimeNoteData, RealtimeUserData} from "./realtime"; + +export interface RealtimeModule { + disconnectProcessQueue: ProcessQueue + + queueForDisconnect(socket: SocketIO.Socket): void + + disconnectSocketOnNote(note: RealtimeNoteData): void + + getNotePool(): Record + + getUserPool(): Record + + getUserFromUserPool(userId: string): RealtimeUserData | null + + getNoteFromNotePool(noteId: string): RealtimeNoteData | null + + checkViewPermission(req, note: RealtimeNoteData): boolean + + emitRefresh(socket: SocketIO.Socket): void + + emitUserStatus(socket: SocketIO.Socket): void + + updateUserData(socket: SocketIO.Socket, user: RealtimeUserData): void + + emitOnlineUsers(socket: SocketIO.Socket): void + + buildUserOutData(user: RealtimeUserData): RealtimeClientUserData + + emitCheck(note: RealtimeNoteData): void + + updateNote(note: RealtimeNoteData, callback: (err: Error | null, note: Note) => void): void + + io: SocketIO.Server +} + diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index b32fc0eab9..0ca01e51d7 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -497,7 +497,7 @@ export function emitRefresh(socket: SocketIO.Socket): void { socket.emit('refresh', out) } -export function checkViewPermission(req, note: RealtimeNoteData) { +export function checkViewPermission(req, note: RealtimeNoteData): boolean { if (note.permission === 'private') { if (req.user && req.user.logged_in && req.user.id === note.owner) { return true @@ -636,7 +636,7 @@ export function queueForDisconnect(socket: SocketIO.Socket): void { }) } -interface RealtimeClientUserData { +export interface RealtimeClientUserData { id?: string login?: boolean userid?: string diff --git a/lib/realtime/realtimeCleanDanglingUserJob.ts b/lib/realtime/realtimeCleanDanglingUserJob.ts index 7c97a7ad05..ca88b65f20 100644 --- a/lib/realtime/realtimeCleanDanglingUserJob.ts +++ b/lib/realtime/realtimeCleanDanglingUserJob.ts @@ -5,15 +5,16 @@ import async from "async"; import config from "../config"; import {logger} from "../logger"; import {JobWorker} from "./jobWorker"; +import {RealtimeModule} from "./realtime-types"; /** * clean when user not in any rooms or user not in connected list */ export class CleanDanglingUserJob implements JobWorker { - private realtime: any; + private realtime: RealtimeModule; private timer: NodeJS.Timeout; - constructor(realtime: any) { + constructor(realtime: RealtimeModule) { this.realtime = realtime } @@ -33,7 +34,7 @@ export class CleanDanglingUserJob implements JobWorker { async.each(Object.keys(users), (key, callback) => { const socket = this.realtime.io.sockets.connected[key] if ((!socket && users[key]) || - (socket && (!socket.rooms || socket.rooms.length <= 0))) { + (socket && (!socket.rooms || Object.keys(socket.rooms).length <= 0))) { if (config.debug) { logger.info('cleaner found redundant user: ' + key) } diff --git a/lib/realtime/realtimeClientConnection.ts b/lib/realtime/realtimeClientConnection.ts index f4414abbb5..e4af3480f4 100644 --- a/lib/realtime/realtimeClientConnection.ts +++ b/lib/realtime/realtimeClientConnection.ts @@ -7,6 +7,7 @@ import config from "../config"; import {Note} from "../models"; import {logger} from "../logger"; import {RealtimeNoteData, RealtimeUserData} from "./realtime"; +import {RealtimeModule} from "./realtime-types"; export type CursorData = {line: number, ch: number} @@ -17,7 +18,7 @@ export interface UserStatus { export class RealtimeClientConnection { private socket: Socket; - private realtime: any; + private realtime: RealtimeModule; constructor(socket: Socket) { this.socket = socket @@ -56,7 +57,7 @@ export class RealtimeClientConnection { isNoteAndUserExists(): boolean { const note = this.realtime.getNoteFromNotePool(this.socket.noteId) const user = this.realtime.getUserFromUserPool(this.socket.id) - return note && user + return !!(note && user) } isNoteOwner(): boolean { diff --git a/lib/realtime/realtimeSaveRevisionJob.ts b/lib/realtime/realtimeSaveRevisionJob.ts index 6fce4e9f34..ea7e5ad940 100644 --- a/lib/realtime/realtimeSaveRevisionJob.ts +++ b/lib/realtime/realtimeSaveRevisionJob.ts @@ -3,16 +3,17 @@ import {logger} from "../logger"; import {saveAllNotesRevision} from "../services/note"; import {JobWorker} from "./jobWorker"; +import {RealtimeModule} from "./realtime-types"; /** * clean when user not in any rooms or user not in connected list */ export class SaveRevisionJob implements JobWorker { - private realtime: any; + private realtime: RealtimeModule; private saverSleep: boolean; private timer: NodeJS.Timeout; - constructor(realtime: any) { + constructor(realtime: RealtimeModule) { this.realtime = realtime this.saverSleep = false } diff --git a/lib/realtime/realtimeUpdateDirtyNoteJob.ts b/lib/realtime/realtimeUpdateDirtyNoteJob.ts index d37583a700..787170b270 100644 --- a/lib/realtime/realtimeUpdateDirtyNoteJob.ts +++ b/lib/realtime/realtimeUpdateDirtyNoteJob.ts @@ -5,12 +5,13 @@ import {logger} from "../logger"; import {Note} from "../models"; import {JobWorker} from "./jobWorker"; import {RealtimeNoteData} from "./realtime"; +import {RealtimeModule} from "./realtime-types"; export class UpdateDirtyNoteJob implements JobWorker { - private realtime: any; + private realtime: RealtimeModule; private timer: NodeJS.Timeout; - constructor(realtime: any) { + constructor(realtime: RealtimeModule) { this.realtime = realtime } From 847acda4dec07ee987224a0be908619cc3d6a63e Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 20:04:01 +0800 Subject: [PATCH 159/167] lint: lib/realtime/realtime.ts - add socker.request Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 3 ++- typings/socket.io/index.d.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 0ca01e51d7..112035f7d9 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -24,6 +24,7 @@ import {CursorData, RealtimeClientConnection} from "./realtimeClientConnection"; import {UpdateDirtyNoteJob} from "./realtimeUpdateDirtyNoteJob"; import {CleanDanglingUserJob} from "./realtimeCleanDanglingUserJob"; import {SaveRevisionJob} from "./realtimeSaveRevisionJob"; +import SocketRequest = SocketIO.SocketRequest; export interface RealtimeUserData { @@ -497,7 +498,7 @@ export function emitRefresh(socket: SocketIO.Socket): void { socket.emit('refresh', out) } -export function checkViewPermission(req, note: RealtimeNoteData): boolean { +export function checkViewPermission(req: SocketRequest, note: RealtimeNoteData): boolean { if (note.permission === 'private') { if (req.user && req.user.logged_in && req.user.id === note.owner) { return true diff --git a/typings/socket.io/index.d.ts b/typings/socket.io/index.d.ts index fb6ca268a9..4e2cb1441e 100644 --- a/typings/socket.io/index.d.ts +++ b/typings/socket.io/index.d.ts @@ -10,9 +10,17 @@ declare namespace SocketIO { } | any } + export interface SocketRequest { + user?: { + logged_in: boolean + id: string + } + } + export interface Socket { origin?: any noteId?: string + request: SocketRequest | any } } From f35d68409d15a276656f0ba2d386f835baf9674d Mon Sep 17 00:00:00 2001 From: Raccoon Date: Mon, 14 Jun 2021 20:04:22 +0800 Subject: [PATCH 160/167] lint: lib/realtime/realtime.ts - add ot typing Signed-off-by: Raccoon --- lib/realtime/realtime.ts | 4 +-- tsconfig.json | 3 +- typings/ot/index.d.ts | 62 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 typings/ot/index.d.ts diff --git a/lib/realtime/realtime.ts b/lib/realtime/realtime.ts index 112035f7d9..9f8948c42e 100644 --- a/lib/realtime/realtime.ts +++ b/lib/realtime/realtime.ts @@ -72,7 +72,7 @@ export interface RealtimeNoteData { updatetime: number // type: ot.EditorSocketIOServer - server: any + server: ot.EditorSocketIOServer authors: Record authorship: Authorship[] @@ -714,7 +714,7 @@ export function ifMayEdit(socket: SocketIO.Socket, callback: (canEdit: boolean) } // TODO: test it -function operationCallback(socket: SocketIO.Socket, operation: any) { +function operationCallback(socket: SocketIO.Socket, operation: ot.Operation[]) { const noteId = socket.noteId if (!noteId || !notes[noteId]) return const note = notes[noteId] diff --git a/tsconfig.json b/tsconfig.json index bbc91998dc..85772bade4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,8 @@ "typeRoots": ["./typings", "./node_modules/@types"], "paths": { - "@hackmd/diff-match-patch": ["./typings/diff-match-patch/"] + "@hackmd/diff-match-patch": ["./typings/diff-match-patch/"], + "ot": ["./typings/ot/"] } }, "include": [ diff --git a/typings/ot/index.d.ts b/typings/ot/index.d.ts new file mode 100644 index 0000000000..e86de954d3 --- /dev/null +++ b/typings/ot/index.d.ts @@ -0,0 +1,62 @@ +import SocketIO from "socket.io"; +import EventEmitter from "events"; + +declare module 'ot' { + + export const version: number + + export type Operation = number | string + + export class TextOperation { + static isRetain(op: Operation): boolean + + static isInsert(op: Operation): boolean + + static isDelete(op: Operation): boolean + } + + export class EditorSocketIOServer extends EventEmitter { + + public isDirty: boolean + public document: string + public debug: boolean + public operations: Operation[] + + constructor( + document: string, + operations: Operation[], + docId: string, + mayWrite: ( + socket: SocketIO.Socket, + callback: (canEdit: boolean) => void) => void, + operationCallback: ( + socket: SocketIO.Socket, + operation: Operation[]) => void, + operationEventCallback?: any) + + setLogger(logger): void + + debugLog(mes: string): void + + setDocumentMaxLength(number): void + + addClient(socket: SocketIO.Socket): void + + onOperation(socket: SocketIO.Server, revision, operation, selection) + + onGetOperations(socket, base, head) + + updateSelection(socket, selection) + + setName(socket, name) + + setColor(socket, color) + + getClient(clientId) + + onDisconnect(socket) + } + +} + + From d2eed8286078aae61ea452bd3e73c1e35e20a4e8 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 31 Jul 2021 07:38:22 +0800 Subject: [PATCH 161/167] upgrade to webpack 5 --- package-lock.json | 6201 +++++++++++++++-------------------------- package.json | 23 +- webpack.common.js | 163 +- webpack.dev.js | 6 +- webpack.htmlexport.js | 9 + webpack.prod.js | 11 +- 6 files changed, 2400 insertions(+), 4013 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a40b1ec95..0705075362 100644 --- a/package-lock.json +++ b/package-lock.json @@ -801,6 +801,12 @@ "kuler": "^2.0.0" } }, + "@discoveryjs/json-ext": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", + "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==", + "dev": true + }, "@eslint/eslintrc": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", @@ -1088,6 +1094,12 @@ "unified": "^6.1.6" } }, + "@trysound/sax": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.1.1.tgz", + "integrity": "sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==", + "dev": true + }, "@types/accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", @@ -1413,6 +1425,32 @@ "@types/node": "*" } }, + "@types/eslint": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "dev": true + }, "@types/express": { "version": "4.17.9", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.9.tgz", @@ -1464,6 +1502,12 @@ "integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ==", "dev": true }, + "@types/html-minifier-terser": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz", + "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==", + "dev": true + }, "@types/http-assert": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz", @@ -1598,12 +1642,6 @@ "@types/socket.io": "2.1.13" } }, - "@types/q": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", - "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", - "dev": true - }, "@types/qs": { "version": "6.9.6", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", @@ -1904,181 +1942,172 @@ } }, "@webassemblyjs/ast": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", - "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "dev": true, "requires": { - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5" + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" } }, "@webassemblyjs/floating-point-hex-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", - "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", "dev": true }, "@webassemblyjs/helper-api-error": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", - "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", "dev": true }, "@webassemblyjs/helper-buffer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", - "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", - "dev": true - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", - "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", - "dev": true, - "requires": { - "@webassemblyjs/wast-printer": "1.8.5" - } - }, - "@webassemblyjs/helper-fsm": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", - "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", "dev": true }, - "@webassemblyjs/helper-module-context": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", - "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", + "@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "mamacro": "^0.0.3" + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" } }, "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", - "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", "dev": true }, "@webassemblyjs/helper-wasm-section": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", - "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" } }, "@webassemblyjs/ieee754": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", - "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", "dev": true, "requires": { "@xtuc/ieee754": "^1.2.0" } }, "@webassemblyjs/leb128": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", - "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", "dev": true, "requires": { "@xtuc/long": "4.2.2" } }, "@webassemblyjs/utf8": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", - "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", "dev": true }, "@webassemblyjs/wasm-edit": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", - "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/helper-wasm-section": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-opt": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "@webassemblyjs/wast-printer": "1.8.5" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" } }, "@webassemblyjs/wasm-gen": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", - "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, "@webassemblyjs/wasm-opt": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", - "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" } }, "@webassemblyjs/wasm-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", - "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, - "@webassemblyjs/wast-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", - "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", + "@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/floating-point-hex-parser": "1.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-code-frame": "1.8.5", - "@webassemblyjs/helper-fsm": "1.8.5", + "@webassemblyjs/ast": "1.11.1", "@xtuc/long": "4.2.2" } }, - "@webassemblyjs/wast-printer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", - "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", + "@webpack-cli/configtest": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.4.tgz", + "integrity": "sha512-cs3XLy+UcxiP6bj0A6u7MLLuwdXJ1c3Dtc0RkKg+wiI1g/Ti1om8+/2hc2A2B60NbBNAbMgyBMHvyymWm/j4wQ==", + "dev": true + }, + "@webpack-cli/info": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.3.0.tgz", + "integrity": "sha512-ASiVB3t9LOKHs5DyVUcxpraBXDOKubYu/ihHhU+t1UPpxsivg6Od2E2qU4gJCekfEddzRBzHhzA/Acyw/mlK/w==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5", - "@xtuc/long": "4.2.2" + "envinfo": "^7.7.3" } }, + "@webpack-cli/serve": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", + "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==", + "dev": true + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -2308,16 +2337,6 @@ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, "append-transform": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", @@ -2405,24 +2424,6 @@ "sprintf-js": "~1.0.2" } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, "array-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", @@ -2470,24 +2471,9 @@ } }, "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, "arraybuffer.slice": { @@ -2508,55 +2494,11 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, "astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -2568,12 +2510,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==" }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -2584,12 +2520,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, "autolinker": { "version": "0.28.1", "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.28.1.tgz", @@ -2598,6 +2528,12 @@ "gulp-header": "^1.7.1" } }, + "available-typed-arrays": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz", + "integrity": "sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA==", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -3436,61 +3372,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "base64-arraybuffer": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", @@ -3564,22 +3445,6 @@ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "bintrees": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.1.tgz", @@ -3635,12 +3500,6 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -3697,41 +3556,6 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, "browser-process-hrtime": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", @@ -3744,82 +3568,11 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "browserify-mime": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/browserify-mime/-/browserify-mime-1.2.9.tgz", "integrity": "sha1-rrGvKN5sDXpqLOQK22j/GEIq8x8=" }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, "browserslist": { "version": "3.2.8", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", @@ -3830,17 +3583,6 @@ "electron-to-chromium": "^1.3.47" } }, - "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -3862,12 +3604,6 @@ "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz", "integrity": "sha1-Iqk2kB4wKa/NdUfrRIfOtpejvwg=" }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, "bufferutil": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", @@ -3877,12 +3613,6 @@ "node-gyp-build": "~3.7.0" } }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, "bunyan": { "version": "1.8.12", "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", @@ -3900,41 +3630,37 @@ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, "cacache": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", - "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", "dev": true, "requires": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.1", - "mississippi": "^2.0.0", + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^5.2.4", - "unique-filename": "^1.1.0", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", "y18n": "^4.0.0" - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + } } }, "cacheable-request": { @@ -3996,6 +3722,16 @@ } } }, + "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" + } + }, "call-matcher": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.1.0.tgz", @@ -4014,35 +3750,11 @@ "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=", "dev": true }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", - "dev": true, - "requires": { - "callsites": "^2.0.0" - } - }, - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", - "dev": true, - "requires": { - "caller-callsite": "^2.0.0" - } - }, "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" }, - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true - }, "camel-case": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", @@ -4076,15 +3788,31 @@ }, "dependencies": { "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + }, + "dependencies": { + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true + } } + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true } } }, @@ -4191,81 +3919,17 @@ } } }, - "chokidar": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", - "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - } - } - }, "chownr": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, "chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true }, "clean-css": { "version": "4.2.1", @@ -4332,6 +3996,17 @@ "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", "dev": true }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, "clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", @@ -4349,33 +4024,12 @@ "shimmer": "^1.1.0" } }, - "coa": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", - "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", - "dev": true, - "requires": { - "@types/q": "^1.5.1", - "chalk": "^2.4.1", - "q": "^1.1.2" - } - }, "collapse-white-space": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz", "integrity": "sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==", "dev": true }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", @@ -4407,6 +4061,18 @@ "simple-swizzle": "^0.2.2" } }, + "colord": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.4.0.tgz", + "integrity": "sha512-2306/NeTDOykDwvFQK0ctnP+9I5KQdqVm+IJAM6MsAr4vvy1llAdJyax4YmZoqTxdJ/lvRBwR8MqyJi/tupBAw==", + "dev": true + }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -4445,12 +4111,6 @@ "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, "component-inherit": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", @@ -4531,18 +4191,6 @@ } } }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", @@ -4631,26 +4279,77 @@ "run-queue": "^1.0.0" } }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, "copy-webpack-plugin": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.5.4.tgz", - "integrity": "sha512-0lstlEyj74OAtYMrDxlNZsU7cwFijAI3Ofz2fD6Mpo9r4xCv4yegfa3uHIKvZY1NSuOtE9nvG6TAhJ+uz9gDaQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-9.0.1.tgz", + "integrity": "sha512-14gHKKdYIxF84jCEgPgYXCPpldbwpxxLbCmA7LReY7gvbaT555DgeBWBgBZM116tv/fO6RRJrsivBqRyRlukhw==", "dev": true, "requires": { - "cacache": "^10.0.4", - "find-cache-dir": "^1.0.0", - "globby": "^7.1.1", - "is-glob": "^4.0.0", - "loader-utils": "^1.1.0", - "minimatch": "^3.0.4", - "p-limit": "^1.0.0", - "serialize-javascript": "^1.4.0" + "fast-glob": "^3.2.5", + "glob-parent": "^6.0.0", + "globby": "^11.0.3", + "normalize-path": "^3.0.0", + "p-limit": "^3.1.0", + "schema-utils": "^3.0.0", + "serialize-javascript": "^6.0.0" + }, + "dependencies": { + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "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" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "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 + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } } }, "core-js": { @@ -4663,18 +4362,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", - "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - } - }, "cp-file": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", @@ -4746,43 +4433,6 @@ } } }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -4796,25 +4446,6 @@ "which": "^1.2.9" } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "crypto-random-string": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-3.3.0.tgz", @@ -4844,32 +4475,18 @@ "dev": true }, "css-color-names": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", - "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-1.0.1.tgz", + "integrity": "sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA==", "dev": true }, "css-declaration-sorter": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz", - "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.1.1.tgz", + "integrity": "sha512-BZ1aOuif2Sb7tQYY1GeCjG7F++8ggnwUkH5Ictw0mrdpqpEd+zWmcPdstnH2TItlb74FqR0DrVEieon221T/1Q==", "dev": true, "requires": { - "postcss": "^7.0.1", "timsort": "^0.3.0" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } } }, "css-loader": { @@ -4892,6 +4509,90 @@ "source-list-map": "^2.0.0" } }, + "css-minimizer-webpack-plugin": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-3.0.2.tgz", + "integrity": "sha512-B3I5e17RwvKPJwsxjjWcdgpU/zqylzK1bPVghcmpFHRL48DXiBgrtqz1BJsn68+t/zzaLp9kYAaEDvQ7GyanFQ==", + "dev": true, + "requires": { + "cssnano": "^5.0.6", + "jest-worker": "^27.0.2", + "p-limit": "^3.0.2", + "postcss": "^8.3.5", + "schema-utils": "^3.0.0", + "serialize-javascript": "^6.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "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" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "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 + }, + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "postcss": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz", + "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==", + "dev": true, + "requires": { + "colorette": "^1.2.2", + "nanoid": "^3.1.23", + "source-map-js": "^0.6.2" + } + }, + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } + } + }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -4914,12 +4615,6 @@ } } }, - "css-select-base-adapter": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", - "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", - "dev": true - }, "css-selector-tokenizer": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", @@ -4945,21 +4640,15 @@ } }, "css-tree": { - "version": "1.0.0-alpha.37", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", - "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", "dev": true, "requires": { - "mdn-data": "2.0.4", + "mdn-data": "2.0.14", "source-map": "^0.6.1" } }, - "css-unit-converter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz", - "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=", - "dev": true - }, "css-what": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", @@ -4978,134 +4667,73 @@ "dev": true }, "cssnano": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", - "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.0.7.tgz", + "integrity": "sha512-7C0tbb298hef3rq+TtBbMuezBQ9VrFtrQEsPNuBKNVgWny/67vdRsnq8EoNu7TRjAHURgYvWlRIpCUmcMZkRzw==", "dev": true, "requires": { - "cosmiconfig": "^5.0.0", - "cssnano-preset-default": "^4.0.7", - "is-resolvable": "^1.0.0", - "postcss": "^7.0.0" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } + "cssnano-preset-default": "^5.1.3", + "is-resolvable": "^1.1.0", + "lilconfig": "^2.0.3", + "yaml": "^1.10.2" } }, "cssnano-preset-default": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz", - "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==", - "dev": true, - "requires": { - "css-declaration-sorter": "^4.0.1", - "cssnano-util-raw-cache": "^4.0.1", - "postcss": "^7.0.0", - "postcss-calc": "^7.0.1", - "postcss-colormin": "^4.0.3", - "postcss-convert-values": "^4.0.1", - "postcss-discard-comments": "^4.0.2", - "postcss-discard-duplicates": "^4.0.2", - "postcss-discard-empty": "^4.0.1", - "postcss-discard-overridden": "^4.0.1", - "postcss-merge-longhand": "^4.0.11", - "postcss-merge-rules": "^4.0.3", - "postcss-minify-font-values": "^4.0.2", - "postcss-minify-gradients": "^4.0.2", - "postcss-minify-params": "^4.0.2", - "postcss-minify-selectors": "^4.0.2", - "postcss-normalize-charset": "^4.0.1", - "postcss-normalize-display-values": "^4.0.2", - "postcss-normalize-positions": "^4.0.2", - "postcss-normalize-repeat-style": "^4.0.2", - "postcss-normalize-string": "^4.0.2", - "postcss-normalize-timing-functions": "^4.0.2", - "postcss-normalize-unicode": "^4.0.1", - "postcss-normalize-url": "^4.0.1", - "postcss-normalize-whitespace": "^4.0.2", - "postcss-ordered-values": "^4.1.2", - "postcss-reduce-initial": "^4.0.3", - "postcss-reduce-transforms": "^4.0.2", - "postcss-svgo": "^4.0.2", - "postcss-unique-selectors": "^4.0.1" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } - } - }, - "cssnano-util-get-arguments": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", - "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=", - "dev": true - }, - "cssnano-util-get-match": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz", - "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.1.3.tgz", + "integrity": "sha512-qo9tX+t4yAAZ/yagVV3b+QBKeLklQbmgR3wI7mccrDcR+bEk9iHgZN1E7doX68y9ThznLya3RDmR+nc7l6/2WQ==", + "dev": true, + "requires": { + "css-declaration-sorter": "^6.0.3", + "cssnano-utils": "^2.0.1", + "postcss-calc": "^8.0.0", + "postcss-colormin": "^5.2.0", + "postcss-convert-values": "^5.0.1", + "postcss-discard-comments": "^5.0.1", + "postcss-discard-duplicates": "^5.0.1", + "postcss-discard-empty": "^5.0.1", + "postcss-discard-overridden": "^5.0.1", + "postcss-merge-longhand": "^5.0.2", + "postcss-merge-rules": "^5.0.2", + "postcss-minify-font-values": "^5.0.1", + "postcss-minify-gradients": "^5.0.1", + "postcss-minify-params": "^5.0.1", + "postcss-minify-selectors": "^5.1.0", + "postcss-normalize-charset": "^5.0.1", + "postcss-normalize-display-values": "^5.0.1", + "postcss-normalize-positions": "^5.0.1", + "postcss-normalize-repeat-style": "^5.0.1", + "postcss-normalize-string": "^5.0.1", + "postcss-normalize-timing-functions": "^5.0.1", + "postcss-normalize-unicode": "^5.0.1", + "postcss-normalize-url": "^5.0.2", + "postcss-normalize-whitespace": "^5.0.1", + "postcss-ordered-values": "^5.0.2", + "postcss-reduce-initial": "^5.0.1", + "postcss-reduce-transforms": "^5.0.1", + "postcss-svgo": "^5.0.2", + "postcss-unique-selectors": "^5.0.1" + } + }, + "cssnano-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-2.0.1.tgz", + "integrity": "sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ==", "dev": true }, - "cssnano-util-raw-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz", - "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==", + "csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", "dev": true, "requires": { - "postcss": "^7.0.0" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } + "css-tree": "^1.1.2" } }, - "cssnano-util-same-parent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz", - "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==", - "dev": true - }, - "csso": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.0.2.tgz", - "integrity": "sha512-kS7/oeNVXkHWxby5tHVxlhjizRCSv8QdU7hB2FpdAibDU8FjTAolhNjKNTiLzXtUrKT6HwClE81yXwEk1309wg==", - "dev": true, - "requires": { - "css-tree": "1.0.0-alpha.37" - } - }, - "cssom": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.2.5.tgz", - "integrity": "sha1-JoJwm1kC5yEt9SkRb/eIzVslSJQ=" + "cssom": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.2.5.tgz", + "integrity": "sha1-JoJwm1kC5yEt9SkRb/eIzVslSJQ=" }, "cssstyle": { "version": "0.2.37", @@ -5573,12 +5201,6 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, "decompress-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", @@ -5626,47 +5248,6 @@ "object-keys": "^1.0.12" } }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "deglob": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/deglob/-/deglob-3.1.0.tgz", @@ -5717,27 +5298,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -5783,24 +5348,21 @@ "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "dir-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", - "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "requires": { - "path-type": "^3.0.0" + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + } } }, "dns-prefetch-control": { @@ -5877,12 +5439,6 @@ } } }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, "domelementtype": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", @@ -5919,13 +5475,41 @@ "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", "dev": true, "requires": { - "is-obj": "^1.0.0" + "no-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "requires": { + "tslib": "^2.0.3" + } + }, + "no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, + "requires": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "dev": true + } } }, "dottie": { @@ -6069,21 +5653,6 @@ "integrity": "sha512-Yy4jF5hJd57BWmGPt0KjaXc25AmWZeQK75kdr4zIzksWVtiT6DwaNtvTb9dt+LkQKwUpvBfCyyPsXXtbY/5GYw==", "dev": true }, - "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, "emoji-regex": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.1.1.tgz", @@ -6251,25 +5820,20 @@ } }, "enhanced-resolve": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", - "integrity": "sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==", + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz", + "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" }, "dependencies": { - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true } } }, @@ -6296,6 +5860,12 @@ "he": "^1.1.1" } }, + "envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true + }, "errlop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/errlop/-/errlop-2.0.0.tgz", @@ -6346,6 +5916,12 @@ } } }, + "es-module-lexer": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz", + "integrity": "sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw==", + "dev": true + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -7340,80 +6916,98 @@ } }, "events": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", - "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" }, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "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": { - "is-descriptor": "^0.1.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, - "extend-shallow": { + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "is-stream": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "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 + }, + "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==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "isexe": "^2.0.0" } } } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "expect-ct": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/expect-ct/-/expect-ct-0.2.0.tgz", @@ -7529,27 +7123,6 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "extendr": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/extendr/-/extendr-2.1.0.tgz", @@ -7576,71 +7149,6 @@ "tmp": "^0.0.33" } }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "extract-opts": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/extract-opts/-/extract-opts-2.2.0.tgz", @@ -7767,6 +7275,12 @@ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" }, + "fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, "fastparse": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", @@ -7810,9 +7324,9 @@ "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" }, "figgy-pudding": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", - "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, "figures": { @@ -7854,36 +7368,6 @@ "resolved": "https://registry.npmjs.org/file-type/-/file-type-10.11.0.tgz", "integrity": "sha512-uzk64HRpUZyTGZtVuvrjP0FYxzQrBf4rojot6J65YMEbwBLB0CWm0CLojVpwpmFmxcE/lkvYICgfcGozbBq6rw==" }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -7923,18 +7407,6 @@ "locate-path": "^3.0.0" } }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -7997,10 +7469,10 @@ "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, "foreground-child": { @@ -8062,15 +7534,6 @@ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, "frameguard": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/frameguard/-/frameguard-3.1.0.tgz", @@ -8131,631 +7594,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fsevents": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", - "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": false, - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "resolved": false, - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": false, - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": false, - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.3", - "resolved": false, - "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==", - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": false, - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": false, - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "optional": true - }, - "debug": { - "version": "3.2.6", - "resolved": false, - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": false, - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "resolved": false, - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "resolved": false, - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": false, - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": false, - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": false, - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": false, - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "resolved": false, - "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": false, - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": false, - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "resolved": false, - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": false, - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": false, - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.9.0", - "resolved": false, - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "resolved": false, - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": false, - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.2", - "resolved": false, - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "optional": true - }, - "needle": { - "version": "2.4.0", - "resolved": false, - "integrity": "sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==", - "dev": true, - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "resolved": false, - "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.1", - "resolved": false, - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "dev": true, - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": false, - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.7", - "resolved": false, - "integrity": "sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==", - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": false, - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": false, - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": false, - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": false, - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "resolved": false, - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": false, - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": false, - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "resolved": false, - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": false, - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": false, - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": false, - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": false, - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": false, - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "resolved": false, - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.1", - "resolved": false, - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": false, - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": false, - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": false, - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": false, - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.13", - "resolved": false, - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": false, - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.1.1", - "resolved": false, - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "optional": true - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -8787,6 +7625,25 @@ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + } + } + }, "get-stdin": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", @@ -8801,12 +7658,6 @@ "pump": "^3.0.0" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -8843,60 +7694,19 @@ } }, "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.1.tgz", + "integrity": "sha512-kEVjS71mQazDBHKcsq4E9u/vUzaLcw1A8EtUeydawvIWQCJM0qQ08G1H7/XTjFUulla6XQiDOG6MXSaG0HDKog==", "dev": true, "requires": { - "global-prefix": "^3.0.0" - }, - "dependencies": { - "global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "requires": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - } - } + "is-glob": "^4.0.1" } }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true }, "globals": { "version": "11.12.0", @@ -8905,17 +7715,25 @@ "dev": true }, "globby": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", - "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "requires": { - "array-union": "^1.0.1", - "dir-glob": "^2.0.0", - "glob": "^7.1.2", - "ignore": "^3.3.5", - "pify": "^3.0.0", - "slash": "^1.0.0" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "dependencies": { + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + } } }, "good-listener": { @@ -9038,6 +7856,12 @@ "ansi-regex": "^2.0.0" } }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true + }, "has-binary2": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", @@ -9075,38 +7899,6 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "hash-base": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", @@ -9116,16 +7908,6 @@ "safe-buffer": "^5.0.1" } }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "hasha": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", @@ -9202,17 +7984,6 @@ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.9.tgz", "integrity": "sha512-M0zZvfLr5p0keDMCAhNBp03XJbKBxUx5AfyfufMdFMEP4N/Xj6dh0IqC75ys7BAzceR34NgcvXjupRVaHBPPVQ==" }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -9223,15 +7994,6 @@ "os-tmpdir": "^1.0.1" } }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "hosted-git-info": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", @@ -9270,12 +8032,6 @@ } } }, - "html-comment-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", - "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", - "dev": true - }, "html-encoding-sniffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", @@ -9326,18 +8082,112 @@ } } }, + "html-minifier-terser": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", + "integrity": "sha512-ZPr5MNObqnV/T9akshPKbVgyOqLmy+Bxo7juKCfTfnjNniTAMdy4hz21YQqoofMBJD2kdREaqPPdThoR78Tgxg==", + "dev": true, + "requires": { + "camel-case": "^4.1.1", + "clean-css": "^4.2.3", + "commander": "^4.1.1", + "he": "^1.2.0", + "param-case": "^3.0.3", + "relateurl": "^0.2.7", + "terser": "^4.6.3" + }, + "dependencies": { + "camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "dev": true, + "requires": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "clean-css": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", + "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", + "dev": true, + "requires": { + "source-map": "~0.6.0" + } + }, + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + }, + "param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "dev": true, + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "terser": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + } + } + }, + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "dev": true + } + } + }, "html-webpack-plugin": { - "version": "4.0.0-beta.8", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.8.tgz", - "integrity": "sha512-n5S2hJi3/vioRvEDswZP2WFgZU8TUqFoYIrkg5dt+xDC4TigQEhIcl4Y81Qs2La/EqKWuJZP8+ikbHGVmzQ4Mg==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.3.2.tgz", + "integrity": "sha512-HvB33boVNCz2lTyBsSiMffsJ+m0YLIQ+pskblXgN9fnjS1BgEcuAfdInfXfGrkdXV406k9FiDi86eVCDBgJOyQ==", "dev": true, "requires": { - "html-minifier": "^4.0.0", - "loader-utils": "^1.2.3", - "lodash": "^4.17.11", - "pretty-error": "^2.1.1", - "tapable": "^1.1.3", - "util.promisify": "1.0.0" + "@types/html-minifier-terser": "^5.0.0", + "html-minifier-terser": "^5.0.1", + "lodash": "^4.17.21", + "pretty-error": "^3.0.4", + "tapable": "^2.0.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + } } }, "htmlparser2": { @@ -9399,12 +8249,6 @@ "sshpk": "^1.7.0" } }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, "https-proxy-agent": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", @@ -9424,6 +8268,12 @@ } } }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, "i18n": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/i18n/-/i18n-0.8.3.tgz", @@ -9477,9 +8327,9 @@ "dev": true }, "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true }, "ignorefs": { @@ -9514,41 +8364,72 @@ "file-type": "^10.10.0" } }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "dev": true, - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", "dev": true, "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" }, "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "find-up": "^3.0.0" + "find-up": "^4.0.0" } } } @@ -9569,12 +8450,6 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, - "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", - "dev": true - }, "indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", @@ -9669,10 +8544,21 @@ "espower-loader": "^1.0.0" } }, + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, "interpret": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, "invariant": { @@ -9684,12 +8570,6 @@ "loose-envify": "^1.0.0" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, "ionicons": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-2.0.1.tgz", @@ -9702,31 +8582,11 @@ "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, "is-absolute-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", - "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", "dev": true }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-alphabetical": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", @@ -9743,26 +8603,41 @@ "is-decimal": "^1.0.0" } }, + "is-arguments": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", + "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0" + } + }, "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-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } + "is-bigint": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", + "dev": true }, "is-bluebird": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz", "integrity": "sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI=" }, + "is-boolean-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", + "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -9787,25 +8662,13 @@ "hsla-regex": "^1.0.0", "rgb-regex": "^1.0.1", "rgba-regex": "^1.0.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" }, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } + "css-color-names": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", + "dev": true } } }, @@ -9821,43 +8684,12 @@ "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", "dev": true }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-directory": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", - "dev": true - }, "is-docker": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.0.0.tgz", "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", "dev": true }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -9875,6 +8707,12 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, + "is-generator-function": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz", + "integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==", + "dev": true + }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -9890,30 +8728,16 @@ "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", "dev": true }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "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-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "is-number-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", + "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", "dev": true }, "is-plain-obj": { @@ -9973,15 +8797,6 @@ "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", "dev": true }, - "is-svg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", - "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", - "dev": true, - "requires": { - "html-comment-regex": "^1.1.0" - } - }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -9999,6 +8814,92 @@ } } }, + "is-typed-array": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz", + "integrity": "sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "call-bind": "^1.0.2", + "es-abstract": "^1.18.0-next.2", + "foreach": "^2.0.5", + "has-symbols": "^1.0.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.4.tgz", + "integrity": "sha512-xjDAPJRxKc1uoTkdW8MEk7Fq/2bzz3YoCADYniDV7+KITCUdu9c90fj1aKI7nEZFZxRrHlDo3wtma/C6QkhlXQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.11.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + } + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true + }, + "is-regex": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.2" + } + }, + "is-string": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", + "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", + "dev": true + }, + "object-inspect": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "dev": true + }, + "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" + } + } + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -10016,12 +8917,6 @@ "integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==", "dev": true }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, "is-word-character": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", @@ -10180,6 +9075,34 @@ "html-escaper": "^2.0.0" } }, + "jest-worker": { + "version": "27.0.6", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz", + "integrity": "sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "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": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "jquery": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", @@ -10502,16 +9425,6 @@ "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" }, - "last-call-webpack-plugin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz", - "integrity": "sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w==", - "dev": true, - "requires": { - "lodash": "^4.17.5", - "webpack-sources": "^1.1.0" - } - }, "lazystream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", @@ -10520,15 +9433,6 @@ "readable-stream": "^2.0.5" } }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, "ldap-filter": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/ldap-filter/-/ldap-filter-0.2.2.tgz", @@ -10645,6 +9549,12 @@ "type-check": "~0.3.2" } }, + "lilconfig": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.3.tgz", + "integrity": "sha512-EHKqr/+ZvdKCifpNrJCKxBTgk5XupZA3y/aCPY9mxfgBzmgh93Mt/WqjjQ38oMxXuvDokaKiM3lAgvSH2sjtHg==", + "dev": true + }, "linkify-it": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", @@ -10675,9 +9585,9 @@ } }, "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", "dev": true }, "loader-utils": { @@ -10946,36 +9856,6 @@ "minimist": "^1.2.0" } }, - "mamacro": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", - "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", - "dev": true - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, "markdown-escapes": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", @@ -11247,21 +10127,10 @@ } } }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "mdn-data": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", - "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", "dev": true }, "mdurl": { @@ -11280,17 +10149,6 @@ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, "memoizee": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", @@ -11306,16 +10164,6 @@ "timers-ext": "^0.1.5" } }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -11339,6 +10187,12 @@ "source-map": "^0.6.1" } }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -11422,40 +10276,9 @@ } }, "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, "mime": { "version": "1.6.0", @@ -11487,14 +10310,55 @@ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" }, "mini-css-extract-plugin": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.5.tgz", - "integrity": "sha512-dqBanNfktnp2hwL2YguV9Jh91PFX7gu7nRLs4TGsbAfAG6WOtlynFRYzwDwmmeSb5uIwHo9nx1ta0f7vAZVp2w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.1.0.tgz", + "integrity": "sha512-SV1GgjMcfqy6hW07rAniUbQE4qS3inh3v4rZEUySkPRWy3vMbS3jUCjMOvNI4lUnDlQYJEmuUqKktTCNY5koFQ==", "dev": true, "requires": { - "loader-utils": "^1.1.0", - "schema-utils": "^1.0.0", - "webpack-sources": "^1.1.0" + "schema-utils": "^3.0.0" + }, + "dependencies": { + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "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" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "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 + }, + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } } }, "minify": { @@ -11523,18 +10387,6 @@ } } }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -11608,9 +10460,9 @@ } }, "mississippi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", - "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", "dev": true, "requires": { "concat-stream": "^1.5.0", @@ -11619,43 +10471,10 @@ "flush-write-stream": "^1.0.0", "from2": "^2.1.0", "parallel-transform": "^1.1.0", - "pump": "^2.0.1", + "pump": "^3.0.0", "pumpify": "^1.3.3", "stream-each": "^1.1.0", "through2": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } } }, "mkdirp": { @@ -11948,25 +10767,6 @@ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.1.11.tgz", "integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==" }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, "native-duplexpair": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/native-duplexpair/-/native-duplexpair-1.0.0.tgz", @@ -12086,61 +10886,11 @@ "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", "optional": true }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, "node-releases": { - "version": "1.1.48", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.48.tgz", - "integrity": "sha512-Hr8BbmUl1ujAST0K0snItzEA5zkJTQup8VNTKNfT6Zw8vTJkIiagUPNfxHmgDOyfFYNfKAul40sD0UEYTvwebw==", - "dev": true, - "requires": { - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } + "version": "1.1.73", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", + "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==", + "dev": true }, "nomnom": { "version": "1.8.1", @@ -12218,12 +10968,20 @@ "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" }, "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "requires": { - "path-key": "^2.0.0" + "path-key": "^3.0.0" + }, + "dependencies": { + "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 + } } }, "nth-check": { @@ -12336,37 +11094,6 @@ "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "object-inspect": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", @@ -12379,15 +11106,6 @@ "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", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, "object.assign": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", @@ -12424,25 +11142,6 @@ "has": "^1.0.3" } }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, "object.values": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", @@ -12545,16 +11244,6 @@ } } }, - "optimize-css-assets-webpack-plugin": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.3.tgz", - "integrity": "sha512-q9fbvCRS6EYtUKKSwI87qm2IxlyJK5b4dygW1rKUBT6mMDhdG5e5bZT63v6tnJR9F9FB/H5a0HTmtw+laUBxKA==", - "dev": true, - "requires": { - "cssnano": "^4.1.10", - "last-call-webpack-plugin": "^3.0.0" - } - }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", @@ -12577,28 +11266,11 @@ } } }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -12622,23 +11294,11 @@ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "dev": true - }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -12694,12 +11354,6 @@ "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-0.2.0.tgz", "integrity": "sha1-gZ300BC4LV6lZx+KGjrPA5vNdwA=" }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, "papaparse": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.2.0.tgz", @@ -12743,20 +11397,6 @@ } } }, - "parse-asn1": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", - "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-entities": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.2.tgz", @@ -12781,12 +11421,6 @@ "json-parse-better-errors": "^1.0.1" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "parse5": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", @@ -12814,11 +11448,42 @@ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true + "pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "dev": true, + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "requires": { + "tslib": "^2.0.3" + } + }, + "no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, + "requires": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "dev": true + } + } }, "passport": { "version": "0.4.0", @@ -12982,18 +11647,6 @@ "xtend": "^4.0.0" } }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -13034,19 +11687,6 @@ "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "pdfobject": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/pdfobject/-/pdfobject-2.2.4.tgz", @@ -13321,402 +11961,282 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/pop-iterate/-/pop-iterate-1.0.1.tgz", "integrity": "sha1-zqz9q0q/NT16DyqqLB/Hs/lBO6M=" - }, - "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=", - "dev": true - }, - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - }, - "dependencies": { - "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" - } - } - } - }, - "postcss-calc": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.1.tgz", - "integrity": "sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ==", - "dev": true, - "requires": { - "css-unit-converter": "^1.1.1", - "postcss": "^7.0.5", - "postcss-selector-parser": "^5.0.0-rc.4", - "postcss-value-parser": "^3.3.1" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } - } - }, - "postcss-colormin": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz", - "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "color": "^3.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" - } - }, - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } - } - }, - "postcss-convert-values": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz", - "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==", + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", + "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": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" + "has-flag": "^3.0.0" } } } }, - "postcss-discard-comments": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", - "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==", + "postcss-calc": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-8.0.0.tgz", + "integrity": "sha512-5NglwDrcbiy8XXfPM11F3HeC6hoT9W7GUH/Zi5U/p7u3Irv4rHhdDcIZwG0llHXV4ftsBjpfWMXAnXNl4lnt8g==", "dev": true, "requires": { - "postcss": "^7.0.0" + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.0.2" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, - "postcss-discard-duplicates": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz", - "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==", + "postcss-colormin": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-5.2.0.tgz", + "integrity": "sha512-+HC6GfWU3upe5/mqmxuqYZ9B2Wl4lcoUUNkoaX59nEWV4EtADCMiBqui111Bu8R8IvaZTmqmxrqOAqjbHIwXPw==", "dev": true, "requires": { - "postcss": "^7.0.0" + "browserslist": "^4.16.6", + "caniuse-api": "^3.0.0", + "colord": "^2.0.1", + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } + }, + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true + }, + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, - "postcss-discard-empty": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz", - "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==", + "postcss-convert-values": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-5.0.1.tgz", + "integrity": "sha512-C3zR1Do2BkKkCgC0g3sF8TS0koF2G+mN8xxayZx3f10cIRmTaAnpgpRQZjNekTZxM2ciSPoh2IWJm0VZx8NoQg==", "dev": true, "requires": { - "postcss": "^7.0.0" + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, + "postcss-discard-comments": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.0.1.tgz", + "integrity": "sha512-lgZBPTDvWrbAYY1v5GYEv8fEO/WhKOu/hmZqmCYfrpD6eyDWWzAOsl2rF29lpvziKO02Gc5GJQtlpkTmakwOWg==", + "dev": true + }, + "postcss-discard-duplicates": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.0.1.tgz", + "integrity": "sha512-svx747PWHKOGpAXXQkCc4k/DsWo+6bc5LsVrAsw+OU+Ibi7klFZCyX54gjYzX4TH+f2uzXjRviLARxkMurA2bA==", + "dev": true + }, + "postcss-discard-empty": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.0.1.tgz", + "integrity": "sha512-vfU8CxAQ6YpMxV2SvMcMIyF2LX1ZzWpy0lqHDsOdaKKLQVQGVP1pzhrI9JlsO65s66uQTfkQBKBD/A5gp9STFw==", + "dev": true + }, "postcss-discard-overridden": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz", - "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.0.1.tgz", + "integrity": "sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q==", + "dev": true }, "postcss-merge-longhand": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz", - "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-5.0.2.tgz", + "integrity": "sha512-BMlg9AXSI5G9TBT0Lo/H3PfUy63P84rVz3BjCFE9e9Y9RXQZD3+h3YO1kgTNsNJy7bBc1YQp8DmSnwLIW5VPcw==", "dev": true, "requires": { - "css-color-names": "0.0.4", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "stylehacks": "^4.0.0" + "css-color-names": "^1.0.1", + "postcss-value-parser": "^4.1.0", + "stylehacks": "^5.0.1" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-merge-rules": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz", - "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-5.0.2.tgz", + "integrity": "sha512-5K+Md7S3GwBewfB4rjDeol6V/RZ8S+v4B66Zk2gChRqLTCC8yjnHQ601omj9TKftS19OPGqZ/XzoqpzNQQLwbg==", "dev": true, "requires": { - "browserslist": "^4.0.0", + "browserslist": "^4.16.6", "caniuse-api": "^3.0.0", - "cssnano-util-same-parent": "^4.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0", - "vendors": "^1.0.0" + "cssnano-utils": "^2.0.1", + "postcss-selector-parser": "^6.0.5", + "vendors": "^1.0.3" }, "dependencies": { "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } }, - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true }, - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "dev": true, - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true } } }, "postcss-minify-font-values": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz", - "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-5.0.1.tgz", + "integrity": "sha512-7JS4qIsnqaxk+FXY1E8dHBDmraYFWmuL6cgt0T1SWGRO5bzJf8sUoelwa4P88LEWJZweHevAiDKxHlofuvtIoA==", "dev": true, "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-minify-gradients": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz", - "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-5.0.1.tgz", + "integrity": "sha512-odOwBFAIn2wIv+XYRpoN2hUV3pPQlgbJ10XeXPq8UY2N+9ZG42xu45lTn/g9zZ+d70NKSQD6EOi6UiCMu3FN7g==", "dev": true, "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "is-color-stop": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "cssnano-utils": "^2.0.1", + "is-color-stop": "^1.1.0", + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-minify-params": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz", - "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-5.0.1.tgz", + "integrity": "sha512-4RUC4k2A/Q9mGco1Z8ODc7h+A0z7L7X2ypO1B6V8057eVK6mZ6xwz6QN64nHuHLbqbclkX1wyzRnIrdZehTEHw==", "dev": true, "requires": { - "alphanum-sort": "^1.0.0", - "browserslist": "^4.0.0", - "cssnano-util-get-arguments": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", + "alphanum-sort": "^1.0.2", + "browserslist": "^4.16.0", + "cssnano-utils": "^2.0.1", + "postcss-value-parser": "^4.1.0", "uniqs": "^2.0.0" }, "dependencies": { "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } }, - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true + }, + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-minify-selectors": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz", - "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-5.1.0.tgz", + "integrity": "sha512-NzGBXDa7aPsAcijXZeagnJBKBPMYLaJJzB8CQh6ncvyl2sIndLVWfbcDi0SBjRWk5VqEjXvf8tYwzoKf4Z07og==", "dev": true, "requires": { - "alphanum-sort": "^1.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - }, - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "dev": true, - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } + "alphanum-sort": "^1.0.2", + "postcss-selector-parser": "^6.0.5" } }, "postcss-modules-extract-imports": { @@ -13759,389 +12279,302 @@ } }, "postcss-normalize-charset": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz", - "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.0.1.tgz", + "integrity": "sha512-6J40l6LNYnBdPSk+BHZ8SF+HAkS4q2twe5jnocgd+xWpz/mx/5Sa32m3W1AA8uE8XaXN+eg8trIlfu8V9x61eg==", + "dev": true }, "postcss-normalize-display-values": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz", - "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-5.0.1.tgz", + "integrity": "sha512-uupdvWk88kLDXi5HEyI9IaAJTE3/Djbcrqq8YgjvAVuzgVuqIk3SuJWUisT2gaJbZm1H9g5k2w1xXilM3x8DjQ==", "dev": true, "requires": { - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "cssnano-utils": "^2.0.1", + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-normalize-positions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz", - "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-5.0.1.tgz", + "integrity": "sha512-rvzWAJai5xej9yWqlCb1OWLd9JjW2Ex2BCPzUJrbaXmtKtgfL8dBMOOMTX6TnvQMtjk3ei1Lswcs78qKO1Skrg==", "dev": true, "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-normalize-repeat-style": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz", - "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.0.1.tgz", + "integrity": "sha512-syZ2itq0HTQjj4QtXZOeefomckiV5TaUO6ReIEabCh3wgDs4Mr01pkif0MeVwKyU/LHEkPJnpwFKRxqWA/7O3w==", "dev": true, "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "cssnano-utils": "^2.0.1", + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-normalize-string": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz", - "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-5.0.1.tgz", + "integrity": "sha512-Ic8GaQ3jPMVl1OEn2U//2pm93AXUcF3wz+OriskdZ1AOuYV25OdgS7w9Xu2LO5cGyhHCgn8dMXh9bO7vi3i9pA==", "dev": true, "requires": { - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-normalize-timing-functions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz", - "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.0.1.tgz", + "integrity": "sha512-cPcBdVN5OsWCNEo5hiXfLUnXfTGtSFiBU9SK8k7ii8UD7OLuznzgNRYkLZow11BkQiiqMcgPyh4ZqXEEUrtQ1Q==", "dev": true, "requires": { - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "cssnano-utils": "^2.0.1", + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-normalize-unicode": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz", - "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.0.1.tgz", + "integrity": "sha512-kAtYD6V3pK0beqrU90gpCQB7g6AOfP/2KIPCVBKJM2EheVsBQmx/Iof+9zR9NFKLAx4Pr9mDhogB27pmn354nA==", "dev": true, "requires": { - "browserslist": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "browserslist": "^4.16.0", + "postcss-value-parser": "^4.1.0" }, "dependencies": { "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } }, - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true + }, + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-normalize-url": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz", - "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.0.2.tgz", + "integrity": "sha512-k4jLTPUxREQ5bpajFQZpx8bCF2UrlqOTzP9kEqcEnOfwsRshWs2+oAFIHfDQB8GO2PaUaSE0NlTAYtbluZTlHQ==", "dev": true, "requires": { - "is-absolute-url": "^2.0.0", - "normalize-url": "^3.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "is-absolute-url": "^3.0.3", + "normalize-url": "^6.0.1", + "postcss-value-parser": "^4.1.0" }, "dependencies": { "normalize-url": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", - "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", "dev": true }, - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-normalize-whitespace": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz", - "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.0.1.tgz", + "integrity": "sha512-iPklmI5SBnRvwceb/XH568yyzK0qRVuAG+a1HFUsFRf11lEJTiQQa03a4RSCQvLKdcpX7XsI1Gen9LuLoqwiqA==", "dev": true, "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-ordered-values": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz", - "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.0.2.tgz", + "integrity": "sha512-8AFYDSOYWebJYLyJi3fyjl6CqMEG/UVworjiyK1r573I56kb3e879sCJLGvR3merj+fAdPpVplXKQZv+ey6CgQ==", "dev": true, "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "cssnano-utils": "^2.0.1", + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-reduce-initial": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz", - "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.0.1.tgz", + "integrity": "sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw==", "dev": true, "requires": { - "browserslist": "^4.0.0", - "caniuse-api": "^3.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0" + "browserslist": "^4.16.0", + "caniuse-api": "^3.0.0" }, "dependencies": { "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } }, - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true } } }, "postcss-reduce-transforms": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz", - "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.0.1.tgz", + "integrity": "sha512-a//FjoPeFkRuAguPscTVmRQUODP+f3ke2HqFNgGPwdYnpeC29RZdCBvGRGTsKpMURb/I3p6jdKoBQ2zI+9Q7kA==", "dev": true, "requires": { - "cssnano-util-get-match": "^4.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" + "cssnano-utils": "^2.0.1", + "postcss-value-parser": "^4.1.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-selector-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", - "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz", + "integrity": "sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg==", "dev": true, "requires": { - "cssesc": "^2.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" }, "dependencies": { "cssesc": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", - "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "dev": true } } }, "postcss-svgo": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz", - "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-5.0.2.tgz", + "integrity": "sha512-YzQuFLZu3U3aheizD+B1joQ94vzPfE6BNUcSYuceNxlVnKKsOtdo6hL9/zyC168Q8EwfLSgaDSalsUGa9f2C0A==", "dev": true, "requires": { - "is-svg": "^3.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "svgo": "^1.0.0" + "postcss-value-parser": "^4.1.0", + "svgo": "^2.3.0" }, "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true } } }, "postcss-unique-selectors": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz", - "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-5.0.1.tgz", + "integrity": "sha512-gwi1NhHV4FMmPn+qwBNuot1sG1t2OmacLQ/AX29lzyggnjd+MnVD5uqQmpXO3J17KGL2WAxQruj1qTd3H0gG/w==", "dev": true, "requires": { - "alphanum-sort": "^1.0.0", - "postcss": "^7.0.0", + "alphanum-sort": "^1.0.2", + "postcss-selector-parser": "^6.0.5", "uniqs": "^2.0.0" - }, - "dependencies": { - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } } }, "postcss-value-parser": { @@ -14318,13 +12751,21 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" }, "pretty-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", - "integrity": "sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-3.0.4.tgz", + "integrity": "sha512-ytLFLfv1So4AO1UkoBF6GXQgJRaKbiSiGFICaOPNwQ3CMvBvXpLRubeQWyPGnsbV/t9ml9qto6IeCsho0aEvwQ==", "dev": true, "requires": { - "renderkid": "^2.0.1", - "utila": "~0.4" + "lodash": "^4.17.20", + "renderkid": "^2.0.6" + }, + "dependencies": { + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + } } }, "prismjs": { @@ -14342,12 +12783,6 @@ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -14470,20 +12905,6 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==" }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -14536,12 +12957,6 @@ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, "random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", @@ -14561,16 +12976,6 @@ "resolved": "https://registry.npmjs.org/randomcolor/-/randomcolor-0.5.4.tgz", "integrity": "sha512-nYd4nmTuuwMFzHL6W+UWR5fNERGZeVauho8mrJDUSXdNDbao4rbrUwhuLgKC/j8VCS5+34Ria8CsTDuBjrIrQA==" }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -14666,22 +13071,20 @@ } } }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, "readline-sync": { "version": "1.4.10", "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==" }, + "rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, "redeyed": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", @@ -14758,16 +13161,6 @@ "private": "^0.1.6" } }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -14853,18 +13246,107 @@ "dev": true }, "renderkid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.3.tgz", - "integrity": "sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.7.tgz", + "integrity": "sha512-oCcFyxaMrKsKcTY59qnCAtmDVSLfPbrv6A3tVbPdFMMrv5jaK10V6m40cKsoPNhAqN6rmHW9sswW4o3ruSrwUQ==", "dev": true, "requires": { - "css-select": "^1.1.0", - "dom-converter": "^0.2", - "htmlparser2": "^3.3.0", - "strip-ansi": "^3.0.0", - "utila": "^0.4.0" + "css-select": "^4.1.3", + "dom-converter": "^0.2.0", + "htmlparser2": "^6.1.0", + "lodash": "^4.17.21", + "strip-ansi": "^3.0.1" }, "dependencies": { + "css-select": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", + "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^5.0.0", + "domhandler": "^4.2.0", + "domutils": "^2.6.0", + "nth-check": "^2.0.0" + } + }, + "css-what": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", + "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==", + "dev": true + }, + "dom-serializer": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", + "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "dev": true + }, + "domhandler": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz", + "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==", + "dev": true, + "requires": { + "domelementtype": "^2.2.0" + } + }, + "domutils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", + "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", + "dev": true, + "requires": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + } + }, + "entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true + }, + "htmlparser2": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", + "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0", + "domutils": "^2.5.2", + "entities": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "nth-check": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", + "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "dev": true, + "requires": { + "boolbase": "^1.0.0" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -14876,12 +13358,6 @@ } } }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -14988,57 +13464,28 @@ } }, "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "requires": { - "resolve-from": "^3.0.0" + "resolve-from": "^5.0.0" }, "dependencies": { "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true } } }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "dependencies": { - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^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", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, "responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", @@ -15057,12 +13504,6 @@ "signal-exit": "^3.0.2" } }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, "retry-as-promised": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz", @@ -15104,16 +13545,6 @@ "glob": "^7.1.3" } }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -15161,15 +13592,6 @@ "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", "optional": true }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, "safefs": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/safefs/-/safefs-3.2.2.tgz", @@ -15369,10 +13791,13 @@ "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=" }, "serialize-javascript": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", - "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", - "dev": true + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "series-stream": { "version": "1.0.1", @@ -15395,48 +13820,18 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "kind-of": "^6.0.2" } }, "shallow-equals": { @@ -15472,6 +13867,25 @@ "nanoid": "^2.0.0" } }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "dependencies": { + "object-inspect": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "dev": true + } + } + }, "sigmund": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", @@ -15579,119 +13993,6 @@ "integrity": "sha512-ZdJIgv9gdrYwhXqxsH9pv7nXxjUEyQ6nqhngRxoAAOlmMGA28FDq5O4/5US4G2/Nod7d1ovNcgURQJ7kHq50KQ==", "dev": true }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "socket.io": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.2.0.tgz", @@ -15807,18 +14108,11 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } + "source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true }, "source-map-support": { "version": "0.4.18", @@ -15837,12 +14131,6 @@ } } }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, "spawn-wrap": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", @@ -15903,15 +14191,6 @@ "through": "2" } }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -15939,12 +14218,12 @@ } }, "ssri": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", - "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", "dev": true, "requires": { - "safe-buffer": "^5.1.1" + "figgy-pudding": "^3.5.1" } }, "stable": { @@ -16152,27 +14431,6 @@ "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==", "dev": true }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -16190,16 +14448,6 @@ "integrity": "sha1-jFNOKguDH3K3X8XxEZhXxE711ZM=", "dev": true }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, "stream-each": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", @@ -16228,23 +14476,10 @@ } } }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, "string-loader": { @@ -16276,6 +14511,16 @@ } } }, + "string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, "string.prototype.trimleft": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", @@ -16296,6 +14541,16 @@ "function-bind": "^1.1.1" } }, + "string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -16352,10 +14607,10 @@ "is-regexp": "^1.0.0" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true }, "strip-json-comments": { @@ -16384,48 +14639,39 @@ } }, "stylehacks": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", - "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.0.1.tgz", + "integrity": "sha512-Es0rVnHIqbWzveU1b24kbw92HsebBepxfcqe5iix7t9j0PQqhs0IxXVXv0pY2Bxa08CgMkzD6OWql7kbGOuEdA==", "dev": true, "requires": { - "browserslist": "^4.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0" + "browserslist": "^4.16.0", + "postcss-selector-parser": "^6.0.4" }, "dependencies": { "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } }, - "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true }, - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "dev": true, - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true } } }, @@ -16439,43 +14685,145 @@ } }, "svgo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", - "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.3.1.tgz", + "integrity": "sha512-riDDIQgXpEnn0BEl9Gvhh1LNLIyiusSpt64IR8upJu7MwxnzetmF/Y57pXQD2NMX2lVyMRzXt5f2M5rO4wG7Dw==", "dev": true, "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.2", - "css-select": "^2.0.0", - "css-select-base-adapter": "^0.1.1", - "css-tree": "1.0.0-alpha.37", - "csso": "^4.0.2", - "js-yaml": "^3.13.1", - "mkdirp": "~0.5.1", - "object.values": "^1.1.0", - "sax": "~1.2.4", - "stable": "^0.1.8", - "unquote": "~1.1.1", - "util.promisify": "~1.0.0" + "@trysound/sax": "0.1.1", + "chalk": "^4.1.0", + "commander": "^7.1.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.2", + "csso": "^4.2.0", + "stable": "^0.1.8" }, "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" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + }, "css-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", - "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", + "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==", "dev": true, "requires": { "boolbase": "^1.0.0", - "css-what": "^3.2.1", - "domutils": "^1.7.0", - "nth-check": "^1.0.2" + "css-what": "^5.0.0", + "domhandler": "^4.2.0", + "domutils": "^2.6.0", + "nth-check": "^2.0.0" } }, "css-what": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.2.1.tgz", - "integrity": "sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", + "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==", + "dev": true + }, + "dom-serializer": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", + "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "dev": true + }, + "domhandler": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz", + "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==", + "dev": true, + "requires": { + "domelementtype": "^2.2.0" + } + }, + "domutils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", + "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", + "dev": true, + "requires": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + } + }, + "entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", "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 + }, + "nth-check": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", + "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "dev": true, + "requires": { + "boolbase": "^1.0.0" + } + }, + "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" + } } } }, @@ -16569,9 +14917,9 @@ } }, "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", + "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", "dev": true }, "tar": { @@ -16706,121 +15054,96 @@ } }, "terser-webpack-plugin": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", - "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz", + "integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==", "dev": true, "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^2.1.2", + "jest-worker": "^27.0.2", + "p-limit": "^3.1.0", + "schema-utils": "^3.0.0", + "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" + "terser": "^5.7.0" }, "dependencies": { - "cacache": { - "version": "12.0.3", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", - "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "dev": true }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "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": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "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 + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "yocto-queue": "^0.1.0" } }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { - "find-up": "^3.0.0" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "serialize-javascript": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", - "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", - "dev": true - }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "terser": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", + "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", "dev": true, "requires": { - "figgy-pudding": "^3.5.1" + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } } } } @@ -16867,15 +15190,6 @@ "xtend": "~4.0.1" } }, - "timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, "timers-ext": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", @@ -16911,65 +15225,17 @@ "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", @@ -17080,12 +15346,6 @@ "tslib": "^1.8.1" } }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -17176,49 +15436,70 @@ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "uglify-js": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", + "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", + "dev": true + }, + "uglifyjs-webpack-plugin": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.2.0.tgz", + "integrity": "sha512-mHSkufBmBuJ+KHQhv5H0MXijtsoA1lynJt1lXOaotja8/I0pR4L9oGaPIZw+bQBOFittXZg9OC1sXSGO9D9ZYg==", "dev": true, "requires": { - "commander": "~2.13.0", - "source-map": "~0.6.1" + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^1.7.0", + "source-map": "^0.6.1", + "uglify-js": "^3.6.0", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" }, "dependencies": { - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true - } - } - }, - "uglifyjs-webpack-plugin": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.7.tgz", - "integrity": "sha512-1VicfKhCYHLS8m1DCApqBhoulnASsEoJ/BvpUpP4zoNAPpKzdH+ghk0olGJMmwX2/jprK2j3hAHdUbczBSy2FA==", - "dev": true, - "requires": { - "cacache": "^10.0.4", - "find-cache-dir": "^1.0.0", - "schema-utils": "^0.4.5", - "serialize-javascript": "^1.4.0", - "source-map": "^0.6.1", - "uglify-es": "^3.3.4", - "webpack-sources": "^1.1.0", - "worker-farm": "^1.5.2" - }, - "dependencies": { - "schema-utils": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", - "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0" + "find-up": "^3.0.0" } + }, + "serialize-javascript": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", + "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", + "dev": true } } }, @@ -17244,6 +15525,26 @@ "bluebird": "^3.5.3" } }, + "unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + } + } + }, "underscore": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", @@ -17273,18 +15574,6 @@ "x-is-string": "^0.1.0" } }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", @@ -17375,58 +15664,6 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, - "unquote": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", - "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true - }, "update-section": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/update-section/-/update-section-0.3.3.tgz", @@ -17447,30 +15684,6 @@ "punycode": "^2.1.0" } }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, "url-loader": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-1.0.1.tgz", @@ -17508,12 +15721,6 @@ "prepend-http": "^2.0.0" } }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, "utf-8-validate": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", @@ -17524,20 +15731,17 @@ } }, "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", + "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", "dev": true, "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" } }, "util-deprecate": { @@ -17545,16 +15749,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" - } - }, "utila": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", @@ -18510,12 +16704,6 @@ "integrity": "sha512-UO6CPAuEMJ8oNR0gLLNl+wUiIzQUsyUOp8SyyDKTqVRBtq7kk1VnFmIZW8QufjxGrGEuI+LVR7p/C7uEKy0LQw==", "dev": true }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, "w3c-hr-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", @@ -18526,14 +16714,13 @@ } }, "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz", + "integrity": "sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA==", "dev": true, "requires": { - "chokidar": "^2.0.2", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" } }, "watchr": { @@ -18563,149 +16750,234 @@ "dev": true }, "webpack": { - "version": "4.39.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.39.1.tgz", - "integrity": "sha512-/LAb2TJ2z+eVwisldp3dqTEoNhzp/TLCZlmZm3GGGAlnfIWDgOEE758j/9atklNLfRyhKbZTCOIoPqLJXeBLbQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/wasm-edit": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "acorn": "^6.2.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", + "version": "5.47.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.47.1.tgz", + "integrity": "sha512-cW+Mzy9SCDapFV4OrkHuP6EFV2mAsiQd+gOa3PKtHNoKg6qPqQXZzBlHH+CnQG1osplBCqwsJZ8CfGO6XWah0g==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.50", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.4.1", + "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.3", + "enhanced-resolve": "^5.8.0", + "es-module-lexer": "^0.7.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.1", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.1", - "watchpack": "^1.6.0", - "webpack-sources": "^1.4.1" - }, - "dependencies": { + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.2.0", + "webpack-sources": "^3.1.1" + }, + "dependencies": { + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "dev": true + }, "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", + "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", "dev": true }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "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": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } - } - } - }, - "webpack-cli": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.6.tgz", - "integrity": "sha512-0vEa83M7kJtxK/jUhlpZ27WHIOndz5mghWL2O53kiDoA9DIxSKnfqB92LoqEn77cT4f3H2cZm1BMEat/6AZz3A==", - "dev": true, - "requires": { - "chalk": "2.4.2", - "cross-spawn": "6.0.5", - "enhanced-resolve": "4.1.0", - "findup-sync": "3.0.0", - "global-modules": "2.0.0", - "import-local": "2.0.0", - "interpret": "1.2.0", - "loader-utils": "1.2.3", - "supports-color": "6.1.0", - "v8-compile-cache": "2.0.3", - "yargs": "13.2.4" - }, - "dependencies": { - "enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "tapable": "^1.0.0" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", "dev": true }, - "v8-compile-cache": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz", - "integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==", + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", "dev": true }, - "yargs": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "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 + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true + }, + "mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.0" + "mime-db": "1.49.0" + } + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } + }, + "webpack-sources": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.1.2.tgz", + "integrity": "sha512-//DeuK5SzM6yFRXNOGK+4tX7QB8PghkL8kFBPyqSlN62oJOUkmby8ptV7+IBGH6BkIuIw5Rjd7OvvwZaoiF4ag==", + "dev": true + } + } + }, + "webpack-cli": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz", + "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==", + "dev": true, + "requires": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.0.4", + "@webpack-cli/info": "^1.3.0", + "@webpack-cli/serve": "^1.5.1", + "colorette": "^1.2.1", + "commander": "^7.0.0", + "execa": "^5.0.0", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.2.0", + "webpack-merge": "^5.7.3" + }, + "dependencies": { + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true } } }, "webpack-merge": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.1.tgz", - "integrity": "sha512-4p8WQyS98bUJcCvFMbdGZyZmsKuWjWVnVHnAS3FFg0HDaRVrPbkivx2RYCre8UiemD67RsiFFLfn4JhLAin8Vw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", "dev": true, "requires": { - "lodash": "^4.17.5" + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" } }, "webpack-parallel-uglify-plugin": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/webpack-parallel-uglify-plugin/-/webpack-parallel-uglify-plugin-1.1.2.tgz", - "integrity": "sha512-S+siPmIYTtUk8uY8WYpeBEa/g6E1qlnpn/nsqIvGlYoQcJEhUDEMXADgAdpqGyExzt90Gle98D/1tgMVCzCJgg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/webpack-parallel-uglify-plugin/-/webpack-parallel-uglify-plugin-2.0.0.tgz", + "integrity": "sha512-LasXFnpuKGK8jObwbn/eTNZKmRpwpJTHiAzW3uRWMrH54kAxhbW8M44MPkAqU5ZWtJ3/ap35x6h2D1XN2umhDQ==", "dev": true, "requires": { "babel-code-frame": "^6.26.0", "glob": "^7.0.5", "mkdirp": "^0.5.1", "pify": "^3.0.0", + "terser": "^5.3.5", "tmp": "0.0.29", - "uglify-es": "^3.3.9", - "uglify-js": "^3.6.0", + "uglify-js": "^3.12.1", "webpack-sources": "^1.0.0", "worker-farm": "^1.3.1" }, "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "terser": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", + "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + } + }, "tmp": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", @@ -18714,16 +16986,6 @@ "requires": { "os-tmpdir": "~1.0.1" } - }, - "uglify-js": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.7.tgz", - "integrity": "sha512-FeSU+hi7ULYy6mn8PKio/tXsdSXN35lm4KgV2asx00kzrLU9Pi3oAslcJT70Jdj7PHX29gGUPOT6+lXGBbemhA==", - "dev": true, - "requires": { - "commander": "~2.20.3", - "source-map": "~0.6.1" - } } } }, @@ -18776,11 +17038,118 @@ "isexe": "^2.0.0" } }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "which-typed-array": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", + "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "call-bind": "^1.0.0", + "es-abstract": "^1.18.0-next.1", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.1", + "is-typed-array": "^1.1.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.4.tgz", + "integrity": "sha512-xjDAPJRxKc1uoTkdW8MEk7Fq/2bzz3YoCADYniDV7+KITCUdu9c90fj1aKI7nEZFZxRrHlDo3wtma/C6QkhlXQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.11.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + } + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true + }, + "is-regex": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.2" + } + }, + "is-string": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", + "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", + "dev": true + }, + "object-inspect": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "dev": true + }, + "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" + } + } + } + }, + "wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, "winston": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz", @@ -19082,6 +17451,12 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" }, + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true + }, "yargs": { "version": "13.3.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", @@ -19128,6 +17503,12 @@ "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + }, "zip-stream": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.3.tgz", diff --git a/package.json b/package.json index d042668432..309cd9f093 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "license": "AGPL-3.0", "main": "app.js", "scripts": { - "build": "webpack --config webpack.prod.js --display errors-only -p", - "dev": "webpack --config webpack.dev.js --progress --colors --watch", + "build": "NODE_ENV=production NODE_DEBUG=false webpack --config webpack.prod.js", + "dev": "webpack --config webpack.dev.js --progress --watch", "doctoc": "doctoc --title='# Table of Contents' README.md", "lint": "standard ./public && eslint --quiet lib/**/*.ts lib/app.ts", "jsonlint": "find . -type f -not -ipath \"./node_modules/*\" -not -ipath \"./.vscode/*\" \\( -name \"*.json\" -o -name \"*.json.*\" \\) | xargs -n 1 -I{} -- bash -c 'echo {}; jq . {} > /dev/null;'", @@ -136,8 +136,9 @@ "babel-runtime": "~6.26.0", "bootstrap": "~3.4.0", "bootstrap-validator": "~0.11.8", - "copy-webpack-plugin": "~4.5.2", + "copy-webpack-plugin": "~9.0.1", "css-loader": "~1.0.0", + "css-minimizer-webpack-plugin": "~3.0.2", "dictionary-de": "^2.0.3", "dictionary-de-at": "^2.0.3", "dictionary-de-ch": "^2.0.3", @@ -155,7 +156,7 @@ "graceful-fs": "~4.2.1", "handlebars": "~4.1.2", "highlight.js": "~9.15.9", - "html-webpack-plugin": "~4.0.0-beta.2", + "html-webpack-plugin": "~5.3.2", "imports-loader": "~0.8.0", "intelli-espower-loader": "~1.0.1", "ionicons": "~2.0.1", @@ -187,11 +188,10 @@ "markmap-lib": "^0.4.2", "mathjax": "~2.7.5", "mermaid": "~8.6.4", - "mini-css-extract-plugin": "~0.4.1", + "mini-css-extract-plugin": "~2.1.0", "mocha": "~5.2.0", "mock-require": "~3.0.3", "nyc": "~14.0.0", - "optimize-css-assets-webpack-plugin": "~5.0.0", "papaparse": "^5.2.0", "pdfobject": "~2.2.4", "plantuml-encoder": "^1.2.5", @@ -212,18 +212,19 @@ "turndown": "~5.0.3", "typescript": "^4.3.2", "typo-js": "^1.0.3", - "uglifyjs-webpack-plugin": "~1.2.7", + "uglifyjs-webpack-plugin": "~2.2.0", "url-loader": "~1.0.1", + "util": "^0.12.4", "vega": "~5.17.1", "vega-embed": "~6.14.2", "vega-lite": "~4.17.0", "velocity-animate": "~1.5.2", "visibilityjs": "~2.0.2", "viz.js": "~2.1.2", - "webpack": "~4.39.0", - "webpack-cli": "~3.3.6", - "webpack-merge": "~4.2.1", - "webpack-parallel-uglify-plugin": "~1.1.0", + "webpack": "~5.47.1", + "webpack-cli": "~4.7.2", + "webpack-merge": "~5.8.0", + "webpack-parallel-uglify-plugin": "~2.0.0", "wurl": "~2.5.3", "xss": "~1.0.6" }, diff --git a/webpack.common.js b/webpack.common.js index d4569912e4..d8783b4759 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -12,6 +12,7 @@ gracefulFs.gracefulify(fs) module.exports = { name: 'app', plugins: [ + new webpack.EnvironmentPlugin(['NODE_ENV', 'NODE_DEBUG']), new webpack.ProvidePlugin({ Visibility: 'visibilityjs', Cookies: 'js-cookie', @@ -129,79 +130,81 @@ module.exports = { filename: path.join(__dirname, 'public/views/build/slide-pack-scripts.ejs'), inject: false }), - new CopyWebpackPlugin([ - { - context: path.join(__dirname, 'node_modules/mathjax'), - from: { - glob: '**/*', - dot: false + new CopyWebpackPlugin({ + patterns: [ + { + context: path.join(__dirname, 'node_modules/mathjax'), + from: '**/*', + to: 'MathJax/', + globOptions: { + dot: false + } + }, + { + context: path.join(__dirname, 'node_modules/@hackmd/emojify.js'), + from: 'dist/**/*', + to: 'emojify.js/', + globOptions: { + dot: false + } + }, + { + context: path.join(__dirname, 'node_modules/reveal.js'), + from: 'js', + to: 'reveal.js/js' + }, + { + context: path.join(__dirname, 'node_modules/reveal.js'), + from: 'css', + to: 'reveal.js/css' + }, + { + context: path.join(__dirname, 'node_modules/reveal.js'), + from: 'lib', + to: 'reveal.js/lib' + }, + { + context: path.join(__dirname, 'node_modules/reveal.js'), + from: 'plugin', + to: 'reveal.js/plugin' + }, + { + context: path.join(__dirname, 'node_modules/dictionary-de'), + from: '*', + to: 'dictionary-de/' }, - to: 'MathJax/' - }, - { - context: path.join(__dirname, 'node_modules/@hackmd/emojify.js'), - from: { - glob: 'dist/**/*', - dot: false + { + context: path.join(__dirname, 'node_modules/dictionary-de-at'), + from: '*', + to: 'dictionary-de-at/' + }, + { + context: path.join(__dirname, 'node_modules/dictionary-de-ch'), + from: '*', + to: 'dictionary-de-ch/' + }, + { + context: path.join(__dirname, 'node_modules/dictionary-en-gb'), + from: '*', + to: 'dictionary-en-gb/' + }, + { + context: path.join(__dirname, 'node_modules/leaflet'), + from: 'dist', + to: 'leaflet' }, - to: 'emojify.js/' - }, - { - context: path.join(__dirname, 'node_modules/reveal.js'), - from: 'js', - to: 'reveal.js/js' - }, - { - context: path.join(__dirname, 'node_modules/reveal.js'), - from: 'css', - to: 'reveal.js/css' - }, - { - context: path.join(__dirname, 'node_modules/reveal.js'), - from: 'lib', - to: 'reveal.js/lib' - }, - { - context: path.join(__dirname, 'node_modules/reveal.js'), - from: 'plugin', - to: 'reveal.js/plugin' - }, - { - context: path.join(__dirname, 'node_modules/dictionary-de'), - from: '*', - to: 'dictionary-de/' - }, - { - context: path.join(__dirname, 'node_modules/dictionary-de-at'), - from: '*', - to: 'dictionary-de-at/' - }, - { - context: path.join(__dirname, 'node_modules/dictionary-de-ch'), - from: '*', - to: 'dictionary-de-ch/' - }, - { - context: path.join(__dirname, 'node_modules/dictionary-en-gb'), - from: '*', - to: 'dictionary-en-gb/' - }, - { - context: path.join(__dirname, 'node_modules/leaflet'), - from: 'dist', - to: 'leaflet' - }, - { - context: path.join(__dirname, 'node_modules/fork-awesome'), - from: 'fonts', - to: 'fork-awesome/fonts' - }, - { - context: path.join(__dirname, 'node_modules/fork-awesome'), - from: 'css', - to: 'fork-awesome/css' - } - ]), + { + context: path.join(__dirname, 'node_modules/fork-awesome'), + from: 'fonts', + to: 'fork-awesome/fonts' + }, + { + context: path.join(__dirname, 'node_modules/fork-awesome'), + from: 'css', + to: 'fork-awesome/css' + } + ] + }), new MiniCssExtractPlugin() ], @@ -398,8 +401,6 @@ module.exports = { }, resolve: { - modules: ['node_modules'], - extensions: ['.js'], alias: { codemirror: path.join(__dirname, 'node_modules/@hackmd/codemirror/codemirror.min.js'), inlineAttachment: path.join(__dirname, 'public/vendor/inlineAttachment/inline-attachment.js'), @@ -423,6 +424,14 @@ module.exports = { 'viz.js': path.join(__dirname, 'node_modules/viz.js/viz.js'), 'viz.render.js': path.join(__dirname, 'node_modules/viz.js/full.render.js'), markdownlint: path.join(__dirname, 'node_modules/markdownlint/demo/markdownlint-browser.js') + }, + fallback: { + "fs": false, + "os": false, + "path": false, + "util": require.resolve("util"), + "buffer": false, + "process": false } }, @@ -523,13 +532,5 @@ module.exports = { loader: 'script-loader' }] }] - }, - node: { - fs: 'empty', - os: 'empty' - }, - - stats: { - assets: false } } diff --git a/webpack.dev.js b/webpack.dev.js index b1ed361238..53e02dd060 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -1,14 +1,14 @@ const common = require('./webpack.common.js') const htmlexport = require('./webpack.htmlexport') -const merge = require('webpack-merge') +const { merge } = require('webpack-merge') module.exports = [ // merge common config merge(common, { mode: 'development', - devtool: 'cheap-module-eval-source-map' + devtool: 'eval-cheap-module-source-map' }), merge(htmlexport, { mode: 'development', - devtool: 'cheap-module-eval-source-map' + devtool: 'eval-cheap-module-source-map' })] diff --git a/webpack.htmlexport.js b/webpack.htmlexport.js index dd6f4c01cc..4392143bee 100644 --- a/webpack.htmlexport.js +++ b/webpack.htmlexport.js @@ -6,6 +6,15 @@ module.exports = { entry: { htmlExport: path.join(__dirname, 'public/js/htmlExport.js') }, + resolve: { + fallback: { + fs: 'false', + os: 'false', + buffer: 'false', + path: 'false', + util: 'false' + } + }, module: { rules: [{ test: /\.css$/, diff --git a/webpack.prod.js b/webpack.prod.js index 188d9881f3..4f0fe09899 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,8 +1,8 @@ const common = require('./webpack.common.js') const htmlexport = require('./webpack.htmlexport') -const merge = require('webpack-merge') +const { merge } = require('webpack-merge') const path = require('path') -const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin') module.exports = [ merge(common, { @@ -14,10 +14,5 @@ module.exports = [ } }), merge(htmlexport, { - mode: 'production', - optimization: { - minimizer: [ - new OptimizeCSSAssetsPlugin({}) - ] - } + mode: 'production' })] From 4dfb6e94f985496739fbf26fcdeee1c19e8c35e4 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 31 Jul 2021 10:10:04 +0800 Subject: [PATCH 162/167] upgrade expose-loader to 2.0.0 --- package-lock.json | 6 +++--- package.json | 2 +- webpack.common.js | 48 +++++++++++++++++++++++------------------------ 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0705075362..918c683674 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7032,9 +7032,9 @@ } }, "expose-loader": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-0.7.5.tgz", - "integrity": "sha512-iPowgKUZkTPX5PznYsmifVj9Bob0w2wTHVkt/eYNPSzyebkUgIedmskf/kcfEIWpiWjg3JRjnW+a17XypySMuw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-2.0.0.tgz", + "integrity": "sha512-WBpSGlNkn7YwbU2us7O+h0XsoFrB43Y/VCNSpRV4OZFXXKgw8W800BgNxLV0S97N3+KGnFYSCAJi1AV86NO22w==", "dev": true }, "express": { diff --git a/package.json b/package.json index 309cd9f093..e7e6001770 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "ejs-loader": "~0.3.1", "eslint": "^7.28.0", "exports-loader": "~0.7.0", - "expose-loader": "~0.7.5", + "expose-loader": "~2.0.0", "file-loader": "~2.0.0", "file-saver": "~2.0.2", "flowchart.js": "~1.15.0", diff --git a/webpack.common.js b/webpack.common.js index d8783b4759..52f98bf54b 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -211,7 +211,7 @@ module.exports = { entry: { font: path.join(__dirname, 'public/css/google-font.css'), common: [ - 'expose-loader?jQuery!expose-loader?$!jquery', + 'expose-loader?exposes=$,jQuery!jquery', 'velocity-animate', 'imports-loader?$=jquery!jquery-mousewheel', 'bootstrap' @@ -229,8 +229,8 @@ module.exports = { 'cover-pack': [ 'babel-polyfill', 'bootstrap-validator', - 'expose-loader?select2!select2', - 'expose-loader?moment!moment', + 'expose-loader?exposes=select2!select2', + 'expose-loader?exposes=moment!moment', path.join(__dirname, 'public/js/cover.js') ], index: [ @@ -243,7 +243,7 @@ module.exports = { 'script-loader!ot', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - 'expose-loader?RevealMarkdown!reveal-markdown', + 'expose-loader?exposes=RevealMarkdown!reveal-markdown', path.join(__dirname, 'public/js/index.js') ], 'index-styles': [ @@ -284,11 +284,11 @@ module.exports = { 'babel-polyfill', 'script-loader!jquery-ui-resizable', 'bootstrap-validator', - 'expose-loader?jsyaml!js-yaml', + 'expose-loader?exposes=jsyaml!js-yaml', 'script-loader!mermaid', - 'expose-loader?moment!moment', + 'expose-loader?exposes=moment!moment', 'script-loader!handlebars', - 'expose-loader?hljs!highlight.js', + 'expose-loader?exposes=hljs!highlight.js', 'emojify.js', 'script-loader!gist-embed', 'script-loader!codemirror', @@ -304,16 +304,16 @@ module.exports = { 'script-loader!vega', 'script-loader!vega-lite', 'script-loader!vega-embed', - 'expose-loader?io!socket.io-client', - 'expose-loader?RevealMarkdown!reveal-markdown', - 'expose-loader?L!leaflet', + 'expose-loader?exposes=io!socket.io-client', + 'expose-loader?exposes=RevealMarkdown!reveal-markdown', + 'expose-loader?exposes=L|L|true!leaflet', path.join(__dirname, 'public/js/index.js') ], pretty: [ 'babel-polyfill', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - 'expose-loader?RevealMarkdown!reveal-markdown', + 'expose-loader?exposes=RevealMarkdown!reveal-markdown', path.join(__dirname, 'public/js/pretty.js') ], 'pretty-styles': [ @@ -329,11 +329,11 @@ module.exports = { ], 'pretty-pack': [ 'babel-polyfill', - 'expose-loader?jsyaml!js-yaml', + 'expose-loader?exposes=jsyaml!js-yaml', 'script-loader!mermaid', - 'expose-loader?moment!moment', + 'expose-loader?exposes=moment!moment', 'script-loader!handlebars', - 'expose-loader?hljs!highlight.js', + 'expose-loader?exposes=hljs!highlight.js', 'emojify.js', 'script-loader!gist-embed', 'flowchart.js', @@ -344,8 +344,8 @@ module.exports = { 'script-loader!vega', 'script-loader!vega-lite', 'script-loader!vega-embed', - 'expose-loader?RevealMarkdown!reveal-markdown', - 'expose-loader?L!leaflet', + 'expose-loader?exposes=RevealMarkdown!reveal-markdown', + 'expose-loader?exposes=L|L|true!leaflet', path.join(__dirname, 'public/js/pretty.js') ], slide: [ @@ -353,7 +353,7 @@ module.exports = { 'bootstrap-tooltip', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - 'expose-loader?RevealMarkdown!reveal-markdown', + 'expose-loader?exposes=RevealMarkdown!reveal-markdown', path.join(__dirname, 'public/js/slide.js') ], 'slide-styles': [ @@ -368,15 +368,15 @@ module.exports = { ], 'slide-pack': [ 'babel-polyfill', - 'expose-loader?jQuery!expose-loader?$!jquery', + 'expose-loader?exposes=$,jQuery!jquery', 'velocity-animate', 'imports-loader?$=jquery!jquery-mousewheel', 'bootstrap-tooltip', - 'expose-loader?jsyaml!js-yaml', + 'expose-loader?exposes=jsyaml!js-yaml', 'script-loader!mermaid', - 'expose-loader?moment!moment', + 'expose-loader?exposes=moment!moment', 'script-loader!handlebars', - 'expose-loader?hljs!highlight.js', + 'expose-loader?exposes=hljs!highlight.js', 'emojify.js', 'script-loader!gist-embed', 'flowchart.js', @@ -387,9 +387,9 @@ module.exports = { 'script-loader!vega', 'script-loader!vega-lite', 'script-loader!vega-embed', - 'expose-loader?Reveal!reveal.js', - 'expose-loader?RevealMarkdown!reveal-markdown', - 'expose-loader?L!leaflet', + 'expose-loader?exposes=Reveal!reveal.js', + 'expose-loader?exposes=RevealMarkdown!reveal-markdown', + 'expose-loader?exposes=L|L|true!leaflet', path.join(__dirname, 'public/js/slide.js') ] }, From e0835bb73bb956e6b167f9835876ea7c2c17e544 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 31 Jul 2021 11:28:30 +0800 Subject: [PATCH 163/167] upgrade babel to 7 --- .babelrc | 6 +- package-lock.json | 6729 ++++++++++++++++++++++------------ package.json | 13 +- public/js/index.js | 6 +- public/js/pretty.js | 6 +- public/js/reveal-markdown.js | 31 +- public/js/slide.js | 1 + webpack.common.js | 35 +- 8 files changed, 4462 insertions(+), 2365 deletions(-) diff --git a/.babelrc b/.babelrc index 26e5c9249a..b6bc825fc8 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,8 @@ { "presets": [ - ["env", { + ["@babel/preset-env", { + "useBuiltIns": "entry", + "corejs": 2, "targets": { "node": "6", "uglify": true @@ -8,6 +10,6 @@ }] ], "plugins": [ - "transform-runtime" + "@babel/plugin-transform-runtime" ] } diff --git a/package-lock.json b/package-lock.json index 918c683674..953e1bf4a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -528,6 +528,212 @@ "@babel/highlight": "^7.0.0" } }, + "@babel/compat-data": { + "version": "7.14.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.7.tgz", + "integrity": "sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw==", + "dev": true + }, + "@babel/core": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.8.tgz", + "integrity": "sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-compilation-targets": "^7.14.5", + "@babel/helper-module-transforms": "^7.14.8", + "@babel/helpers": "^7.14.8", + "@babel/parser": "^7.14.8", + "@babel/template": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/generator": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/traverse": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + } + } + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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 + } + } + }, "@babel/generator": { "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", @@ -555,38 +761,28 @@ } } }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", + "@babel/helper-annotate-as-pure": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz", + "integrity": "sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/types": "^7.14.5" }, "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==" + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true }, "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "dev": true, "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", + "@babel/helper-validator-identifier": "^7.14.8", "to-fast-properties": "^2.0.0" } }, @@ -598,23 +794,29 @@ } } }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz", + "integrity": "sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/helper-explode-assignable-expression": "^7.14.5", + "@babel/types": "^7.14.5" }, "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "dev": true, "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", + "@babel/helper-validator-identifier": "^7.14.8", "to-fast-properties": "^2.0.0" } }, @@ -626,157 +828,147 @@ } } }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "@babel/helper-compilation-targets": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz", + "integrity": "sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/compat-data": "^7.14.5", + "@babel/helper-validator-option": "^7.14.5", + "browserslist": "^4.16.6", + "semver": "^6.3.0" }, "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" } }, - "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=", + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", "dev": true - } - } - }, - "@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", - "dev": true - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/runtime": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz", - "integrity": "sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.2" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", + "@babel/helper-create-class-features-plugin": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.8.tgz", + "integrity": "sha512-bpYvH8zJBWzeqi1o+co8qOrw+EXzQ/0c74gVmY205AWXy9nifHrOg77y+1zwxX5lXE7Icq4sPlSQ4O2kWBrteQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/helper-annotate-as-pure": "^7.14.5", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-member-expression-to-functions": "^7.14.7", + "@babel/helper-optimise-call-expression": "^7.14.5", + "@babel/helper-replace-supers": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5" }, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.14.5" } }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", "dev": true, "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" } }, - "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=", + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", "dev": true - } - } - }, - "@babel/traverse": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", - "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", "dev": true, "requires": { - "ms": "^2.1.1" + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" } - } - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - }, - "dependencies": { + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -785,2495 +977,4245 @@ } } }, - "@braintree/sanitize-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-3.1.0.tgz", - "integrity": "sha512-GcIY79elgB+azP74j8vqkiXz8xLFfIzbQJdlwOPisgbKT00tviJQuEghOXSMVxJ00HoYJbGswr4kcllUc4xCcg==", - "dev": true - }, - "@dabh/diagnostics": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", - "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", + "@babel/helper-create-regexp-features-plugin": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz", + "integrity": "sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A==", + "dev": true, "requires": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" + "@babel/helper-annotate-as-pure": "^7.14.5", + "regexpu-core": "^4.7.1" } }, - "@discoveryjs/json-ext": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", - "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==", - "dev": true - }, - "@eslint/eslintrc": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "@babel/helper-define-polyfill-provider": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz", + "integrity": "sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew==", "dev": true, "requires": { - "ajv": "^6.12.4", + "@babel/helper-compilation-targets": "^7.13.0", + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/traverse": "^7.13.0", "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" }, "dependencies": { - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", "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" + "@babel/highlight": "^7.14.5" } }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "@babel/generator": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", "dev": true, "requires": { - "ms": "2.1.2" + "@babel/types": "^7.14.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" } }, - "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==", + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", "dev": true }, - "globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", "dev": true, "requires": { - "type-fest": "^0.20.2" + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" } }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "@babel/traverse": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + } + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" } }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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 } } }, - "@hackmd/codemirror": { - "version": "5.57.7", - "resolved": "https://registry.npmjs.org/@hackmd/codemirror/-/codemirror-5.57.7.tgz", - "integrity": "sha512-eNWQaKg39JoCH++PyM6drafjKLf7LmpCypI4/K3ftGo/wuTh4iZXk02qoRWFMVSvowYN7eH8pDSkKiZmiD2T1w==", - "dev": true - }, - "@hackmd/diff-match-patch": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@hackmd/diff-match-patch/-/diff-match-patch-1.1.3.tgz", - "integrity": "sha512-n6drMSGRHzK33vc8qNhJmMwLYOrtWKugkJAFTETHEKew+E3KwEKhaR0TTHl1sgm5gujvdPPQRXAHC5EI81tMFA==" - }, - "@hackmd/emojify.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@hackmd/emojify.js/-/emojify.js-2.1.0.tgz", - "integrity": "sha512-RmQXPGD/uGaa0w2qoc+y6ur+TpQhAr2aBOm2QDLBDMzOdhkdmh9MyadM2rtLGz6U3ZilPjkQYzs+gHm1BhwvtA==", + "@babel/helper-explode-assignable-expression": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz", + "integrity": "sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ==", "dev": true, "requires": { - "@babel/runtime": "^7.5.5", - "core-js": "^3.2.1" + "@babel/types": "^7.14.5" }, "dependencies": { - "core-js": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", - "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 } } }, - "@hackmd/idle-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@hackmd/idle-js/-/idle-js-1.0.1.tgz", - "integrity": "sha512-yuv9BBdA5rk4TpmSrsdNgkLIyRt73hWyBEs7PhWhIozFcNv66JfUzXqA0eT3ToXX0163aVnbpHeJZRvcYy5Seg==", - "dev": true - }, - "@hackmd/imgur": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@hackmd/imgur/-/imgur-0.5.0.tgz", - "integrity": "sha512-5WygmZ0LEezFMxlxxuT03Y9ZNtbJU2ECHTi1Mc2m7SPeUG6sfU3vGsQKmooWA6f5F7HLVskuaSVVq9mOMQv5jg==", + "@babel/helper-function-name": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", + "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", + "dev": true, "requires": { - "commander": "^2.13.0", - "glob": "^7.1.2", - "q": "^2.0.3", - "request": "^2.83.0" + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" }, "dependencies": { - "q": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/q/-/q-2.0.3.tgz", - "integrity": "sha1-dbjbAlWhpa+C9Yw/Oqoe/sfQ0TQ=", + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "requires": { - "asap": "^2.0.0", - "pop-iterate": "^1.0.1", - "weak-map": "^1.0.5" + "@babel/highlight": "^7.8.3" + } + }, + "@babel/parser": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==" + }, + "@babel/types": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", + "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" } + }, + "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 } } }, - "@hackmd/js-sequence-diagrams": { - "version": "0.0.1-alpha.3", - "resolved": "https://registry.npmjs.org/@hackmd/js-sequence-diagrams/-/js-sequence-diagrams-0.0.1-alpha.3.tgz", - "integrity": "sha512-eHpAlFAKU4BmNvwvXryQh7nkdUaYP1FBeMf0zENRHyT9RtkVaY12F61AY2Pbx60xb5+mvg1qxnm3ODLApH9jjQ==", - "dev": true - }, - "@hackmd/lz-string": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@hackmd/lz-string/-/lz-string-1.4.4.tgz", - "integrity": "sha512-KP8U3BGp/qOdoQBfQp1nHvdyT/xi3dBV2qq8YPv1P5rBCR7OF9NpGTdAoOR6n3fONEaMJBdy069cGGbycJolpQ==" - }, - "@hackmd/meta-marked": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@hackmd/meta-marked/-/meta-marked-0.4.4.tgz", - "integrity": "sha512-idndsvVHGn9m11H1w6N1YeUH3wecOVSBjDFH5ENDhgVsmHoms3V4e0Vi1q3boQRQKV/dVxYK0Fk1f3Psvjg60w==", - "requires": { - "js-yaml": "~3.13.1", - "marked": "~0.6.2" - } - }, - "@hackmd/pandoc.js": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@hackmd/pandoc.js/-/pandoc.js-0.1.9.tgz", - "integrity": "sha512-Z8i8vpFOP34v9rRm0vURTmDSqTW8JcXlI1TIiW3AKuJ3+nygTYc/wkaPATRLvusv1JkPrD+m4cIv4aPO9GkULw==", - "requires": { - "extract-zip": "^1.6.7", - "fs-extra": "^8.1.0", - "glob": "^7.1.4", - "got": "^9.6.0", - "progress": "^2.0.3", - "tar": "^5.0.5" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", - "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@passport-next/passport-openid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@passport-next/passport-openid/-/passport-openid-1.0.0.tgz", - "integrity": "sha512-W9uj4Ui/ZK/iBUNzSNxPWDQ8wCD1tUddGEVSGm0FN0B7ewo3yBQLGMoW3i3UqcwEzxdyGbAj06ohAhNQIXC4VA==", - "requires": { - "@passport-next/passport-strategy": "1.x.x", - "openid": "2.x.x" - } - }, - "@passport-next/passport-strategy": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@passport-next/passport-strategy/-/passport-strategy-1.1.0.tgz", - "integrity": "sha512-2KhFjtPueJG6xVj2HnqXt9BlANOfYCVLyu+pXYjPGBDT8yk+vQwc/6tsceIj+mayKcoxMau2JimggXRPHgoc8w==" - }, - "@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" - }, - "@sinonjs/commons": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz", - "integrity": "sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg==", + "@babel/helper-get-function-arity": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", "dev": true, "requires": { - "type-detect": "4.0.8" + "@babel/types": "^7.8.3" + }, + "dependencies": { + "@babel/types": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", + "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } } }, - "@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "@babel/helper-hoist-variables": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz", + "integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==", "dev": true, "requires": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } } }, - "@sinonjs/samsam": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "@babel/helper-member-expression-to-functions": { + "version": "7.14.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz", + "integrity": "sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA==", "dev": true, "requires": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } } }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "@susisu/mte-kernel": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@susisu/mte-kernel/-/mte-kernel-2.1.0.tgz", - "integrity": "sha512-4XgtDqZNoVGy2BKqHBhm972T4uGaOWRK1BNnh97ryL2cm2Z8g7Zq59OwcNUNaNLVoqsCp6Nv61qn4z+gq4DYyw==", + "@babel/helper-module-imports": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz", + "integrity": "sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ==", "dev": true, "requires": { - "meaw": "^4.3.0" - } - }, - "@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "requires": { - "defer-to-connect": "^1.0.1" + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } } }, - "@textlint/ast-node-types": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@textlint/ast-node-types/-/ast-node-types-4.2.5.tgz", - "integrity": "sha512-+rEx4jLOeZpUcdvll7jEg/7hNbwYvHWFy4IGW/tk2JdbyB3SJVyIP6arAwzTH/sp/pO9jftfyZnRj4//sLbLvQ==", - "dev": true - }, - "@textlint/markdown-to-ast": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/@textlint/markdown-to-ast/-/markdown-to-ast-6.0.9.tgz", - "integrity": "sha512-hfAWBvTeUGh5t5kTn2U3uP3qOSM1BSrxzl1jF3nn0ywfZXpRBZr5yRjXnl4DzIYawCtZOshmRi/tI3/x4TE1jQ==", + "@babel/helper-module-transforms": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.8.tgz", + "integrity": "sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==", "dev": true, "requires": { - "@textlint/ast-node-types": "^4.0.3", - "debug": "^2.1.3", - "remark-frontmatter": "^1.2.0", - "remark-parse": "^5.0.0", - "structured-source": "^3.0.2", - "traverse": "^0.6.6", - "unified": "^6.1.6" + "@babel/helper-module-imports": "^7.14.5", + "@babel/helper-replace-supers": "^7.14.5", + "@babel/helper-simple-access": "^7.14.8", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", + "@babel/template": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/generator": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/traverse": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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 + } } }, - "@trysound/sax": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.1.1.tgz", - "integrity": "sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==", + "@babel/helper-optimise-call-expression": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz", + "integrity": "sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } + } + }, + "@babel/helper-plugin-utils": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz", + "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==", "dev": true }, - "@types/accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", + "@babel/helper-remap-async-to-generator": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz", + "integrity": "sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A==", + "dev": true, "requires": { - "@types/node": "*" + "@babel/helper-annotate-as-pure": "^7.14.5", + "@babel/helper-wrap-function": "^7.14.5", + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } + } + }, + "@babel/helper-replace-supers": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz", + "integrity": "sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.14.5", + "@babel/helper-optimise-call-expression": "^7.14.5", + "@babel/traverse": "^7.14.5", + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/generator": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/traverse": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + } + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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 + } + } + }, + "@babel/helper-simple-access": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", + "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.8" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } + } + }, + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz", + "integrity": "sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + }, + "dependencies": { + "@babel/types": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", + "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", + "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", + "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz", + "integrity": "sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/traverse": "^7.14.5", + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/generator": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/traverse": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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 + } + } + }, + "@babel/helpers": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.8.tgz", + "integrity": "sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==", + "dev": true, + "requires": { + "@babel/template": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/generator": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/traverse": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + } + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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 + } + } + }, + "@babel/highlight": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", + "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", + "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", + "dev": true + }, + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz", + "integrity": "sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5", + "@babel/plugin-proposal-optional-chaining": "^7.14.5" + } + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.14.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.7.tgz", + "integrity": "sha512-RK8Wj7lXLY3bqei69/cc25gwS5puEc3dknoFPFbqfy3XxYQBQFvu4ioWpafMBAB+L9NyptQK4nMOa5Xz16og8Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-remap-async-to-generator": "^7.14.5", + "@babel/plugin-syntax-async-generators": "^7.8.4" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz", + "integrity": "sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-proposal-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.5.tgz", + "integrity": "sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz", + "integrity": "sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + } + }, + "@babel/plugin-proposal-export-namespace-from": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz", + "integrity": "sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz", + "integrity": "sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" + } + }, + "@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz", + "integrity": "sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz", + "integrity": "sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz", + "integrity": "sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.14.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz", + "integrity": "sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.14.7", + "@babel/helper-compilation-targets": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.14.5" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz", + "integrity": "sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz", + "integrity": "sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + } + }, + "@babel/plugin-proposal-private-methods": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz", + "integrity": "sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-proposal-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.14.5", + "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz", + "integrity": "sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz", + "integrity": "sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz", + "integrity": "sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-remap-async-to-generator": "^7.14.5" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz", + "integrity": "sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.5.tgz", + "integrity": "sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.5.tgz", + "integrity": "sha512-J4VxKAMykM06K/64z9rwiL6xnBHgB1+FVspqvlgCdwD1KUbQNfszeKVVOMh59w3sztHYIZDgnhOC4WbdEfHFDA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.14.5", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-optimise-call-expression": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-replace-supers": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "globals": "^11.1.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz", + "integrity": "sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.14.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz", + "integrity": "sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz", + "integrity": "sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz", + "integrity": "sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz", + "integrity": "sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz", + "integrity": "sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz", + "integrity": "sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } + } + }, + "@babel/plugin-transform-literals": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz", + "integrity": "sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz", + "integrity": "sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz", + "integrity": "sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz", + "integrity": "sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-simple-access": "^7.14.5", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz", + "integrity": "sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-module-transforms": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.5", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz", + "integrity": "sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.14.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.7.tgz", + "integrity": "sha512-DTNOTaS7TkW97xsDMrp7nycUVh6sn/eq22VaxWfEdzuEbRsiaOU0pqU7DlyUGHVsbQbSghvjKRpEl+nUCKGQSg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.14.5" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz", + "integrity": "sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz", + "integrity": "sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-replace-supers": "^7.14.5" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz", + "integrity": "sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz", + "integrity": "sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz", + "integrity": "sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + }, + "dependencies": { + "regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + } + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz", + "integrity": "sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-runtime": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.14.5.tgz", + "integrity": "sha512-fPMBhh1AV8ZyneiCIA+wYYUH1arzlXR1UMcApjvchDhfKxhy2r2lReJv8uHEyihi4IFIGlr1Pdx7S5fkESDQsg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "babel-plugin-polyfill-corejs2": "^0.2.2", + "babel-plugin-polyfill-corejs3": "^0.2.2", + "babel-plugin-polyfill-regenerator": "^0.2.2", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz", + "integrity": "sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.14.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz", + "integrity": "sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz", + "integrity": "sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz", + "integrity": "sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz", + "integrity": "sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz", + "integrity": "sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz", + "integrity": "sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/preset-env": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.8.tgz", + "integrity": "sha512-a9aOppDU93oArQ51H+B8M1vH+tayZbuBqzjOhntGetZVa+4tTu5jp+XTwqHGG2lxslqomPYVSjIxQkFwXzgnxg==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.14.7", + "@babel/helper-compilation-targets": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-validator-option": "^7.14.5", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.14.5", + "@babel/plugin-proposal-async-generator-functions": "^7.14.7", + "@babel/plugin-proposal-class-properties": "^7.14.5", + "@babel/plugin-proposal-class-static-block": "^7.14.5", + "@babel/plugin-proposal-dynamic-import": "^7.14.5", + "@babel/plugin-proposal-export-namespace-from": "^7.14.5", + "@babel/plugin-proposal-json-strings": "^7.14.5", + "@babel/plugin-proposal-logical-assignment-operators": "^7.14.5", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", + "@babel/plugin-proposal-numeric-separator": "^7.14.5", + "@babel/plugin-proposal-object-rest-spread": "^7.14.7", + "@babel/plugin-proposal-optional-catch-binding": "^7.14.5", + "@babel/plugin-proposal-optional-chaining": "^7.14.5", + "@babel/plugin-proposal-private-methods": "^7.14.5", + "@babel/plugin-proposal-private-property-in-object": "^7.14.5", + "@babel/plugin-proposal-unicode-property-regex": "^7.14.5", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-transform-arrow-functions": "^7.14.5", + "@babel/plugin-transform-async-to-generator": "^7.14.5", + "@babel/plugin-transform-block-scoped-functions": "^7.14.5", + "@babel/plugin-transform-block-scoping": "^7.14.5", + "@babel/plugin-transform-classes": "^7.14.5", + "@babel/plugin-transform-computed-properties": "^7.14.5", + "@babel/plugin-transform-destructuring": "^7.14.7", + "@babel/plugin-transform-dotall-regex": "^7.14.5", + "@babel/plugin-transform-duplicate-keys": "^7.14.5", + "@babel/plugin-transform-exponentiation-operator": "^7.14.5", + "@babel/plugin-transform-for-of": "^7.14.5", + "@babel/plugin-transform-function-name": "^7.14.5", + "@babel/plugin-transform-literals": "^7.14.5", + "@babel/plugin-transform-member-expression-literals": "^7.14.5", + "@babel/plugin-transform-modules-amd": "^7.14.5", + "@babel/plugin-transform-modules-commonjs": "^7.14.5", + "@babel/plugin-transform-modules-systemjs": "^7.14.5", + "@babel/plugin-transform-modules-umd": "^7.14.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.14.7", + "@babel/plugin-transform-new-target": "^7.14.5", + "@babel/plugin-transform-object-super": "^7.14.5", + "@babel/plugin-transform-parameters": "^7.14.5", + "@babel/plugin-transform-property-literals": "^7.14.5", + "@babel/plugin-transform-regenerator": "^7.14.5", + "@babel/plugin-transform-reserved-words": "^7.14.5", + "@babel/plugin-transform-shorthand-properties": "^7.14.5", + "@babel/plugin-transform-spread": "^7.14.6", + "@babel/plugin-transform-sticky-regex": "^7.14.5", + "@babel/plugin-transform-template-literals": "^7.14.5", + "@babel/plugin-transform-typeof-symbol": "^7.14.5", + "@babel/plugin-transform-unicode-escapes": "^7.14.5", + "@babel/plugin-transform-unicode-regex": "^7.14.5", + "@babel/preset-modules": "^0.1.4", + "@babel/types": "^7.14.8", + "babel-plugin-polyfill-corejs2": "^0.2.2", + "babel-plugin-polyfill-corejs3": "^0.2.2", + "babel-plugin-polyfill-regenerator": "^0.2.2", + "core-js-compat": "^3.15.0", + "semver": "^6.3.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", + "dev": true + }, + "@babel/types": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.8", + "to-fast-properties": "^2.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "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 + } } }, - "@types/body-parser": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz", - "integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==", + "@babel/preset-modules": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", + "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", + "dev": true, "requires": { - "@types/connect": "*", - "@types/node": "*" + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" } }, - "@types/cheerio": { - "version": "0.22.29", - "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.29.tgz", - "integrity": "sha512-rNX1PsrDPxiNiyLnRKiW2NXHJFHqx0Fl3J2WsZq0MTBspa/FgwlqhXJE2crIcc+/2IglLHtSWw7g053oUR8fOg==", + "@babel/runtime": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.8.tgz", + "integrity": "sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==", "dev": true, "requires": { - "@types/node": "*" + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "dev": true + } } }, - "@types/clone": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/clone/-/clone-2.1.0.tgz", - "integrity": "sha512-d/aS/lPOnUSruPhgNtT8jW39fHRVTLQy9sodysP1kkG8EdAtdZu1vt8NJaYA8w/6Z9j8izkAsx1A/yJhcYR1CA==", - "dev": true - }, - "@types/connect": { - "version": "3.4.33", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", - "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", + "@babel/template": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", + "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", + "dev": true, "requires": { - "@types/node": "*" + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.3", + "@babel/types": "^7.8.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/parser": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", + "dev": true + }, + "@babel/types": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", + "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "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 + } } }, - "@types/content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg==" - }, - "@types/cookies": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.4.tgz", - "integrity": "sha512-oTGtMzZZAVuEjTwCjIh8T8FrC8n/uwy+PG0yTvQcdZ7etoel7C7/3MSd7qrukENTgQtotG7gvBlBojuVs7X5rw==", + "@babel/traverse": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", + "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", + "dev": true, "requires": { - "@types/connect": "*", - "@types/express": "*", - "@types/keygrip": "*", - "@types/node": "*" + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.5.5", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.5.5", + "@babel/types": "^7.5.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } } }, - "@types/d3": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/@types/d3/-/d3-5.7.2.tgz", - "integrity": "sha512-7/wClB8ycneWGy3jdvLfXKTd5SoTg9hji7IdJ0RuO9xTY54YpJ8zlcFADcXhY1J3kCBwxp+/1jeN6a5OMwgYOw==", + "@babel/types": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", + "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", "dev": true, "requires": { - "@types/d3-array": "^1", - "@types/d3-axis": "*", - "@types/d3-brush": "*", - "@types/d3-chord": "*", - "@types/d3-collection": "*", - "@types/d3-color": "*", - "@types/d3-contour": "*", - "@types/d3-dispatch": "*", - "@types/d3-drag": "*", - "@types/d3-dsv": "*", - "@types/d3-ease": "*", - "@types/d3-fetch": "*", - "@types/d3-force": "*", - "@types/d3-format": "*", - "@types/d3-geo": "*", - "@types/d3-hierarchy": "*", - "@types/d3-interpolate": "*", - "@types/d3-path": "*", - "@types/d3-polygon": "*", - "@types/d3-quadtree": "*", - "@types/d3-random": "*", - "@types/d3-scale": "*", - "@types/d3-scale-chromatic": "*", - "@types/d3-selection": "*", - "@types/d3-shape": "*", - "@types/d3-time": "*", - "@types/d3-time-format": "*", - "@types/d3-timer": "*", - "@types/d3-transition": "*", - "@types/d3-voronoi": "*", - "@types/d3-zoom": "*" + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "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 + } } }, - "@types/d3-array": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-1.2.7.tgz", - "integrity": "sha512-51vHWuUyDOi+8XuwPrTw3cFqyh2Slg9y8COYkRfjCPG9TfYqY0hoNPzv/8BrcAy0FeQBzqEo/D/8Nk2caOQJnA==", + "@braintree/sanitize-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-3.1.0.tgz", + "integrity": "sha512-GcIY79elgB+azP74j8vqkiXz8xLFfIzbQJdlwOPisgbKT00tviJQuEghOXSMVxJ00HoYJbGswr4kcllUc4xCcg==", "dev": true }, - "@types/d3-axis": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-1.0.12.tgz", - "integrity": "sha512-BZISgSD5M8TgURyNtcPAmUB9sk490CO1Thb6/gIn0WZTt3Y50IssX+2Z0vTccoqZksUDTep0b+o4ofXslvNbqg==", - "dev": true, + "@dabh/diagnostics": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", + "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", "requires": { - "@types/d3-selection": "*" + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" } }, - "@types/d3-brush": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-1.1.1.tgz", - "integrity": "sha512-Exx14trm/q2cskHyMjCrdDllOQ35r1/pmZXaOIt8bBHwYNk722vWY3VxHvN0jdFFX7p2iL3+gD+cGny/aEmhlw==", + "@discoveryjs/json-ext": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", + "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==", + "dev": true + }, + "@eslint/eslintrc": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", "dev": true, "requires": { - "@types/d3-selection": "*" + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "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" + } + }, + "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" + } + }, + "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 + }, + "globals": { + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "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 + }, + "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" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } } }, - "@types/d3-chord": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-1.0.9.tgz", - "integrity": "sha512-UA6lI9CVW5cT5Ku/RV4hxoFn4mKySHm7HEgodtfRthAj1lt9rKZEPon58vyYfk+HIAm33DtJJgZwMXy2QgyPXw==", - "dev": true - }, - "@types/d3-collection": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/d3-collection/-/d3-collection-1.0.8.tgz", - "integrity": "sha512-y5lGlazdc0HNO0F3UUX2DPE7OmYvd9Kcym4hXwrJcNUkDaypR5pX+apuMikl9LfTxKItJsY9KYvzBulpCKyvuQ==", - "dev": true - }, - "@types/d3-color": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-1.2.2.tgz", - "integrity": "sha512-6pBxzJ8ZP3dYEQ4YjQ+NVbQaOflfgXq/JbDiS99oLobM2o72uAST4q6yPxHv6FOTCRC/n35ktuo8pvw/S4M7sw==", + "@hackmd/codemirror": { + "version": "5.57.7", + "resolved": "https://registry.npmjs.org/@hackmd/codemirror/-/codemirror-5.57.7.tgz", + "integrity": "sha512-eNWQaKg39JoCH++PyM6drafjKLf7LmpCypI4/K3ftGo/wuTh4iZXk02qoRWFMVSvowYN7eH8pDSkKiZmiD2T1w==", "dev": true }, - "@types/d3-contour": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-1.3.0.tgz", - "integrity": "sha512-AUCUIjEnC5lCGBM9hS+MryRaFLIrPls4Rbv6ktqbd+TK/RXZPwOy9rtBWmGpbeXcSOYCJTUDwNJuEnmYPJRxHQ==", - "dev": true, - "requires": { - "@types/d3-array": "*", - "@types/geojson": "*" - } - }, - "@types/d3-dispatch": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-1.0.8.tgz", - "integrity": "sha512-lCDtqoYez0TgFN3FljBXrz2icqeSzD0gufGook6DPBia+NOh2TBfogjHIsmNa/a+ZOewlHtq4cgLY80O1uLymw==", - "dev": true + "@hackmd/diff-match-patch": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@hackmd/diff-match-patch/-/diff-match-patch-1.1.3.tgz", + "integrity": "sha512-n6drMSGRHzK33vc8qNhJmMwLYOrtWKugkJAFTETHEKew+E3KwEKhaR0TTHl1sgm5gujvdPPQRXAHC5EI81tMFA==" }, - "@types/d3-drag": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-1.2.3.tgz", - "integrity": "sha512-rWB5SPvkYVxW3sqUxHOJUZwifD0KqvKwvt1bhNqcLpW6Azsd0BJgRNcyVW8GAferaAk5r8dzeZnf9zKlg9+xMQ==", + "@hackmd/emojify.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@hackmd/emojify.js/-/emojify.js-2.1.0.tgz", + "integrity": "sha512-RmQXPGD/uGaa0w2qoc+y6ur+TpQhAr2aBOm2QDLBDMzOdhkdmh9MyadM2rtLGz6U3ZilPjkQYzs+gHm1BhwvtA==", "dev": true, "requires": { - "@types/d3-selection": "*" + "@babel/runtime": "^7.5.5", + "core-js": "^3.2.1" + }, + "dependencies": { + "core-js": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", + "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", + "dev": true + } } }, - "@types/d3-dsv": { - "version": "1.0.36", - "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-1.0.36.tgz", - "integrity": "sha512-jbIWQ27QJcBNMZbQv0NSQMHnBDCmxghAxePxgyiPH1XPCRkOsTBei7jcdi3fDrUCGpCV3lKrSZFSlOkhUQVClA==", - "dev": true - }, - "@types/d3-ease": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-1.0.9.tgz", - "integrity": "sha512-U5ADevQ+W6fy32FVZZC9EXallcV/Mi12A5Tkd0My5MrC7T8soMQEhlDAg88XUWm0zoCQlB4XV0en/24LvuDB4Q==", + "@hackmd/idle-js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@hackmd/idle-js/-/idle-js-1.0.1.tgz", + "integrity": "sha512-yuv9BBdA5rk4TpmSrsdNgkLIyRt73hWyBEs7PhWhIozFcNv66JfUzXqA0eT3ToXX0163aVnbpHeJZRvcYy5Seg==", "dev": true }, - "@types/d3-fetch": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-1.1.5.tgz", - "integrity": "sha512-o9c0ItT5/Gl3wbNuVpzRnYX1t3RghzeWAjHUVLuyZJudiTxC4f/fC0ZPFWLQ2lVY8pAMmxpV8TJ6ETYCgPeI3A==", - "dev": true, + "@hackmd/imgur": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@hackmd/imgur/-/imgur-0.5.0.tgz", + "integrity": "sha512-5WygmZ0LEezFMxlxxuT03Y9ZNtbJU2ECHTi1Mc2m7SPeUG6sfU3vGsQKmooWA6f5F7HLVskuaSVVq9mOMQv5jg==", "requires": { - "@types/d3-dsv": "*" + "commander": "^2.13.0", + "glob": "^7.1.2", + "q": "^2.0.3", + "request": "^2.83.0" + }, + "dependencies": { + "q": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/q/-/q-2.0.3.tgz", + "integrity": "sha1-dbjbAlWhpa+C9Yw/Oqoe/sfQ0TQ=", + "requires": { + "asap": "^2.0.0", + "pop-iterate": "^1.0.1", + "weak-map": "^1.0.5" + } + } } }, - "@types/d3-force": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-1.2.1.tgz", - "integrity": "sha512-jqK+I36uz4kTBjyk39meed5y31Ab+tXYN/x1dn3nZEus9yOHCLc+VrcIYLc/aSQ0Y7tMPRlIhLetulME76EiiA==", + "@hackmd/js-sequence-diagrams": { + "version": "0.0.1-alpha.3", + "resolved": "https://registry.npmjs.org/@hackmd/js-sequence-diagrams/-/js-sequence-diagrams-0.0.1-alpha.3.tgz", + "integrity": "sha512-eHpAlFAKU4BmNvwvXryQh7nkdUaYP1FBeMf0zENRHyT9RtkVaY12F61AY2Pbx60xb5+mvg1qxnm3ODLApH9jjQ==", "dev": true }, - "@types/d3-format": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-1.3.1.tgz", - "integrity": "sha512-KAWvReOKMDreaAwOjdfQMm0HjcUMlQG47GwqdVKgmm20vTd2pucj0a70c3gUSHrnsmo6H2AMrkBsZU2UhJLq8A==", - "dev": true + "@hackmd/lz-string": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@hackmd/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha512-KP8U3BGp/qOdoQBfQp1nHvdyT/xi3dBV2qq8YPv1P5rBCR7OF9NpGTdAoOR6n3fONEaMJBdy069cGGbycJolpQ==" }, - "@types/d3-geo": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-1.11.1.tgz", - "integrity": "sha512-Ox8WWOG3igDRoep/dNsGbOiSJYdUG3ew/6z0ETvHyAtXZVBjOE0S96zSSmzgl0gqQ3RdZjn2eeJOj9oRcMZPkQ==", - "dev": true, + "@hackmd/meta-marked": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@hackmd/meta-marked/-/meta-marked-0.4.4.tgz", + "integrity": "sha512-idndsvVHGn9m11H1w6N1YeUH3wecOVSBjDFH5ENDhgVsmHoms3V4e0Vi1q3boQRQKV/dVxYK0Fk1f3Psvjg60w==", "requires": { - "@types/geojson": "*" + "js-yaml": "~3.13.1", + "marked": "~0.6.2" } }, - "@types/d3-hierarchy": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-1.1.6.tgz", - "integrity": "sha512-vvSaIDf/Ov0o3KwMT+1M8+WbnnlRiGjlGD5uvk83a1mPCTd/E5x12bUJ/oP55+wUY/4Kb5kc67rVpVGJ2KUHxg==", - "dev": true - }, - "@types/d3-interpolate": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-1.3.1.tgz", - "integrity": "sha512-z8Zmi08XVwe8e62vP6wcA+CNuRhpuUU5XPEfqpG0hRypDE5BWNthQHB1UNWWDB7ojCbGaN4qBdsWp5kWxhT1IQ==", - "dev": true, + "@hackmd/pandoc.js": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@hackmd/pandoc.js/-/pandoc.js-0.1.9.tgz", + "integrity": "sha512-Z8i8vpFOP34v9rRm0vURTmDSqTW8JcXlI1TIiW3AKuJ3+nygTYc/wkaPATRLvusv1JkPrD+m4cIv4aPO9GkULw==", "requires": { - "@types/d3-color": "*" + "extract-zip": "^1.6.7", + "fs-extra": "^8.1.0", + "glob": "^7.1.4", + "got": "^9.6.0", + "progress": "^2.0.3", + "tar": "^5.0.5" } }, - "@types/d3-path": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.8.tgz", - "integrity": "sha512-AZGHWslq/oApTAHu9+yH/Bnk63y9oFOMROtqPAtxl5uB6qm1x2lueWdVEjsjjV3Qc2+QfuzKIwIR5MvVBakfzA==", - "dev": true - }, - "@types/d3-polygon": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-1.0.7.tgz", - "integrity": "sha512-Xuw0eSjQQKs8jTiNbntWH0S+Xp+JyhqxmQ0YAQ3rDu6c3kKMFfgsaGN7Jv5u3zG6yVX/AsLP/Xs/QRjmi9g43Q==", - "dev": true - }, - "@types/d3-quadtree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-1.0.7.tgz", - "integrity": "sha512-0ajFawWicfjsaCLh6NzxOyVDYhQAmMFbsiI3MPGLInorauHFEh9/Cl6UHNf+kt/J1jfoxKY/ZJaKAoDpbvde5Q==", - "dev": true - }, - "@types/d3-random": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-1.1.2.tgz", - "integrity": "sha512-Jui+Zn28pQw/3EayPKaN4c/PqTvqNbIPjHkgIIFnxne1FdwNjfHtAIsZIBMKlquQNrrMjFzCrlF2gPs3xckqaA==", - "dev": true - }, - "@types/d3-scale": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-2.2.0.tgz", - "integrity": "sha512-oQFanN0/PiR2oySHfj+zAAkK1/p4LD32Nt1TMVmzk+bYHk7vgIg/iTXQWitp1cIkDw4LMdcgvO63wL+mNs47YA==", + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { - "@types/d3-time": "*" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" } }, - "@types/d3-scale-chromatic": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz", - "integrity": "sha512-9/D7cOBKdZdTCPc6re0HeSUFBM0aFzdNdmYggUWT9SRRiYSOa6Ys2xdTwHKgc1WS3gGfwTMatBOdWCS863REsg==", - "dev": true - }, - "@types/d3-selection": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-1.4.2.tgz", - "integrity": "sha512-ksY8UxvTXpzD91Dy3D9zZg98yF2ZEPMKJd8ZQJlZt1QH3Xxr08s6fESEdC2l0Kbe6Xd9VhaoJX06cRaMR1lEnA==", + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, - "@types/d3-shape": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.3.2.tgz", - "integrity": "sha512-LtD8EaNYCaBRzHzaAiIPrfcL3DdIysc81dkGlQvv7WQP3+YXV7b0JJTtR1U3bzeRieS603KF4wUo+ZkJVenh8w==", + "@nodelib/fs.walk": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", + "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", "dev": true, "requires": { - "@types/d3-path": "*" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" } }, - "@types/d3-time": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-1.0.10.tgz", - "integrity": "sha512-aKf62rRQafDQmSiv1NylKhIMmznsjRN+MnXRXTqHoqm0U/UZzVpdrtRnSIfdiLS616OuC1soYeX1dBg2n1u8Xw==", - "dev": true - }, - "@types/d3-time-format": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-2.1.1.tgz", - "integrity": "sha512-tJSyXta8ZyJ52wDDHA96JEsvkbL6jl7wowGmuf45+fAkj5Y+SQOnz0N7/H68OWmPshPsAaWMQh+GAws44IzH3g==", - "dev": true - }, - "@types/d3-timer": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-1.0.9.tgz", - "integrity": "sha512-WvfJ3LFxBbWjqRGz9n7GJt08RrTHPJDVsIwwoCMROlqF+iDacYiAFjf9oqnq0mXpb2juA2N/qjKP+MKdal3YNQ==", - "dev": true - }, - "@types/d3-transition": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-1.1.6.tgz", - "integrity": "sha512-/F+O2r4oz4G9ATIH3cuSCMGphAnl7VDx7SbENEK0NlI/FE8Jx2oiIrv0uTrpg7yF/AmuWbqp7AGdEHAPIh24Gg==", - "dev": true, + "@passport-next/passport-openid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@passport-next/passport-openid/-/passport-openid-1.0.0.tgz", + "integrity": "sha512-W9uj4Ui/ZK/iBUNzSNxPWDQ8wCD1tUddGEVSGm0FN0B7ewo3yBQLGMoW3i3UqcwEzxdyGbAj06ohAhNQIXC4VA==", "requires": { - "@types/d3-selection": "*" + "@passport-next/passport-strategy": "1.x.x", + "openid": "2.x.x" } }, - "@types/d3-voronoi": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@types/d3-voronoi/-/d3-voronoi-1.1.9.tgz", - "integrity": "sha512-DExNQkaHd1F3dFPvGA/Aw2NGyjMln6E9QzsiqOcBgnE+VInYnFBHBBySbZQts6z6xD+5jTfKCP7M4OqMyVjdwQ==", - "dev": true + "@passport-next/passport-strategy": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@passport-next/passport-strategy/-/passport-strategy-1.1.0.tgz", + "integrity": "sha512-2KhFjtPueJG6xVj2HnqXt9BlANOfYCVLyu+pXYjPGBDT8yk+vQwc/6tsceIj+mayKcoxMau2JimggXRPHgoc8w==" }, - "@types/d3-zoom": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-1.7.4.tgz", - "integrity": "sha512-5jnFo/itYhJeB2khO/lKe730kW/h2EbKMOvY0uNp3+7NdPm4w63DwPEMxifQZ7n902xGYK5DdU67FmToSoy4VA==", + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" + }, + "@sinonjs/commons": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz", + "integrity": "sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg==", "dev": true, "requires": { - "@types/d3-interpolate": "*", - "@types/d3-selection": "*" + "type-detect": "4.0.8" } }, - "@types/engine.io": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@types/engine.io/-/engine.io-3.1.5.tgz", - "integrity": "sha512-DLVpLEGTEZGBXOYoYoagHSxXkDHONc0fZouF2ayw7Q18aRu1Afwci+1CFKvPpouCUOVWP+dmCaAWpQjswe7kpg==", + "@sinonjs/formatio": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", + "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", "dev": true, "requires": { - "@types/node": "*" + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^3.1.0" } }, - "@types/eslint": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", - "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==", + "@sinonjs/samsam": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", + "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", "dev": true, "requires": { - "@types/estree": "*", - "@types/json-schema": "*" + "@sinonjs/commons": "^1.3.0", + "array-from": "^2.1.1", + "lodash": "^4.17.15" } }, - "@types/eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==", + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "@susisu/mte-kernel": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@susisu/mte-kernel/-/mte-kernel-2.1.0.tgz", + "integrity": "sha512-4XgtDqZNoVGy2BKqHBhm972T4uGaOWRK1BNnh97ryL2cm2Z8g7Zq59OwcNUNaNLVoqsCp6Nv61qn4z+gq4DYyw==", "dev": true, "requires": { - "@types/eslint": "*", - "@types/estree": "*" + "meaw": "^4.3.0" } }, - "@types/estree": { - "version": "0.0.50", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", - "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@textlint/ast-node-types": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@textlint/ast-node-types/-/ast-node-types-4.2.5.tgz", + "integrity": "sha512-+rEx4jLOeZpUcdvll7jEg/7hNbwYvHWFy4IGW/tk2JdbyB3SJVyIP6arAwzTH/sp/pO9jftfyZnRj4//sLbLvQ==", "dev": true }, - "@types/express": { - "version": "4.17.9", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.9.tgz", - "integrity": "sha512-SDzEIZInC4sivGIFY4Sz1GG6J9UObPwCInYJjko2jzOf/Imx/dlpume6Xxwj1ORL82tBbmN4cPDIDkLbWHk9hw==", + "@textlint/markdown-to-ast": { + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@textlint/markdown-to-ast/-/markdown-to-ast-6.0.9.tgz", + "integrity": "sha512-hfAWBvTeUGh5t5kTn2U3uP3qOSM1BSrxzl1jF3nn0ywfZXpRBZr5yRjXnl4DzIYawCtZOshmRi/tI3/x4TE1jQ==", + "dev": true, "requires": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "*", - "@types/qs": "*", - "@types/serve-static": "*" + "@textlint/ast-node-types": "^4.0.3", + "debug": "^2.1.3", + "remark-frontmatter": "^1.2.0", + "remark-parse": "^5.0.0", + "structured-source": "^3.0.2", + "traverse": "^0.6.6", + "unified": "^6.1.6" } }, - "@types/express-flash": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@types/express-flash/-/express-flash-0.0.2.tgz", - "integrity": "sha512-1l0s3YiZpMkWZ/65S4iSOLOnI7bYNDgnxx54nw5eA2pWOZ7Vvc7PpDv6iJq0bB7EBusoVWkzd+RV4r/nLY4/HA==", - "dev": true, + "@trysound/sax": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.1.1.tgz", + "integrity": "sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==", + "dev": true + }, + "@types/accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", "requires": { - "@types/express": "*" + "@types/node": "*" } }, - "@types/express-serve-static-core": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.21.tgz", - "integrity": "sha512-gwCiEZqW6f7EoR8TTEfalyEhb1zA5jQJnRngr97+3pzMaO1RKoI1w2bw07TK72renMUVWcWS5mLI6rk1NqN0nA==", + "@types/body-parser": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz", + "integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==", "requires": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" + "@types/connect": "*", + "@types/node": "*" } }, - "@types/express-session": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/@types/express-session/-/express-session-1.17.3.tgz", - "integrity": "sha512-57DnyxiqClXOIjoCgeKCUYfKxBPOlOY/k+l1TPK+7bSwyiPTrS5FIk1Ycql7twk4wO7P5lfOVy6akDGiaMSLfw==", + "@types/cheerio": { + "version": "0.22.29", + "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.29.tgz", + "integrity": "sha512-rNX1PsrDPxiNiyLnRKiW2NXHJFHqx0Fl3J2WsZq0MTBspa/FgwlqhXJE2crIcc+/2IglLHtSWw7g053oUR8fOg==", "dev": true, "requires": { - "@types/express": "*" + "@types/node": "*" } }, - "@types/fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ==", - "dev": true - }, - "@types/geojson": { - "version": "7946.0.7", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz", - "integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ==", - "dev": true - }, - "@types/html-minifier-terser": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz", - "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==", + "@types/clone": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/clone/-/clone-2.1.0.tgz", + "integrity": "sha512-d/aS/lPOnUSruPhgNtT8jW39fHRVTLQy9sodysP1kkG8EdAtdZu1vt8NJaYA8w/6Z9j8izkAsx1A/yJhcYR1CA==", "dev": true }, - "@types/http-assert": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz", - "integrity": "sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ==" - }, - "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", - "dev": true + "@types/connect": { + "version": "3.4.33", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", + "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", + "requires": { + "@types/node": "*" + } }, - "@types/keygrip": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz", - "integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==" + "@types/content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg==" }, - "@types/koa": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.11.3.tgz", - "integrity": "sha512-ABxVkrNWa4O/Jp24EYI/hRNqEVRlhB9g09p48neQp4m3xL1TJtdWk2NyNQSMCU45ejeELMQZBYyfstyVvO2H3Q==", + "@types/cookies": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.4.tgz", + "integrity": "sha512-oTGtMzZZAVuEjTwCjIh8T8FrC8n/uwy+PG0yTvQcdZ7etoel7C7/3MSd7qrukENTgQtotG7gvBlBojuVs7X5rw==", "requires": { - "@types/accepts": "*", - "@types/content-disposition": "*", - "@types/cookies": "*", - "@types/http-assert": "*", + "@types/connect": "*", + "@types/express": "*", "@types/keygrip": "*", - "@types/koa-compose": "*", "@types/node": "*" } }, - "@types/koa-compose": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz", - "integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==", + "@types/d3": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-5.7.2.tgz", + "integrity": "sha512-7/wClB8ycneWGy3jdvLfXKTd5SoTg9hji7IdJ0RuO9xTY54YpJ8zlcFADcXhY1J3kCBwxp+/1jeN6a5OMwgYOw==", + "dev": true, + "requires": { + "@types/d3-array": "^1", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-collection": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-voronoi": "*", + "@types/d3-zoom": "*" + } + }, + "@types/d3-array": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-1.2.7.tgz", + "integrity": "sha512-51vHWuUyDOi+8XuwPrTw3cFqyh2Slg9y8COYkRfjCPG9TfYqY0hoNPzv/8BrcAy0FeQBzqEo/D/8Nk2caOQJnA==", + "dev": true + }, + "@types/d3-axis": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-1.0.12.tgz", + "integrity": "sha512-BZISgSD5M8TgURyNtcPAmUB9sk490CO1Thb6/gIn0WZTt3Y50IssX+2Z0vTccoqZksUDTep0b+o4ofXslvNbqg==", + "dev": true, "requires": { - "@types/koa": "*" + "@types/d3-selection": "*" } }, - "@types/ldapjs": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-1.0.5.tgz", - "integrity": "sha512-hrtMZjVfWNPxkwFkYhLAU0ITZ3/reDft4jDzLBvrGDSKCbEvW+GeZb4PgM3jlSwSsv0cXqnDeWcupFLIgW9E0Q==", + "@types/d3-brush": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-1.1.1.tgz", + "integrity": "sha512-Exx14trm/q2cskHyMjCrdDllOQ35r1/pmZXaOIt8bBHwYNk722vWY3VxHvN0jdFFX7p2iL3+gD+cGny/aEmhlw==", + "dev": true, "requires": { - "@types/node": "*" + "@types/d3-selection": "*" } }, - "@types/lodash": { - "version": "4.14.170", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", - "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==", + "@types/d3-chord": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-1.0.9.tgz", + "integrity": "sha512-UA6lI9CVW5cT5Ku/RV4hxoFn4mKySHm7HEgodtfRthAj1lt9rKZEPon58vyYfk+HIAm33DtJJgZwMXy2QgyPXw==", "dev": true }, - "@types/markdown-pdf": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@types/markdown-pdf/-/markdown-pdf-9.0.0.tgz", - "integrity": "sha512-T/WQ6cRAhWaxcs1HHoqMYz7ZXcA/MMjR8RrX1SY6mpmc0n/CsGzy/hvffMLaiI0L+vxsvxNNC3rB59NqxrlL2w==", + "@types/d3-collection": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-collection/-/d3-collection-1.0.8.tgz", + "integrity": "sha512-y5lGlazdc0HNO0F3UUX2DPE7OmYvd9Kcym4hXwrJcNUkDaypR5pX+apuMikl9LfTxKItJsY9KYvzBulpCKyvuQ==", "dev": true }, - "@types/mime": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", - "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" - }, - "@types/mime-types": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.0.tgz", - "integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM=", + "@types/d3-color": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-1.2.2.tgz", + "integrity": "sha512-6pBxzJ8ZP3dYEQ4YjQ+NVbQaOflfgXq/JbDiS99oLobM2o72uAST4q6yPxHv6FOTCRC/n35ktuo8pvw/S4M7sw==", "dev": true }, - "@types/minio": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/minio/-/minio-7.0.7.tgz", - "integrity": "sha512-cK0VuWZ5zvFmkxQzK46RtJ4qt2Gtrv34hsXDr0D3vqesjrnEKT+0rw0zWk40JtCPkoEFgLdIUbXnePsKjbb80Q==", + "@types/d3-contour": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-1.3.0.tgz", + "integrity": "sha512-AUCUIjEnC5lCGBM9hS+MryRaFLIrPls4Rbv6ktqbd+TK/RXZPwOy9rtBWmGpbeXcSOYCJTUDwNJuEnmYPJRxHQ==", "dev": true, "requires": { - "@types/node": "*" + "@types/d3-array": "*", + "@types/geojson": "*" } }, - "@types/node": { - "version": "12.20.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.15.tgz", - "integrity": "sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==" + "@types/d3-dispatch": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-1.0.8.tgz", + "integrity": "sha512-lCDtqoYez0TgFN3FljBXrz2icqeSzD0gufGook6DPBia+NOh2TBfogjHIsmNa/a+ZOewlHtq4cgLY80O1uLymw==", + "dev": true }, - "@types/oauth": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.1.tgz", - "integrity": "sha512-a1iY62/a3yhZ7qH7cNUsxoI3U/0Fe9+RnuFrpTKr+0WVOzbKlSLojShCKe20aOD1Sppv+i8Zlq0pLDuTJnwS4A==", + "@types/d3-drag": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-1.2.3.tgz", + "integrity": "sha512-rWB5SPvkYVxW3sqUxHOJUZwifD0KqvKwvt1bhNqcLpW6Azsd0BJgRNcyVW8GAferaAk5r8dzeZnf9zKlg9+xMQ==", "dev": true, "requires": { - "@types/node": "*" + "@types/d3-selection": "*" } }, - "@types/passport": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.2.tgz", - "integrity": "sha512-Pf39AYKf8q+YoONym3150cEwfUD66dtwHJWvbeOzKxnA0GZZ/vAXhNWv9vMhKyRQBQZiQyWQnhYBEBlKW6G8wg==", - "requires": { - "@types/express": "*" - } + "@types/d3-dsv": { + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-1.0.36.tgz", + "integrity": "sha512-jbIWQ27QJcBNMZbQv0NSQMHnBDCmxghAxePxgyiPH1XPCRkOsTBei7jcdi3fDrUCGpCV3lKrSZFSlOkhUQVClA==", + "dev": true }, - "@types/passport-google-oauth20": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@types/passport-google-oauth20/-/passport-google-oauth20-2.0.8.tgz", - "integrity": "sha512-Lc+DYCCFeMVbodISydQLT6PjIlL0TcLup3HMiJ8RHHHBltArA3oC4qocyQH1OsEq5ovQ19PaKlpGqsNT8NYz1w==", + "@types/d3-ease": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-1.0.9.tgz", + "integrity": "sha512-U5ADevQ+W6fy32FVZZC9EXallcV/Mi12A5Tkd0My5MrC7T8soMQEhlDAg88XUWm0zoCQlB4XV0en/24LvuDB4Q==", + "dev": true + }, + "@types/d3-fetch": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-1.1.5.tgz", + "integrity": "sha512-o9c0ItT5/Gl3wbNuVpzRnYX1t3RghzeWAjHUVLuyZJudiTxC4f/fC0ZPFWLQ2lVY8pAMmxpV8TJ6ETYCgPeI3A==", "dev": true, "requires": { - "@types/express": "*", - "@types/passport": "*", - "@types/passport-oauth2": "*" + "@types/d3-dsv": "*" } }, - "@types/passport-oauth2": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/@types/passport-oauth2/-/passport-oauth2-1.4.10.tgz", - "integrity": "sha512-klShWm9xAqjM3rU31KyMMiB9M8jmJPkStUvCJ/kIv73/Vh3OVnfeTExrkMCM2wA+94MliExqwHVL3J0WD2kbnQ==", + "@types/d3-force": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-1.2.1.tgz", + "integrity": "sha512-jqK+I36uz4kTBjyk39meed5y31Ab+tXYN/x1dn3nZEus9yOHCLc+VrcIYLc/aSQ0Y7tMPRlIhLetulME76EiiA==", + "dev": true + }, + "@types/d3-format": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-1.3.1.tgz", + "integrity": "sha512-KAWvReOKMDreaAwOjdfQMm0HjcUMlQG47GwqdVKgmm20vTd2pucj0a70c3gUSHrnsmo6H2AMrkBsZU2UhJLq8A==", + "dev": true + }, + "@types/d3-geo": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-1.11.1.tgz", + "integrity": "sha512-Ox8WWOG3igDRoep/dNsGbOiSJYdUG3ew/6z0ETvHyAtXZVBjOE0S96zSSmzgl0gqQ3RdZjn2eeJOj9oRcMZPkQ==", "dev": true, "requires": { - "@types/express": "*", - "@types/oauth": "*", - "@types/passport": "*" + "@types/geojson": "*" } }, - "@types/passport.socketio": { - "version": "3.7.5", - "resolved": "https://registry.npmjs.org/@types/passport.socketio/-/passport.socketio-3.7.5.tgz", - "integrity": "sha512-ldYKNCHsoqD8bjvnMNgmNszGmEvWML3RPy0CNW14BAhkf3d/xSbmhKqn3qaeRWFJ/BhOgs02HWtWW4O5d5SLUA==", + "@types/d3-hierarchy": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-1.1.6.tgz", + "integrity": "sha512-vvSaIDf/Ov0o3KwMT+1M8+WbnnlRiGjlGD5uvk83a1mPCTd/E5x12bUJ/oP55+wUY/4Kb5kc67rVpVGJ2KUHxg==", + "dev": true + }, + "@types/d3-interpolate": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-1.3.1.tgz", + "integrity": "sha512-z8Zmi08XVwe8e62vP6wcA+CNuRhpuUU5XPEfqpG0hRypDE5BWNthQHB1UNWWDB7ojCbGaN4qBdsWp5kWxhT1IQ==", "dev": true, "requires": { - "@types/express": "*", - "@types/express-session": "*", - "@types/passport": "*", - "@types/socket.io": "2.1.13" + "@types/d3-color": "*" } }, - "@types/qs": { - "version": "6.9.6", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", - "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==" + "@types/d3-path": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.8.tgz", + "integrity": "sha512-AZGHWslq/oApTAHu9+yH/Bnk63y9oFOMROtqPAtxl5uB6qm1x2lueWdVEjsjjV3Qc2+QfuzKIwIR5MvVBakfzA==", + "dev": true }, - "@types/randomcolor": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/@types/randomcolor/-/randomcolor-0.5.5.tgz", - "integrity": "sha512-PywdYff3F8lGO3BggkCXaPFH0Ue/2Y7xliihoQNkxCGPJ4w7VTMfgcmSMIE6gOVAEu9Wx42JRSuRREVG3AUrtg==", + "@types/d3-polygon": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-1.0.7.tgz", + "integrity": "sha512-Xuw0eSjQQKs8jTiNbntWH0S+Xp+JyhqxmQ0YAQ3rDu6c3kKMFfgsaGN7Jv5u3zG6yVX/AsLP/Xs/QRjmi9g43Q==", "dev": true }, - "@types/range-parser": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", - "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" + "@types/d3-quadtree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-1.0.7.tgz", + "integrity": "sha512-0ajFawWicfjsaCLh6NzxOyVDYhQAmMFbsiI3MPGLInorauHFEh9/Cl6UHNf+kt/J1jfoxKY/ZJaKAoDpbvde5Q==", + "dev": true }, - "@types/serve-static": { - "version": "1.13.9", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", - "integrity": "sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA==", + "@types/d3-random": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-1.1.2.tgz", + "integrity": "sha512-Jui+Zn28pQw/3EayPKaN4c/PqTvqNbIPjHkgIIFnxne1FdwNjfHtAIsZIBMKlquQNrrMjFzCrlF2gPs3xckqaA==", + "dev": true + }, + "@types/d3-scale": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-2.2.0.tgz", + "integrity": "sha512-oQFanN0/PiR2oySHfj+zAAkK1/p4LD32Nt1TMVmzk+bYHk7vgIg/iTXQWitp1cIkDw4LMdcgvO63wL+mNs47YA==", + "dev": true, "requires": { - "@types/mime": "^1", - "@types/node": "*" + "@types/d3-time": "*" } }, - "@types/socket.io": { - "version": "2.1.13", - "resolved": "https://registry.npmjs.org/@types/socket.io/-/socket.io-2.1.13.tgz", - "integrity": "sha512-JRgH3nCgsWel4OPANkhH8TelpXvacAJ9VeryjuqCDiaVDMpLysd6sbt0dr6Z15pqH3p2YpOT3T1C5vQ+O/7uyg==", + "@types/d3-scale-chromatic": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz", + "integrity": "sha512-9/D7cOBKdZdTCPc6re0HeSUFBM0aFzdNdmYggUWT9SRRiYSOa6Ys2xdTwHKgc1WS3gGfwTMatBOdWCS863REsg==", + "dev": true + }, + "@types/d3-selection": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-1.4.2.tgz", + "integrity": "sha512-ksY8UxvTXpzD91Dy3D9zZg98yF2ZEPMKJd8ZQJlZt1QH3Xxr08s6fESEdC2l0Kbe6Xd9VhaoJX06cRaMR1lEnA==", + "dev": true + }, + "@types/d3-shape": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.3.2.tgz", + "integrity": "sha512-LtD8EaNYCaBRzHzaAiIPrfcL3DdIysc81dkGlQvv7WQP3+YXV7b0JJTtR1U3bzeRieS603KF4wUo+ZkJVenh8w==", "dev": true, "requires": { - "@types/engine.io": "*", - "@types/node": "*", - "@types/socket.io-parser": "*" + "@types/d3-path": "*" } }, - "@types/socket.io-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/socket.io-parser/-/socket.io-parser-3.0.0.tgz", - "integrity": "sha512-Ry/rbTE6HQNL9eu3LpL1Ocup5VexXu1bSSGlSho/IR5LuRc8YvxwSNJ3JxqTltVJEATLbZkMQETSbxfKNgp4Ew==", + "@types/d3-time": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-1.0.10.tgz", + "integrity": "sha512-aKf62rRQafDQmSiv1NylKhIMmznsjRN+MnXRXTqHoqm0U/UZzVpdrtRnSIfdiLS616OuC1soYeX1dBg2n1u8Xw==", + "dev": true + }, + "@types/d3-time-format": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-2.1.1.tgz", + "integrity": "sha512-tJSyXta8ZyJ52wDDHA96JEsvkbL6jl7wowGmuf45+fAkj5Y+SQOnz0N7/H68OWmPshPsAaWMQh+GAws44IzH3g==", + "dev": true + }, + "@types/d3-timer": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-1.0.9.tgz", + "integrity": "sha512-WvfJ3LFxBbWjqRGz9n7GJt08RrTHPJDVsIwwoCMROlqF+iDacYiAFjf9oqnq0mXpb2juA2N/qjKP+MKdal3YNQ==", + "dev": true + }, + "@types/d3-transition": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-1.1.6.tgz", + "integrity": "sha512-/F+O2r4oz4G9ATIH3cuSCMGphAnl7VDx7SbENEK0NlI/FE8Jx2oiIrv0uTrpg7yF/AmuWbqp7AGdEHAPIh24Gg==", "dev": true, "requires": { - "socket.io-parser": "*" + "@types/d3-selection": "*" } }, - "@types/validator": { - "version": "13.1.4", - "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.1.4.tgz", - "integrity": "sha512-19C02B8mr53HufY7S+HO/EHBD7a/R22IwEwyqiHaR19iwL37dN3o0M8RianVInfSSqP7InVSg/o0mUATM4JWsQ==", + "@types/d3-voronoi": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@types/d3-voronoi/-/d3-voronoi-1.1.9.tgz", + "integrity": "sha512-DExNQkaHd1F3dFPvGA/Aw2NGyjMln6E9QzsiqOcBgnE+VInYnFBHBBySbZQts6z6xD+5jTfKCP7M4OqMyVjdwQ==", "dev": true }, - "@typescript-eslint/eslint-plugin": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.1.tgz", - "integrity": "sha512-aoIusj/8CR+xDWmZxARivZjbMBQTT9dImUtdZ8tVCVRXgBUuuZyM5Of5A9D9arQPxbi/0rlJLcuArclz/rCMJw==", + "@types/d3-zoom": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-1.7.4.tgz", + "integrity": "sha512-5jnFo/itYhJeB2khO/lKe730kW/h2EbKMOvY0uNp3+7NdPm4w63DwPEMxifQZ7n902xGYK5DdU67FmToSoy4VA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.26.1", - "@typescript-eslint/scope-manager": "4.26.1", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.21", - "regexpp": "^3.1.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "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.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "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" - } - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" } }, - "@typescript-eslint/experimental-utils": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.1.tgz", - "integrity": "sha512-sQHBugRhrXzRCs9PaGg6rowie4i8s/iD/DpTB+EXte8OMDfdCG5TvO73XlO9Wc/zi0uyN4qOmX9hIjQEyhnbmQ==", + "@types/engine.io": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@types/engine.io/-/engine.io-3.1.5.tgz", + "integrity": "sha512-DLVpLEGTEZGBXOYoYoagHSxXkDHONc0fZouF2ayw7Q18aRu1Afwci+1CFKvPpouCUOVWP+dmCaAWpQjswe7kpg==", "dev": true, "requires": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.26.1", - "@typescript-eslint/types": "4.26.1", - "@typescript-eslint/typescript-estree": "4.26.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } + "@types/node": "*" } }, - "@typescript-eslint/parser": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.26.1.tgz", - "integrity": "sha512-q7F3zSo/nU6YJpPJvQveVlIIzx9/wu75lr6oDbDzoeIRWxpoc/HQ43G4rmMoCc5my/3uSj2VEpg/D83LYZF5HQ==", + "@types/eslint": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.26.1", - "@typescript-eslint/types": "4.26.1", - "@typescript-eslint/typescript-estree": "4.26.1", - "debug": "^4.3.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" - } - } + "@types/estree": "*", + "@types/json-schema": "*" } }, - "@typescript-eslint/scope-manager": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.26.1.tgz", - "integrity": "sha512-TW1X2p62FQ8Rlne+WEShyd7ac2LA6o27S9i131W4NwDSfyeVlQWhw8ylldNNS8JG6oJB9Ha9Xyc+IUcqipvheQ==", + "@types/eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==", "dev": true, "requires": { - "@typescript-eslint/types": "4.26.1", - "@typescript-eslint/visitor-keys": "4.26.1" + "@types/eslint": "*", + "@types/estree": "*" } }, - "@typescript-eslint/types": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.26.1.tgz", - "integrity": "sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==", + "@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", "dev": true }, - "@typescript-eslint/typescript-estree": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.1.tgz", - "integrity": "sha512-l3ZXob+h0NQzz80lBGaykdScYaiEbFqznEs99uwzm8fPHhDjwaBFfQkjUC/slw6Sm7npFL8qrGEAMxcfBsBJUg==", - "dev": true, + "@types/express": { + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.9.tgz", + "integrity": "sha512-SDzEIZInC4sivGIFY4Sz1GG6J9UObPwCInYJjko2jzOf/Imx/dlpume6Xxwj1ORL82tBbmN4cPDIDkLbWHk9hw==", "requires": { - "@typescript-eslint/types": "4.26.1", - "@typescript-eslint/visitor-keys": "4.26.1", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "dependencies": { - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "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" - } - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "globby": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", - "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - }, - "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" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/qs": "*", + "@types/serve-static": "*" } }, - "@typescript-eslint/visitor-keys": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.1.tgz", - "integrity": "sha512-IGouNSSd+6x/fHtYRyLOM6/C+QxMDzWlDtN41ea+flWuSF9g02iqcIlX8wM53JkfljoIjP0U+yp7SiTS1onEkw==", + "@types/express-flash": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@types/express-flash/-/express-flash-0.0.2.tgz", + "integrity": "sha512-1l0s3YiZpMkWZ/65S4iSOLOnI7bYNDgnxx54nw5eA2pWOZ7Vvc7PpDv6iJq0bB7EBusoVWkzd+RV4r/nLY4/HA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.26.1", - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } + "@types/express": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.21.tgz", + "integrity": "sha512-gwCiEZqW6f7EoR8TTEfalyEhb1zA5jQJnRngr97+3pzMaO1RKoI1w2bw07TK72renMUVWcWS5mLI6rk1NqN0nA==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" } }, - "@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "@types/express-session": { + "version": "1.17.3", + "resolved": "https://registry.npmjs.org/@types/express-session/-/express-session-1.17.3.tgz", + "integrity": "sha512-57DnyxiqClXOIjoCgeKCUYfKxBPOlOY/k+l1TPK+7bSwyiPTrS5FIk1Ycql7twk4wO7P5lfOVy6akDGiaMSLfw==", "dev": true, "requires": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@types/express": "*" } }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "@types/fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ==", "dev": true }, - "@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "@types/geojson": { + "version": "7946.0.7", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz", + "integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ==", "dev": true }, - "@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "@types/html-minifier-terser": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz", + "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==", "dev": true }, - "@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", - "dev": true, + "@types/http-assert": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz", + "integrity": "sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ==" + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "@types/keygrip": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.2.tgz", + "integrity": "sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==" + }, + "@types/koa": { + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.11.3.tgz", + "integrity": "sha512-ABxVkrNWa4O/Jp24EYI/hRNqEVRlhB9g09p48neQp4m3xL1TJtdWk2NyNQSMCU45ejeELMQZBYyfstyVvO2H3Q==", "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@xtuc/long": "4.2.2" + "@types/accepts": "*", + "@types/content-disposition": "*", + "@types/cookies": "*", + "@types/http-assert": "*", + "@types/keygrip": "*", + "@types/koa-compose": "*", + "@types/node": "*" } }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", - "dev": true + "@types/koa-compose": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.5.tgz", + "integrity": "sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==", + "requires": { + "@types/koa": "*" + } }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", - "dev": true, + "@types/ldapjs": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-1.0.5.tgz", + "integrity": "sha512-hrtMZjVfWNPxkwFkYhLAU0ITZ3/reDft4jDzLBvrGDSKCbEvW+GeZb4PgM3jlSwSsv0cXqnDeWcupFLIgW9E0Q==", "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@types/node": "*" } }, - "@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "@types/lodash": { + "version": "4.14.170", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", + "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==", + "dev": true + }, + "@types/markdown-pdf": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/markdown-pdf/-/markdown-pdf-9.0.0.tgz", + "integrity": "sha512-T/WQ6cRAhWaxcs1HHoqMYz7ZXcA/MMjR8RrX1SY6mpmc0n/CsGzy/hvffMLaiI0L+vxsvxNNC3rB59NqxrlL2w==", + "dev": true + }, + "@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" + }, + "@types/mime-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.0.tgz", + "integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM=", + "dev": true + }, + "@types/minio": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/minio/-/minio-7.0.7.tgz", + "integrity": "sha512-cK0VuWZ5zvFmkxQzK46RtJ4qt2Gtrv34hsXDr0D3vqesjrnEKT+0rw0zWk40JtCPkoEFgLdIUbXnePsKjbb80Q==", "dev": true, "requires": { - "@xtuc/ieee754": "^1.2.0" + "@types/node": "*" } }, - "@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "@types/node": { + "version": "12.20.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.15.tgz", + "integrity": "sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==" + }, + "@types/oauth": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.1.tgz", + "integrity": "sha512-a1iY62/a3yhZ7qH7cNUsxoI3U/0Fe9+RnuFrpTKr+0WVOzbKlSLojShCKe20aOD1Sppv+i8Zlq0pLDuTJnwS4A==", "dev": true, "requires": { - "@xtuc/long": "4.2.2" + "@types/node": "*" } }, - "@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", - "dev": true + "@types/passport": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.2.tgz", + "integrity": "sha512-Pf39AYKf8q+YoONym3150cEwfUD66dtwHJWvbeOzKxnA0GZZ/vAXhNWv9vMhKyRQBQZiQyWQnhYBEBlKW6G8wg==", + "requires": { + "@types/express": "*" + } }, - "@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "@types/passport-google-oauth20": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@types/passport-google-oauth20/-/passport-google-oauth20-2.0.8.tgz", + "integrity": "sha512-Lc+DYCCFeMVbodISydQLT6PjIlL0TcLup3HMiJ8RHHHBltArA3oC4qocyQH1OsEq5ovQ19PaKlpGqsNT8NYz1w==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@types/express": "*", + "@types/passport": "*", + "@types/passport-oauth2": "*" } }, - "@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "@types/passport-oauth2": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@types/passport-oauth2/-/passport-oauth2-1.4.10.tgz", + "integrity": "sha512-klShWm9xAqjM3rU31KyMMiB9M8jmJPkStUvCJ/kIv73/Vh3OVnfeTExrkMCM2wA+94MliExqwHVL3J0WD2kbnQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@types/express": "*", + "@types/oauth": "*", + "@types/passport": "*" } }, - "@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "@types/passport.socketio": { + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/@types/passport.socketio/-/passport.socketio-3.7.5.tgz", + "integrity": "sha512-ldYKNCHsoqD8bjvnMNgmNszGmEvWML3RPy0CNW14BAhkf3d/xSbmhKqn3qaeRWFJ/BhOgs02HWtWW4O5d5SLUA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@types/express": "*", + "@types/express-session": "*", + "@types/passport": "*", + "@types/socket.io": "2.1.13" } }, - "@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", - "dev": true, + "@types/qs": { + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==" + }, + "@types/randomcolor": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@types/randomcolor/-/randomcolor-0.5.5.tgz", + "integrity": "sha512-PywdYff3F8lGO3BggkCXaPFH0Ue/2Y7xliihoQNkxCGPJ4w7VTMfgcmSMIE6gOVAEu9Wx42JRSuRREVG3AUrtg==", + "dev": true + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" + }, + "@types/serve-static": { + "version": "1.13.9", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", + "integrity": "sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA==", "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@types/mime": "^1", + "@types/node": "*" + } + }, + "@types/socket.io": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@types/socket.io/-/socket.io-2.1.13.tgz", + "integrity": "sha512-JRgH3nCgsWel4OPANkhH8TelpXvacAJ9VeryjuqCDiaVDMpLysd6sbt0dr6Z15pqH3p2YpOT3T1C5vQ+O/7uyg==", + "dev": true, + "requires": { + "@types/engine.io": "*", + "@types/node": "*", + "@types/socket.io-parser": "*" } }, - "@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "@types/socket.io-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/socket.io-parser/-/socket.io-parser-3.0.0.tgz", + "integrity": "sha512-Ry/rbTE6HQNL9eu3LpL1Ocup5VexXu1bSSGlSho/IR5LuRc8YvxwSNJ3JxqTltVJEATLbZkMQETSbxfKNgp4Ew==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@xtuc/long": "4.2.2" + "socket.io-parser": "*" } }, - "@webpack-cli/configtest": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.4.tgz", - "integrity": "sha512-cs3XLy+UcxiP6bj0A6u7MLLuwdXJ1c3Dtc0RkKg+wiI1g/Ti1om8+/2hc2A2B60NbBNAbMgyBMHvyymWm/j4wQ==", + "@types/validator": { + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.1.4.tgz", + "integrity": "sha512-19C02B8mr53HufY7S+HO/EHBD7a/R22IwEwyqiHaR19iwL37dN3o0M8RianVInfSSqP7InVSg/o0mUATM4JWsQ==", "dev": true }, - "@webpack-cli/info": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.3.0.tgz", - "integrity": "sha512-ASiVB3t9LOKHs5DyVUcxpraBXDOKubYu/ihHhU+t1UPpxsivg6Od2E2qU4gJCekfEddzRBzHhzA/Acyw/mlK/w==", + "@typescript-eslint/eslint-plugin": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.1.tgz", + "integrity": "sha512-aoIusj/8CR+xDWmZxARivZjbMBQTT9dImUtdZ8tVCVRXgBUuuZyM5Of5A9D9arQPxbi/0rlJLcuArclz/rCMJw==", "dev": true, "requires": { - "envinfo": "^7.7.3" + "@typescript-eslint/experimental-utils": "4.26.1", + "@typescript-eslint/scope-manager": "4.26.1", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.21", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "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.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "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" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } } }, - "@webpack-cli/serve": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", - "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==", - "dev": true - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "JSV": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", - "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=", - "dev": true - }, - "abab": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", - "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==", - "dev": true - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "@typescript-eslint/experimental-utils": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.1.tgz", + "integrity": "sha512-sQHBugRhrXzRCs9PaGg6rowie4i8s/iD/DpTB+EXte8OMDfdCG5TvO73XlO9Wc/zi0uyN4qOmX9hIjQEyhnbmQ==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.26.1", + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/typescript-estree": "4.26.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } }, - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "@typescript-eslint/parser": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.26.1.tgz", + "integrity": "sha512-q7F3zSo/nU6YJpPJvQveVlIIzx9/wu75lr6oDbDzoeIRWxpoc/HQ43G4rmMoCc5my/3uSj2VEpg/D83LYZF5HQ==", + "dev": true, "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" + "@typescript-eslint/scope-manager": "4.26.1", + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/typescript-estree": "4.26.1", + "debug": "^4.3.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" + } + } } }, - "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", - "dev": true + "@typescript-eslint/scope-manager": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.26.1.tgz", + "integrity": "sha512-TW1X2p62FQ8Rlne+WEShyd7ac2LA6o27S9i131W4NwDSfyeVlQWhw8ylldNNS8JG6oJB9Ha9Xyc+IUcqipvheQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/visitor-keys": "4.26.1" + } }, - "acorn-es7-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", - "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=", + "@typescript-eslint/types": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.26.1.tgz", + "integrity": "sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==", "dev": true }, - "acorn-globals": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", - "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", + "@typescript-eslint/typescript-estree": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.1.tgz", + "integrity": "sha512-l3ZXob+h0NQzz80lBGaykdScYaiEbFqznEs99uwzm8fPHhDjwaBFfQkjUC/slw6Sm7npFL8qrGEAMxcfBsBJUg==", "dev": true, "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" + "@typescript-eslint/types": "4.26.1", + "@typescript-eslint/visitor-keys": "4.26.1", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "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" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "globby": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "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" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "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 - }, - "acorn-walk": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", - "dev": true - }, - "adal-node": { - "version": "0.1.28", - "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", - "integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=", + "@typescript-eslint/visitor-keys": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.1.tgz", + "integrity": "sha512-IGouNSSd+6x/fHtYRyLOM6/C+QxMDzWlDtN41ea+flWuSF9g02iqcIlX8wM53JkfljoIjP0U+yp7SiTS1onEkw==", "dev": true, "requires": { - "@types/node": "^8.0.47", - "async": ">=0.6.0", - "date-utils": "*", - "jws": "3.x.x", - "request": ">= 2.52.0", - "underscore": ">= 1.3.1", - "uuid": "^3.1.0", - "xmldom": ">= 0.1.x", - "xpath.js": "~1.1.0" + "@typescript-eslint/types": "4.26.1", + "eslint-visitor-keys": "^2.0.0" }, "dependencies": { - "@types/node": { - "version": "8.10.59", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.59.tgz", - "integrity": "sha512-8RkBivJrDCyPpBXhVZcjh7cQxVBSmRk9QM7hOketZzp6Tg79c0N8kkpAIito9bnJ3HCVCHVYz+KHTEbfQNfeVQ==", + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true } } }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" - }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" } }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", "dev": true }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", + "@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", "dev": true }, - "alphanum-sort": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", - "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "@webassemblyjs/helper-buffer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", "dev": true }, - "ambi": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/ambi/-/ambi-2.5.0.tgz", - "integrity": "sha1-fI43K+SIkRV+fOoBy2+RQ9H3QiA=", + "@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "dev": true, "requires": { - "editions": "^1.1.1", - "typechecker": "^4.3.0" - }, - "dependencies": { - "editions": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", - "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==" - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - }, - "typechecker": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-4.11.0.tgz", - "integrity": "sha512-lz39Mc/d1UBcF/uQFL5P8L+oWdIn/stvkUgHf0tPRW4aEwGGErewNXo2Nb6We2WslWifn00rhcHbbRWRcTGhuw==", - "requires": { - "editions": "^2.2.0" - }, - "dependencies": { - "editions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/editions/-/editions-2.3.0.tgz", - "integrity": "sha512-jeXYwHPKbitU1l14dWlsl5Nm+b1Hsm7VX73BsrQ4RVwEcAQQIPFHTZAbVtuIGxZBrpdT2FXd8lbtrNBrzZxIsA==", - "requires": { - "errlop": "^2.0.0", - "semver": "^6.3.0" - } - } - } - } + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", "dev": true }, - "anchor-markdown-header": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/anchor-markdown-header/-/anchor-markdown-header-0.5.7.tgz", - "integrity": "sha1-BFBj125qH5zTJ6V6ASaqD97Dcac=", + "@webassemblyjs/helper-wasm-section": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, "requires": { - "emoji-regex": "~6.1.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" } }, - "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 + "@webassemblyjs/ieee754": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true + "@webassemblyjs/leb128": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "@webassemblyjs/utf8": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "@webassemblyjs/wasm-edit": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "dev": true, "requires": { - "color-convert": "^1.9.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" } }, - "ansicolors": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", - "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=" - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, - "append-transform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "@webassemblyjs/wasm-gen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, "requires": { - "default-require-extensions": "^2.0.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true + "@webassemblyjs/wasm-opt": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" + } }, - "archiver": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz", - "integrity": "sha512-5Hxxcig7gw5Jod/8Gq0OneVgLYET+oNHcxgWItq4TbhOzRLKNAFUb9edAftiMKXvXfCB0vbGrJdZDNq0dWMsxg==", + "@webassemblyjs/wasm-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "dev": true, "requires": { - "archiver-utils": "^2.1.0", - "async": "^2.6.3", - "buffer-crc32": "^0.2.1", - "glob": "^7.1.4", - "readable-stream": "^3.4.0", - "tar-stream": "^2.1.0", - "zip-stream": "^2.1.2" - }, - "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } - }, - "readable-stream": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", - "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, - "archiver-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", - "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "dev": true, "requires": { - "glob": "^7.1.4", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^2.0.0" - }, - "dependencies": { - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - } + "@webassemblyjs/ast": "1.11.1", + "@xtuc/long": "4.2.2" } }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "@webpack-cli/configtest": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.4.tgz", + "integrity": "sha512-cs3XLy+UcxiP6bj0A6u7MLLuwdXJ1c3Dtc0RkKg+wiI1g/Ti1om8+/2hc2A2B60NbBNAbMgyBMHvyymWm/j4wQ==", "dev": true }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "@webpack-cli/info": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.3.0.tgz", + "integrity": "sha512-ASiVB3t9LOKHs5DyVUcxpraBXDOKubYu/ihHhU+t1UPpxsivg6Od2E2qU4gJCekfEddzRBzHhzA/Acyw/mlK/w==", + "dev": true, "requires": { - "sprintf-js": "~1.0.2" + "envinfo": "^7.7.3" } }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true - }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "@webpack-cli/serve": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", + "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==", "dev": true }, - "array-find": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", - "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", "dev": true }, - "array-flat-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-flat-polyfill/-/array-flat-polyfill-1.0.1.tgz", - "integrity": "sha512-hfJmKupmQN0lwi0xG6FQ5U8Rd97RnIERplymOv/qpq8AoNKPPAnxJadjFA23FNWm88wykh9HmpLJUUwUtNU/iw==", + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "JSV": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=", "dev": true }, - "array-includes": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", - "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0", - "is-string": "^1.0.5" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "abab": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", + "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==", "dev": true }, - "arraybuffer.slice": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" - }, - "asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "requires": { - "safer-buffer": "~2.1.0" + "mime-types": "~2.1.24", + "negotiator": "0.6.2" } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", "dev": true }, - "async": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", - "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==" - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "acorn-es7-plugin": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", + "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=", + "dev": true }, - "autolinker": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.28.1.tgz", - "integrity": "sha1-BlK0kYgYefB3XazgzcoyM5QqTkc=", + "acorn-globals": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", + "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", + "dev": true, "requires": { - "gulp-header": "^1.7.1" + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" } }, - "available-typed-arrays": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz", - "integrity": "sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA==", + "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 }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" + "acorn-walk": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "dev": true }, - "azure-storage": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/azure-storage/-/azure-storage-2.10.3.tgz", - "integrity": "sha512-IGLs5Xj6kO8Ii90KerQrrwuJKexLgSwYC4oLWmc11mzKe7Jt2E5IVg+ZQ8K53YWZACtVTMBNO3iGuA+4ipjJxQ==", + "adal-node": { + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", + "integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=", + "dev": true, "requires": { - "browserify-mime": "~1.2.9", - "extend": "^3.0.2", - "json-edm-parser": "0.1.2", - "md5.js": "1.3.4", - "readable-stream": "~2.0.0", - "request": "^2.86.0", - "underscore": "~1.8.3", - "uuid": "^3.0.0", - "validator": "~9.4.1", - "xml2js": "0.2.8", - "xmlbuilder": "^9.0.7" + "@types/node": "^8.0.47", + "async": ">=0.6.0", + "date-utils": "*", + "jws": "3.x.x", + "request": ">= 2.52.0", + "underscore": ">= 1.3.1", + "uuid": "^3.1.0", + "xmldom": ">= 0.1.x", + "xpath.js": "~1.1.0" }, "dependencies": { - "md5.js": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", - "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - }, - "sax": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/sax/-/sax-0.5.8.tgz", - "integrity": "sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "validator": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/validator/-/validator-9.4.1.tgz", - "integrity": "sha512-YV5KjzvRmSyJ1ee/Dm5UED0G+1L4GZnLN3w6/T+zZm8scVua4sOhYKWTUrKa0H/tMiJyO9QLHMPN+9mB/aMunA==" - }, - "xml2js": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.2.8.tgz", - "integrity": "sha1-m4FpCTFjH/CdGVdUn69U9PmAs8I=", - "requires": { - "sax": "0.5.x" - } + "@types/node": { + "version": "8.10.59", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.59.tgz", + "integrity": "sha512-8RkBivJrDCyPpBXhVZcjh7cQxVBSmRk9QM7hOketZzp6Tg79c0N8kkpAIito9bnJ3HCVCHVYz+KHTEbfQNfeVQ==", + "dev": true } } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + }, + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } + "es6-promisify": "^5.0.0" } }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "dev": true, + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "dev": true, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true + }, + "ajv-keywords": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", + "dev": true + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "dev": true + }, + "ambi": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ambi/-/ambi-2.5.0.tgz", + "integrity": "sha1-fI43K+SIkRV+fOoBy2+RQ9H3QiA=", "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" + "editions": "^1.1.1", + "typechecker": "^4.3.0" }, "dependencies": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true + "editions": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", + "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==" }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", - "dev": true, - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, + "typechecker": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-4.11.0.tgz", + "integrity": "sha512-lz39Mc/d1UBcF/uQFL5P8L+oWdIn/stvkUgHf0tPRW4aEwGGErewNXo2Nb6We2WslWifn00rhcHbbRWRcTGhuw==", + "requires": { + "editions": "^2.2.0" + }, + "dependencies": { + "editions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/editions/-/editions-2.3.0.tgz", + "integrity": "sha512-jeXYwHPKbitU1l14dWlsl5Nm+b1Hsm7VX73BsrQ4RVwEcAQQIPFHTZAbVtuIGxZBrpdT2FXd8lbtrNBrzZxIsA==", + "requires": { + "errlop": "^2.0.0", + "semver": "^6.3.0" + } + } + } + } } }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "anchor-markdown-header": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/anchor-markdown-header/-/anchor-markdown-header-0.5.7.tgz", + "integrity": "sha1-BFBj125qH5zTJ6V6ASaqD97Dcac=", "dev": true, "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" + "emoji-regex": "~6.1.0" } }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "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 }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "dev": true, - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "dev": true, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "color-convert": "^1.9.0" } }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "ansicolors": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", + "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=" }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "append-transform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", "dev": true, "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "default-require-extensions": "^2.0.0" } }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "dev": true, - "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, + "archiver": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz", + "integrity": "sha512-5Hxxcig7gw5Jod/8Gq0OneVgLYET+oNHcxgWItq4TbhOzRLKNAFUb9edAftiMKXvXfCB0vbGrJdZDNq0dWMsxg==", "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "archiver-utils": "^2.1.0", + "async": "^2.6.3", + "buffer-crc32": "^0.2.1", + "glob": "^7.1.4", + "readable-stream": "^3.4.0", + "tar-stream": "^2.1.0", + "zip-stream": "^2.1.2" + }, + "dependencies": { + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "readable-stream": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", + "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, - "babel-loader": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz", - "integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==", - "dev": true, + "archiver-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", "requires": { - "find-cache-dir": "^1.0.0", - "loader-utils": "^1.0.2", - "mkdirp": "^0.5.1" + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "dependencies": { + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + } } }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "dev": true, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { - "babel-runtime": "^6.22.0" + "sprintf-js": "~1.0.2" } }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", "dev": true }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "array-find": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", + "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", "dev": true }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", - "dev": true, - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", - "dev": true, - "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "array-flat-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-flat-polyfill/-/array-flat-polyfill-1.0.1.tgz", + "integrity": "sha512-hfJmKupmQN0lwi0xG6FQ5U8Rd97RnIERplymOv/qpq8AoNKPPAnxJadjFA23FNWm88wykh9HmpLJUUwUtNU/iw==", + "dev": true }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "array-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "dev": true }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" } }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "arraybuffer.slice": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "dev": true, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "safer-buffer": "~2.1.0" } }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "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 }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } + "async": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", + "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==" }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "dev": true, - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "dev": true, - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", - "dev": true, + "autolinker": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.28.1.tgz", + "integrity": "sha1-BlK0kYgYefB3XazgzcoyM5QqTkc=", "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "gulp-header": "^1.7.1" } }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "available-typed-arrays": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz", + "integrity": "sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA==", + "dev": true }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } + "aws4": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "dev": true, + "azure-storage": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/azure-storage/-/azure-storage-2.10.3.tgz", + "integrity": "sha512-IGLs5Xj6kO8Ii90KerQrrwuJKexLgSwYC4oLWmc11mzKe7Jt2E5IVg+ZQ8K53YWZACtVTMBNO3iGuA+4ipjJxQ==", "requires": { - "babel-runtime": "^6.22.0" + "browserify-mime": "~1.2.9", + "extend": "^3.0.2", + "json-edm-parser": "0.1.2", + "md5.js": "1.3.4", + "readable-stream": "~2.0.0", + "request": "^2.86.0", + "underscore": "~1.8.3", + "uuid": "^3.0.0", + "validator": "~9.4.1", + "xml2js": "0.2.8", + "xmlbuilder": "^9.0.7" + }, + "dependencies": { + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "sax": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.5.8.tgz", + "integrity": "sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE=" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "validator": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/validator/-/validator-9.4.1.tgz", + "integrity": "sha512-YV5KjzvRmSyJ1ee/Dm5UED0G+1L4GZnLN3w6/T+zZm8scVua4sOhYKWTUrKa0H/tMiJyO9QLHMPN+9mB/aMunA==" + }, + "xml2js": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.2.8.tgz", + "integrity": "sha1-m4FpCTFjH/CdGVdUn69U9PmAs8I=", + "requires": { + "sax": "0.5.x" + } + } } }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true } } }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "babel-loader": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.2.tgz", + "integrity": "sha512-JvTd0/D889PQBtUXJ2PXaKU/pjZDMtHA9V2ecm+eNRmmBCMR09a+fmpGTNwnJtFmFl5Ei7Vy47LjBb+L0wQ99g==", "dev": true, "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" + "find-cache-dir": "^3.3.1", + "loader-utils": "^1.4.0", + "make-dir": "^3.1.0", + "schema-utils": "^2.6.5" + }, + "dependencies": { + "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" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "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 + }, + "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" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + } } }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", "dev": true, "requires": { - "regenerator-transform": "^0.10.0" + "object.assign": "^4.1.0" } }, - "babel-plugin-transform-runtime": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz", - "integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=", + "babel-plugin-polyfill-corejs2": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz", + "integrity": "sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ==", "dev": true, "requires": { - "babel-runtime": "^6.22.0" + "@babel/compat-data": "^7.13.11", + "@babel/helper-define-polyfill-provider": "^0.2.2", + "semver": "^6.1.1" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "babel-plugin-polyfill-corejs3": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.4.tgz", + "integrity": "sha512-z3HnJE5TY/j4EFEa/qpQMSbcUJZ5JQi+3UFjXzn6pQCmIKc5Ug5j98SuYyH+m4xQnvKlMDIW4plLfgyVnd0IcQ==", "dev": true, "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-polyfill": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", - "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", - "requires": { - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "regenerator-runtime": "^0.10.5" + "@babel/helper-define-polyfill-provider": "^0.2.2", + "core-js-compat": "^3.14.0" } }, - "babel-preset-env": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", - "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "babel-plugin-polyfill-regenerator": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz", + "integrity": "sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg==", "dev": true, "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" + "@babel/helper-define-polyfill-provider": "^0.2.2" } }, "babel-runtime": { @@ -3285,69 +5227,18 @@ "regenerator-runtime": "^0.11.0" }, "dependencies": { - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - } - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - } - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } } }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -3573,16 +5464,6 @@ "resolved": "https://registry.npmjs.org/browserify-mime/-/browserify-mime-1.2.9.tgz", "integrity": "sha1-rrGvKN5sDXpqLOQK22j/GEIq8x8=" }, - "browserslist": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", - "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" - } - }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -3742,6 +5623,14 @@ "deep-equal": "^1.0.0", "espurify": "^1.6.0", "estraverse": "^4.0.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "call-signature": { @@ -4353,9 +6242,53 @@ } }, "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==" + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, + "core-js-compat": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.16.0.tgz", + "integrity": "sha512-5D9sPHCdewoUK7pSUPfTF7ZhLh8k9/CoJXWUEo+F1dZT5Z1DVgcuRqUKhjeKW+YLb8f21rTFgWwQJiNw1hoZ5Q==", + "dev": true, + "requires": { + "browserslist": "^4.16.6", + "semver": "7.0.0" + }, + "dependencies": { + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + } + }, + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true + }, + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } }, "core-util-is": { "version": "1.0.2", @@ -5303,15 +7236,6 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, "dictionary-de": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dictionary-de/-/dictionary-de-2.0.3.tgz", @@ -5647,12 +7571,6 @@ } } }, - "electron-to-chromium": { - "version": "1.3.346", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.346.tgz", - "integrity": "sha512-Yy4jF5hJd57BWmGPt0KjaXc25AmWZeQK75kdr4zIzksWVtiT6DwaNtvTb9dt+LkQKwUpvBfCyyPsXXtbY/5GYw==", - "dev": true - }, "emoji-regex": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.1.1.tgz", @@ -5673,6 +7591,14 @@ "requires": { "core-js": "^2.0.0", "empower-core": "^1.2.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "empower-assert": { @@ -5692,6 +7618,14 @@ "requires": { "call-signature": "0.0.2", "core-js": "^2.0.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "enabled": { @@ -6856,6 +8790,14 @@ "dev": true, "requires": { "core-js": "^2.0.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "esquery": { @@ -7383,14 +9325,74 @@ } }, "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + } } }, "find-root": { @@ -7619,6 +9621,12 @@ "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-2.4.3.tgz", "integrity": "sha1-eAw29p360FpaBF3Te+etyhGk9v8=" }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", @@ -7984,16 +9992,6 @@ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.9.tgz", "integrity": "sha512-M0zZvfLr5p0keDMCAhNBp03XJbKBxUx5AfyfufMdFMEP4N/Xj6dh0IqC75ys7BAzceR34NgcvXjupRVaHBPPVQ==" }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, "hosted-git-info": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", @@ -8561,15 +10559,6 @@ "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, "ionicons": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-2.0.1.tgz", @@ -8672,6 +10661,15 @@ } } }, + "is-core-module": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz", + "integrity": "sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", @@ -8696,12 +10694,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-finite": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -9652,6 +11644,12 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, "lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", @@ -9840,12 +11838,20 @@ } }, "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { - "pify": "^3.0.0" + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "make-plural": { @@ -12627,6 +14633,14 @@ "requires": { "core-js": "^2.0.0", "power-assert-context-traversal": "^1.2.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "power-assert-context-reducer-ast": { @@ -12647,6 +14661,12 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", "dev": true + }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true } } }, @@ -12658,6 +14678,14 @@ "requires": { "core-js": "^2.0.0", "estraverse": "^4.1.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "power-assert-formatter": { @@ -12673,6 +14701,14 @@ "power-assert-renderer-comparison": "^1.0.7", "power-assert-renderer-diagram": "^1.0.7", "power-assert-renderer-file": "^1.0.7" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "power-assert-renderer-assertion": { @@ -12702,6 +14738,14 @@ "power-assert-renderer-base": "^1.1.1", "stringifier": "^1.3.0", "type-name": "^2.0.1" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "power-assert-renderer-diagram": { @@ -12714,6 +14758,14 @@ "power-assert-renderer-base": "^1.1.1", "power-assert-util-string-width": "^1.2.0", "stringifier": "^1.3.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "power-assert-renderer-file": { @@ -12777,12 +14829,6 @@ "clipboard": "^2.0.0" } }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -13145,28 +15191,58 @@ "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", "dev": true }, - "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" - }, - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", "dev": true, "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" + "regenerate": "^1.4.0" } }, + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "dev": true + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "regexpu-core": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", + "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + }, + "dependencies": { + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + } + } + }, "regjsgen": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", @@ -13364,15 +15440,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, "replace-ext": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", @@ -13938,12 +16005,6 @@ } } }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true - }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -14575,6 +16636,14 @@ "core-js": "^2.0.0", "traverse": "^0.6.6", "type-name": "^2.0.1" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + } } }, "strip-ansi": { @@ -15225,12 +17294,6 @@ "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -15560,6 +17623,34 @@ "xtend": "^4.0.0" } }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, "unified": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz", @@ -15696,9 +17787,9 @@ }, "dependencies": { "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", + "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", "dev": true }, "schema-utils": { diff --git a/package.json b/package.json index e7e6001770..8703794553 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "archiver": "~3.1.1", "async": "~3.1.0", "azure-storage": "~2.10.3", - "babel-polyfill": "~6.26.0", "base64url": "~3.0.1", "body-parser": "~1.19.0", "chance": "~1.0.18", @@ -106,6 +105,10 @@ "ws": "~7.1.1" }, "devDependencies": { + "@babel/core": "~7.14.8", + "@babel/plugin-transform-runtime": "~7.14.5", + "@babel/preset-env": "~7.14.8", + "@babel/runtime": "~7.14.8", "@hackmd/codemirror": "~5.57.7", "@hackmd/emojify.js": "^2.1.0", "@hackmd/idle-js": "~1.0.1", @@ -129,14 +132,11 @@ "@typescript-eslint/eslint-plugin": "^4.26.1", "@typescript-eslint/parser": "^4.26.1", "acorn": "~6.1.1", - "babel-core": "~6.26.3", - "babel-loader": "~7.1.4", - "babel-plugin-transform-runtime": "~6.23.0", - "babel-preset-env": "~1.7.0", - "babel-runtime": "~6.26.0", + "babel-loader": "~8.2.2", "bootstrap": "~3.4.0", "bootstrap-validator": "~0.11.8", "copy-webpack-plugin": "~9.0.1", + "core-js": "^2.6.12", "css-loader": "~1.0.0", "css-minimizer-webpack-plugin": "~3.0.2", "dictionary-de": "^2.0.3", @@ -198,6 +198,7 @@ "power-assert": "~1.6.1", "prismjs": "^1.17.1", "raphael": "~2.2.8", + "regenerator-runtime": "^0.13.9", "reveal.js": "~3.9.2", "script-loader": "~0.7.2", "select2": "~3.5.2-browserify", diff --git a/public/js/index.js b/public/js/index.js index c736cb7f2c..82cbb35780 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -81,6 +81,8 @@ import { emojifyImageDir } from './lib/editor/constants' import modeType from './lib/modeType' import appState from './lib/appState' +import {RevealMarkdown} from './reveal-markdown' + require('../vendor/showup/showup') require('../css/index.css') @@ -2792,9 +2794,9 @@ function updateViewInner () { separator: '^(\r\n?|\n)---(\r\n?|\n)$', verticalSeparator: '^(\r\n?|\n)----(\r\n?|\n)$' } - var slides = window.RevealMarkdown.slidify(editor.getValue(), slideOptions) + var slides = RevealMarkdown.slidify(editor.getValue(), slideOptions) ui.area.markdown.html(slides) - window.RevealMarkdown.initialize() + RevealMarkdown.initialize() // prevent XSS ui.area.markdown.html(preventXSS(ui.area.markdown.html())) ui.area.markdown.addClass('slides') diff --git a/public/js/pretty.js b/public/js/pretty.js index a5df0a4789..6b6babecd3 100644 --- a/public/js/pretty.js +++ b/public/js/pretty.js @@ -18,6 +18,8 @@ import { import { preventXSS } from './render' +import { RevealMarkdown } from './reveal-markdown' + require('../css/extra.css') require('../css/slide-preview.css') require('../css/site.css') @@ -35,9 +37,9 @@ if (md.meta.type && md.meta.type === 'slide') { separator: '^(\r\n?|\n)---(\r\n?|\n)$', verticalSeparator: '^(\r\n?|\n)----(\r\n?|\n)$' } - const slides = window.RevealMarkdown.slidify(text, slideOptions) + const slides = RevealMarkdown.slidify(text, slideOptions) markdown.html(slides) - window.RevealMarkdown.initialize() + RevealMarkdown.initialize() // prevent XSS markdown.html(preventXSS(markdown.html())) markdown.addClass('slides') diff --git a/public/js/reveal-markdown.js b/public/js/reveal-markdown.js index c49bb9a249..c39d6962c8 100644 --- a/public/js/reveal-markdown.js +++ b/public/js/reveal-markdown.js @@ -8,15 +8,7 @@ import { md } from './extra' * markdown inside of presentations as well as loading * of external markdown documents. */ -(function (root, factory) { - if (typeof exports === 'object') { - module.exports = factory() - } else { - // Browser globals (root is window) - root.RevealMarkdown = factory() - root.RevealMarkdown.initialize() - } -}(this, function () { +function factory() { var DEFAULT_SLIDE_SEPARATOR = '^\r?\n---\r?\n$' var DEFAULT_NOTES_SEPARATOR = '^note:' var DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR = '\\.element\\s*?(.+?)$' @@ -209,10 +201,10 @@ import { md } from './extra' }) } else { section.outerHTML = '
' + - 'ERROR: The attempt to fetch ' + url + ' failed with HTTP status ' + xhr.status + '.' + - 'Check your browser\'s JavaScript console for more details.' + - '

Remember that you need to serve the presentation HTML from a HTTP server.

' + - '
' + 'ERROR: The attempt to fetch ' + url + ' failed with HTTP status ' + xhr.status + '.' + + 'Check your browser\'s JavaScript console for more details.' + + '

Remember that you need to serve the presentation HTML from a HTTP server.

' + + '' } } } @@ -326,11 +318,11 @@ import { md } from './extra' var result = window.postProcess(rendered) section.innerHTML = result[0].outerHTML addAttributes(section, section, null, section.getAttribute('data-element-attributes') || - section.parentNode.getAttribute('data-element-attributes') || - DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR, - section.getAttribute('data-attributes') || - section.parentNode.getAttribute('data-attributes') || - DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR) + section.parentNode.getAttribute('data-element-attributes') || + DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR, + section.getAttribute('data-attributes') || + section.parentNode.getAttribute('data-attributes') || + DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR) // If there were notes, we need to re-add them after // having overwritten the section's HTML @@ -352,4 +344,5 @@ import { md } from './extra' convertSlides: convertSlides, slidify: slidify } -})) +} +export const RevealMarkdown = factory() diff --git a/public/js/slide.js b/public/js/slide.js index 455986f4d6..a5cc5dab7b 100644 --- a/public/js/slide.js +++ b/public/js/slide.js @@ -3,6 +3,7 @@ import { preventXSS } from './render' import { md, updateLastChange, removeDOMEvents, finishView } from './extra' +import { RevealMarkdown } from './reveal-markdown' require('../css/extra.css') require('../css/site.css') diff --git a/webpack.common.js b/webpack.common.js index 52f98bf54b..e7475603d1 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -12,7 +12,10 @@ gracefulFs.gracefulify(fs) module.exports = { name: 'app', plugins: [ - new webpack.EnvironmentPlugin(['NODE_ENV', 'NODE_DEBUG']), + new webpack.DefinePlugin({ + "process.env.NODE_DEBUG": process.env.NODE_ENV || 'development', + "process.env.NODE_DEBUG": "false" + }), new webpack.ProvidePlugin({ Visibility: 'visibilityjs', Cookies: 'js-cookie', @@ -217,7 +220,8 @@ module.exports = { 'bootstrap' ], cover: [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', path.join(__dirname, 'public/js/cover.js') ], 'cover-styles-pack': [ @@ -227,14 +231,16 @@ module.exports = { path.join(__dirname, 'node_modules/select2/select2-bootstrap.css') ], 'cover-pack': [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', 'bootstrap-validator', 'expose-loader?exposes=select2!select2', 'expose-loader?exposes=moment!moment', path.join(__dirname, 'public/js/cover.js') ], index: [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', 'script-loader!jquery-ui-resizable', 'script-loader!codemirror', 'script-loader!inlineAttachment', @@ -243,7 +249,6 @@ module.exports = { 'script-loader!ot', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - 'expose-loader?exposes=RevealMarkdown!reveal-markdown', path.join(__dirname, 'public/js/index.js') ], 'index-styles': [ @@ -281,7 +286,8 @@ module.exports = { path.join(__dirname, 'node_modules/leaflet/dist/leaflet.css') ], 'index-pack': [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', 'script-loader!jquery-ui-resizable', 'bootstrap-validator', 'expose-loader?exposes=jsyaml!js-yaml', @@ -305,15 +311,14 @@ module.exports = { 'script-loader!vega-lite', 'script-loader!vega-embed', 'expose-loader?exposes=io!socket.io-client', - 'expose-loader?exposes=RevealMarkdown!reveal-markdown', 'expose-loader?exposes=L|L|true!leaflet', path.join(__dirname, 'public/js/index.js') ], pretty: [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - 'expose-loader?exposes=RevealMarkdown!reveal-markdown', path.join(__dirname, 'public/js/pretty.js') ], 'pretty-styles': [ @@ -328,7 +333,8 @@ module.exports = { path.join(__dirname, 'node_modules/leaflet/dist/leaflet.css') ], 'pretty-pack': [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', 'expose-loader?exposes=jsyaml!js-yaml', 'script-loader!mermaid', 'expose-loader?exposes=moment!moment', @@ -344,16 +350,15 @@ module.exports = { 'script-loader!vega', 'script-loader!vega-lite', 'script-loader!vega-embed', - 'expose-loader?exposes=RevealMarkdown!reveal-markdown', 'expose-loader?exposes=L|L|true!leaflet', path.join(__dirname, 'public/js/pretty.js') ], slide: [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', 'bootstrap-tooltip', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - 'expose-loader?exposes=RevealMarkdown!reveal-markdown', path.join(__dirname, 'public/js/slide.js') ], 'slide-styles': [ @@ -367,7 +372,8 @@ module.exports = { path.join(__dirname, 'node_modules/leaflet/dist/leaflet.css') ], 'slide-pack': [ - 'babel-polyfill', + 'core-js', + 'regenerator-runtime/runtime', 'expose-loader?exposes=$,jQuery!jquery', 'velocity-animate', 'imports-loader?$=jquery!jquery-mousewheel', @@ -388,7 +394,6 @@ module.exports = { 'script-loader!vega-lite', 'script-loader!vega-embed', 'expose-loader?exposes=Reveal!reveal.js', - 'expose-loader?exposes=RevealMarkdown!reveal-markdown', 'expose-loader?exposes=L|L|true!leaflet', path.join(__dirname, 'public/js/slide.js') ] From ed80cb222149de69c36c5cbe2e7953411821f042 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 31 Jul 2021 11:39:28 +0800 Subject: [PATCH 164/167] remove unused webpack plugins --- package-lock.json | 950 ++++++++++++---------------------------------- package.json | 12 +- webpack.common.js | 24 -- 3 files changed, 237 insertions(+), 749 deletions(-) diff --git a/package-lock.json b/package-lock.json index 953e1bf4a6..5394f650b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4658,16 +4658,10 @@ "uri-js": "^4.2.2" } }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true - }, "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true }, "alphanum-sort": { @@ -4775,12 +4769,6 @@ "default-require-extensions": "^2.0.0" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, "archiver": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz", @@ -5043,59 +5031,6 @@ } } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, "babel-loader": { "version": "8.2.2", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.2.tgz", @@ -5510,40 +5445,6 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - } - } - }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -5808,12 +5709,6 @@ } } }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, "chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -6154,20 +6049,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, "copy-webpack-plugin": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-9.0.1.tgz", @@ -6423,23 +6304,45 @@ } }, "css-loader": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-1.0.1.tgz", - "integrity": "sha512-+ZHAZm/yqvJ2kDtPne3uX0C+Vr3Zn5jFn2N4HywtS5ujwvsVkyg0VArEXpl3BgczDA8anieki1FIzhchX4yrDw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.2.0.tgz", + "integrity": "sha512-/rvHfYRjIpymZblf49w8jYcRo2y9gj6rV8UroHGmBxKrIyGLokpycyKzp9OkitvqT29ZSpzJ0Ic7SpnJX3sC8g==", "dev": true, "requires": { - "babel-code-frame": "^6.26.0", - "css-selector-tokenizer": "^0.7.0", - "icss-utils": "^2.1.0", - "loader-utils": "^1.0.2", - "lodash": "^4.17.11", - "postcss": "^6.0.23", - "postcss-modules-extract-imports": "^1.2.0", - "postcss-modules-local-by-default": "^1.2.0", - "postcss-modules-scope": "^1.1.0", - "postcss-modules-values": "^1.3.0", - "postcss-value-parser": "^3.3.0", - "source-list-map": "^2.0.0" + "icss-utils": "^5.1.0", + "postcss": "^8.2.15", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.0", + "postcss-modules-scope": "^3.0.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.1.0", + "semver": "^7.3.5" + }, + "dependencies": { + "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" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } } }, "css-minimizer-webpack-plugin": { @@ -6548,30 +6451,6 @@ } } }, - "css-selector-tokenizer": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", - "integrity": "sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA==", - "dev": true, - "requires": { - "cssesc": "^0.1.0", - "fastparse": "^1.1.1", - "regexpu-core": "^1.0.0" - }, - "dependencies": { - "regexpu-core": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", - "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", - "dev": true, - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - } - } - }, "css-tree": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", @@ -6587,12 +6466,6 @@ "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" }, - "cssesc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", - "integrity": "sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=", - "dev": true - }, "cssfilter": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", @@ -6683,12 +6556,6 @@ } } }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -7460,18 +7327,6 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, "eachr": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/eachr/-/eachr-2.0.4.tgz", @@ -7805,15 +7660,6 @@ "resolved": "https://registry.npmjs.org/errlop/-/errlop-2.0.0.tgz", "integrity": "sha512-z00WIrQhtOMUnjdTG0O4f6hMG64EVccVDBy2WwgjcF8S4UB1exGYuc2OFwmdQmsJwLQVEIHWHPCz/omXXgAZHw==" }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -8955,24 +8801,6 @@ "resolved": "https://registry.npmjs.org/expect-ct/-/expect-ct-0.2.0.tgz", "integrity": "sha512-6SK3MG/Bbhm8MsgyJAylg+ucIOU71/FzyFalcfu5nY19dH8y/z0tBJU0wrNBXD4B27EoQtqPF/9wqH0iYAd04g==" }, - "exports-loader": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/exports-loader/-/exports-loader-0.7.0.tgz", - "integrity": "sha512-RKwCrO4A6IiKm0pG3c9V46JxIHcDplwwGJn6+JJ1RcVnh/WSGJa0xkmk5cRVtgOPzCAtTMGj2F7nluh9L0vpSA==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0", - "source-map": "0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.0.tgz", - "integrity": "sha1-D+llA6yGpa213mP05BKuSHLNvoY=", - "dev": true - } - } - }, "expose-loader": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-2.0.0.tgz", @@ -9223,12 +9051,6 @@ "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", "dev": true }, - "fastparse": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", - "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", - "dev": true - }, "fastq": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", @@ -9265,12 +9087,6 @@ "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -9290,13 +9106,47 @@ } }, "file-loader": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-2.0.0.tgz", - "integrity": "sha512-YCsBfd1ZGCyonOKLxPiKPdu+8ld9HAaMEvJewzz+b2eTF7uL5Zm/HdBF6FjCrpCMRq25Mi0U1gl4pwn2TlH7hQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", + "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", "dev": true, "requires": { - "loader-utils": "^1.0.2", - "schema-utils": "^1.0.0" + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "dependencies": { + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } } }, "file-saver": { @@ -9456,16 +9306,6 @@ } } }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, "fn.name": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", @@ -9546,16 +9386,6 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -9579,18 +9409,6 @@ "minipass": "^3.0.0" } }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -9855,15 +9673,6 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-bigints": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", @@ -10293,20 +10102,11 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", - "dev": true - }, "icss-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", - "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", - "dev": true, - "requires": { - "postcss": "^6.0.1" - } + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true }, "ieee754": { "version": "1.1.13", @@ -10318,12 +10118,6 @@ "resolved": "https://registry.npmjs.org/ienoopen/-/ienoopen-1.1.0.tgz", "integrity": "sha512-MFs36e/ca6ohEKtinTJ5VvAJ6oDRAYFdYXweUnGY9L9vcoqFOU4n2ZhmJ0C4z/cwGZ3YIQRSB3XZ1+ghZkY5NQ==" }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, "ignore": { "version": "5.1.8", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", @@ -10347,13 +10141,6 @@ "editions": "^2.2.0" } }, - "image-size": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", - "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", - "dev": true, - "optional": true - }, "image-type": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/image-type/-/image-type-4.1.0.tgz", @@ -10453,12 +10240,6 @@ "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, "inflection": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", @@ -10915,12 +10696,6 @@ "integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==", "dev": true }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -11503,34 +11278,6 @@ "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", "dev": true }, - "less": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/less/-/less-3.9.0.tgz", - "integrity": "sha512-31CmtPEZraNUtuUREYjSqRkeETFdyEHSEPAGq4erDlUXtda7pzNmctdljdIagSb589d/qXGWiiP31R5JVf+v0w==", - "dev": true, - "requires": { - "clone": "^2.1.2", - "errno": "^0.1.1", - "graceful-fs": "^4.1.2", - "image-size": "~0.5.0", - "mime": "^1.4.1", - "mkdirp": "^0.5.0", - "promise": "^7.1.1", - "request": "^2.83.0", - "source-map": "~0.6.0" - } - }, - "less-loader": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-4.1.0.tgz", - "integrity": "sha512-KNTsgCE9tMOM70+ddxp9yyt9iHqgmSs0yTZc5XH5Wo+g80RWRIYNqE58QJKm/yMud5wZEvz50ugRDuzVIkyahg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "loader-utils": "^1.1.0", - "pify": "^3.0.0" - } - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -12465,24 +12212,6 @@ } } }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -12617,20 +12346,6 @@ } } }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -13366,17 +13081,6 @@ "integrity": "sha512-ylq1wgUSnagU+MKQtNeVqrPhZuMYBvOSL00DHycFTCxownF95gpLAk1HiHdUW77N8yxRq1qHXLdlIPyBSG9NSA==", "dev": true }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, "param-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", @@ -13969,24 +13673,21 @@ "integrity": "sha1-zqz9q0q/NT16DyqqLB/Hs/lBO6M=" }, "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz", + "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==", "dev": true, "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" + "colorette": "^1.2.2", + "nanoid": "^3.1.23", + "source-map-js": "^0.6.2" }, "dependencies": { - "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" - } + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true } } }, @@ -14246,42 +13947,38 @@ } }, "postcss-modules-extract-imports": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.1.tgz", - "integrity": "sha512-6jt9XZwUhwmRUhb/CkyJY020PYaPJsCyt3UjbaWo6XEbH/94Hmv6MP7fG2C5NDU/BcHzyGYxNtHvM+LTf9HrYw==", - "dev": true, - "requires": { - "postcss": "^6.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", + "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", + "dev": true }, "postcss-modules-local-by-default": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", - "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz", + "integrity": "sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==", "dev": true, "requires": { - "css-selector-tokenizer": "^0.7.0", - "postcss": "^6.0.1" + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" } }, "postcss-modules-scope": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", - "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz", + "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==", "dev": true, "requires": { - "css-selector-tokenizer": "^0.7.0", - "postcss": "^6.0.1" + "postcss-selector-parser": "^6.0.4" } }, "postcss-modules-values": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz", - "integrity": "sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", "dev": true, "requires": { - "icss-replace-symbols": "^1.1.0", - "postcss": "^6.0.1" + "icss-utils": "^5.0.0" } }, "postcss-normalize-charset": { @@ -14584,9 +14281,9 @@ } }, "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, "postgres-array": { @@ -14894,22 +14591,6 @@ } } }, - "promise": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", - "dev": true, - "optional": true, - "requires": { - "asap": "~2.0.3" - } - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, "prop-types": { "version": "15.7.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", @@ -14935,12 +14616,6 @@ "ipaddr.js": "1.9.0" } }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -14960,29 +14635,6 @@ "once": "^1.3.1" } }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -15243,21 +14895,6 @@ } } }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -15624,15 +15261,6 @@ "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", "dev": true }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, "rw": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", @@ -15688,14 +15316,40 @@ } }, "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "dependencies": { + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "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" + } + }, + "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 + } } }, "scope-css": { @@ -16158,12 +15812,6 @@ } } }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -16278,15 +15926,6 @@ "tweetnacl": "~0.14.0" } }, - "ssri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", - "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, "stable": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", @@ -16509,16 +16148,6 @@ "integrity": "sha1-jFNOKguDH3K3X8XxEZhXxE711ZM=", "dev": true }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, "stream-from-to": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/stream-from-to/-/stream-from-to-1.4.3.tgz", @@ -16537,12 +16166,6 @@ } } }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, "string-loader": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/string-loader/-/string-loader-0.0.1.tgz", @@ -16697,16 +16320,6 @@ "boundary": "^1.0.1" } }, - "style-loader": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.1.tgz", - "integrity": "sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0", - "schema-utils": "^1.0.0" - } - }, "stylehacks": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.0.1.tgz", @@ -17499,73 +17112,6 @@ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" }, - "uglify-js": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", - "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", - "dev": true - }, - "uglifyjs-webpack-plugin": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.2.0.tgz", - "integrity": "sha512-mHSkufBmBuJ+KHQhv5H0MXijtsoA1lynJt1lXOaotja8/I0pR4L9oGaPIZw+bQBOFittXZg9OC1sXSGO9D9ZYg==", - "dev": true, - "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^1.7.0", - "source-map": "^0.6.1", - "uglify-js": "^3.6.0", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "dependencies": { - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "serialize-javascript": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", - "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", - "dev": true - } - } - }, "uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", @@ -17677,24 +17223,6 @@ "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", "dev": true }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, "unist-util-is": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", @@ -17776,30 +17304,102 @@ } }, "url-loader": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-1.0.1.tgz", - "integrity": "sha512-rAonpHy7231fmweBKUFe0bYnlGDty77E+fm53NZdij7j/YOpyGzc7ttqG1nAXl3aRs0k41o0PC3TvGXQiw2Zvw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-4.1.1.tgz", + "integrity": "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==", "dev": true, "requires": { - "loader-utils": "^1.1.0", - "mime": "^2.0.3", - "schema-utils": "^0.4.3" + "loader-utils": "^2.0.0", + "mime-types": "^2.1.27", + "schema-utils": "^3.0.0" }, "dependencies": { - "mime": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "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" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "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 + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true + }, + "mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "dev": true, + "requires": { + "mime-db": "1.49.0" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "schema-utils": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", - "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } } } @@ -19017,79 +18617,6 @@ "wildcard": "^2.0.0" } }, - "webpack-parallel-uglify-plugin": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/webpack-parallel-uglify-plugin/-/webpack-parallel-uglify-plugin-2.0.0.tgz", - "integrity": "sha512-LasXFnpuKGK8jObwbn/eTNZKmRpwpJTHiAzW3uRWMrH54kAxhbW8M44MPkAqU5ZWtJ3/ap35x6h2D1XN2umhDQ==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "glob": "^7.0.5", - "mkdirp": "^0.5.1", - "pify": "^3.0.0", - "terser": "^5.3.5", - "tmp": "0.0.29", - "uglify-js": "^3.12.1", - "webpack-sources": "^1.0.0", - "worker-farm": "^1.3.1" - }, - "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - } - }, - "tmp": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", - "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.1" - } - } - } - }, - "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - } - }, "whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -19346,15 +18873,6 @@ "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", "dev": true }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "requires": { - "errno": "~0.1.7" - } - }, "wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", diff --git a/package.json b/package.json index 8703794553..aa9a34bec7 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "bootstrap-validator": "~0.11.8", "copy-webpack-plugin": "~9.0.1", "core-js": "^2.6.12", - "css-loader": "~1.0.0", + "css-loader": "~6.2.0", "css-minimizer-webpack-plugin": "~3.0.2", "dictionary-de": "^2.0.3", "dictionary-de-at": "^2.0.3", @@ -146,9 +146,8 @@ "doctoc": "~1.4.0", "ejs-loader": "~0.3.1", "eslint": "^7.28.0", - "exports-loader": "~0.7.0", "expose-loader": "~2.0.0", - "file-loader": "~2.0.0", + "file-loader": "~6.2.0", "file-saver": "~2.0.2", "flowchart.js": "~1.15.0", "fork-awesome": "~1.1.7", @@ -168,8 +167,6 @@ "jsonlint": "~1.6.2", "keymaster": "~1.6.2", "leaflet": "~1.6.0", - "less": "~3.9.0", - "less-loader": "~4.1.0", "list.js": "~1.5.0", "markdown-it-abbr": "~1.0.4", "markdown-it-container": "~2.0.0", @@ -208,13 +205,11 @@ "standard": "~13.1.0", "store": "~2.0.12", "string-loader": "~0.0.1", - "style-loader": "~0.23.1", "tedious": "~6.2.0", "turndown": "~5.0.3", "typescript": "^4.3.2", "typo-js": "^1.0.3", - "uglifyjs-webpack-plugin": "~2.2.0", - "url-loader": "~1.0.1", + "url-loader": "~4.1.1", "util": "^0.12.4", "vega": "~5.17.1", "vega-embed": "~6.14.2", @@ -225,7 +220,6 @@ "webpack": "~5.47.1", "webpack-cli": "~4.7.2", "webpack-merge": "~5.8.0", - "webpack-parallel-uglify-plugin": "~2.0.0", "wurl": "~2.5.3", "xss": "~1.0.6" }, diff --git a/webpack.common.js b/webpack.common.js index e7475603d1..c40efbeff9 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -467,30 +467,6 @@ module.exports = { MiniCssExtractPlugin.loader, 'css-loader' ] - }, { - test: /\.scss$/, - use: [ - MiniCssExtractPlugin.loader, - { - loader: 'css-loader', - options: { - importLoaders: 1 - } - }, - 'sass-loader' - ] - }, { - test: /\.less$/, - use: [ - MiniCssExtractPlugin.loader, - { - loader: 'css-loader', - options: { - importLoaders: 1 - } - }, - 'less-loader' - ] }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: [{ loader: 'file-loader' }] From 2135fb0d93d091fe481508496000fd0085b16b20 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 31 Jul 2021 11:47:20 +0800 Subject: [PATCH 165/167] convert frontend to ts --- .babelrc | 3 +- package-lock.json | 31 +++++++++++++++++++++ package.json | 1 + public/js/lib/common/{login.js => login.ts} | 2 +- public/js/lib/config/{index.js => index.ts} | 9 ++++++ webpack.common.js | 6 ++-- 6 files changed, 46 insertions(+), 6 deletions(-) rename public/js/lib/common/{login.js => login.ts} (98%) rename public/js/lib/config/{index.js => index.ts} (84%) diff --git a/.babelrc b/.babelrc index b6bc825fc8..1712fddd7e 100644 --- a/.babelrc +++ b/.babelrc @@ -7,7 +7,8 @@ "node": "6", "uglify": true } - }] + }], + "@babel/preset-typescript" ], "plugins": [ "@babel/plugin-transform-runtime" diff --git a/package-lock.json b/package-lock.json index 5394f650b1..90a132c03d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2465,6 +2465,15 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, + "@babel/plugin-syntax-typescript": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz", + "integrity": "sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, "@babel/plugin-transform-arrow-functions": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz", @@ -2962,6 +2971,17 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, + "@babel/plugin-transform-typescript": { + "version": "7.14.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.14.6.tgz", + "integrity": "sha512-XlTdBq7Awr4FYIzqhmYY80WN0V0azF74DMPyFqVHBvf81ZUgc4X7ZOpx6O8eLDK6iM5cCQzeyJw0ynTaefixRA==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.14.6", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-typescript": "^7.14.5" + } + }, "@babel/plugin-transform-unicode-escapes": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz", @@ -3105,6 +3125,17 @@ "esutils": "^2.0.2" } }, + "@babel/preset-typescript": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.14.5.tgz", + "integrity": "sha512-u4zO6CdbRKbS9TypMqrlGH7sd2TAJppZwn3c/ZRLeO/wGsbddxgbPDUZVNrie3JWYLQ9vpineKlsrWFvO6Pwkw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-validator-option": "^7.14.5", + "@babel/plugin-transform-typescript": "^7.14.5" + } + }, "@babel/runtime": { "version": "7.14.8", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.8.tgz", diff --git a/package.json b/package.json index aa9a34bec7..b1c14f3f4a 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,7 @@ "@babel/core": "~7.14.8", "@babel/plugin-transform-runtime": "~7.14.5", "@babel/preset-env": "~7.14.8", + "@babel/preset-typescript": "^7.14.5", "@babel/runtime": "~7.14.8", "@hackmd/codemirror": "~5.57.7", "@hackmd/emojify.js": "^2.1.0", diff --git a/public/js/lib/common/login.js b/public/js/lib/common/login.ts similarity index 98% rename from public/js/lib/common/login.js rename to public/js/lib/common/login.ts index 28e5b4703b..15c64668f6 100644 --- a/public/js/lib/common/login.js +++ b/public/js/lib/common/login.ts @@ -7,7 +7,7 @@ let checkAuth = false let profile = null let lastLoginState = getLoginState() let lastUserId = getUserId() -var loginStateChangeEvent = null +let loginStateChangeEvent = null export function setloginStateChangeEvent (func) { loginStateChangeEvent = func diff --git a/public/js/lib/config/index.js b/public/js/lib/config/index.ts similarity index 84% rename from public/js/lib/config/index.js rename to public/js/lib/config/index.ts index 6133e2c86f..1b7e2183ec 100644 --- a/public/js/lib/config/index.js +++ b/public/js/lib/config/index.ts @@ -1,3 +1,12 @@ +interface Window { + DROPBOX_APP_KEY: string, + domain: string, + urlpath: string, + debug: boolean, + serverurl: string, + version: string +} + export const DROPBOX_APP_KEY = window.DROPBOX_APP_KEY || '' export const domain = window.domain || '' // domain name diff --git a/webpack.common.js b/webpack.common.js index c40efbeff9..e35d34d7e6 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -406,6 +406,7 @@ module.exports = { }, resolve: { + extensions: ['.js', '.ts'], alias: { codemirror: path.join(__dirname, 'node_modules/@hackmd/codemirror/codemirror.min.js'), inlineAttachment: path.join(__dirname, 'public/vendor/inlineAttachment/inline-attachment.js'), @@ -452,10 +453,7 @@ module.exports = { module: { rules: [{ - test: /\.mjs$/, - type: 'javascript/auto' - }, { - test: /\.js$/, + test: /\.(m?js|ts)$/, use: [{ loader: 'babel-loader' }], exclude: [ path.resolve(__dirname, 'node_modules'), From e4855cdb3ce0a47131c30246c1289d0799071858 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 31 Jul 2021 11:55:48 +0800 Subject: [PATCH 166/167] move all files to .ts --- public/js/{cover.js => cover.ts} | 0 public/js/{extra.js => extra.ts} | 0 public/js/{history.js => history.ts} | 0 public/js/{index.js => index.ts} | 0 public/js/lib/{appState.js => appState.ts} | 0 public/js/lib/config/index.ts | 3 ++- public/js/lib/editor/{config.js => config.ts} | 0 .../js/lib/editor/{constants.js => constants.ts} | 0 public/js/lib/editor/{index.js => index.ts} | 2 ++ .../editor/markdown-lint/{index.js => index.ts} | 2 ++ .../lib/editor/{spellcheck.js => spellcheck.ts} | 0 .../editor/{table-editor.js => table-editor.ts} | 0 .../editor/{ui-elements.js => ui-elements.ts} | 0 public/js/lib/editor/{utils.js => utils.ts} | 1 + public/js/lib/markdown/{utils.js => utils.ts} | 0 public/js/lib/{modeType.js => modeType.ts} | 0 .../renderer/{csvpreview.js => csvpreview.ts} | 0 .../fretboard/{fretboard.js => fretboard.ts} | 2 ++ .../lib/renderer/lightbox/{index.js => index.ts} | 0 public/js/lib/{syncscroll.js => syncscroll.ts} | 0 public/js/{locale.js => locale.ts} | 0 ...x-config-extra.js => mathjax-config-extra.ts} | 0 public/js/{pretty.js => pretty.ts} | 0 public/js/{render.js => render.ts} | 0 .../{reveal-markdown.js => reveal-markdown.ts} | 0 public/js/{slide.js => slide.ts} | 0 public/js/{utils.js => utils.ts} | 0 webpack.common.js | 16 ++++++++-------- 28 files changed, 17 insertions(+), 9 deletions(-) rename public/js/{cover.js => cover.ts} (100%) rename public/js/{extra.js => extra.ts} (100%) rename public/js/{history.js => history.ts} (100%) rename public/js/{index.js => index.ts} (100%) rename public/js/lib/{appState.js => appState.ts} (100%) rename public/js/lib/editor/{config.js => config.ts} (100%) rename public/js/lib/editor/{constants.js => constants.ts} (100%) rename public/js/lib/editor/{index.js => index.ts} (99%) rename public/js/lib/editor/markdown-lint/{index.js => index.ts} (99%) rename public/js/lib/editor/{spellcheck.js => spellcheck.ts} (100%) rename public/js/lib/editor/{table-editor.js => table-editor.ts} (100%) rename public/js/lib/editor/{ui-elements.js => ui-elements.ts} (100%) rename public/js/lib/editor/{utils.js => utils.ts} (99%) rename public/js/lib/markdown/{utils.js => utils.ts} (100%) rename public/js/lib/{modeType.js => modeType.ts} (100%) rename public/js/lib/renderer/{csvpreview.js => csvpreview.ts} (100%) rename public/js/lib/renderer/fretboard/{fretboard.js => fretboard.ts} (99%) rename public/js/lib/renderer/lightbox/{index.js => index.ts} (100%) rename public/js/lib/{syncscroll.js => syncscroll.ts} (100%) rename public/js/{locale.js => locale.ts} (100%) rename public/js/{mathjax-config-extra.js => mathjax-config-extra.ts} (100%) rename public/js/{pretty.js => pretty.ts} (100%) rename public/js/{render.js => render.ts} (100%) rename public/js/{reveal-markdown.js => reveal-markdown.ts} (100%) rename public/js/{slide.js => slide.ts} (100%) rename public/js/{utils.js => utils.ts} (100%) diff --git a/public/js/cover.js b/public/js/cover.ts similarity index 100% rename from public/js/cover.js rename to public/js/cover.ts diff --git a/public/js/extra.js b/public/js/extra.ts similarity index 100% rename from public/js/extra.js rename to public/js/extra.ts diff --git a/public/js/history.js b/public/js/history.ts similarity index 100% rename from public/js/history.js rename to public/js/history.ts diff --git a/public/js/index.js b/public/js/index.ts similarity index 100% rename from public/js/index.js rename to public/js/index.ts diff --git a/public/js/lib/appState.js b/public/js/lib/appState.ts similarity index 100% rename from public/js/lib/appState.js rename to public/js/lib/appState.ts diff --git a/public/js/lib/config/index.ts b/public/js/lib/config/index.ts index 1b7e2183ec..89fe0bfbc9 100644 --- a/public/js/lib/config/index.ts +++ b/public/js/lib/config/index.ts @@ -1,10 +1,11 @@ -interface Window { +declare interface Window { DROPBOX_APP_KEY: string, domain: string, urlpath: string, debug: boolean, serverurl: string, version: string + USE_CDN: boolean } export const DROPBOX_APP_KEY = window.DROPBOX_APP_KEY || '' diff --git a/public/js/lib/editor/config.js b/public/js/lib/editor/config.ts similarity index 100% rename from public/js/lib/editor/config.js rename to public/js/lib/editor/config.ts diff --git a/public/js/lib/editor/constants.js b/public/js/lib/editor/constants.ts similarity index 100% rename from public/js/lib/editor/constants.js rename to public/js/lib/editor/constants.ts diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.ts similarity index 99% rename from public/js/lib/editor/index.js rename to public/js/lib/editor/index.ts index eb887da694..84675d6375 100644 --- a/public/js/lib/editor/index.js +++ b/public/js/lib/editor/index.ts @@ -11,6 +11,8 @@ import CodeMirrorSpellChecker, { supportLanguages, supportLanguageCodes } from ' import { initTableEditor } from './table-editor' import { availableThemes } from './constants' +declare const CodeMirror: any + /* config section */ const isMac = CodeMirror.keyMap.default === CodeMirror.keyMap.macDefault const defaultEditorMode = 'gfm' diff --git a/public/js/lib/editor/markdown-lint/index.js b/public/js/lib/editor/markdown-lint/index.ts similarity index 99% rename from public/js/lib/editor/markdown-lint/index.js rename to public/js/lib/editor/markdown-lint/index.ts index 349d458b8b..83f8fda613 100644 --- a/public/js/lib/editor/markdown-lint/index.js +++ b/public/js/lib/editor/markdown-lint/index.ts @@ -10,6 +10,8 @@ window.markdownit = require('markdown-it') // eslint-disable-next-line require('script-loader!markdownlint'); +declare const CodeMirror: any + (function (mod) { mod(CodeMirror) })(function (CodeMirror) { diff --git a/public/js/lib/editor/spellcheck.js b/public/js/lib/editor/spellcheck.ts similarity index 100% rename from public/js/lib/editor/spellcheck.js rename to public/js/lib/editor/spellcheck.ts diff --git a/public/js/lib/editor/table-editor.js b/public/js/lib/editor/table-editor.ts similarity index 100% rename from public/js/lib/editor/table-editor.js rename to public/js/lib/editor/table-editor.ts diff --git a/public/js/lib/editor/ui-elements.js b/public/js/lib/editor/ui-elements.ts similarity index 100% rename from public/js/lib/editor/ui-elements.js rename to public/js/lib/editor/ui-elements.ts diff --git a/public/js/lib/editor/utils.js b/public/js/lib/editor/utils.ts similarity index 99% rename from public/js/lib/editor/utils.js rename to public/js/lib/editor/utils.ts index 32bd441924..525361abb9 100644 --- a/public/js/lib/editor/utils.js +++ b/public/js/lib/editor/utils.ts @@ -1,4 +1,5 @@ /* global CodeMirror, editor */ +declare const CodeMirror: any const wrapSymbols = ['*', '_', '~', '^', '+', '='] export function wrapTextWith (editor, cm, symbol) { if (!cm.getSelection()) { diff --git a/public/js/lib/markdown/utils.js b/public/js/lib/markdown/utils.ts similarity index 100% rename from public/js/lib/markdown/utils.js rename to public/js/lib/markdown/utils.ts diff --git a/public/js/lib/modeType.js b/public/js/lib/modeType.ts similarity index 100% rename from public/js/lib/modeType.js rename to public/js/lib/modeType.ts diff --git a/public/js/lib/renderer/csvpreview.js b/public/js/lib/renderer/csvpreview.ts similarity index 100% rename from public/js/lib/renderer/csvpreview.js rename to public/js/lib/renderer/csvpreview.ts diff --git a/public/js/lib/renderer/fretboard/fretboard.js b/public/js/lib/renderer/fretboard/fretboard.ts similarity index 99% rename from public/js/lib/renderer/fretboard/fretboard.js rename to public/js/lib/renderer/fretboard/fretboard.ts index c7e56fd160..f155c9253c 100644 --- a/public/js/lib/renderer/fretboard/fretboard.js +++ b/public/js/lib/renderer/fretboard/fretboard.ts @@ -12,6 +12,8 @@ import dotWideMiddle from './svg/dotWideMiddle.svg' import stringO from './svg/string_o.svg' import stringX from './svg/string_x.svg' +declare const $: any + const switchListV = { o: `
${dot}
`, '*': `
${dot}
`, diff --git a/public/js/lib/renderer/lightbox/index.js b/public/js/lib/renderer/lightbox/index.ts similarity index 100% rename from public/js/lib/renderer/lightbox/index.js rename to public/js/lib/renderer/lightbox/index.ts diff --git a/public/js/lib/syncscroll.js b/public/js/lib/syncscroll.ts similarity index 100% rename from public/js/lib/syncscroll.js rename to public/js/lib/syncscroll.ts diff --git a/public/js/locale.js b/public/js/locale.ts similarity index 100% rename from public/js/locale.js rename to public/js/locale.ts diff --git a/public/js/mathjax-config-extra.js b/public/js/mathjax-config-extra.ts similarity index 100% rename from public/js/mathjax-config-extra.js rename to public/js/mathjax-config-extra.ts diff --git a/public/js/pretty.js b/public/js/pretty.ts similarity index 100% rename from public/js/pretty.js rename to public/js/pretty.ts diff --git a/public/js/render.js b/public/js/render.ts similarity index 100% rename from public/js/render.js rename to public/js/render.ts diff --git a/public/js/reveal-markdown.js b/public/js/reveal-markdown.ts similarity index 100% rename from public/js/reveal-markdown.js rename to public/js/reveal-markdown.ts diff --git a/public/js/slide.js b/public/js/slide.ts similarity index 100% rename from public/js/slide.js rename to public/js/slide.ts diff --git a/public/js/utils.js b/public/js/utils.ts similarity index 100% rename from public/js/utils.js rename to public/js/utils.ts diff --git a/webpack.common.js b/webpack.common.js index e35d34d7e6..0d1627e32a 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -222,7 +222,7 @@ module.exports = { cover: [ 'core-js', 'regenerator-runtime/runtime', - path.join(__dirname, 'public/js/cover.js') + path.join(__dirname, 'public/js/cover.ts') ], 'cover-styles-pack': [ path.join(__dirname, 'node_modules/bootstrap/dist/css/bootstrap.min.css'), @@ -236,7 +236,7 @@ module.exports = { 'bootstrap-validator', 'expose-loader?exposes=select2!select2', 'expose-loader?exposes=moment!moment', - path.join(__dirname, 'public/js/cover.js') + path.join(__dirname, 'public/js/cover.ts') ], index: [ 'core-js', @@ -249,7 +249,7 @@ module.exports = { 'script-loader!ot', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - path.join(__dirname, 'public/js/index.js') + path.join(__dirname, 'public/js/index.ts') ], 'index-styles': [ path.join(__dirname, 'public/vendor/jquery-ui/jquery-ui.min.css'), @@ -312,14 +312,14 @@ module.exports = { 'script-loader!vega-embed', 'expose-loader?exposes=io!socket.io-client', 'expose-loader?exposes=L|L|true!leaflet', - path.join(__dirname, 'public/js/index.js') + path.join(__dirname, 'public/js/index.ts') ], pretty: [ 'core-js', 'regenerator-runtime/runtime', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - path.join(__dirname, 'public/js/pretty.js') + path.join(__dirname, 'public/js/pretty.ts') ], 'pretty-styles': [ path.join(__dirname, 'public/css/github-extract.css'), @@ -351,7 +351,7 @@ module.exports = { 'script-loader!vega-lite', 'script-loader!vega-embed', 'expose-loader?exposes=L|L|true!leaflet', - path.join(__dirname, 'public/js/pretty.js') + path.join(__dirname, 'public/js/pretty.ts') ], slide: [ 'core-js', @@ -359,7 +359,7 @@ module.exports = { 'bootstrap-tooltip', 'flowchart.js', 'imports-loader?Raphael=raphael!js-sequence-diagrams', - path.join(__dirname, 'public/js/slide.js') + path.join(__dirname, 'public/js/slide.ts') ], 'slide-styles': [ path.join(__dirname, 'public/vendor/bootstrap/tooltip.min.css'), @@ -395,7 +395,7 @@ module.exports = { 'script-loader!vega-embed', 'expose-loader?exposes=Reveal!reveal.js', 'expose-loader?exposes=L|L|true!leaflet', - path.join(__dirname, 'public/js/slide.js') + path.join(__dirname, 'public/js/slide.ts') ] }, From f83b4b77fdc14006a6542bcde815ecd8d926a5e1 Mon Sep 17 00:00:00 2001 From: Raccoon Date: Sat, 31 Jul 2021 15:56:50 +0800 Subject: [PATCH 167/167] refactor --- package-lock.json | 58 +++- package.json | 7 +- public/js/cover.ts | 574 ++++++++++++++++++---------------- public/js/extra.ts | 2 + public/js/history.ts | 162 +++++++--- public/js/index.ts | 20 +- public/js/lib/common/login.ts | 117 ++++--- public/js/lib/config/index.ts | 9 - public/js/locale.ts | 63 ++-- public/js/render.ts | 24 +- public/js/tsconfig.json | 27 ++ public/js/typings/index.d.ts | 12 + public/js/utils.ts | 8 +- 13 files changed, 657 insertions(+), 426 deletions(-) create mode 100644 public/js/tsconfig.json create mode 100644 public/js/typings/index.d.ts diff --git a/package-lock.json b/package-lock.json index 90a132c03d..27f548b45b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3973,6 +3973,21 @@ "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz", "integrity": "sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ==" }, + "@types/jquery": { + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.6.tgz", + "integrity": "sha512-SmgCQRzGPId4MZQKDj9Hqc6kSXFNWZFHpELkyK8AQhf8Zr6HKfCzFv9ZC1Fv3FyQttJZOlap3qYb12h61iZAIg==", + "dev": true, + "requires": { + "@types/sizzle": "*" + } + }, + "@types/js-cookie": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-2.2.7.tgz", + "integrity": "sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA==", + "dev": true + }, "@types/json-schema": { "version": "7.0.7", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", @@ -4014,6 +4029,12 @@ "@types/node": "*" } }, + "@types/list.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@types/list.js/-/list.js-2.3.1.tgz", + "integrity": "sha512-yKwk95g7K5mKl9i5/rrkrbwoXvRtiC/gd4b1qU8mbfxanSkPsCSqAvmgaXS+tdj66+l5BMvdargh57pdOH+yBg==", + "dev": true + }, "@types/lodash": { "version": "4.14.170", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", @@ -4118,6 +4139,15 @@ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" }, + "@types/select2": { + "version": "4.0.54", + "resolved": "https://registry.npmjs.org/@types/select2/-/select2-4.0.54.tgz", + "integrity": "sha512-xq8c3zsKktym2b9XbDLUWBDyX0WyWjKzeFsDQHkM9p6NfxJza4g2Ud1bheTKNXpHNyVPUrfGwDEMN7JBe3gQbw==", + "dev": true, + "requires": { + "@types/jquery": "*" + } + }, "@types/serve-static": { "version": "1.13.9", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", @@ -4127,6 +4157,12 @@ "@types/node": "*" } }, + "@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, "@types/socket.io": { "version": "2.1.13", "resolved": "https://registry.npmjs.org/@types/socket.io/-/socket.io-2.1.13.tgz", @@ -4147,6 +4183,12 @@ "socket.io-parser": "*" } }, + "@types/store": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/store/-/store-2.0.2.tgz", + "integrity": "sha512-ZPHnXkzmGMfk+pHqAGzTSpA9CbsHmJLgkvOl5w52LZ0XTxB1ZIHWZzQ7lEtjTNWScBbsQekg8TjApMXkMe4nkw==", + "dev": true + }, "@types/validator": { "version": "13.1.4", "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.1.4.tgz", @@ -19059,13 +19101,21 @@ "integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=" }, "xss": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.6.tgz", - "integrity": "sha512-6Q9TPBeNyoTRxgZFk5Ggaepk/4vUOYdOsIUYvLehcsIZTFjaavbVnsuAkLA5lIFuug5hw8zxcB9tm01gsjph2A==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.9.tgz", + "integrity": "sha512-2t7FahYnGJys6DpHLhajusId7R0Pm2yTmuL0GV9+mV0ZlaLSnb2toBmppATfg5sWIhZQGlsTLoecSzya+l4EAQ==", "dev": true, "requires": { - "commander": "^2.9.0", + "commander": "^2.20.3", "cssfilter": "0.0.10" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + } } }, "xtend": { diff --git a/package.json b/package.json index b1c14f3f4a..039f6afc40 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,9 @@ "@types/express": "4.17.9", "@types/express-flash": "0.0.2", "@types/express-session": "^1.17.3", + "@types/jquery": "^3.5.6", + "@types/js-cookie": "^2.2.7", + "@types/list.js": "^2.3.1", "@types/lodash": "^4.14.170", "@types/markdown-pdf": "^9.0.0", "@types/mime-types": "^2.1.0", @@ -128,7 +131,9 @@ "@types/passport.socketio": "^3.7.5", "@types/qs": "^6.9.6", "@types/randomcolor": "^0.5.5", + "@types/select2": "^4.0.54", "@types/socket.io": "^2.1.13", + "@types/store": "^2.0.2", "@types/validator": "^13.1.4", "@typescript-eslint/eslint-plugin": "^4.26.1", "@typescript-eslint/parser": "^4.26.1", @@ -222,7 +227,7 @@ "webpack-cli": "~4.7.2", "webpack-merge": "~5.8.0", "wurl": "~2.5.3", - "xss": "~1.0.6" + "xss": "~1.0.9" }, "optionalDependencies": { "bufferutil": "~4.0.0", diff --git a/public/js/cover.ts b/public/js/cover.ts index 10111bfa08..d91ba5979b 100644 --- a/public/js/cover.ts +++ b/public/js/cover.ts @@ -1,38 +1,115 @@ -/* eslint-env browser, jquery */ -/* global moment, serverurl */ +import {saveAs} from 'file-saver' +import $ from 'jquery' +import List from 'list.js' +import unescapeHTML from 'lodash/unescape' +import moment from 'moment' -import { - checkIfAuth, - clearLoginState, - getLoginState, - resetCheckAuth, - setloginStateChangeEvent -} from './lib/common/login' +import '../css/cover.css' +import '../css/site.css' import { clearDuplicatedHistory, - deleteServerHistory, + clearServerHistoryAsync, + deleteServerHistoryAsync, getHistory, + getHistoryAsync, getStorageHistory, + NoteHistory, parseHistory, parseServerToHistory, parseStorageToHistory, - postHistoryToServer, + postHistoryToServerAsync, removeHistory, saveHistory, saveStorageHistoryToServer } from './history' -import { saveAs } from 'file-saver' -import List from 'list.js' -import unescapeHTML from 'lodash/unescape' +import { + checkIfAuth, + clearLoginState, + getLoginState, + getLoginUserProfile, isLogin, + resetCheckAuth, + setLoginStateChangeEvent +} from './lib/common/login' +import {serverurl} from "./lib/config"; + +import {initializeLocaleDropdown} from "./locale"; + +initializeLocaleDropdown() + +setLoginStateChangeEvent(pageInit) + +void pageInit() + +async function pageInit() { + try { + const profile = await getLoginUserProfile() + $('.ui-signin').hide() + $('.ui-or').hide() + $('.ui-welcome').show() + if (profile.photo) $('.ui-avatar').prop('src', profile.photo).show() + else $('.ui-avatar').prop('src', '').hide() + $('.ui-name').html(profile.name) + $('.ui-signout').show() + navSection.historyPageBtn.trigger('click') + parseServerToHistory(historyList, parseHistoryCallback) + } catch (err) { + $('.ui-signin').show() + $('.ui-or').show() + $('.ui-welcome').hide() + $('.ui-avatar').prop('src', '').hide() + $('.ui-name').html('') + $('.ui-signout').hide() + parseStorageToHistory(historyList, parseHistoryCallback) + } +} -require('./locale') +// prevent empty link change hash +$('a[href="#"]').on('click', function (e) { + e.preventDefault() +}) -require('../css/cover.css') -require('../css/site.css') +/** + * masthead nav section + */ +const navSection = { + introPageBtn: $('.ui-home'), + historyPageBtn: $('.ui-history'), + deleteUserModalCancel: $('.ui-delete-user-modal-cancel'), + logoutBtn: $('.ui-logout') +} +const introSection = $('#home') +const historySection = $('#history') + +navSection.introPageBtn.on('click', function (e) { + if (!introSection.is(':visible')) { + $('.section:visible').hide() + introSection.fadeIn() + } +}) + +navSection.historyPageBtn.on('click', () => { + if (!historySection.is(':visible')) { + $('.section:visible').hide() + historySection.fadeIn() + } +}) + +navSection.deleteUserModalCancel.on('click', () => { + $('.ui-delete-user').parent().removeClass('active') +}) -const options = { +navSection.logoutBtn.on('click', () => { + clearLoginState() + location.href = `${serverurl}/logout` +}) + +/** + * History Section + */ + +const options: List.ListOptions = { valueNames: ['id', 'text', 'timestamp', 'fromNow', 'time', 'tags', 'pinned'], item: `
  • @@ -54,87 +131,169 @@ const options = {
  • `, page: 18, - pagination: [{ + pagination: { outerWindow: 1 - }] + } } const historyList = new List('history', options) -window.migrateHistoryFromTempCallback = pageInit -setloginStateChangeEvent(pageInit) - -pageInit() - -function pageInit () { - checkIfAuth( - data => { - $('.ui-signin').hide() - $('.ui-or').hide() - $('.ui-welcome').show() - if (data.photo) $('.ui-avatar').prop('src', data.photo).show() - else $('.ui-avatar').prop('src', '').hide() - $('.ui-name').html(data.name) - $('.ui-signout').show() - $('.ui-history').click() - parseServerToHistory(historyList, parseHistoryCallback) - }, - () => { - $('.ui-signin').show() - $('.ui-or').show() - $('.ui-welcome').hide() - $('.ui-avatar').prop('src', '').hide() - $('.ui-name').html('') - $('.ui-signout').hide() - parseStorageToHistory(historyList, parseHistoryCallback) - } - ) +/** + * History Tool Bar + */ +const historyListContainer = $('#history-list') +const historyPagination = $('.pagination') +const historyToolbar = { + importFromBrowserBtn: $('.ui-import-from-browser'), + clearHistoryBtn: $('.ui-clear-history'), + saveHistoryBtn: $('.ui-save-history'), + openHistoryFile: $('.ui-open-history'), + tagFilter: $('.ui-use-tags') } -$('.masthead-nav li').click(function () { - $(this).siblings().removeClass('active') - $(this).addClass('active') +/** + * clear all history + */ +historyToolbar.clearHistoryBtn.on('click', () => { + $('.ui-delete-history-modal-msg').text('Do you really want to clear all history?') + $('.ui-delete-history-modal-item').html('There is no turning back.') + isClearAllHistory = true + deleteHistoryModalTargetId = null }) -// prevent empty link change hash -$('a[href="#"]').click(function (e) { - e.preventDefault() +historyToolbar.importFromBrowserBtn.on('click', () => { + saveStorageHistoryToServer(() => { + parseStorageToHistory(historyList, parseHistoryCallback) + }) }) -$('.ui-home').click(function (e) { - if (!$('#home').is(':visible')) { - $('.section:visible').hide() - $('#home').fadeIn() +historyToolbar.saveHistoryBtn.on('click', async function () { + const history = JSON.stringify(await getHistoryAsync()) + const blob = new Blob([history], { + type: 'application/json;charset=utf-8' + }) + saveAs(blob, `codimd_history_${moment().format('YYYYMMDDHHmmss')}`, true) +}) + +historyToolbar.openHistoryFile.on('change', function (e) { + const files = e.target.files || e.dataTransfer.files + const file = files[0] + const reader = new FileReader() + reader.onload = () => { + const notehistory = JSON.parse(reader.result) + // console.log(notehistory); + if (!reader.result) return + getHistory(data => { + let mergedata = data.concat(notehistory) + mergedata = clearDuplicatedHistory(mergedata) + saveHistory(mergedata) + parseHistory(historyList, parseHistoryCallback) + }) + historyToolbar.openHistoryFile.replaceWith(historyToolbar.openHistoryFile.val('').clone(true)) } + reader.readAsText(file) }) -$('.ui-history').click(() => { - if (!$('#history').is(':visible')) { - $('.section:visible').hide() - $('#history').fadeIn() +$('.ui-refresh-history').on('click', () => { + const lastTags = historyToolbar.tagFilter.select2('val') + historyToolbar.tagFilter.select2('val', '') + historyList.filter() + const lastKeyword = $('.search').val() + $('.search').val('') + historyList.search() + historyListContainer.slideUp('fast') + historyPagination.hide() + + resetCheckAuth() + historyList.clear() + parseHistory(historyList, (list, notehistory) => { + parseHistoryCallback(list, notehistory) + historyToolbar.tagFilter.select2('val', lastTags) + historyToolbar.tagFilter.trigger('change') + historyList.search(lastKeyword) + $('.search').val(lastKeyword) + refreshHistoryUIElementVisibility() + historyListContainer.slideDown('fast') + }) +}) + + +let filtertags = [] +historyToolbar.tagFilter.select2({ + placeholder: historyToolbar.tagFilter.attr('placeholder'), + multiple: true, + data() { + return { + results: filtertags + } } }) +$('.select2-input').css('width', 'inherit') +buildTagsFilter([]) -function checkHistoryList () { - if ($('#history-list').children().length > 0) { - $('.pagination').show() - $('.ui-nohistory').hide() - $('.ui-import-from-browser').hide() - } else if ($('#history-list').children().length === 0) { - $('.pagination').hide() - $('.ui-nohistory').slideDown() - getStorageHistory(data => { - if (data && data.length > 0 && getLoginState() && historyList.items.length === 0) { - $('.ui-import-from-browser').slideDown() +function buildTagsFilter(tags) { + for (let i = 0; i < tags.length; i++) { + tags[i] = { + id: i, + text: unescapeHTML(tags[i]) + } + } + filtertags = tags +} + + +historyToolbar.tagFilter.on('change', function () { + const tags = [] + const data = $(this).select2('data') + for (let i = 0; i < data.length; i++) { + tags.push(data[i].text) + } + if (tags.length > 0) { + historyList.filter(item => { + const values = item.values() + if (!values.tags) return false + let found = false + for (let i = 0; i < tags.length; i++) { + if (values.tags.includes(tags[i])) { + found = true + break + } } + return found }) + } else { + historyList.filter() } + refreshHistoryUIElementVisibility() +}) + +$('.search').on('keyup', () => { + refreshHistoryUIElementVisibility() +}) + + +// ---------------------------------------------------------------------------------------------------------------- + +function refreshHistoryUIElementVisibility() { + if (historyListContainer.children().length > 0) { + historyPagination.show() + $('.ui-nohistory').hide() + historyToolbar.importFromBrowserBtn.hide() + return + } + historyPagination.hide() + $('.ui-nohistory').slideDown() + getStorageHistory(data => { + if (data && data.length > 0 && getLoginState() && historyList.items.length === 0) { + historyToolbar.importFromBrowserBtn.slideDown() + } + }) } -function parseHistoryCallback (list, notehistory) { - checkHistoryList() +function parseHistoryCallback(list, notehistory) { + refreshHistoryUIElementVisibility() // sort by pinned then timestamp list.sort('', { - sortFunction (a, b) { + sortFunction(a, b) { const notea = a.values() const noteb = b.values() if (notea.pinned && !noteb.pinned) { @@ -160,8 +319,12 @@ function parseHistoryCallback (list, notehistory) { for (let j = 0; j < tags.length; j++) { // push info filtertags if not found let found = false - if (filtertags.includes(tags[j])) { found = true } - if (!found) { filtertags.push(tags[j]) } + if (filtertags.includes(tags[j])) { + found = true + } + if (!found) { + filtertags.push(tags[j]) + } } } } @@ -169,7 +332,7 @@ function parseHistoryCallback (list, notehistory) { } // update items whenever list updated -historyList.on('updated', e => { +historyList.on('updated', function (e) { for (let i = 0, l = e.items.length; i < l; i++) { const item = e.items[i] if (item.visible()) { @@ -189,7 +352,7 @@ historyList.on('updated', e => { // parse tags const tags = values.tags if (tags && tags.length > 0 && tagsEl.children().length <= 0) { - const labels = [] + const labels: string[] = [] for (let j = 0; j < tags.length; j++) { // push into the item label labels.push(`${tags[j]}`) @@ -199,22 +362,66 @@ historyList.on('updated', e => { } } $('.ui-history-close').off('click') - $('.ui-history-close').on('click', historyCloseClick) + $('.ui-history-close').on('click', onHistoryCloseClick) $('.ui-history-pin').off('click') $('.ui-history-pin').on('click', historyPinClick) }) -function historyCloseClick (e) { +/** + * Delete History Modal + */ +let isClearAllHistory: boolean = false +let deleteHistoryModalTargetId: string | null = null + +function onHistoryCloseClick(this: HTMLElement, e) { e.preventDefault() - const id = $(this).closest('a').siblings('span').html() - const value = historyList.get('id', id)[0]._values + const id: string = $(this).closest('a').siblings('span').html() + const value: NoteHistory = historyList.get('id', id)[0].values() $('.ui-delete-history-modal-msg').text('Do you really want to delete below history?') $('.ui-delete-history-modal-item').html(` ${value.text}
    ${value.time}`) - clearHistory = false - deleteId = id + isClearAllHistory = false + deleteHistoryModalTargetId = id } -function historyPinClick (e) { +$('.ui-delete-history-modal-confirm').on('click', async function () { + if (await isLogin()) { + if (isClearAllHistory) { + await clearServerHistoryAsync() + } else { + if (deleteHistoryModalTargetId) { + await deleteServerHistoryAsync(deleteHistoryModalTargetId) + } + } + refreshHistoryUIElementVisibility() + $('.delete-history-modal').modal('hide') + deleteHistoryModalTargetId = null + isClearAllHistory = false + } else { + if (isClearAllHistory) { + saveHistory([]) + historyList.clear() + refreshHistoryUIElementVisibility() + deleteHistoryModalTargetId = null + } else { + if (!deleteHistoryModalTargetId) return + getHistory(notehistory => { + const newnotehistory = removeHistory(deleteHistoryModalTargetId, notehistory) + saveHistory(newnotehistory) + historyList.remove('id', deleteHistoryModalTargetId) + refreshHistoryUIElementVisibility() + deleteHistoryModalTargetId = null + }) + } + $('.delete-history-modal').modal('hide') + isClearAllHistory = false + } +}) + +/** + * Pin History + */ + +function historyPinClick(e) { e.preventDefault() const $this = $(this) const id = $this.closest('a').siblings('span').html() @@ -229,13 +436,17 @@ function historyPinClick (e) { item._values.pinned = false } checkIfAuth(() => { - postHistoryToServer(id, { - pinned - }, (err, result) => { - if (!err) { - if (pinned) { $this.addClass('active') } else { $this.removeClass('active') } - } - }) + postHistoryToServerAsync(id, {pinned}) + .then(() => { + if (pinned) { + $this.addClass('active') + } else { + $this.removeClass('active') + } + }) + .catch(err => { + console.error(err) + }) }, () => { getHistory(notehistory => { for (let i = 0; i < notehistory.length; i++) { @@ -245,7 +456,11 @@ function historyPinClick (e) { } } saveHistory(notehistory) - if (pinned) { $this.addClass('active') } else { $this.removeClass('active') } + if (pinned) { + $this.addClass('active') + } else { + $this.removeClass('active') + } }) }) } @@ -253,7 +468,7 @@ function historyPinClick (e) { // auto update item fromNow every minutes setInterval(updateItemFromNow, 60000) -function updateItemFromNow () { +function updateItemFromNow() { const items = $('.item').toArray() for (let i = 0; i < items.length; i++) { const item = $(items[i]) @@ -261,170 +476,3 @@ function updateItemFromNow () { item.find('.fromNow').text(moment(timestamp).fromNow()) } } - -var clearHistory = false -var deleteId = null - -function deleteHistory () { - checkIfAuth(() => { - deleteServerHistory(deleteId, (err, result) => { - if (!err) { - if (clearHistory) { - historyList.clear() - checkHistoryList() - } else { - historyList.remove('id', deleteId) - checkHistoryList() - } - } - $('.delete-history-modal').modal('hide') - deleteId = null - clearHistory = false - }) - }, () => { - if (clearHistory) { - saveHistory([]) - historyList.clear() - checkHistoryList() - deleteId = null - } else { - if (!deleteId) return - getHistory(notehistory => { - const newnotehistory = removeHistory(deleteId, notehistory) - saveHistory(newnotehistory) - historyList.remove('id', deleteId) - checkHistoryList() - deleteId = null - }) - } - $('.delete-history-modal').modal('hide') - clearHistory = false - }) -} - -$('.ui-delete-history-modal-confirm').click(() => { - deleteHistory() -}) - -$('.ui-import-from-browser').click(() => { - saveStorageHistoryToServer(() => { - parseStorageToHistory(historyList, parseHistoryCallback) - }) -}) - -$('.ui-save-history').click(() => { - getHistory(data => { - const history = JSON.stringify(data) - const blob = new Blob([history], { - type: 'application/json;charset=utf-8' - }) - saveAs(blob, `codimd_history_${moment().format('YYYYMMDDHHmmss')}`, true) - }) -}) - -$('.ui-open-history').bind('change', e => { - const files = e.target.files || e.dataTransfer.files - const file = files[0] - const reader = new FileReader() - reader.onload = () => { - const notehistory = JSON.parse(reader.result) - // console.log(notehistory); - if (!reader.result) return - getHistory(data => { - let mergedata = data.concat(notehistory) - mergedata = clearDuplicatedHistory(mergedata) - saveHistory(mergedata) - parseHistory(historyList, parseHistoryCallback) - }) - $('.ui-open-history').replaceWith($('.ui-open-history').val('').clone(true)) - } - reader.readAsText(file) -}) - -$('.ui-clear-history').click(() => { - $('.ui-delete-history-modal-msg').text('Do you really want to clear all history?') - $('.ui-delete-history-modal-item').html('There is no turning back.') - clearHistory = true - deleteId = null -}) - -$('.ui-refresh-history').click(() => { - const lastTags = $('.ui-use-tags').select2('val') - $('.ui-use-tags').select2('val', '') - historyList.filter() - const lastKeyword = $('.search').val() - $('.search').val('') - historyList.search() - $('#history-list').slideUp('fast') - $('.pagination').hide() - - resetCheckAuth() - historyList.clear() - parseHistory(historyList, (list, notehistory) => { - parseHistoryCallback(list, notehistory) - $('.ui-use-tags').select2('val', lastTags) - $('.ui-use-tags').trigger('change') - historyList.search(lastKeyword) - $('.search').val(lastKeyword) - checkHistoryList() - $('#history-list').slideDown('fast') - }) -}) - -$('.ui-delete-user-modal-cancel').click(() => { - $('.ui-delete-user').parent().removeClass('active') -}) - -$('.ui-logout').click(() => { - clearLoginState() - location.href = `${serverurl}/logout` -}) - -let filtertags = [] -$('.ui-use-tags').select2({ - placeholder: $('.ui-use-tags').attr('placeholder'), - multiple: true, - data () { - return { - results: filtertags - } - } -}) -$('.select2-input').css('width', 'inherit') -buildTagsFilter([]) - -function buildTagsFilter (tags) { - for (let i = 0; i < tags.length; i++) { - tags[i] = { - id: i, - text: unescapeHTML(tags[i]) - } - } - filtertags = tags -} -$('.ui-use-tags').on('change', function () { - const tags = [] - const data = $(this).select2('data') - for (let i = 0; i < data.length; i++) { tags.push(data[i].text) } - if (tags.length > 0) { - historyList.filter(item => { - const values = item.values() - if (!values.tags) return false - let found = false - for (let i = 0; i < tags.length; i++) { - if (values.tags.includes(tags[i])) { - found = true - break - } - } - return found - }) - } else { - historyList.filter() - } - checkHistoryList() -}) - -$('.search').keyup(() => { - checkHistoryList() -}) diff --git a/public/js/extra.ts b/public/js/extra.ts index f076d1bb20..84722051a2 100644 --- a/public/js/extra.ts +++ b/public/js/extra.ts @@ -44,6 +44,8 @@ require('prismjs/components/prism-gherkin') require('./lib/common/login') require('../vendor/md-toc') + + let viz = new window.Viz() const plantumlEncoder = require('plantuml-encoder') diff --git a/public/js/history.ts b/public/js/history.ts index da39f09560..945d6a14b2 100644 --- a/public/js/history.ts +++ b/public/js/history.ts @@ -1,9 +1,10 @@ /* eslint-env browser, jquery */ /* global serverurl, moment */ +import $ from 'jquery' import store from 'store' import LZString from '@hackmd/lz-string' - +import {serverurl} from "./lib/config"; import escapeHTML from 'lodash/escape' import { @@ -11,13 +12,11 @@ import { encodeNoteId } from './utils' -import { checkIfAuth } from './lib/common/login' - -import { urlpath } from './lib/config' +import {checkIfAuth, isLogin} from './lib/common/login' -window.migrateHistoryFromTempCallback = null +import {urlpath} from './lib/config' -export function saveHistory (notehistory) { +export function saveHistory(notehistory) { checkIfAuth( () => { saveHistoryToServer(notehistory) @@ -28,17 +27,17 @@ export function saveHistory (notehistory) { ) } -function saveHistoryToStorage (notehistory) { +function saveHistoryToStorage(notehistory) { store.set('notehistory', JSON.stringify(notehistory)) } -function saveHistoryToServer (notehistory) { +function saveHistoryToServer(notehistory) { $.post(`${serverurl}/history`, { history: JSON.stringify(notehistory) }) } -export function saveStorageHistoryToServer (callback) { +export function saveStorageHistoryToServer(callback) { const data = store.get('notehistory') if (data) { $.post(`${serverurl}/history`, { @@ -50,7 +49,7 @@ export function saveStorageHistoryToServer (callback) { } } -export function clearDuplicatedHistory (notehistory) { +export function clearDuplicatedHistory(notehistory) { const newnotehistory = [] for (let i = 0; i < notehistory.length; i++) { let found = false @@ -67,12 +66,14 @@ export function clearDuplicatedHistory (notehistory) { break } } - if (!found) { newnotehistory.push(notehistory[i]) } + if (!found) { + newnotehistory.push(notehistory[i]) + } } return newnotehistory } -function addHistory (id, text, time, tags, pinned, notehistory) { +function addHistory(id, text, time, tags, pinned, notehistory) { // only add when note id exists if (id) { notehistory.push({ @@ -86,7 +87,7 @@ function addHistory (id, text, time, tags, pinned, notehistory) { return notehistory } -export function removeHistory (id, notehistory) { +export function removeHistory(id, notehistory) { for (let i = 0; i < notehistory.length; i++) { if (notehistory[i].id === id) { notehistory.splice(i, 1) @@ -97,7 +98,7 @@ export function removeHistory (id, notehistory) { } // used for inner -export function writeHistory (title, tags) { +export function writeHistory(title, tags) { checkIfAuth( () => { // no need to do this anymore, this will count from server-side @@ -109,7 +110,7 @@ export function writeHistory (title, tags) { ) } -function writeHistoryToStorage (title, tags) { +function writeHistoryToStorage(title, tags) { const data = store.get('notehistory') let notehistory if (data && typeof data === 'string') { @@ -126,7 +127,7 @@ if (!Array.isArray) { Array.isArray = arg => Object.prototype.toString.call(arg) === '[object Array]' } -function renderHistory (title, tags) { +function renderHistory(title, tags) { // console.debug(tags); const id = urlpath ? location.pathname.slice(urlpath.length + 1, location.pathname.length).split('/')[1] : location.pathname.split('/')[1] return { @@ -137,7 +138,7 @@ function renderHistory (title, tags) { } } -function generateHistory (title, tags, notehistory) { +function generateHistory(title, tags, notehistory) { const info = renderHistory(title, tags) // keep any pinned data let pinned = false @@ -154,22 +155,42 @@ function generateHistory (title, tags, notehistory) { } // used for outer -export function getHistory (callback) { - checkIfAuth( - () => { - getServerHistory(callback) - }, - () => { - getStorageHistory(callback) - } - ) + +export async function getHistoryAsync(): Promise { + if (await isLogin()) { + return await getServerHistoryAsync() + } + return getStorageHistoryAsync(); } -function getServerHistory (callback) { +export function getHistory(callback: (_: NoteHistory[]) => void) { + getHistoryAsync() + .then((data) => { + callback(data) + }) +} + +export interface NoteHistory { + id?: string + text?: string + time?: Date | number + tags?: string[] + pinned?: boolean +} + +function getServerHistoryAsync(): Promise { + return new Promise((resolve) => { + getServerHistory(function (data: NoteHistory[]) { + resolve(data) + }) + }) +} + +function getServerHistory(callback) { $.get(`${serverurl}/history`) .done(data => { if (data.history) { - callback(data.history) + callback(data.history as NoteHistory[]) } }) .fail((xhr, status, error) => { @@ -177,17 +198,30 @@ function getServerHistory (callback) { }) } -export function getStorageHistory (callback) { +function getStorageHistoryAsync(): NoteHistory[] { + let data = store.get('notehistory') + if (data) { + if (typeof data === 'string') { + data = JSON.parse(data) + } + return data + } + return [] +} + +export function getStorageHistory(callback) { let data = store.get('notehistory') if (data) { - if (typeof data === 'string') { data = JSON.parse(data) } + if (typeof data === 'string') { + data = JSON.parse(data) + } callback(data) } // eslint-disable-next-line standard/no-callback-literal callback([]) } -export function parseHistory (list, callback) { +export function parseHistory(list, callback) { checkIfAuth( () => { parseServerToHistory(list, callback) @@ -198,7 +232,7 @@ export function parseHistory (list, callback) { ) } -export function parseServerToHistory (list, callback) { +export function parseServerToHistory(list, callback) { $.get(`${serverurl}/history`) .done(data => { if (data.history) { @@ -210,16 +244,18 @@ export function parseServerToHistory (list, callback) { }) } -export function parseStorageToHistory (list, callback) { +export function parseStorageToHistory(list, callback) { let data = store.get('notehistory') if (data) { - if (typeof data === 'string') { data = JSON.parse(data) } + if (typeof data === 'string') { + data = JSON.parse(data) + } parseToHistory(list, data, callback) } parseToHistory(list, [], callback) } -function parseToHistory (list, notehistory, callback) { +function parseToHistory(list, notehistory, callback) { if (!callback) return else if (!list || !notehistory) callback(list, notehistory) else if (notehistory && notehistory.length > 0) { @@ -242,29 +278,53 @@ function parseToHistory (list, notehistory, callback) { notehistory[i].text = escapeHTML(notehistory[i].text) notehistory[i].tags = (notehistory[i].tags && notehistory[i].tags.length > 0) ? escapeHTML(notehistory[i].tags).split(',') : [] // add to list - if (notehistory[i].id && list.get('id', notehistory[i].id).length === 0) { list.add(notehistory[i]) } + if (notehistory[i].id && list.get('id', notehistory[i].id).length === 0) { + list.add(notehistory[i]) + } } } callback(list, notehistory) } -export function postHistoryToServer (noteId, data, callback) { - $.post(`${serverurl}/history/${noteId}`, data) - .done(result => callback(null, result)) - .fail((xhr, status, error) => { - console.error(xhr.responseText) - return callback(error, null) - }) +interface HistoryUpdatePayload { + pinned: boolean +} + +export function postHistoryToServerAsync(noteId: string, data ?: HistoryUpdatePayload) { + return new Promise((resolve, reject) => { + $.post(`${serverurl}/history/${noteId}`, data as any) + .done(result => resolve(result)) + .fail((xhr, status, error) => { + console.error(xhr.responseText) + return reject(error) + }) + }) } -export function deleteServerHistory (noteId, callback) { - $.ajax({ - url: `${serverurl}/history${noteId ? '/' + noteId : ''}`, - type: 'DELETE' +export function deleteServerHistoryAsync(noteId: string) { + return new Promise((resolve, reject) => { + $.ajax({ + url: `${serverurl}/history/${noteId}`, + type: 'DELETE' + }) + .done(result => resolve(result)) + .fail((xhr, status, error) => { + console.error(xhr.responseText) + return reject(error) + }) }) - .done(result => callback(null, result)) - .fail((xhr, status, error) => { - console.error(xhr.responseText) - return callback(error, null) +} + +export function clearServerHistoryAsync() { + return new Promise((resolve, reject) => { + $.ajax({ + url: `${serverurl}/history`, + type: 'DELETE' }) + .done(result => resolve(result)) + .fail((xhr, status, error) => { + console.error(xhr.responseText) + return reject(error) + }) + }) } diff --git a/public/js/index.ts b/public/js/index.ts index 82cbb35780..9213ea4e14 100644 --- a/public/js/index.ts +++ b/public/js/index.ts @@ -23,14 +23,14 @@ import { Spinner } from 'spin.js' import { checkLoginStateChanged, - setloginStateChangeEvent + setLoginStateChangeEvent } from './lib/common/login' import { debug, DROPBOX_APP_KEY, noteid, - noteurl, + noteurl, serverurl, urlpath, version } from './lib/config' @@ -66,10 +66,9 @@ import { import { writeHistory, - deleteServerHistory, getHistory, saveHistory, - removeHistory + removeHistory, deleteServerHistoryAsync } from './history' import { preventXSS } from './render' @@ -396,7 +395,7 @@ function setNeedRefresh () { showStatus(statusType.offline) } -setloginStateChangeEvent(function () { +setLoginStateChangeEvent(function () { setRefreshModal('user-state-changed') setNeedRefresh() }) @@ -1752,11 +1751,14 @@ socket.on('error', function (data) { console.error(data) if (data.message && data.message.indexOf('AUTH failed') === 0) { location.href = serverurl + '/403' } }) -socket.on('delete', function () { +socket.on('delete', async function () { if (personalInfo.login) { - deleteServerHistory(noteid, function (err, data) { - if (!err) location.href = serverurl - }) + try { + await deleteServerHistoryAsync(noteid) + location.href = serverurl + } catch (err) { + console.error(err) + } } else { getHistory(function (notehistory) { var newnotehistory = removeHistory(noteid, notehistory) diff --git a/public/js/lib/common/login.ts b/public/js/lib/common/login.ts index 15c64668f6..770ccd9a61 100644 --- a/public/js/lib/common/login.ts +++ b/public/js/lib/common/login.ts @@ -1,24 +1,28 @@ /* eslint-env browser, jquery */ /* global Cookies */ -import { serverurl } from '../config' +import Cookies from 'js-cookie' -let checkAuth = false +import {serverurl} from '../config' + +type PureFunction = () => void + +let checkAuth: boolean = false let profile = null let lastLoginState = getLoginState() -let lastUserId = getUserId() -let loginStateChangeEvent = null +let lastUserId: string | null = getUserId() +let loginStateChangeEvent: PureFunction | null = null -export function setloginStateChangeEvent (func) { +export function setLoginStateChangeEvent(func: PureFunction): void { loginStateChangeEvent = func } -export function resetCheckAuth () { +export function resetCheckAuth(): void { checkAuth = false } -export function setLoginState (bool, id) { - Cookies.set('loginstate', bool, { +function setLoginState(bool: boolean, id?: string) { + Cookies.set('loginstate', String(bool), { expires: 365 }) if (id) { @@ -29,64 +33,81 @@ export function setLoginState (bool, id) { Cookies.remove('userid') } lastLoginState = bool - lastUserId = id + lastUserId = id || null checkLoginStateChanged() } -export function checkLoginStateChanged () { +export function checkLoginStateChanged(): boolean { if (getLoginState() !== lastLoginState || getUserId() !== lastUserId) { if (loginStateChangeEvent) setTimeout(loginStateChangeEvent, 100) return true - } else { - return false } + return false } -export function getLoginState () { +export function getLoginState(): boolean { const state = Cookies.get('loginstate') - return state === 'true' || state === true + return state === 'true' } -export function getUserId () { - return Cookies.get('userid') +function getUserId(): string { + return Cookies.get('userid') || "" } -export function clearLoginState () { +export function clearLoginState(): void { Cookies.remove('loginstate') } -export function checkIfAuth (yesCallback, noCallback) { - const cookieLoginState = getLoginState() - if (checkLoginStateChanged()) checkAuth = false - if (!checkAuth || typeof cookieLoginState === 'undefined') { - $.get(`${serverurl}/me`) - .done(data => { - if (data && data.status === 'ok') { - profile = data - yesCallback(profile) - setLoginState(true, data.id) - } else { - noCallback() - setLoginState(false) - } - }) - .fail(() => { - noCallback() - }) - .always(() => { - checkAuth = true - }) - } else if (cookieLoginState) { - yesCallback(profile) - } else { - noCallback() +type YesCallbackFunc = (profile: any) => void + +/** + * getLoginUserProfile + * @throws Error when user not login + * @return profile user profile + */ +export async function getLoginUserProfile(): Promise { + return new Promise(function (resolve, reject) { + const cookieLoginState = getLoginState() + if (checkLoginStateChanged()) checkAuth = false + if (!checkAuth || typeof cookieLoginState === 'undefined') { + $.get(`${serverurl}/me`) + .done(data => { + if (data && data.status === 'ok') { + profile = data + setLoginState(true, data.id) + return resolve(profile) + } else { + setLoginState(false) + return reject(new Error('user not login')) + } + }) + .fail(() => { + return reject(new Error('user not login')) + }) + .always(() => { + checkAuth = true + }) + } else if (cookieLoginState) { + return resolve(profile) + } else { + return reject(new Error('user not login')) + } + }) +} + +export async function isLogin(): Promise { + try { + await getLoginUserProfile() + return true + } catch (e) { + return false } } -export default { - checkAuth, - profile, - lastLoginState, - lastUserId, - loginStateChangeEvent +export function checkIfAuth(yesCallback: YesCallbackFunc, noCallback: PureFunction) { + getLoginUserProfile().then((profile) => { + yesCallback(profile) + }).catch(() => { + noCallback() + }) } diff --git a/public/js/lib/config/index.ts b/public/js/lib/config/index.ts index 89fe0bfbc9..04c631ba43 100644 --- a/public/js/lib/config/index.ts +++ b/public/js/lib/config/index.ts @@ -1,12 +1,3 @@ -declare interface Window { - DROPBOX_APP_KEY: string, - domain: string, - urlpath: string, - debug: boolean, - serverurl: string, - version: string - USE_CDN: boolean -} export const DROPBOX_APP_KEY = window.DROPBOX_APP_KEY || '' diff --git a/public/js/locale.ts b/public/js/locale.ts index 71c0f99fb5..89a93820b4 100644 --- a/public/js/locale.ts +++ b/public/js/locale.ts @@ -1,31 +1,48 @@ /* eslint-env browser, jquery */ /* global Cookies */ -var lang = 'en' -var userLang = navigator.language || navigator.userLanguage -var userLangCode = userLang.split('-')[0] -var locale = $('.ui-locale') -var supportLangs = [] -$('.ui-locale option').each(function () { - supportLangs.push($(this).val()) -}) -if (Cookies.get('locale')) { - lang = Cookies.get('locale') - if (lang === 'zh') { - lang = 'zh-TW' +import $ from 'jquery' +import Cookies from 'js-cookie' + +const userLang = navigator.language || navigator.userLanguage +const userLangCode = userLang.split('-')[0] + +let lang = 'en' +let supportLangs: string[] = [] + +function reloadLanguageFromCookie () { + if (Cookies.get('locale')) { + lang = Cookies.get('locale') as string + if (lang === 'zh') { + lang = 'zh-TW' + } + } else if (supportLangs.indexOf(userLang) !== -1) { + lang = supportLangs[supportLangs.indexOf(userLang)] + } else if (supportLangs.indexOf(userLangCode) !== -1) { + lang = supportLangs[supportLangs.indexOf(userLangCode)] } -} else if (supportLangs.indexOf(userLang) !== -1) { - lang = supportLangs[supportLangs.indexOf(userLang)] -} else if (supportLangs.indexOf(userLangCode) !== -1) { - lang = supportLangs[supportLangs.indexOf(userLangCode)] } -locale.val(lang) -$('select.ui-locale option[value="' + lang + '"]').attr('selected', 'selected') +function fillSupportLanguageArrayFromDropdownOptions () { + const $langOptions = $('.ui-locale option'); + $langOptions.each(function () { + supportLangs.push($(this).val() as string) + }) +} -locale.change(function () { - Cookies.set('locale', $(this).val(), { - expires: 365 +export function initializeLocaleDropdown() { + const $locale = $('.ui-locale') + + fillSupportLanguageArrayFromDropdownOptions() + reloadLanguageFromCookie() + + $locale.val(lang) + $('select.ui-locale option[value="' + lang + '"]').attr('selected', 'selected') + + $locale.on('change', function () { + Cookies.set('locale', $(this).val() as string, { + expires: 365 + }) + window.location.reload() }) - window.location.reload() -}) +} diff --git a/public/js/render.ts b/public/js/render.ts index 4a9c3b25f7..66ce713dc5 100644 --- a/public/js/render.ts +++ b/public/js/render.ts @@ -1,16 +1,15 @@ /* eslint-env browser, jquery */ // allow some attributes -var filterXSS = require('xss') +import {filterXSS, escapeAttrValue, whiteList} from 'xss' -var whiteListAttr = ['id', 'class', 'style'] +const whiteListAttr = ['id', 'class', 'style'] window.whiteListAttr = whiteListAttr // allow link starts with '.', '/' and custom protocol with '://', exclude link starts with javascript:// -var linkRegex = /^(?!javascript:\/\/)([\w|-]+:\/\/)|^([.|/])+/i +const linkRegex = /^(?!javascript:\/\/)([\w|-]+:\/\/)|^([.|/])+/i // allow data uri, from https://gist.github.com/bgrins/6194623 -var dataUriRegex = /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*)\s*$/i +const dataUriRegex = /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*)\s*$/i // custom white list -var whiteList = filterXSS.whiteList // allow ol specify start number whiteList.ol = ['start'] // allow li specify value number @@ -34,7 +33,7 @@ whiteList.figure = [] // allow figcaption tag whiteList.figcaption = [] -var filterXSSOptions = { +const filterXSSOptions = { allowCommentTag: true, whiteList: whiteList, escapeHtml: function (html) { @@ -51,28 +50,25 @@ var filterXSSOptions = { onTagAttr: function (tag, name, value, isWhiteAttr) { // allow href and src that match linkRegex if (isWhiteAttr && (name === 'href' || name === 'src') && linkRegex.test(value)) { - return name + '="' + filterXSS.escapeAttrValue(value) + '"' + return name + '="' + escapeAttrValue(value) + '"' } // allow data uri in img src if (isWhiteAttr && (tag === 'img' && name === 'src') && dataUriRegex.test(value)) { - return name + '="' + filterXSS.escapeAttrValue(value) + '"' + return name + '="' + escapeAttrValue(value) + '"' } }, onIgnoreTagAttr: function (tag, name, value, isWhiteAttr) { // allow attr start with 'data-' or in the whiteListAttr if (name.substr(0, 5) === 'data-' || window.whiteListAttr.indexOf(name) !== -1) { // escape its value using built-in escapeAttrValue function - return name + '="' + filterXSS.escapeAttrValue(value) + '"' + return name + '="' + escapeAttrValue(value) + '"' } } } -function preventXSS (html) { +export function preventXSS (html) { return filterXSS(html, filterXSSOptions) } window.preventXSS = preventXSS -module.exports = { - preventXSS: preventXSS, - escapeAttrValue: filterXSS.escapeAttrValue -} +export {escapeAttrValue} from 'xss' diff --git a/public/js/tsconfig.json b/public/js/tsconfig.json new file mode 100644 index 0000000000..1ab62d9e19 --- /dev/null +++ b/public/js/tsconfig.json @@ -0,0 +1,27 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "lib": ["DOM", "ESNext"], + "sourceMap": true, + "baseUrl": ".", + "allowJs": true, + "strict": false, + "strictNullChecks": true, + "strictBindCallApply": true, + "noImplicitThis": true, + "alwaysStrict": true, + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + + "typeRoots": ["../../node_modules/@types", + "./typings" + ] + }, + "include": [ + "./" + ] +} diff --git a/public/js/typings/index.d.ts b/public/js/typings/index.d.ts new file mode 100644 index 0000000000..51da1516fe --- /dev/null +++ b/public/js/typings/index.d.ts @@ -0,0 +1,12 @@ +declare global { + interface Window { + Viz: any + createtime: any + lastchangetime: any + lastchangeui: any + owner: any + ownerprofile: any + whiteListAttr: any + preventXSS: any + } +} diff --git a/public/js/utils.ts b/public/js/utils.ts index 6a98ce9eb3..82183cbcd1 100644 --- a/public/js/utils.ts +++ b/public/js/utils.ts @@ -2,23 +2,23 @@ import base64url from 'base64url' const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i -export function checkNoteIdValid (id) { +export function checkNoteIdValid (id: string) { const result = id.match(uuidRegex) return !!(result && result.length === 1) } -export function encodeNoteId (id) { +export function encodeNoteId (id: string) { // remove dashes in UUID and encode in url-safe base64 const str = id.replace(/-/g, '') const hexStr = Buffer.from(str, 'hex') return base64url.encode(hexStr) } -export function decodeNoteId (encodedId) { +export function decodeNoteId (encodedId: string) { // decode from url-safe base64 const id = base64url.toBuffer(encodedId).toString('hex') // add dashes between the UUID string parts - const idParts = [] + const idParts: string[] = [] idParts.push(id.substr(0, 8)) idParts.push(id.substr(8, 4)) idParts.push(id.substr(12, 4))