From 3263a241ab3263db3c8b75dc6af62cc302c49555 Mon Sep 17 00:00:00 2001 From: ChengLei Shao Date: Sat, 12 Nov 2022 17:12:50 +0800 Subject: [PATCH] feat: logging package (#1021) * feat: logging package * chore: dependency * chore: pino * feat: request log * feat: log rotate * fix: gitignore * fix: gitignore * fix: middleware await * fix: test * docs: logging * feat: log error handler errors * feat: improve code * fix: response error log level * feat: log http body * feat: improve code * feat: improve code * feat: update docs * fix: error * feat: improve code * fix: deps * feat: update docs * fix: error * fix: colorize Co-authored-by: chenos --- docs/menus.ts | 20 +-- docs/zh-CN/api/env.md | 11 ++ docs/zh-CN/api/server/application.md | 10 +- .../ui-schema-designer/what-is-ui-schema.md | 8 +- packages/app/server/src/config/index.ts | 4 +- packages/app/server/src/config/logger.ts | 5 + packages/core/logger/package.json | 24 +++ packages/core/logger/src/create-app-logger.ts | 81 +++++++++ packages/core/logger/src/create-logger.ts | 67 ++++++++ packages/core/logger/src/index.ts | 3 + packages/core/resourcer/src/action.ts | 17 +- packages/core/server/package.json | 1 + packages/core/server/src/application.ts | 17 ++ packages/core/server/src/helper.ts | 1 + .../error-handler/src/error-handler.ts | 3 + storage/logs/.gitignore | 2 + yarn.lock | 156 +++++++++++++++++- 17 files changed, 401 insertions(+), 29 deletions(-) create mode 100644 packages/app/server/src/config/logger.ts create mode 100644 packages/core/logger/package.json create mode 100644 packages/core/logger/src/create-app-logger.ts create mode 100644 packages/core/logger/src/create-logger.ts create mode 100644 packages/core/logger/src/index.ts create mode 100644 storage/logs/.gitignore diff --git a/docs/menus.ts b/docs/menus.ts index b5a38bff3..6ca303a0d 100644 --- a/docs/menus.ts +++ b/docs/menus.ts @@ -44,10 +44,7 @@ export default { title: 'Release', 'title.zh-CN': '版本发布', type: 'group', - children: [ - '/welcome/release/index', - '/welcome/release/v08-changelog', - ], + children: ['/welcome/release/index', '/welcome/release/v08-changelog'], }, { title: 'Community', @@ -57,7 +54,7 @@ export default { '/welcome/community/contributing', // '/welcome/community/faq', '/welcome/community/translations', - + '/welcome/community/thanks', ], }, @@ -91,9 +88,7 @@ export default { title: 'Blocks Guide', 'title.zh-CN': '区块指南', type: 'group', - children: [ - '/manual/blocks-guide/charts', - ], + children: ['/manual/blocks-guide/charts'], }, ], '/development': [ @@ -174,17 +169,14 @@ export default { { title: 'HTTP API', type: 'subMenu', - children: [ - '/api/http/index', - '/api/http/rest-api', - ], + children: ['/api/http/index', '/api/http/rest-api'], }, { title: '@nocobase/server', type: 'subMenu', children: [ - '/api/server/application', - // '/api/server/plugin-manager', + '/api/server/application', + // '/api/server/plugin-manager', '/api/server/plugin', ], }, diff --git a/docs/zh-CN/api/env.md b/docs/zh-CN/api/env.md index e3140bfff..9cc424176 100644 --- a/docs/zh-CN/api/env.md +++ b/docs/zh-CN/api/env.md @@ -152,6 +152,17 @@ DB_TABLE_PREFIX=nocobase_ DB_LOGGING=on ``` +### LOGGER_TRANSPORT + +日志 transport,默认值 `console,dailyRotateFile`,可选项 + +- `console` +- `dailyRotateFile` + +### DAILY_ROTATE_FILE_DIRNAME + +`dailyRotateFile` 日志的存储路径,默认为 `storage/logs` + ## 临时环境变量 安装 NocoBase 时,可以通过设置临时的环境变量来辅助安装,如: diff --git a/docs/zh-CN/api/server/application.md b/docs/zh-CN/api/server/application.md index 2c8b1d5c4..0b8d3965e 100644 --- a/docs/zh-CN/api/server/application.md +++ b/docs/zh-CN/api/server/application.md @@ -148,6 +148,7 @@ Application 类的更多示例可参考 [examples](https://github.com/nocobase/n | --- | --- | --- | --- | | `options.database` | `IDatabaseOptions` or `Database` | `{}` | 数据库配置 | | `options.resourcer` | `ResourcerOptions` | `{}` | 资源路由配置 | +| `options.logger` | `AppLoggerOptions` | `{}` | 日志 | | `options.cors` | [`CorsOptions`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/koa__cors/index.d.ts#L24) | `{}` | 跨域配置,参考 [@koa/cors](https://npmjs.com/package/@koa/cors) | | `options.dataWrapping` | `boolean` | `true` | 是否包装响应数据,`true` 则将把通常的 `ctx.body` 包装为 `{ data, meta }` 的结构。 | | `options.registerActions` | `boolean` | `true` | 是否注册默认的 [actions](#) | @@ -180,6 +181,11 @@ interface ApplicationOptions { ACL 实例,相关 API 参考 [ACL](/api/acl)。 + +### `logger` + +Winston 实例,相关 API 参考 [Winston](https://github.com/winstonjs/winston#table-of-contents)。 + ### `i18n` I18next 实例,相关 API 参考 [I18next](https://www.i18next.com/overview/api)。 @@ -196,11 +202,12 @@ I18next 实例,相关 API 参考 [I18next](https://www.i18next.com/overview/ap 内置的中间件有: +- logger - i18next - bodyParser - cors - dataWrapping -- collection2resource +- db2resource - restApiMiddleware ### `context` @@ -215,6 +222,7 @@ NocoBase 默认对 context 注入了以下成员,可以在请求处理函数 | `ctx.db` | `Database` | 数据库实例 | | `ctx.resourcer` | `Resourcer` | 资源路由管理器实例 | | `ctx.action` | `Action` | 资源操作相关对象实例 | +| `ctx.logger` | `Winston` | 日志实例 | | `ctx.i18n` | `I18n` | 国际化实例 | | `ctx.t` | `i18n.t` | 国际化翻译函数快捷方式 | | `ctx.getBearerToken()` | `Function` | 获取请求头中的 bearer token | diff --git a/docs/zh-CN/development/client/ui-schema-designer/what-is-ui-schema.md b/docs/zh-CN/development/client/ui-schema-designer/what-is-ui-schema.md index 0ea86181c..c941ca06c 100644 --- a/docs/zh-CN/development/client/ui-schema-designer/what-is-ui-schema.md +++ b/docs/zh-CN/development/client/ui-schema-designer/what-is-ui-schema.md @@ -129,13 +129,13 @@ JSX 等同于 type: 'void', ['x-component']: 'div', properties: { - title: { - type: 'string', + table: { + type: 'array', 'x-decorator': 'CardItem', 'x-component': 'Table', }, - content: { - type: 'string', + kanban: { + type: 'array', 'x-decorator': 'CardItem', 'x-component': 'Kanban', }, diff --git a/packages/app/server/src/config/index.ts b/packages/app/server/src/config/index.ts index ae26a7c7a..55b45c2d9 100644 --- a/packages/app/server/src/config/index.ts +++ b/packages/app/server/src/config/index.ts @@ -1,11 +1,13 @@ +import cache from './cache'; import database from './database'; +import logger from './logger'; import plugins from './plugins'; import resourcer from './resourcer'; -import cache from './cache'; export default { database, resourcer, plugins, cache, + logger, }; diff --git a/packages/app/server/src/config/logger.ts b/packages/app/server/src/config/logger.ts new file mode 100644 index 000000000..c4897d643 --- /dev/null +++ b/packages/app/server/src/config/logger.ts @@ -0,0 +1,5 @@ +import { AppLoggerOptions } from '@nocobase/logger'; + +export default { + transports: process.env.LOGGER_TRANSPORT || ['console', 'dailyRotateFile'], +} as AppLoggerOptions; diff --git a/packages/core/logger/package.json b/packages/core/logger/package.json new file mode 100644 index 000000000..185fb6148 --- /dev/null +++ b/packages/core/logger/package.json @@ -0,0 +1,24 @@ +{ + "name": "@nocobase/logger", + "version": "0.8.0-alpha.13", + "description": "nocobase logging library", + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "main": "./lib/index.js", + "types": "./lib/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/nocobase/nocobase.git", + "directory": "packages/logging" + }, + "dependencies": { + "lodash": "^4.17.21", + "winston": "^3.8.2", + "winston-daily-rotate-file": "^4.7.1" + } +} diff --git a/packages/core/logger/src/create-app-logger.ts b/packages/core/logger/src/create-app-logger.ts new file mode 100644 index 000000000..b9ebf9e97 --- /dev/null +++ b/packages/core/logger/src/create-app-logger.ts @@ -0,0 +1,81 @@ +import { randomUUID } from 'crypto'; +import Koa from 'koa'; +import { pick } from 'lodash'; +import { createLogger, LoggerOptions } from './create-logger'; + +const defaultRequestWhitelist = [ + 'action', + 'header.x-role', + 'header.x-hostname', + 'header.x-timezone', + 'header.x-locale', + 'referer', +]; + +const defaultResponseWhitelist = ['status']; + +export interface AppLoggerOptions extends LoggerOptions { + skip?: (ctx?: any) => Promise; + requestWhitelist?: string[]; + responseWhitelist?: string[]; +} + +export function createAppLogger(options: AppLoggerOptions = {}) { + const { + skip, + requestWhitelist = defaultRequestWhitelist, + responseWhitelist = defaultResponseWhitelist, + ...others + } = options; + const instance = createLogger(others); + const middleware = async (ctx: Koa.Context, next: Koa.Next) => { + if (skip && (await skip(ctx))) { + return next(); + } + const logger = ctx.app['logger']; + const startTime = Date.now(); + const info = { + level: 'info', + message: `END: ${ctx.method} ${ctx.url}`, + req: ctx.request.toJSON(), + }; + + ctx.reqId = ctx.req['id'] = randomUUID(); + ctx.logger = ctx.log = logger.child({ reqId: ctx.reqId }); + + ctx.logger.info(`BEGIN: ${ctx.method} ${ctx.url}`); + + let error; + + try { + await next(); + } catch (e) { + error = e; + } finally { + info['res'] = ctx.response.toJSON(); + // info['status'] = ctx.status; + if (Math.floor(ctx.status / 100) == 5) { + info.level = 'error'; + info['errors'] = ctx.body?.['errors'] || ctx.body; + } else if (Math.floor(ctx.status / 100) == 4) { + info.level = 'warn'; + info['errors'] = ctx.body?.['errors'] || ctx.body; + } + info['responseTime'] = Date.now() - startTime; + if (ctx.action) { + info['req']['action'] = ctx.action?.toJSON?.(); + } + info['req'] = pick(info['req'], requestWhitelist); + info['res'] = pick(info['res'], responseWhitelist); + ctx.logger.log(info); + } + + if (error) { + throw error; + } + }; + + return { instance, middleware }; +} + +export default createAppLogger; diff --git a/packages/core/logger/src/create-logger.ts b/packages/core/logger/src/create-logger.ts new file mode 100644 index 000000000..6d2da4708 --- /dev/null +++ b/packages/core/logger/src/create-logger.ts @@ -0,0 +1,67 @@ +import path from 'path'; +import winston, { format, Logger } from 'winston'; +import 'winston-daily-rotate-file'; + +const { combine, timestamp, colorize, simple } = format; + +function loggingLevel() { + return process.env.LOGGER_LEVEL || 'info'; +} + +const Transports = { + console(options) { + return new winston.transports.Console({ + format: combine(simple(), colorize()), + ...options, + }); + }, + dailyRotateFile(options: any) { + let dirname = process.env.DAILY_ROTATE_FILE_DIRNAME || path.resolve(process.cwd(), './storage/logs'); + if (!path.isAbsolute(dirname)) { + dirname = path.resolve(process.cwd(), dirname); + } + return new winston.transports.DailyRotateFile({ + dirname, + level: loggingLevel(), + filename: 'nocobase-%DATE%.log', + datePattern: 'YYYY-MM-DD-HH', + maxFiles: '14d', + ...options, + }); + }, +}; + +function toArr(value: any) { + if (Array.isArray(value)) { + return value; + } + return value ? value.split(',') : []; +} + +type WinstonTransport = string | string[] | winston.transport | winston.transport[]; + +interface LoggerOptions extends Omit { + transports?: WinstonTransport; +} + +function createLogger(options: LoggerOptions = {}) { + const transports: winston.transport[] = toArr(options?.transports || ['console', 'dailyRotateFile']) + .map((t) => { + if (typeof t === 'string') { + return Transports[t](); + } + return t; + }) + .filter((t) => t); + const logger = winston.createLogger({ + level: loggingLevel(), + levels: winston.config.cli.levels, + format: combine(timestamp(), format.errors({ stack: true }), format.json(), colorize()), + ...options, + transports, + }); + winston.addColors(winston.config.cli.colors); + return logger; +} + +export { Logger, LoggerOptions, Transports, createLogger }; diff --git a/packages/core/logger/src/index.ts b/packages/core/logger/src/index.ts new file mode 100644 index 000000000..b132835ae --- /dev/null +++ b/packages/core/logger/src/index.ts @@ -0,0 +1,3 @@ +export * from './create-app-logger'; +export * from './create-logger'; + diff --git a/packages/core/resourcer/src/action.ts b/packages/core/resourcer/src/action.ts index df8e5fbac..f5c131c9a 100644 --- a/packages/core/resourcer/src/action.ts +++ b/packages/core/resourcer/src/action.ts @@ -221,6 +221,15 @@ export class Action { this.mergeParams(params); } + toJSON() { + return { + actionName: this.actionName, + resourceName: this.resourceName, + resourceOf: this.resourceOf, + params: this.params, + }; + } + clone() { const options = _.cloneDeep(this.options); delete options.middleware; @@ -286,9 +295,11 @@ export class Action { } getHandlers() { - const handers = [...this.resource.resourcer.getMiddlewares(), ...this.getMiddlewareHandlers(), this.getHandler()].filter( - Boolean, - ); + const handers = [ + ...this.resource.resourcer.getMiddlewares(), + ...this.getMiddlewareHandlers(), + this.getHandler(), + ].filter(Boolean); return handers; } diff --git a/packages/core/server/package.json b/packages/core/server/package.json index 70fa6ddeb..97107f566 100644 --- a/packages/core/server/package.json +++ b/packages/core/server/package.json @@ -18,6 +18,7 @@ "@nocobase/actions": "0.8.0-alpha.13", "@nocobase/database": "0.8.0-alpha.13", "@nocobase/resourcer": "0.8.0-alpha.13", + "@nocobase/logger": "0.8.0-alpha.13", "chalk": "^4.1.1", "commander": "^9.2.0", "find-package-json": "^1.2.0", diff --git a/packages/core/server/src/application.ts b/packages/core/server/src/application.ts index 4838996bb..ecf49ab7b 100644 --- a/packages/core/server/src/application.ts +++ b/packages/core/server/src/application.ts @@ -2,6 +2,7 @@ import { ACL } from '@nocobase/acl'; import { registerActions } from '@nocobase/actions'; import { Cache, createCache, ICacheConfig } from '@nocobase/cache'; import Database, { Collection, CollectionOptions, IDatabaseOptions } from '@nocobase/database'; +import { AppLoggerOptions, createAppLogger, Logger } from '@nocobase/logger'; import Resourcer, { ResourceOptions } from '@nocobase/resourcer'; import { applyMixins, AsyncEmitter, Toposort, ToposortOptions } from '@nocobase/utils'; import { Command, CommandOptions, ParseOptions } from 'commander'; @@ -37,6 +38,7 @@ export interface ApplicationOptions { i18n?: i18n | InitOptions; plugins?: PluginConfiguration[]; acl?: boolean; + logger?: AppLoggerOptions; pmSock?: string; } @@ -119,6 +121,7 @@ export class ApplicationVersion { await this.collection.model.destroy({ truncate: true, }); + await this.collection.model.create({ value: this.app.getVersion(), }); @@ -139,6 +142,7 @@ export class ApplicationVersion { export class Application extends Koa implements AsyncEmitter { protected _db: Database; + protected _logger: Logger; protected _resourcer: Resourcer; @@ -203,8 +207,18 @@ export class Application exten return this._appManager; } + get logger() { + return this._logger; + } + + get log() { + return this._logger; + } + protected init() { const options = this.options; + const logger = createAppLogger(options.logger); + this._logger = logger.instance; // @ts-ignore this._events = []; // @ts-ignore @@ -214,6 +228,8 @@ export class Application exten this.plugins = new Map(); this._acl = createACL(); + this.use(logger.middleware, { tag: 'logger' }); + if (this._db) { // MaxListenersExceededWarning this._db.removeAllListeners(); @@ -226,6 +242,7 @@ export class Application exten this._i18n = createI18n(options); this._cache = createCache(options.cache); this.context.db = this._db; + this.context.logger = this._logger; this.context.resourcer = this._resourcer; this.context.cache = this._cache; diff --git a/packages/core/server/src/helper.ts b/packages/core/server/src/helper.ts index 6cfb0b9ea..d866c99f4 100644 --- a/packages/core/server/src/helper.ts +++ b/packages/core/server/src/helper.ts @@ -49,6 +49,7 @@ export function registerMiddlewares(app: Application, options: ApplicationOption }), { tag: 'bodyParser', + after: 'logger', }, ); } diff --git a/packages/plugins/error-handler/src/error-handler.ts b/packages/plugins/error-handler/src/error-handler.ts index 04aa3c5f9..38f0dad4d 100644 --- a/packages/plugins/error-handler/src/error-handler.ts +++ b/packages/plugins/error-handler/src/error-handler.ts @@ -18,6 +18,7 @@ export class ErrorHandler { }, ], }; + if (ctx.status === 500) { console.error(err); } @@ -29,6 +30,8 @@ export class ErrorHandler { try { await next(); } catch (err) { + ctx.log.error(err); + for (const handler of self.handlers) { if (handler.guard(err)) { return handler.render(err, ctx); diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore new file mode 100644 index 000000000..c96a04f00 --- /dev/null +++ b/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 9da753220..d209920ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2753,6 +2753,11 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + "@commitlint/cli@^16.1.0": version "16.1.0" resolved "https://registry.npmjs.org/@commitlint/cli/-/cli-16.1.0.tgz#022ad86008374b02974c9f3faf86affb785f4574" @@ -2947,6 +2952,15 @@ resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz#c3c5ae543c897caa9c2a68630bed355be5f9990f" integrity sha512-JZButFdZ1+/xAfpguQHoabIXkcqRRKpMrWKBkpEZZyxfY9C1DpADFB8PEqGSTeFr135SaTRfKqGKx5xSCLI7ZQ== +"@dabh/diagnostics@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.3.tgz#7f7e97ee9a725dffc7808d93668cc984e1dc477a" + integrity sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA== + dependencies: + colorspace "1.1.x" + enabled "2.0.x" + kuler "^2.0.0" + "@dnd-kit/accessibility@^3.0.0": version "3.0.0" resolved "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.0.0.tgz#b56e3750414fd907b7d6972b3116aa8f96d07fde" @@ -5352,7 +5366,14 @@ resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== -"@types/react-dom@^16.9.8", "@types/react-dom@^17.0.0": +"@types/react-dom@^16.9.8": + version "16.9.17" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.17.tgz#29100cbcc422d7b7dba7de24bb906de56680dd34" + integrity sha512-qSRyxEsrm5btPXnowDOs5jSkgT8ldAA0j6Qp+otHUh+xHzy3sXmgNfyhucZjAjkgpdAUw9rJe0QRtX/l+yaS4g== + dependencies: + "@types/react" "^16" + +"@types/react-dom@^17.0.0": version "17.0.11" resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.11.tgz#e1eadc3c5e86bdb5f7684e00274ae228e7bcc466" integrity sha512-f96K3k+24RaLGVu/Y2Ng3e1EbZ8/cVJvypZWd7cy0ofCBaf2lcM46xNhycMZ2xGwbBjRql7hOlZ+e2WlJ5MH3Q== @@ -5412,7 +5433,7 @@ "@types/history" "*" "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.11", "@types/react@^16.9.43", "@types/react@^17.0.0": +"@types/react@*", "@types/react@>=16.9.11", "@types/react@^17.0.0": version "17.0.34" resolved "https://registry.npmjs.org/@types/react/-/react-17.0.34.tgz#797b66d359b692e3f19991b6b07e4b0c706c0102" integrity sha512-46FEGrMjc2+8XhHXILr+3+/sTe3OfzSPU9YGKILLrUYbQ1CLQC9Daqo1KzENGXAWwrFwiY0l4ZbF20gRvgpWTg== @@ -5421,6 +5442,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^16", "@types/react@^16.9.43": + version "16.14.34" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.34.tgz#d129324ffda312044e1c47aab18696e4ed493282" + integrity sha512-b99nWeGGReLh6aKBppghVqp93dFJtgtDOzc8NXM6hewD8PQ2zZG5kBLgbx+VJr7Q7WBMjHxaIl3dwpwwPIUgyA== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" @@ -6766,6 +6796,11 @@ async@^2.6.3, async@~2.6.1: dependencies: lodash "^4.17.14" +async@^3.2.3: + version "3.2.4" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" + integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -8139,7 +8174,7 @@ color-support@^1.1.2, color-support@^1.1.3: resolved "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -color@^3.0.0: +color@^3.0.0, color@^3.1.3: version "3.2.1" resolved "https://registry.npmjs.org/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== @@ -8162,6 +8197,14 @@ colors@~1.2.1: resolved "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz#89c7ad9a374bc030df8013241f68136ed8835afc" integrity sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg== +colorspace@1.1.x: + version "1.1.4" + resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" + integrity sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w== + dependencies: + color "^3.1.3" + text-hex "1.0.x" + columnify@^1.5.4: version "1.5.4" resolved "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -9819,6 +9862,11 @@ emojis-list@^3.0.0: resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== +enabled@2.0.x: + version "2.0.0" + resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" + integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== + encodeurl@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -10707,7 +10755,7 @@ fclone@1.0.11, fclone@~1.0.11: resolved "https://registry.npmjs.org/fclone/-/fclone-1.0.11.tgz#10e85da38bfea7fc599341c296ee1d77266ee640" integrity sha1-EOhdo4v+p/xZk0HClu4ddyZu5kA= -fecha@~4.2.0: +fecha@^4.2.0, fecha@~4.2.0: version "4.2.3" resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw== @@ -10738,6 +10786,13 @@ file-saver@^2.0.5: resolved "https://registry.npmmirror.com/file-saver/download/file-saver-2.0.5.tgz#d61cfe2ce059f414d899e9dd6d4107ee25670c38" integrity sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA== +file-stream-rotator@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/file-stream-rotator/-/file-stream-rotator-0.6.1.tgz#007019e735b262bb6c6f0197e58e5c87cb96cec3" + integrity sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ== + dependencies: + moment "^2.29.1" + file-type@^3.3.0: version "3.9.0" resolved "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" @@ -10909,6 +10964,11 @@ fmin@^0.0.2: tape "^4.5.1" uglify-js "^2.6.2" +fn.name@1.x.x: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" + integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== + follow-redirects@^1.14.0, follow-redirects@^1.14.8: version "1.14.9" resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" @@ -14393,6 +14453,11 @@ koa@^2.13.4: type-is "^1.6.16" vary "^1.1.2" +kuler@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" + integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== + latest-version@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" @@ -14800,6 +14865,17 @@ log-driver@^1.2.7: resolved "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== +logform@^2.3.2, logform@^2.4.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/logform/-/logform-2.4.2.tgz#a617983ac0334d0c3b942c34945380062795b47c" + integrity sha512-W4c9himeAwXEdZ05dQNerhFz2XG80P9Oj0loPUMV23VC2it0orMHQhJm4hdnnor3rd1HsGf6a2lPwBM1zeXHGw== + dependencies: + "@colors/colors" "1.5.0" + fecha "^4.2.0" + ms "^2.1.1" + safe-stable-stringify "^2.3.1" + triple-beam "^1.3.0" + long@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" @@ -15685,7 +15761,7 @@ moment-timezone@^0.5.31: dependencies: moment ">= 2.9.0" -moment@2.x: +moment@2.x, moment@^2.29.1: version "2.29.4" resolved "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== @@ -16380,6 +16456,11 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" +object-hash@^2.0.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" + integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== + object-inspect@^1.11.0, object-inspect@^1.9.0: version "1.11.0" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" @@ -16500,6 +16581,13 @@ once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: dependencies: wrappy "1" +one-time@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45" + integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g== + dependencies: + fn.name "1.x.x" + onetime@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" @@ -19434,7 +19522,7 @@ readable-stream@1.1.x: isarray "0.0.1" string_decoder "~0.10.x" -"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.6.0: +"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -20315,6 +20403,11 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" +safe-stable-stringify@^2.3.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.1.tgz#34694bd8a30575b7f94792aa51527551bd733d61" + integrity sha512-dVHE6bMtS/bnL2mwualjc6IxEv1F+OCUpA46pKUj6F8uDbUM0jCCulPqRNPSnWwGNKx5etqMjZYdXtrm5KJZGA== + "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -21003,6 +21096,11 @@ stable@^0.1.8: resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== +stack-trace@0.0.x: + version "0.0.10" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg== + stack-utils@^1.0.1: version "1.0.5" resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz#a19b0b01947e0029c8e451d5d61a498f5bb1471b" @@ -21642,6 +21740,11 @@ text-extensions@^1.0.0: resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== +text-hex@1.0.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5" + integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg== + text-table@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -21899,6 +22002,11 @@ trim-newlines@^3.0.0: resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== +triple-beam@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" + integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== + trough@^1.0.0: version "1.0.5" resolved "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" @@ -23115,6 +23223,42 @@ window-size@0.1.0: resolved "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= +winston-daily-rotate-file@^4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/winston-daily-rotate-file/-/winston-daily-rotate-file-4.7.1.tgz#f60a643af87f8867f23170d8cd87dbe3603a625f" + integrity sha512-7LGPiYGBPNyGHLn9z33i96zx/bd71pjBn9tqQzO3I4Tayv94WPmBNwKC7CO1wPHdP9uvu+Md/1nr6VSH9h0iaA== + dependencies: + file-stream-rotator "^0.6.1" + object-hash "^2.0.1" + triple-beam "^1.3.0" + winston-transport "^4.4.0" + +winston-transport@^4.4.0, winston-transport@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa" + integrity sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q== + dependencies: + logform "^2.3.2" + readable-stream "^3.6.0" + triple-beam "^1.3.0" + +winston@^3.8.2: + version "3.8.2" + resolved "https://registry.yarnpkg.com/winston/-/winston-3.8.2.tgz#56e16b34022eb4cff2638196d9646d7430fdad50" + integrity sha512-MsE1gRx1m5jdTTO9Ld/vND4krP2To+lgDoMEHGGa4HIlAUyXJtfc7CxQcGXVyz2IBpw5hbFkj2b/AtUdQwyRew== + dependencies: + "@colors/colors" "1.5.0" + "@dabh/diagnostics" "^2.0.2" + async "^3.2.3" + is-stream "^2.0.0" + logform "^2.4.0" + one-time "^1.0.0" + readable-stream "^3.4.0" + safe-stable-stringify "^2.3.1" + stack-trace "0.0.x" + triple-beam "^1.3.0" + winston-transport "^4.5.0" + wkx@^0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz#c6c37019acf40e517cc6b94657a25a3d4aa33e8c"