Initial
This commit is contained in:
3
resources/app/node_modules/logform/.babelrc
generated
vendored
Normal file
3
resources/app/node_modules/logform/.babelrc
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env"]
|
||||
}
|
||||
21
resources/app/node_modules/logform/LICENSE
generated
vendored
Normal file
21
resources/app/node_modules/logform/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Charlie Robbins & the Contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
14
resources/app/node_modules/logform/align.js
generated
vendored
Normal file
14
resources/app/node_modules/logform/align.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
|
||||
/*
|
||||
* function align (info)
|
||||
* Returns a new instance of the align Format which adds a `\t`
|
||||
* delimiter before the message to properly align it in the same place.
|
||||
* It was previously { align: true } in winston < 3.0.0
|
||||
*/
|
||||
module.exports = format(info => {
|
||||
info.message = `\t${info.message}`;
|
||||
return info;
|
||||
});
|
||||
38
resources/app/node_modules/logform/browser.js
generated
vendored
Normal file
38
resources/app/node_modules/logform/browser.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @property {function} format
|
||||
* Both the construction method and set of exposed
|
||||
* formats.
|
||||
*/
|
||||
const format = exports.format = require('././format');
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @method {function} levels
|
||||
* Registers the specified levels with logform.
|
||||
*/
|
||||
exports.levels = require('././levels');
|
||||
|
||||
//
|
||||
// Setup all transports as eager-loaded exports
|
||||
// so that they are static for the bundlers.
|
||||
//
|
||||
Object.defineProperty(format, 'align', { value: require('./align') });
|
||||
Object.defineProperty(format, 'cli', { value: require('./cli') });
|
||||
Object.defineProperty(format, 'colorize', { value: require('./colorize') });
|
||||
Object.defineProperty(format, 'combine', { value: require('./combine') });
|
||||
Object.defineProperty(format, 'errors', { value: require('./errors') });
|
||||
Object.defineProperty(format, 'json', { value: require('./json') });
|
||||
Object.defineProperty(format, 'label', { value: require('./label') });
|
||||
Object.defineProperty(format, 'logstash', { value: require('./logstash') });
|
||||
Object.defineProperty(format, 'metadata', { value: require('./metadata') });
|
||||
Object.defineProperty(format, 'ms', { value: require('./ms') });
|
||||
Object.defineProperty(format, 'padLevels', { value: require('./pad-levels') });
|
||||
Object.defineProperty(format, 'prettyPrint', { value: require('./pretty-print') });
|
||||
Object.defineProperty(format, 'printf', { value: require('./printf') });
|
||||
Object.defineProperty(format, 'simple', { value: require('./simple') });
|
||||
Object.defineProperty(format, 'splat', { value: require('./splat') });
|
||||
Object.defineProperty(format, 'timestamp', { value: require('./timestamp') });
|
||||
Object.defineProperty(format, 'uncolorize', { value: require('./uncolorize') });
|
||||
52
resources/app/node_modules/logform/cli.js
generated
vendored
Normal file
52
resources/app/node_modules/logform/cli.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
const { Colorizer } = require('./colorize');
|
||||
const { Padder } = require('./pad-levels');
|
||||
const { configs, MESSAGE } = require('triple-beam');
|
||||
|
||||
|
||||
/**
|
||||
* Cli format class that handles initial state for a a separate
|
||||
* Colorizer and Padder instance.
|
||||
*/
|
||||
class CliFormat {
|
||||
constructor(opts = {}) {
|
||||
if (!opts.levels) {
|
||||
opts.levels = configs.cli.levels;
|
||||
}
|
||||
|
||||
this.colorizer = new Colorizer(opts);
|
||||
this.padder = new Padder(opts);
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/*
|
||||
* function transform (info, opts)
|
||||
* Attempts to both:
|
||||
* 1. Pad the { level }
|
||||
* 2. Colorize the { level, message }
|
||||
* of the given `logform` info object depending on the `opts`.
|
||||
*/
|
||||
transform(info, opts) {
|
||||
this.colorizer.transform(
|
||||
this.padder.transform(info, opts),
|
||||
opts
|
||||
);
|
||||
|
||||
info[MESSAGE] = `${info.level}:${info.message}`;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* function cli (opts)
|
||||
* Returns a new instance of the CLI format that turns a log
|
||||
* `info` object into the same format previously available
|
||||
* in `winston.cli()` in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = opts => new CliFormat(opts);
|
||||
|
||||
//
|
||||
// Attach the CliFormat for registration purposes
|
||||
//
|
||||
module.exports.Format = CliFormat;
|
||||
122
resources/app/node_modules/logform/colorize.js
generated
vendored
Normal file
122
resources/app/node_modules/logform/colorize.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
'use strict';
|
||||
|
||||
const colors = require('@colors/colors/safe');
|
||||
const { LEVEL, MESSAGE } = require('triple-beam');
|
||||
|
||||
//
|
||||
// Fix colors not appearing in non-tty environments
|
||||
//
|
||||
colors.enabled = true;
|
||||
|
||||
/**
|
||||
* @property {RegExp} hasSpace
|
||||
* Simple regex to check for presence of spaces.
|
||||
*/
|
||||
const hasSpace = /\s+/;
|
||||
|
||||
/*
|
||||
* Colorizer format. Wraps the `level` and/or `message` properties
|
||||
* of the `info` objects with ANSI color codes based on a few options.
|
||||
*/
|
||||
class Colorizer {
|
||||
constructor(opts = {}) {
|
||||
if (opts.colors) {
|
||||
this.addColors(opts.colors);
|
||||
}
|
||||
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds the colors Object to the set of allColors
|
||||
* known by the Colorizer
|
||||
*
|
||||
* @param {Object} colors Set of color mappings to add.
|
||||
*/
|
||||
static addColors(clrs) {
|
||||
const nextColors = Object.keys(clrs).reduce((acc, level) => {
|
||||
acc[level] = hasSpace.test(clrs[level])
|
||||
? clrs[level].split(hasSpace)
|
||||
: clrs[level];
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
Colorizer.allColors = Object.assign({}, Colorizer.allColors || {}, nextColors);
|
||||
return Colorizer.allColors;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds the colors Object to the set of allColors
|
||||
* known by the Colorizer
|
||||
*
|
||||
* @param {Object} colors Set of color mappings to add.
|
||||
*/
|
||||
addColors(clrs) {
|
||||
return Colorizer.addColors(clrs);
|
||||
}
|
||||
|
||||
/*
|
||||
* function colorize (lookup, level, message)
|
||||
* Performs multi-step colorization using @colors/colors/safe
|
||||
*/
|
||||
colorize(lookup, level, message) {
|
||||
if (typeof message === 'undefined') {
|
||||
message = level;
|
||||
}
|
||||
|
||||
//
|
||||
// If the color for the level is just a string
|
||||
// then attempt to colorize the message with it.
|
||||
//
|
||||
if (!Array.isArray(Colorizer.allColors[lookup])) {
|
||||
return colors[Colorizer.allColors[lookup]](message);
|
||||
}
|
||||
|
||||
//
|
||||
// If it is an Array then iterate over that Array, applying
|
||||
// the colors function for each item.
|
||||
//
|
||||
for (let i = 0, len = Colorizer.allColors[lookup].length; i < len; i++) {
|
||||
message = colors[Colorizer.allColors[lookup][i]](message);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
/*
|
||||
* function transform (info, opts)
|
||||
* Attempts to colorize the { level, message } of the given
|
||||
* `logform` info object.
|
||||
*/
|
||||
transform(info, opts) {
|
||||
if (opts.all && typeof info[MESSAGE] === 'string') {
|
||||
info[MESSAGE] = this.colorize(info[LEVEL], info.level, info[MESSAGE]);
|
||||
}
|
||||
|
||||
if (opts.level || opts.all || !opts.message) {
|
||||
info.level = this.colorize(info[LEVEL], info.level);
|
||||
}
|
||||
|
||||
if (opts.all || opts.message) {
|
||||
info.message = this.colorize(info[LEVEL], info.level, info.message);
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* function colorize (info)
|
||||
* Returns a new instance of the colorize Format that applies
|
||||
* level colors to `info` objects. This was previously exposed
|
||||
* as { colorize: true } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = opts => new Colorizer(opts);
|
||||
|
||||
//
|
||||
// Attach the Colorizer for registration purposes
|
||||
//
|
||||
module.exports.Colorizer
|
||||
= module.exports.Format
|
||||
= Colorizer;
|
||||
66
resources/app/node_modules/logform/combine.js
generated
vendored
Normal file
66
resources/app/node_modules/logform/combine.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
|
||||
/*
|
||||
* function cascade(formats)
|
||||
* Returns a function that invokes the `._format` function in-order
|
||||
* for the specified set of `formats`. In this manner we say that Formats
|
||||
* are "pipe-like", but not a pure pumpify implementation. Since there is no back
|
||||
* pressure we can remove all of the "readable" plumbing in Node streams.
|
||||
*/
|
||||
function cascade(formats) {
|
||||
if (!formats.every(isValidFormat)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return info => {
|
||||
let obj = info;
|
||||
for (let i = 0; i < formats.length; i++) {
|
||||
obj = formats[i].transform(obj, formats[i].options);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* function isValidFormat(format)
|
||||
* If the format does not define a `transform` function throw an error
|
||||
* with more detailed usage.
|
||||
*/
|
||||
function isValidFormat(fmt) {
|
||||
if (typeof fmt.transform !== 'function') {
|
||||
throw new Error([
|
||||
'No transform function found on format. Did you create a format instance?',
|
||||
'const myFormat = format(formatFn);',
|
||||
'const instance = myFormat();'
|
||||
].join('\n'));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* function combine (info)
|
||||
* Returns a new instance of the combine Format which combines the specified
|
||||
* formats into a new format. This is similar to a pipe-chain in transform streams.
|
||||
* We choose to combine the prototypes this way because there is no back pressure in
|
||||
* an in-memory transform chain.
|
||||
*/
|
||||
module.exports = (...formats) => {
|
||||
const combinedFormat = format(cascade(formats));
|
||||
const instance = combinedFormat();
|
||||
instance.Format = combinedFormat.Format;
|
||||
return instance;
|
||||
};
|
||||
|
||||
//
|
||||
// Export the cascade method for use in cli and other
|
||||
// combined formats that should not be assumed to be
|
||||
// singletons.
|
||||
//
|
||||
module.exports.cascade = cascade;
|
||||
14
resources/app/node_modules/logform/dist/align.js
generated
vendored
Normal file
14
resources/app/node_modules/logform/dist/align.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var format = require('./format');
|
||||
|
||||
/*
|
||||
* function align (info)
|
||||
* Returns a new instance of the align Format which adds a `\t`
|
||||
* delimiter before the message to properly align it in the same place.
|
||||
* It was previously { align: true } in winston < 3.0.0
|
||||
*/
|
||||
module.exports = format(function (info) {
|
||||
info.message = "\t".concat(info.message);
|
||||
return info;
|
||||
});
|
||||
72
resources/app/node_modules/logform/dist/browser.js
generated
vendored
Normal file
72
resources/app/node_modules/logform/dist/browser.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @property {function} format
|
||||
* Both the construction method and set of exposed
|
||||
* formats.
|
||||
*/
|
||||
var format = exports.format = require('././format');
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @method {function} levels
|
||||
* Registers the specified levels with logform.
|
||||
*/
|
||||
exports.levels = require('././levels');
|
||||
|
||||
//
|
||||
// Setup all transports as eager-loaded exports
|
||||
// so that they are static for the bundlers.
|
||||
//
|
||||
Object.defineProperty(format, 'align', {
|
||||
value: require('./align')
|
||||
});
|
||||
Object.defineProperty(format, 'cli', {
|
||||
value: require('./cli')
|
||||
});
|
||||
Object.defineProperty(format, 'colorize', {
|
||||
value: require('./colorize')
|
||||
});
|
||||
Object.defineProperty(format, 'combine', {
|
||||
value: require('./combine')
|
||||
});
|
||||
Object.defineProperty(format, 'errors', {
|
||||
value: require('./errors')
|
||||
});
|
||||
Object.defineProperty(format, 'json', {
|
||||
value: require('./json')
|
||||
});
|
||||
Object.defineProperty(format, 'label', {
|
||||
value: require('./label')
|
||||
});
|
||||
Object.defineProperty(format, 'logstash', {
|
||||
value: require('./logstash')
|
||||
});
|
||||
Object.defineProperty(format, 'metadata', {
|
||||
value: require('./metadata')
|
||||
});
|
||||
Object.defineProperty(format, 'ms', {
|
||||
value: require('./ms')
|
||||
});
|
||||
Object.defineProperty(format, 'padLevels', {
|
||||
value: require('./pad-levels')
|
||||
});
|
||||
Object.defineProperty(format, 'prettyPrint', {
|
||||
value: require('./pretty-print')
|
||||
});
|
||||
Object.defineProperty(format, 'printf', {
|
||||
value: require('./printf')
|
||||
});
|
||||
Object.defineProperty(format, 'simple', {
|
||||
value: require('./simple')
|
||||
});
|
||||
Object.defineProperty(format, 'splat', {
|
||||
value: require('./splat')
|
||||
});
|
||||
Object.defineProperty(format, 'timestamp', {
|
||||
value: require('./timestamp')
|
||||
});
|
||||
Object.defineProperty(format, 'uncolorize', {
|
||||
value: require('./uncolorize')
|
||||
});
|
||||
63
resources/app/node_modules/logform/dist/cli.js
generated
vendored
Normal file
63
resources/app/node_modules/logform/dist/cli.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
'use strict';
|
||||
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var _require = require('./colorize'),
|
||||
Colorizer = _require.Colorizer;
|
||||
var _require2 = require('./pad-levels'),
|
||||
Padder = _require2.Padder;
|
||||
var _require3 = require('triple-beam'),
|
||||
configs = _require3.configs,
|
||||
MESSAGE = _require3.MESSAGE;
|
||||
|
||||
/**
|
||||
* Cli format class that handles initial state for a a separate
|
||||
* Colorizer and Padder instance.
|
||||
*/
|
||||
var CliFormat = /*#__PURE__*/function () {
|
||||
function CliFormat() {
|
||||
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
_classCallCheck(this, CliFormat);
|
||||
if (!opts.levels) {
|
||||
opts.levels = configs.cli.levels;
|
||||
}
|
||||
this.colorizer = new Colorizer(opts);
|
||||
this.padder = new Padder(opts);
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/*
|
||||
* function transform (info, opts)
|
||||
* Attempts to both:
|
||||
* 1. Pad the { level }
|
||||
* 2. Colorize the { level, message }
|
||||
* of the given `logform` info object depending on the `opts`.
|
||||
*/
|
||||
_createClass(CliFormat, [{
|
||||
key: "transform",
|
||||
value: function transform(info, opts) {
|
||||
this.colorizer.transform(this.padder.transform(info, opts), opts);
|
||||
info[MESSAGE] = "".concat(info.level, ":").concat(info.message);
|
||||
return info;
|
||||
}
|
||||
}]);
|
||||
return CliFormat;
|
||||
}();
|
||||
/*
|
||||
* function cli (opts)
|
||||
* Returns a new instance of the CLI format that turns a log
|
||||
* `info` object into the same format previously available
|
||||
* in `winston.cli()` in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = function (opts) {
|
||||
return new CliFormat(opts);
|
||||
};
|
||||
|
||||
//
|
||||
// Attach the CliFormat for registration purposes
|
||||
//
|
||||
module.exports.Format = CliFormat;
|
||||
132
resources/app/node_modules/logform/dist/colorize.js
generated
vendored
Normal file
132
resources/app/node_modules/logform/dist/colorize.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
'use strict';
|
||||
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var colors = require('@colors/colors/safe');
|
||||
var _require = require('triple-beam'),
|
||||
LEVEL = _require.LEVEL,
|
||||
MESSAGE = _require.MESSAGE;
|
||||
|
||||
//
|
||||
// Fix colors not appearing in non-tty environments
|
||||
//
|
||||
colors.enabled = true;
|
||||
|
||||
/**
|
||||
* @property {RegExp} hasSpace
|
||||
* Simple regex to check for presence of spaces.
|
||||
*/
|
||||
var hasSpace = /\s+/;
|
||||
|
||||
/*
|
||||
* Colorizer format. Wraps the `level` and/or `message` properties
|
||||
* of the `info` objects with ANSI color codes based on a few options.
|
||||
*/
|
||||
var Colorizer = /*#__PURE__*/function () {
|
||||
function Colorizer() {
|
||||
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
_classCallCheck(this, Colorizer);
|
||||
if (opts.colors) {
|
||||
this.addColors(opts.colors);
|
||||
}
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds the colors Object to the set of allColors
|
||||
* known by the Colorizer
|
||||
*
|
||||
* @param {Object} colors Set of color mappings to add.
|
||||
*/
|
||||
_createClass(Colorizer, [{
|
||||
key: "addColors",
|
||||
value:
|
||||
/*
|
||||
* Adds the colors Object to the set of allColors
|
||||
* known by the Colorizer
|
||||
*
|
||||
* @param {Object} colors Set of color mappings to add.
|
||||
*/
|
||||
function addColors(clrs) {
|
||||
return Colorizer.addColors(clrs);
|
||||
}
|
||||
|
||||
/*
|
||||
* function colorize (lookup, level, message)
|
||||
* Performs multi-step colorization using @colors/colors/safe
|
||||
*/
|
||||
}, {
|
||||
key: "colorize",
|
||||
value: function colorize(lookup, level, message) {
|
||||
if (typeof message === 'undefined') {
|
||||
message = level;
|
||||
}
|
||||
|
||||
//
|
||||
// If the color for the level is just a string
|
||||
// then attempt to colorize the message with it.
|
||||
//
|
||||
if (!Array.isArray(Colorizer.allColors[lookup])) {
|
||||
return colors[Colorizer.allColors[lookup]](message);
|
||||
}
|
||||
|
||||
//
|
||||
// If it is an Array then iterate over that Array, applying
|
||||
// the colors function for each item.
|
||||
//
|
||||
for (var i = 0, len = Colorizer.allColors[lookup].length; i < len; i++) {
|
||||
message = colors[Colorizer.allColors[lookup][i]](message);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
/*
|
||||
* function transform (info, opts)
|
||||
* Attempts to colorize the { level, message } of the given
|
||||
* `logform` info object.
|
||||
*/
|
||||
}, {
|
||||
key: "transform",
|
||||
value: function transform(info, opts) {
|
||||
if (opts.all && typeof info[MESSAGE] === 'string') {
|
||||
info[MESSAGE] = this.colorize(info[LEVEL], info.level, info[MESSAGE]);
|
||||
}
|
||||
if (opts.level || opts.all || !opts.message) {
|
||||
info.level = this.colorize(info[LEVEL], info.level);
|
||||
}
|
||||
if (opts.all || opts.message) {
|
||||
info.message = this.colorize(info[LEVEL], info.level, info.message);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}], [{
|
||||
key: "addColors",
|
||||
value: function addColors(clrs) {
|
||||
var nextColors = Object.keys(clrs).reduce(function (acc, level) {
|
||||
acc[level] = hasSpace.test(clrs[level]) ? clrs[level].split(hasSpace) : clrs[level];
|
||||
return acc;
|
||||
}, {});
|
||||
Colorizer.allColors = Object.assign({}, Colorizer.allColors || {}, nextColors);
|
||||
return Colorizer.allColors;
|
||||
}
|
||||
}]);
|
||||
return Colorizer;
|
||||
}();
|
||||
/*
|
||||
* function colorize (info)
|
||||
* Returns a new instance of the colorize Format that applies
|
||||
* level colors to `info` objects. This was previously exposed
|
||||
* as { colorize: true } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = function (opts) {
|
||||
return new Colorizer(opts);
|
||||
};
|
||||
|
||||
//
|
||||
// Attach the Colorizer for registration purposes
|
||||
//
|
||||
module.exports.Colorizer = module.exports.Format = Colorizer;
|
||||
62
resources/app/node_modules/logform/dist/combine.js
generated
vendored
Normal file
62
resources/app/node_modules/logform/dist/combine.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
'use strict';
|
||||
|
||||
var format = require('./format');
|
||||
|
||||
/*
|
||||
* function cascade(formats)
|
||||
* Returns a function that invokes the `._format` function in-order
|
||||
* for the specified set of `formats`. In this manner we say that Formats
|
||||
* are "pipe-like", but not a pure pumpify implementation. Since there is no back
|
||||
* pressure we can remove all of the "readable" plumbing in Node streams.
|
||||
*/
|
||||
function cascade(formats) {
|
||||
if (!formats.every(isValidFormat)) {
|
||||
return;
|
||||
}
|
||||
return function (info) {
|
||||
var obj = info;
|
||||
for (var i = 0; i < formats.length; i++) {
|
||||
obj = formats[i].transform(obj, formats[i].options);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* function isValidFormat(format)
|
||||
* If the format does not define a `transform` function throw an error
|
||||
* with more detailed usage.
|
||||
*/
|
||||
function isValidFormat(fmt) {
|
||||
if (typeof fmt.transform !== 'function') {
|
||||
throw new Error(['No transform function found on format. Did you create a format instance?', 'const myFormat = format(formatFn);', 'const instance = myFormat();'].join('\n'));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* function combine (info)
|
||||
* Returns a new instance of the combine Format which combines the specified
|
||||
* formats into a new format. This is similar to a pipe-chain in transform streams.
|
||||
* We choose to combine the prototypes this way because there is no back pressure in
|
||||
* an in-memory transform chain.
|
||||
*/
|
||||
module.exports = function () {
|
||||
for (var _len = arguments.length, formats = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
formats[_key] = arguments[_key];
|
||||
}
|
||||
var combinedFormat = format(cascade(formats));
|
||||
var instance = combinedFormat();
|
||||
instance.Format = combinedFormat.Format;
|
||||
return instance;
|
||||
};
|
||||
|
||||
//
|
||||
// Export the cascade method for use in cli and other
|
||||
// combined formats that should not be assumed to be
|
||||
// singletons.
|
||||
//
|
||||
module.exports.cascade = cascade;
|
||||
45
resources/app/node_modules/logform/dist/errors.js
generated
vendored
Normal file
45
resources/app/node_modules/logform/dist/errors.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
/* eslint no-undefined: 0 */
|
||||
'use strict';
|
||||
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var format = require('./format');
|
||||
var _require = require('triple-beam'),
|
||||
LEVEL = _require.LEVEL,
|
||||
MESSAGE = _require.MESSAGE;
|
||||
|
||||
/*
|
||||
* function errors (info)
|
||||
* If the `message` property of the `info` object is an instance of `Error`,
|
||||
* replace the `Error` object its own `message` property.
|
||||
*
|
||||
* Optionally, the Error's `stack` and/or `cause` properties can also be appended to the `info` object.
|
||||
*/
|
||||
module.exports = format(function (einfo, _ref) {
|
||||
var stack = _ref.stack,
|
||||
cause = _ref.cause;
|
||||
if (einfo instanceof Error) {
|
||||
var _Object$assign;
|
||||
var info = Object.assign({}, einfo, (_Object$assign = {
|
||||
level: einfo.level
|
||||
}, _defineProperty(_Object$assign, LEVEL, einfo[LEVEL] || einfo.level), _defineProperty(_Object$assign, "message", einfo.message), _defineProperty(_Object$assign, MESSAGE, einfo[MESSAGE] || einfo.message), _Object$assign));
|
||||
if (stack) info.stack = einfo.stack;
|
||||
if (cause) info.cause = einfo.cause;
|
||||
return info;
|
||||
}
|
||||
if (!(einfo.message instanceof Error)) return einfo;
|
||||
|
||||
// Assign all enumerable properties and the
|
||||
// message property from the error provided.
|
||||
var err = einfo.message;
|
||||
Object.assign(einfo, err);
|
||||
einfo.message = err.message;
|
||||
einfo[MESSAGE] = err.message;
|
||||
|
||||
// Assign the stack and/or cause if requested.
|
||||
if (stack) einfo.stack = err.stack;
|
||||
if (cause) einfo.cause = err.cause;
|
||||
return einfo;
|
||||
});
|
||||
71
resources/app/node_modules/logform/dist/format.js
generated
vendored
Normal file
71
resources/app/node_modules/logform/dist/format.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* Displays a helpful message and the source of
|
||||
* the format when it is invalid.
|
||||
*/
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
||||
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
var InvalidFormatError = /*#__PURE__*/function (_Error) {
|
||||
_inherits(InvalidFormatError, _Error);
|
||||
var _super = _createSuper(InvalidFormatError);
|
||||
function InvalidFormatError(formatFn) {
|
||||
var _this;
|
||||
_classCallCheck(this, InvalidFormatError);
|
||||
_this = _super.call(this, "Format functions must be synchronous taking a two arguments: (info, opts)\nFound: ".concat(formatFn.toString().split('\n')[0], "\n"));
|
||||
Error.captureStackTrace(_assertThisInitialized(_this), InvalidFormatError);
|
||||
return _this;
|
||||
}
|
||||
return _createClass(InvalidFormatError);
|
||||
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
||||
/*
|
||||
* function format (formatFn)
|
||||
* Returns a create function for the `formatFn`.
|
||||
*/
|
||||
module.exports = function (formatFn) {
|
||||
if (formatFn.length > 2) {
|
||||
throw new InvalidFormatError(formatFn);
|
||||
}
|
||||
|
||||
/*
|
||||
* function Format (options)
|
||||
* Base prototype which calls a `_format`
|
||||
* function and pushes the result.
|
||||
*/
|
||||
function Format() {
|
||||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
this.options = options;
|
||||
}
|
||||
Format.prototype.transform = formatFn;
|
||||
|
||||
//
|
||||
// Create a function which returns new instances of
|
||||
// FormatWrap for simple syntax like:
|
||||
//
|
||||
// require('winston').formats.json();
|
||||
//
|
||||
function createFormatWrap(opts) {
|
||||
return new Format(opts);
|
||||
}
|
||||
|
||||
//
|
||||
// Expose the FormatWrap through the create function
|
||||
// for testability.
|
||||
//
|
||||
createFormatWrap.Format = Format;
|
||||
return createFormatWrap;
|
||||
};
|
||||
86
resources/app/node_modules/logform/dist/index.js
generated
vendored
Normal file
86
resources/app/node_modules/logform/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @property {function} format
|
||||
* Both the construction method and set of exposed
|
||||
* formats.
|
||||
*/
|
||||
var format = exports.format = require('./format');
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @method {function} levels
|
||||
* Registers the specified levels with logform.
|
||||
*/
|
||||
exports.levels = require('./levels');
|
||||
|
||||
/*
|
||||
* @api private
|
||||
* method {function} exposeFormat
|
||||
* Exposes a sub-format on the main format object
|
||||
* as a lazy-loaded getter.
|
||||
*/
|
||||
function exposeFormat(name, requireFormat) {
|
||||
Object.defineProperty(format, name, {
|
||||
get: function get() {
|
||||
return requireFormat();
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Setup all transports as lazy-loaded getters.
|
||||
//
|
||||
exposeFormat('align', function () {
|
||||
return require('./align');
|
||||
});
|
||||
exposeFormat('errors', function () {
|
||||
return require('./errors');
|
||||
});
|
||||
exposeFormat('cli', function () {
|
||||
return require('./cli');
|
||||
});
|
||||
exposeFormat('combine', function () {
|
||||
return require('./combine');
|
||||
});
|
||||
exposeFormat('colorize', function () {
|
||||
return require('./colorize');
|
||||
});
|
||||
exposeFormat('json', function () {
|
||||
return require('./json');
|
||||
});
|
||||
exposeFormat('label', function () {
|
||||
return require('./label');
|
||||
});
|
||||
exposeFormat('logstash', function () {
|
||||
return require('./logstash');
|
||||
});
|
||||
exposeFormat('metadata', function () {
|
||||
return require('./metadata');
|
||||
});
|
||||
exposeFormat('ms', function () {
|
||||
return require('./ms');
|
||||
});
|
||||
exposeFormat('padLevels', function () {
|
||||
return require('./pad-levels');
|
||||
});
|
||||
exposeFormat('prettyPrint', function () {
|
||||
return require('./pretty-print');
|
||||
});
|
||||
exposeFormat('printf', function () {
|
||||
return require('./printf');
|
||||
});
|
||||
exposeFormat('simple', function () {
|
||||
return require('./simple');
|
||||
});
|
||||
exposeFormat('splat', function () {
|
||||
return require('./splat');
|
||||
});
|
||||
exposeFormat('timestamp', function () {
|
||||
return require('./timestamp');
|
||||
});
|
||||
exposeFormat('uncolorize', function () {
|
||||
return require('./uncolorize');
|
||||
});
|
||||
30
resources/app/node_modules/logform/dist/json.js
generated
vendored
Normal file
30
resources/app/node_modules/logform/dist/json.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var format = require('./format');
|
||||
var _require = require('triple-beam'),
|
||||
MESSAGE = _require.MESSAGE;
|
||||
var stringify = require('safe-stable-stringify');
|
||||
|
||||
/*
|
||||
* function replacer (key, value)
|
||||
* Handles proper stringification of Buffer and bigint output.
|
||||
*/
|
||||
function replacer(key, value) {
|
||||
// safe-stable-stringify does support BigInt, however, it doesn't wrap the value in quotes.
|
||||
// Leading to a loss in fidelity if the resulting string is parsed.
|
||||
// It would also be a breaking change for logform.
|
||||
if (typeof value === 'bigint') return value.toString();
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* function json (info)
|
||||
* Returns a new instance of the JSON format that turns a log `info`
|
||||
* object into pure JSON. This was previously exposed as { json: true }
|
||||
* to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format(function (info, opts) {
|
||||
var jsonStringify = stringify.configure(opts);
|
||||
info[MESSAGE] = jsonStringify(info, opts.replacer || replacer, opts.space);
|
||||
return info;
|
||||
});
|
||||
18
resources/app/node_modules/logform/dist/label.js
generated
vendored
Normal file
18
resources/app/node_modules/logform/dist/label.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var format = require('./format');
|
||||
|
||||
/*
|
||||
* function label (info)
|
||||
* Returns a new instance of the label Format which adds the specified
|
||||
* `opts.label` before the message. This was previously exposed as
|
||||
* { label: 'my label' } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format(function (info, opts) {
|
||||
if (opts.message) {
|
||||
info.message = "[".concat(opts.label, "] ").concat(info.message);
|
||||
return info;
|
||||
}
|
||||
info.label = opts.label;
|
||||
return info;
|
||||
});
|
||||
13
resources/app/node_modules/logform/dist/levels.js
generated
vendored
Normal file
13
resources/app/node_modules/logform/dist/levels.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var _require = require('./colorize'),
|
||||
Colorizer = _require.Colorizer;
|
||||
|
||||
/*
|
||||
* Simple method to register colors with a simpler require
|
||||
* path within the module.
|
||||
*/
|
||||
module.exports = function (config) {
|
||||
Colorizer.addColors(config.colors || config);
|
||||
return config;
|
||||
};
|
||||
28
resources/app/node_modules/logform/dist/logstash.js
generated
vendored
Normal file
28
resources/app/node_modules/logform/dist/logstash.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
var format = require('./format');
|
||||
var _require = require('triple-beam'),
|
||||
MESSAGE = _require.MESSAGE;
|
||||
var jsonStringify = require('safe-stable-stringify');
|
||||
|
||||
/*
|
||||
* function logstash (info)
|
||||
* Returns a new instance of the LogStash Format that turns a
|
||||
* log `info` object into pure JSON with the appropriate logstash
|
||||
* options. This was previously exposed as { logstash: true }
|
||||
* to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format(function (info) {
|
||||
var logstash = {};
|
||||
if (info.message) {
|
||||
logstash['@message'] = info.message;
|
||||
delete info.message;
|
||||
}
|
||||
if (info.timestamp) {
|
||||
logstash['@timestamp'] = info.timestamp;
|
||||
delete info.timestamp;
|
||||
}
|
||||
logstash['@fields'] = info;
|
||||
info[MESSAGE] = jsonStringify(logstash);
|
||||
return info;
|
||||
});
|
||||
56
resources/app/node_modules/logform/dist/metadata.js
generated
vendored
Normal file
56
resources/app/node_modules/logform/dist/metadata.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
'use strict';
|
||||
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var format = require('./format');
|
||||
function fillExcept(info, fillExceptKeys, metadataKey) {
|
||||
var savedKeys = fillExceptKeys.reduce(function (acc, key) {
|
||||
acc[key] = info[key];
|
||||
delete info[key];
|
||||
return acc;
|
||||
}, {});
|
||||
var metadata = Object.keys(info).reduce(function (acc, key) {
|
||||
acc[key] = info[key];
|
||||
delete info[key];
|
||||
return acc;
|
||||
}, {});
|
||||
Object.assign(info, savedKeys, _defineProperty({}, metadataKey, metadata));
|
||||
return info;
|
||||
}
|
||||
function fillWith(info, fillWithKeys, metadataKey) {
|
||||
info[metadataKey] = fillWithKeys.reduce(function (acc, key) {
|
||||
acc[key] = info[key];
|
||||
delete info[key];
|
||||
return acc;
|
||||
}, {});
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds in a "metadata" object to collect extraneous data, similar to the metadata
|
||||
* object in winston 2.x.
|
||||
*/
|
||||
module.exports = format(function (info) {
|
||||
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var metadataKey = 'metadata';
|
||||
if (opts.key) {
|
||||
metadataKey = opts.key;
|
||||
}
|
||||
var fillExceptKeys = [];
|
||||
if (!opts.fillExcept && !opts.fillWith) {
|
||||
fillExceptKeys.push('level');
|
||||
fillExceptKeys.push('message');
|
||||
}
|
||||
if (opts.fillExcept) {
|
||||
fillExceptKeys = opts.fillExcept;
|
||||
}
|
||||
if (fillExceptKeys.length > 0) {
|
||||
return fillExcept(info, fillExceptKeys, metadataKey);
|
||||
}
|
||||
if (opts.fillWith) {
|
||||
return fillWith(info, opts.fillWith, metadataKey);
|
||||
}
|
||||
return info;
|
||||
});
|
||||
18
resources/app/node_modules/logform/dist/ms.js
generated
vendored
Normal file
18
resources/app/node_modules/logform/dist/ms.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var _this = void 0;
|
||||
var format = require('./format');
|
||||
var ms = require('ms');
|
||||
|
||||
/*
|
||||
* function ms (info)
|
||||
* Returns an `info` with a `ms` property. The `ms` property holds the Value
|
||||
* of the time difference between two calls in milliseconds.
|
||||
*/
|
||||
module.exports = format(function (info) {
|
||||
var curr = +new Date();
|
||||
_this.diff = curr - (_this.prevTime || curr);
|
||||
_this.prevTime = curr;
|
||||
info.ms = "+".concat(ms(_this.diff));
|
||||
return info;
|
||||
});
|
||||
111
resources/app/node_modules/logform/dist/pad-levels.js
generated
vendored
Normal file
111
resources/app/node_modules/logform/dist/pad-levels.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
'use strict';
|
||||
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var _require = require('triple-beam'),
|
||||
configs = _require.configs,
|
||||
LEVEL = _require.LEVEL,
|
||||
MESSAGE = _require.MESSAGE;
|
||||
var Padder = /*#__PURE__*/function () {
|
||||
function Padder() {
|
||||
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
||||
levels: configs.npm.levels
|
||||
};
|
||||
_classCallCheck(this, Padder);
|
||||
this.paddings = Padder.paddingForLevels(opts.levels, opts.filler);
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum length of keys in the specified `levels` Object.
|
||||
* @param {Object} levels Set of all levels to calculate longest level against.
|
||||
* @returns {Number} Maximum length of the longest level string.
|
||||
*/
|
||||
_createClass(Padder, [{
|
||||
key: "transform",
|
||||
value:
|
||||
/**
|
||||
* Prepends the padding onto the `message` based on the `LEVEL` of
|
||||
* the `info`. This is based on the behavior of `winston@2` which also
|
||||
* prepended the level onto the message.
|
||||
*
|
||||
* See: https://github.com/winstonjs/winston/blob/2.x/lib/winston/logger.js#L198-L201
|
||||
*
|
||||
* @param {Info} info Logform info object
|
||||
* @param {Object} opts Options passed along to this instance.
|
||||
* @returns {Info} Modified logform info object.
|
||||
*/
|
||||
function transform(info, opts) {
|
||||
info.message = "".concat(this.paddings[info[LEVEL]]).concat(info.message);
|
||||
if (info[MESSAGE]) {
|
||||
info[MESSAGE] = "".concat(this.paddings[info[LEVEL]]).concat(info[MESSAGE]);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}], [{
|
||||
key: "getLongestLevel",
|
||||
value: function getLongestLevel(levels) {
|
||||
var lvls = Object.keys(levels).map(function (level) {
|
||||
return level.length;
|
||||
});
|
||||
return Math.max.apply(Math, _toConsumableArray(lvls));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the padding for the specified `level` assuming that the
|
||||
* maximum length of all levels it's associated with is `maxLength`.
|
||||
* @param {String} level Level to calculate padding for.
|
||||
* @param {String} filler Repeatable text to use for padding.
|
||||
* @param {Number} maxLength Length of the longest level
|
||||
* @returns {String} Padding string for the `level`
|
||||
*/
|
||||
}, {
|
||||
key: "paddingForLevel",
|
||||
value: function paddingForLevel(level, filler, maxLength) {
|
||||
var targetLen = maxLength + 1 - level.length;
|
||||
var rep = Math.floor(targetLen / filler.length);
|
||||
var padding = "".concat(filler).concat(filler.repeat(rep));
|
||||
return padding.slice(0, targetLen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object with the string paddings for the given `levels`
|
||||
* using the specified `filler`.
|
||||
* @param {Object} levels Set of all levels to calculate padding for.
|
||||
* @param {String} filler Repeatable text to use for padding.
|
||||
* @returns {Object} Mapping of level to desired padding.
|
||||
*/
|
||||
}, {
|
||||
key: "paddingForLevels",
|
||||
value: function paddingForLevels(levels) {
|
||||
var filler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
|
||||
var maxLength = Padder.getLongestLevel(levels);
|
||||
return Object.keys(levels).reduce(function (acc, level) {
|
||||
acc[level] = Padder.paddingForLevel(level, filler, maxLength);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
}]);
|
||||
return Padder;
|
||||
}();
|
||||
/*
|
||||
* function padLevels (info)
|
||||
* Returns a new instance of the padLevels Format which pads
|
||||
* levels to be the same length. This was previously exposed as
|
||||
* { padLevels: true } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = function (opts) {
|
||||
return new Padder(opts);
|
||||
};
|
||||
module.exports.Padder = module.exports.Format = Padder;
|
||||
32
resources/app/node_modules/logform/dist/pretty-print.js
generated
vendored
Normal file
32
resources/app/node_modules/logform/dist/pretty-print.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('util').inspect;
|
||||
var format = require('./format');
|
||||
var _require = require('triple-beam'),
|
||||
LEVEL = _require.LEVEL,
|
||||
MESSAGE = _require.MESSAGE,
|
||||
SPLAT = _require.SPLAT;
|
||||
|
||||
/*
|
||||
* function prettyPrint (info)
|
||||
* Returns a new instance of the prettyPrint Format that "prettyPrint"
|
||||
* serializes `info` objects. This was previously exposed as
|
||||
* { prettyPrint: true } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format(function (info) {
|
||||
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
//
|
||||
// info[{LEVEL, MESSAGE, SPLAT}] are enumerable here. Since they
|
||||
// are internal, we remove them before util.inspect so they
|
||||
// are not printed.
|
||||
//
|
||||
var stripped = Object.assign({}, info);
|
||||
|
||||
// Remark (indexzero): update this technique in April 2019
|
||||
// when node@6 is EOL
|
||||
delete stripped[LEVEL];
|
||||
delete stripped[MESSAGE];
|
||||
delete stripped[SPLAT];
|
||||
info[MESSAGE] = inspect(stripped, false, opts.depth || null, opts.colorize);
|
||||
return info;
|
||||
});
|
||||
34
resources/app/node_modules/logform/dist/printf.js
generated
vendored
Normal file
34
resources/app/node_modules/logform/dist/printf.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var _require = require('triple-beam'),
|
||||
MESSAGE = _require.MESSAGE;
|
||||
var Printf = /*#__PURE__*/function () {
|
||||
function Printf(templateFn) {
|
||||
_classCallCheck(this, Printf);
|
||||
this.template = templateFn;
|
||||
}
|
||||
_createClass(Printf, [{
|
||||
key: "transform",
|
||||
value: function transform(info) {
|
||||
info[MESSAGE] = this.template(info);
|
||||
return info;
|
||||
}
|
||||
}]);
|
||||
return Printf;
|
||||
}();
|
||||
/*
|
||||
* function printf (templateFn)
|
||||
* Returns a new instance of the printf Format that creates an
|
||||
* intermediate prototype to store the template string-based formatter
|
||||
* function.
|
||||
*/
|
||||
module.exports = function (opts) {
|
||||
return new Printf(opts);
|
||||
};
|
||||
module.exports.Printf = module.exports.Format = Printf;
|
||||
32
resources/app/node_modules/logform/dist/simple.js
generated
vendored
Normal file
32
resources/app/node_modules/logform/dist/simple.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/* eslint no-undefined: 0 */
|
||||
'use strict';
|
||||
|
||||
var format = require('./format');
|
||||
var _require = require('triple-beam'),
|
||||
MESSAGE = _require.MESSAGE;
|
||||
var jsonStringify = require('safe-stable-stringify');
|
||||
|
||||
/*
|
||||
* function simple (info)
|
||||
* Returns a new instance of the simple format TransformStream
|
||||
* which writes a simple representation of logs.
|
||||
*
|
||||
* const { level, message, splat, ...rest } = info;
|
||||
*
|
||||
* ${level}: ${message} if rest is empty
|
||||
* ${level}: ${message} ${JSON.stringify(rest)} otherwise
|
||||
*/
|
||||
module.exports = format(function (info) {
|
||||
var stringifiedRest = jsonStringify(Object.assign({}, info, {
|
||||
level: undefined,
|
||||
message: undefined,
|
||||
splat: undefined
|
||||
}));
|
||||
var padding = info.padding && info.padding[info.level] || '';
|
||||
if (stringifiedRest !== '{}') {
|
||||
info[MESSAGE] = "".concat(info.level, ":").concat(padding, " ").concat(info.message, " ").concat(stringifiedRest);
|
||||
} else {
|
||||
info[MESSAGE] = "".concat(info.level, ":").concat(padding, " ").concat(info.message);
|
||||
}
|
||||
return info;
|
||||
});
|
||||
144
resources/app/node_modules/logform/dist/splat.js
generated
vendored
Normal file
144
resources/app/node_modules/logform/dist/splat.js
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
'use strict';
|
||||
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var util = require('util');
|
||||
var _require = require('triple-beam'),
|
||||
SPLAT = _require.SPLAT;
|
||||
|
||||
/**
|
||||
* Captures the number of format (i.e. %s strings) in a given string.
|
||||
* Based on `util.format`, see Node.js source:
|
||||
* https://github.com/nodejs/node/blob/b1c8f15c5f169e021f7c46eb7b219de95fe97603/lib/util.js#L201-L230
|
||||
* @type {RegExp}
|
||||
*/
|
||||
var formatRegExp = /%[scdjifoO%]/g;
|
||||
|
||||
/**
|
||||
* Captures the number of escaped % signs in a format string (i.e. %s strings).
|
||||
* @type {RegExp}
|
||||
*/
|
||||
var escapedPercent = /%%/g;
|
||||
var Splatter = /*#__PURE__*/function () {
|
||||
function Splatter(opts) {
|
||||
_classCallCheck(this, Splatter);
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if tokens <= splat.length, assign { splat, meta } into the
|
||||
* `info` accordingly, and write to this instance.
|
||||
*
|
||||
* @param {Info} info Logform info message.
|
||||
* @param {String[]} tokens Set of string interpolation tokens.
|
||||
* @returns {Info} Modified info message
|
||||
* @private
|
||||
*/
|
||||
_createClass(Splatter, [{
|
||||
key: "_splat",
|
||||
value: function _splat(info, tokens) {
|
||||
var msg = info.message;
|
||||
var splat = info[SPLAT] || info.splat || [];
|
||||
var percents = msg.match(escapedPercent);
|
||||
var escapes = percents && percents.length || 0;
|
||||
|
||||
// The expected splat is the number of tokens minus the number of escapes
|
||||
// e.g.
|
||||
// - { expectedSplat: 3 } '%d %s %j'
|
||||
// - { expectedSplat: 5 } '[%s] %d%% %d%% %s %j'
|
||||
//
|
||||
// Any "meta" will be arugments in addition to the expected splat size
|
||||
// regardless of type. e.g.
|
||||
//
|
||||
// logger.log('info', '%d%% %s %j', 100, 'wow', { such: 'js' }, { thisIsMeta: true });
|
||||
// would result in splat of four (4), but only three (3) are expected. Therefore:
|
||||
//
|
||||
// extraSplat = 3 - 4 = -1
|
||||
// metas = [100, 'wow', { such: 'js' }, { thisIsMeta: true }].splice(-1, -1 * -1);
|
||||
// splat = [100, 'wow', { such: 'js' }]
|
||||
var expectedSplat = tokens.length - escapes;
|
||||
var extraSplat = expectedSplat - splat.length;
|
||||
var metas = extraSplat < 0 ? splat.splice(extraSplat, -1 * extraSplat) : [];
|
||||
|
||||
// Now that { splat } has been separated from any potential { meta }. we
|
||||
// can assign this to the `info` object and write it to our format stream.
|
||||
// If the additional metas are **NOT** objects or **LACK** enumerable properties
|
||||
// you are going to have a bad time.
|
||||
var metalen = metas.length;
|
||||
if (metalen) {
|
||||
for (var i = 0; i < metalen; i++) {
|
||||
Object.assign(info, metas[i]);
|
||||
}
|
||||
}
|
||||
info.message = util.format.apply(util, [msg].concat(_toConsumableArray(splat)));
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the `info` message by using `util.format` to complete
|
||||
* any `info.message` provided it has string interpolation tokens.
|
||||
* If no tokens exist then `info` is immutable.
|
||||
*
|
||||
* @param {Info} info Logform info message.
|
||||
* @param {Object} opts Options for this instance.
|
||||
* @returns {Info} Modified info message
|
||||
*/
|
||||
}, {
|
||||
key: "transform",
|
||||
value: function transform(info) {
|
||||
var msg = info.message;
|
||||
var splat = info[SPLAT] || info.splat;
|
||||
|
||||
// No need to process anything if splat is undefined
|
||||
if (!splat || !splat.length) {
|
||||
return info;
|
||||
}
|
||||
|
||||
// Extract tokens, if none available default to empty array to
|
||||
// ensure consistancy in expected results
|
||||
var tokens = msg && msg.match && msg.match(formatRegExp);
|
||||
|
||||
// This condition will take care of inputs with info[SPLAT]
|
||||
// but no tokens present
|
||||
if (!tokens && (splat || splat.length)) {
|
||||
var metas = splat.length > 1 ? splat.splice(0) : splat;
|
||||
|
||||
// Now that { splat } has been separated from any potential { meta }. we
|
||||
// can assign this to the `info` object and write it to our format stream.
|
||||
// If the additional metas are **NOT** objects or **LACK** enumerable properties
|
||||
// you are going to have a bad time.
|
||||
var metalen = metas.length;
|
||||
if (metalen) {
|
||||
for (var i = 0; i < metalen; i++) {
|
||||
Object.assign(info, metas[i]);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
if (tokens) {
|
||||
return this._splat(info, tokens);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}]);
|
||||
return Splatter;
|
||||
}();
|
||||
/*
|
||||
* function splat (info)
|
||||
* Returns a new instance of the splat format TransformStream
|
||||
* which performs string interpolation from `info` objects. This was
|
||||
* previously exposed implicitly in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = function (opts) {
|
||||
return new Splatter(opts);
|
||||
};
|
||||
26
resources/app/node_modules/logform/dist/timestamp.js
generated
vendored
Normal file
26
resources/app/node_modules/logform/dist/timestamp.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
var fecha = require('fecha');
|
||||
var format = require('./format');
|
||||
|
||||
/*
|
||||
* function timestamp (info)
|
||||
* Returns a new instance of the timestamp Format which adds a timestamp
|
||||
* to the info. It was previously available in winston < 3.0.0 as:
|
||||
*
|
||||
* - { timestamp: true } // `new Date.toISOString()`
|
||||
* - { timestamp: function:String } // Value returned by `timestamp()`
|
||||
*/
|
||||
module.exports = format(function (info) {
|
||||
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
if (opts.format) {
|
||||
info.timestamp = typeof opts.format === 'function' ? opts.format() : fecha.format(new Date(), opts.format);
|
||||
}
|
||||
if (!info.timestamp) {
|
||||
info.timestamp = new Date().toISOString();
|
||||
}
|
||||
if (opts.alias) {
|
||||
info[opts.alias] = info.timestamp;
|
||||
}
|
||||
return info;
|
||||
});
|
||||
25
resources/app/node_modules/logform/dist/uncolorize.js
generated
vendored
Normal file
25
resources/app/node_modules/logform/dist/uncolorize.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
var colors = require('@colors/colors/safe');
|
||||
var format = require('./format');
|
||||
var _require = require('triple-beam'),
|
||||
MESSAGE = _require.MESSAGE;
|
||||
|
||||
/*
|
||||
* function uncolorize (info)
|
||||
* Returns a new instance of the uncolorize Format that strips colors
|
||||
* from `info` objects. This was previously exposed as { stripColors: true }
|
||||
* to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format(function (info, opts) {
|
||||
if (opts.level !== false) {
|
||||
info.level = colors.strip(info.level);
|
||||
}
|
||||
if (opts.message !== false) {
|
||||
info.message = colors.strip(String(info.message));
|
||||
}
|
||||
if (opts.raw !== false && info[MESSAGE]) {
|
||||
info[MESSAGE] = colors.strip(String(info[MESSAGE]));
|
||||
}
|
||||
return info;
|
||||
});
|
||||
41
resources/app/node_modules/logform/errors.js
generated
vendored
Normal file
41
resources/app/node_modules/logform/errors.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/* eslint no-undefined: 0 */
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
const { LEVEL, MESSAGE } = require('triple-beam');
|
||||
|
||||
/*
|
||||
* function errors (info)
|
||||
* If the `message` property of the `info` object is an instance of `Error`,
|
||||
* replace the `Error` object its own `message` property.
|
||||
*
|
||||
* Optionally, the Error's `stack` and/or `cause` properties can also be appended to the `info` object.
|
||||
*/
|
||||
module.exports = format((einfo, { stack, cause }) => {
|
||||
if (einfo instanceof Error) {
|
||||
const info = Object.assign({}, einfo, {
|
||||
level: einfo.level,
|
||||
[LEVEL]: einfo[LEVEL] || einfo.level,
|
||||
message: einfo.message,
|
||||
[MESSAGE]: einfo[MESSAGE] || einfo.message
|
||||
});
|
||||
|
||||
if (stack) info.stack = einfo.stack;
|
||||
if (cause) info.cause = einfo.cause;
|
||||
return info;
|
||||
}
|
||||
|
||||
if (!(einfo.message instanceof Error)) return einfo;
|
||||
|
||||
// Assign all enumerable properties and the
|
||||
// message property from the error provided.
|
||||
const err = einfo.message;
|
||||
Object.assign(einfo, err);
|
||||
einfo.message = err.message;
|
||||
einfo[MESSAGE] = err.message;
|
||||
|
||||
// Assign the stack and/or cause if requested.
|
||||
if (stack) einfo.stack = err.stack;
|
||||
if (cause) einfo.cause = err.cause;
|
||||
return einfo;
|
||||
});
|
||||
52
resources/app/node_modules/logform/format.js
generated
vendored
Normal file
52
resources/app/node_modules/logform/format.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* Displays a helpful message and the source of
|
||||
* the format when it is invalid.
|
||||
*/
|
||||
class InvalidFormatError extends Error {
|
||||
constructor(formatFn) {
|
||||
super(`Format functions must be synchronous taking a two arguments: (info, opts)
|
||||
Found: ${formatFn.toString().split('\n')[0]}\n`);
|
||||
|
||||
Error.captureStackTrace(this, InvalidFormatError);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* function format (formatFn)
|
||||
* Returns a create function for the `formatFn`.
|
||||
*/
|
||||
module.exports = formatFn => {
|
||||
if (formatFn.length > 2) {
|
||||
throw new InvalidFormatError(formatFn);
|
||||
}
|
||||
|
||||
/*
|
||||
* function Format (options)
|
||||
* Base prototype which calls a `_format`
|
||||
* function and pushes the result.
|
||||
*/
|
||||
function Format(options = {}) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
Format.prototype.transform = formatFn;
|
||||
|
||||
//
|
||||
// Create a function which returns new instances of
|
||||
// FormatWrap for simple syntax like:
|
||||
//
|
||||
// require('winston').formats.json();
|
||||
//
|
||||
function createFormatWrap(opts) {
|
||||
return new Format(opts);
|
||||
}
|
||||
|
||||
//
|
||||
// Expose the FormatWrap through the create function
|
||||
// for testability.
|
||||
//
|
||||
createFormatWrap.Format = Format;
|
||||
return createFormatWrap;
|
||||
};
|
||||
52
resources/app/node_modules/logform/index.js
generated
vendored
Normal file
52
resources/app/node_modules/logform/index.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @property {function} format
|
||||
* Both the construction method and set of exposed
|
||||
* formats.
|
||||
*/
|
||||
const format = exports.format = require('./format');
|
||||
|
||||
/*
|
||||
* @api public
|
||||
* @method {function} levels
|
||||
* Registers the specified levels with logform.
|
||||
*/
|
||||
exports.levels = require('./levels');
|
||||
|
||||
/*
|
||||
* @api private
|
||||
* method {function} exposeFormat
|
||||
* Exposes a sub-format on the main format object
|
||||
* as a lazy-loaded getter.
|
||||
*/
|
||||
function exposeFormat(name, requireFormat) {
|
||||
Object.defineProperty(format, name, {
|
||||
get() {
|
||||
return requireFormat();
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Setup all transports as lazy-loaded getters.
|
||||
//
|
||||
exposeFormat('align', function () { return require('./align'); });
|
||||
exposeFormat('errors', function () { return require('./errors'); });
|
||||
exposeFormat('cli', function () { return require('./cli'); });
|
||||
exposeFormat('combine', function () { return require('./combine'); });
|
||||
exposeFormat('colorize', function () { return require('./colorize'); });
|
||||
exposeFormat('json', function () { return require('./json'); });
|
||||
exposeFormat('label', function () { return require('./label'); });
|
||||
exposeFormat('logstash', function () { return require('./logstash'); });
|
||||
exposeFormat('metadata', function () { return require('./metadata'); });
|
||||
exposeFormat('ms', function () { return require('./ms'); });
|
||||
exposeFormat('padLevels', function () { return require('./pad-levels'); });
|
||||
exposeFormat('prettyPrint', function () { return require('./pretty-print'); });
|
||||
exposeFormat('printf', function () { return require('./printf'); });
|
||||
exposeFormat('simple', function () { return require('./simple'); });
|
||||
exposeFormat('splat', function () { return require('./splat'); });
|
||||
exposeFormat('timestamp', function () { return require('./timestamp'); });
|
||||
exposeFormat('uncolorize', function () { return require('./uncolorize'); });
|
||||
30
resources/app/node_modules/logform/json.js
generated
vendored
Normal file
30
resources/app/node_modules/logform/json.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
const { MESSAGE } = require('triple-beam');
|
||||
const stringify = require('safe-stable-stringify');
|
||||
|
||||
/*
|
||||
* function replacer (key, value)
|
||||
* Handles proper stringification of Buffer and bigint output.
|
||||
*/
|
||||
function replacer(key, value) {
|
||||
// safe-stable-stringify does support BigInt, however, it doesn't wrap the value in quotes.
|
||||
// Leading to a loss in fidelity if the resulting string is parsed.
|
||||
// It would also be a breaking change for logform.
|
||||
if (typeof value === 'bigint')
|
||||
return value.toString();
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* function json (info)
|
||||
* Returns a new instance of the JSON format that turns a log `info`
|
||||
* object into pure JSON. This was previously exposed as { json: true }
|
||||
* to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format((info, opts) => {
|
||||
const jsonStringify = stringify.configure(opts);
|
||||
info[MESSAGE] = jsonStringify(info, opts.replacer || replacer, opts.space);
|
||||
return info;
|
||||
});
|
||||
19
resources/app/node_modules/logform/label.js
generated
vendored
Normal file
19
resources/app/node_modules/logform/label.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
|
||||
/*
|
||||
* function label (info)
|
||||
* Returns a new instance of the label Format which adds the specified
|
||||
* `opts.label` before the message. This was previously exposed as
|
||||
* { label: 'my label' } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format((info, opts) => {
|
||||
if (opts.message) {
|
||||
info.message = `[${opts.label}] ${info.message}`;
|
||||
return info;
|
||||
}
|
||||
|
||||
info.label = opts.label;
|
||||
return info;
|
||||
});
|
||||
12
resources/app/node_modules/logform/levels.js
generated
vendored
Normal file
12
resources/app/node_modules/logform/levels.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const { Colorizer } = require('./colorize');
|
||||
|
||||
/*
|
||||
* Simple method to register colors with a simpler require
|
||||
* path within the module.
|
||||
*/
|
||||
module.exports = config => {
|
||||
Colorizer.addColors(config.colors || config);
|
||||
return config;
|
||||
};
|
||||
29
resources/app/node_modules/logform/logstash.js
generated
vendored
Normal file
29
resources/app/node_modules/logform/logstash.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
const { MESSAGE } = require('triple-beam');
|
||||
const jsonStringify = require('safe-stable-stringify');
|
||||
|
||||
/*
|
||||
* function logstash (info)
|
||||
* Returns a new instance of the LogStash Format that turns a
|
||||
* log `info` object into pure JSON with the appropriate logstash
|
||||
* options. This was previously exposed as { logstash: true }
|
||||
* to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format(info => {
|
||||
const logstash = {};
|
||||
if (info.message) {
|
||||
logstash['@message'] = info.message;
|
||||
delete info.message;
|
||||
}
|
||||
|
||||
if (info.timestamp) {
|
||||
logstash['@timestamp'] = info.timestamp;
|
||||
delete info.timestamp;
|
||||
}
|
||||
|
||||
logstash['@fields'] = info;
|
||||
info[MESSAGE] = jsonStringify(logstash);
|
||||
return info;
|
||||
});
|
||||
61
resources/app/node_modules/logform/metadata.js
generated
vendored
Normal file
61
resources/app/node_modules/logform/metadata.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
|
||||
function fillExcept(info, fillExceptKeys, metadataKey) {
|
||||
const savedKeys = fillExceptKeys.reduce((acc, key) => {
|
||||
acc[key] = info[key];
|
||||
delete info[key];
|
||||
return acc;
|
||||
}, {});
|
||||
const metadata = Object.keys(info).reduce((acc, key) => {
|
||||
acc[key] = info[key];
|
||||
delete info[key];
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
Object.assign(info, savedKeys, {
|
||||
[metadataKey]: metadata
|
||||
});
|
||||
return info;
|
||||
}
|
||||
|
||||
function fillWith(info, fillWithKeys, metadataKey) {
|
||||
info[metadataKey] = fillWithKeys.reduce((acc, key) => {
|
||||
acc[key] = info[key];
|
||||
delete info[key];
|
||||
return acc;
|
||||
}, {});
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds in a "metadata" object to collect extraneous data, similar to the metadata
|
||||
* object in winston 2.x.
|
||||
*/
|
||||
module.exports = format((info, opts = {}) => {
|
||||
let metadataKey = 'metadata';
|
||||
if (opts.key) {
|
||||
metadataKey = opts.key;
|
||||
}
|
||||
|
||||
let fillExceptKeys = [];
|
||||
if (!opts.fillExcept && !opts.fillWith) {
|
||||
fillExceptKeys.push('level');
|
||||
fillExceptKeys.push('message');
|
||||
}
|
||||
|
||||
if (opts.fillExcept) {
|
||||
fillExceptKeys = opts.fillExcept;
|
||||
}
|
||||
|
||||
if (fillExceptKeys.length > 0) {
|
||||
return fillExcept(info, fillExceptKeys, metadataKey);
|
||||
}
|
||||
|
||||
if (opts.fillWith) {
|
||||
return fillWith(info, opts.fillWith, metadataKey);
|
||||
}
|
||||
|
||||
return info;
|
||||
});
|
||||
18
resources/app/node_modules/logform/ms.js
generated
vendored
Normal file
18
resources/app/node_modules/logform/ms.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
const ms = require('ms');
|
||||
|
||||
/*
|
||||
* function ms (info)
|
||||
* Returns an `info` with a `ms` property. The `ms` property holds the Value
|
||||
* of the time difference between two calls in milliseconds.
|
||||
*/
|
||||
module.exports = format(info => {
|
||||
const curr = +new Date();
|
||||
this.diff = curr - (this.prevTime || curr);
|
||||
this.prevTime = curr;
|
||||
info.ms = `+${ms(this.diff)}`;
|
||||
|
||||
return info;
|
||||
});
|
||||
162
resources/app/node_modules/logform/node_modules/ms/index.js
generated
vendored
Normal file
162
resources/app/node_modules/logform/node_modules/ms/index.js
generated
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
/**
|
||||
* Helpers.
|
||||
*/
|
||||
|
||||
var s = 1000;
|
||||
var m = s * 60;
|
||||
var h = m * 60;
|
||||
var d = h * 24;
|
||||
var w = d * 7;
|
||||
var y = d * 365.25;
|
||||
|
||||
/**
|
||||
* Parse or format the given `val`.
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* - `long` verbose formatting [false]
|
||||
*
|
||||
* @param {String|Number} val
|
||||
* @param {Object} [options]
|
||||
* @throws {Error} throw an error if val is not a non-empty string or a number
|
||||
* @return {String|Number}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function (val, options) {
|
||||
options = options || {};
|
||||
var type = typeof val;
|
||||
if (type === 'string' && val.length > 0) {
|
||||
return parse(val);
|
||||
} else if (type === 'number' && isFinite(val)) {
|
||||
return options.long ? fmtLong(val) : fmtShort(val);
|
||||
}
|
||||
throw new Error(
|
||||
'val is not a non-empty string or a valid number. val=' +
|
||||
JSON.stringify(val)
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse the given `str` and return milliseconds.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {Number}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function parse(str) {
|
||||
str = String(str);
|
||||
if (str.length > 100) {
|
||||
return;
|
||||
}
|
||||
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
||||
str
|
||||
);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
var n = parseFloat(match[1]);
|
||||
var type = (match[2] || 'ms').toLowerCase();
|
||||
switch (type) {
|
||||
case 'years':
|
||||
case 'year':
|
||||
case 'yrs':
|
||||
case 'yr':
|
||||
case 'y':
|
||||
return n * y;
|
||||
case 'weeks':
|
||||
case 'week':
|
||||
case 'w':
|
||||
return n * w;
|
||||
case 'days':
|
||||
case 'day':
|
||||
case 'd':
|
||||
return n * d;
|
||||
case 'hours':
|
||||
case 'hour':
|
||||
case 'hrs':
|
||||
case 'hr':
|
||||
case 'h':
|
||||
return n * h;
|
||||
case 'minutes':
|
||||
case 'minute':
|
||||
case 'mins':
|
||||
case 'min':
|
||||
case 'm':
|
||||
return n * m;
|
||||
case 'seconds':
|
||||
case 'second':
|
||||
case 'secs':
|
||||
case 'sec':
|
||||
case 's':
|
||||
return n * s;
|
||||
case 'milliseconds':
|
||||
case 'millisecond':
|
||||
case 'msecs':
|
||||
case 'msec':
|
||||
case 'ms':
|
||||
return n;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Short format for `ms`.
|
||||
*
|
||||
* @param {Number} ms
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function fmtShort(ms) {
|
||||
var msAbs = Math.abs(ms);
|
||||
if (msAbs >= d) {
|
||||
return Math.round(ms / d) + 'd';
|
||||
}
|
||||
if (msAbs >= h) {
|
||||
return Math.round(ms / h) + 'h';
|
||||
}
|
||||
if (msAbs >= m) {
|
||||
return Math.round(ms / m) + 'm';
|
||||
}
|
||||
if (msAbs >= s) {
|
||||
return Math.round(ms / s) + 's';
|
||||
}
|
||||
return ms + 'ms';
|
||||
}
|
||||
|
||||
/**
|
||||
* Long format for `ms`.
|
||||
*
|
||||
* @param {Number} ms
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function fmtLong(ms) {
|
||||
var msAbs = Math.abs(ms);
|
||||
if (msAbs >= d) {
|
||||
return plural(ms, msAbs, d, 'day');
|
||||
}
|
||||
if (msAbs >= h) {
|
||||
return plural(ms, msAbs, h, 'hour');
|
||||
}
|
||||
if (msAbs >= m) {
|
||||
return plural(ms, msAbs, m, 'minute');
|
||||
}
|
||||
if (msAbs >= s) {
|
||||
return plural(ms, msAbs, s, 'second');
|
||||
}
|
||||
return ms + ' ms';
|
||||
}
|
||||
|
||||
/**
|
||||
* Pluralization helper.
|
||||
*/
|
||||
|
||||
function plural(ms, msAbs, n, name) {
|
||||
var isPlural = msAbs >= n * 1.5;
|
||||
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
||||
}
|
||||
21
resources/app/node_modules/logform/node_modules/ms/license.md
generated
vendored
Normal file
21
resources/app/node_modules/logform/node_modules/ms/license.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Vercel, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
26
resources/app/node_modules/logform/node_modules/ms/package.json
generated
vendored
Normal file
26
resources/app/node_modules/logform/node_modules/ms/package.json
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "ms",
|
||||
"version": "2.1.3",
|
||||
"description": "Tiny millisecond conversion utility",
|
||||
"repository": "vercel/ms",
|
||||
"main": "./index",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"npm run lint",
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"eslint": "4.18.2",
|
||||
"expect.js": "0.3.1",
|
||||
"husky": "0.14.3",
|
||||
"lint-staged": "5.0.0",
|
||||
"mocha": "4.0.1",
|
||||
"prettier": "2.0.5"
|
||||
}
|
||||
}
|
||||
37
resources/app/node_modules/logform/package.json
generated
vendored
Normal file
37
resources/app/node_modules/logform/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "logform",
|
||||
"version": "2.6.0",
|
||||
"description": "An mutable object-based log format designed for chaining & objectMode streams.",
|
||||
"main": "index.js",
|
||||
"browser": "dist/browser.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/winstonjs/logform.git"
|
||||
},
|
||||
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/winstonjs/logform#readme",
|
||||
"dependencies": {
|
||||
"@colors/colors": "1.6.0",
|
||||
"@types/triple-beam": "^1.3.2",
|
||||
"fecha": "^4.2.0",
|
||||
"ms": "^2.1.1",
|
||||
"safe-stable-stringify": "^2.3.1",
|
||||
"triple-beam": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.10.3",
|
||||
"@babel/core": "^7.10.3",
|
||||
"@babel/preset-env": "^7.10.3",
|
||||
"@dabh/eslint-config-populist": "^5.0.0",
|
||||
"assume": "^2.2.0",
|
||||
"eslint": "^8.8.0",
|
||||
"mocha": "^10.0.0",
|
||||
"nyc": "^15.1.0",
|
||||
"rimraf": "^5.0.5"
|
||||
},
|
||||
"types": "./index.d.ts",
|
||||
"engines": {
|
||||
"node": ">= 12.0.0"
|
||||
}
|
||||
}
|
||||
83
resources/app/node_modules/logform/pad-levels.js
generated
vendored
Normal file
83
resources/app/node_modules/logform/pad-levels.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
'use strict';
|
||||
|
||||
const { configs, LEVEL, MESSAGE } = require('triple-beam');
|
||||
|
||||
class Padder {
|
||||
constructor(opts = { levels: configs.npm.levels }) {
|
||||
this.paddings = Padder.paddingForLevels(opts.levels, opts.filler);
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum length of keys in the specified `levels` Object.
|
||||
* @param {Object} levels Set of all levels to calculate longest level against.
|
||||
* @returns {Number} Maximum length of the longest level string.
|
||||
*/
|
||||
static getLongestLevel(levels) {
|
||||
const lvls = Object.keys(levels).map(level => level.length);
|
||||
return Math.max(...lvls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the padding for the specified `level` assuming that the
|
||||
* maximum length of all levels it's associated with is `maxLength`.
|
||||
* @param {String} level Level to calculate padding for.
|
||||
* @param {String} filler Repeatable text to use for padding.
|
||||
* @param {Number} maxLength Length of the longest level
|
||||
* @returns {String} Padding string for the `level`
|
||||
*/
|
||||
static paddingForLevel(level, filler, maxLength) {
|
||||
const targetLen = maxLength + 1 - level.length;
|
||||
const rep = Math.floor(targetLen / filler.length);
|
||||
const padding = `${filler}${filler.repeat(rep)}`;
|
||||
return padding.slice(0, targetLen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object with the string paddings for the given `levels`
|
||||
* using the specified `filler`.
|
||||
* @param {Object} levels Set of all levels to calculate padding for.
|
||||
* @param {String} filler Repeatable text to use for padding.
|
||||
* @returns {Object} Mapping of level to desired padding.
|
||||
*/
|
||||
static paddingForLevels(levels, filler = ' ') {
|
||||
const maxLength = Padder.getLongestLevel(levels);
|
||||
return Object.keys(levels).reduce((acc, level) => {
|
||||
acc[level] = Padder.paddingForLevel(level, filler, maxLength);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepends the padding onto the `message` based on the `LEVEL` of
|
||||
* the `info`. This is based on the behavior of `winston@2` which also
|
||||
* prepended the level onto the message.
|
||||
*
|
||||
* See: https://github.com/winstonjs/winston/blob/2.x/lib/winston/logger.js#L198-L201
|
||||
*
|
||||
* @param {Info} info Logform info object
|
||||
* @param {Object} opts Options passed along to this instance.
|
||||
* @returns {Info} Modified logform info object.
|
||||
*/
|
||||
transform(info, opts) {
|
||||
info.message = `${this.paddings[info[LEVEL]]}${info.message}`;
|
||||
if (info[MESSAGE]) {
|
||||
info[MESSAGE] = `${this.paddings[info[LEVEL]]}${info[MESSAGE]}`;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* function padLevels (info)
|
||||
* Returns a new instance of the padLevels Format which pads
|
||||
* levels to be the same length. This was previously exposed as
|
||||
* { padLevels: true } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = opts => new Padder(opts);
|
||||
|
||||
module.exports.Padder
|
||||
= module.exports.Format
|
||||
= Padder;
|
||||
29
resources/app/node_modules/logform/pretty-print.js
generated
vendored
Normal file
29
resources/app/node_modules/logform/pretty-print.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
const inspect = require('util').inspect;
|
||||
const format = require('./format');
|
||||
const { LEVEL, MESSAGE, SPLAT } = require('triple-beam');
|
||||
|
||||
/*
|
||||
* function prettyPrint (info)
|
||||
* Returns a new instance of the prettyPrint Format that "prettyPrint"
|
||||
* serializes `info` objects. This was previously exposed as
|
||||
* { prettyPrint: true } to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format((info, opts = {}) => {
|
||||
//
|
||||
// info[{LEVEL, MESSAGE, SPLAT}] are enumerable here. Since they
|
||||
// are internal, we remove them before util.inspect so they
|
||||
// are not printed.
|
||||
//
|
||||
const stripped = Object.assign({}, info);
|
||||
|
||||
// Remark (indexzero): update this technique in April 2019
|
||||
// when node@6 is EOL
|
||||
delete stripped[LEVEL];
|
||||
delete stripped[MESSAGE];
|
||||
delete stripped[SPLAT];
|
||||
|
||||
info[MESSAGE] = inspect(stripped, false, opts.depth || null, opts.colorize);
|
||||
return info;
|
||||
});
|
||||
26
resources/app/node_modules/logform/printf.js
generated
vendored
Normal file
26
resources/app/node_modules/logform/printf.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
const { MESSAGE } = require('triple-beam');
|
||||
|
||||
class Printf {
|
||||
constructor(templateFn) {
|
||||
this.template = templateFn;
|
||||
}
|
||||
|
||||
transform(info) {
|
||||
info[MESSAGE] = this.template(info);
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* function printf (templateFn)
|
||||
* Returns a new instance of the printf Format that creates an
|
||||
* intermediate prototype to store the template string-based formatter
|
||||
* function.
|
||||
*/
|
||||
module.exports = opts => new Printf(opts);
|
||||
|
||||
module.exports.Printf
|
||||
= module.exports.Format
|
||||
= Printf;
|
||||
33
resources/app/node_modules/logform/simple.js
generated
vendored
Normal file
33
resources/app/node_modules/logform/simple.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/* eslint no-undefined: 0 */
|
||||
'use strict';
|
||||
|
||||
const format = require('./format');
|
||||
const { MESSAGE } = require('triple-beam');
|
||||
const jsonStringify = require('safe-stable-stringify');
|
||||
|
||||
/*
|
||||
* function simple (info)
|
||||
* Returns a new instance of the simple format TransformStream
|
||||
* which writes a simple representation of logs.
|
||||
*
|
||||
* const { level, message, splat, ...rest } = info;
|
||||
*
|
||||
* ${level}: ${message} if rest is empty
|
||||
* ${level}: ${message} ${JSON.stringify(rest)} otherwise
|
||||
*/
|
||||
module.exports = format(info => {
|
||||
const stringifiedRest = jsonStringify(Object.assign({}, info, {
|
||||
level: undefined,
|
||||
message: undefined,
|
||||
splat: undefined
|
||||
}));
|
||||
|
||||
const padding = info.padding && info.padding[info.level] || '';
|
||||
if (stringifiedRest !== '{}') {
|
||||
info[MESSAGE] = `${info.level}:${padding} ${info.message} ${stringifiedRest}`;
|
||||
} else {
|
||||
info[MESSAGE] = `${info.level}:${padding} ${info.message}`;
|
||||
}
|
||||
|
||||
return info;
|
||||
});
|
||||
132
resources/app/node_modules/logform/splat.js
generated
vendored
Normal file
132
resources/app/node_modules/logform/splat.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
'use strict';
|
||||
|
||||
const util = require('util');
|
||||
const { SPLAT } = require('triple-beam');
|
||||
|
||||
/**
|
||||
* Captures the number of format (i.e. %s strings) in a given string.
|
||||
* Based on `util.format`, see Node.js source:
|
||||
* https://github.com/nodejs/node/blob/b1c8f15c5f169e021f7c46eb7b219de95fe97603/lib/util.js#L201-L230
|
||||
* @type {RegExp}
|
||||
*/
|
||||
const formatRegExp = /%[scdjifoO%]/g;
|
||||
|
||||
/**
|
||||
* Captures the number of escaped % signs in a format string (i.e. %s strings).
|
||||
* @type {RegExp}
|
||||
*/
|
||||
const escapedPercent = /%%/g;
|
||||
|
||||
class Splatter {
|
||||
constructor(opts) {
|
||||
this.options = opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if tokens <= splat.length, assign { splat, meta } into the
|
||||
* `info` accordingly, and write to this instance.
|
||||
*
|
||||
* @param {Info} info Logform info message.
|
||||
* @param {String[]} tokens Set of string interpolation tokens.
|
||||
* @returns {Info} Modified info message
|
||||
* @private
|
||||
*/
|
||||
_splat(info, tokens) {
|
||||
const msg = info.message;
|
||||
const splat = info[SPLAT] || info.splat || [];
|
||||
const percents = msg.match(escapedPercent);
|
||||
const escapes = percents && percents.length || 0;
|
||||
|
||||
// The expected splat is the number of tokens minus the number of escapes
|
||||
// e.g.
|
||||
// - { expectedSplat: 3 } '%d %s %j'
|
||||
// - { expectedSplat: 5 } '[%s] %d%% %d%% %s %j'
|
||||
//
|
||||
// Any "meta" will be arugments in addition to the expected splat size
|
||||
// regardless of type. e.g.
|
||||
//
|
||||
// logger.log('info', '%d%% %s %j', 100, 'wow', { such: 'js' }, { thisIsMeta: true });
|
||||
// would result in splat of four (4), but only three (3) are expected. Therefore:
|
||||
//
|
||||
// extraSplat = 3 - 4 = -1
|
||||
// metas = [100, 'wow', { such: 'js' }, { thisIsMeta: true }].splice(-1, -1 * -1);
|
||||
// splat = [100, 'wow', { such: 'js' }]
|
||||
const expectedSplat = tokens.length - escapes;
|
||||
const extraSplat = expectedSplat - splat.length;
|
||||
const metas = extraSplat < 0
|
||||
? splat.splice(extraSplat, -1 * extraSplat)
|
||||
: [];
|
||||
|
||||
// Now that { splat } has been separated from any potential { meta }. we
|
||||
// can assign this to the `info` object and write it to our format stream.
|
||||
// If the additional metas are **NOT** objects or **LACK** enumerable properties
|
||||
// you are going to have a bad time.
|
||||
const metalen = metas.length;
|
||||
if (metalen) {
|
||||
for (let i = 0; i < metalen; i++) {
|
||||
Object.assign(info, metas[i]);
|
||||
}
|
||||
}
|
||||
|
||||
info.message = util.format(msg, ...splat);
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the `info` message by using `util.format` to complete
|
||||
* any `info.message` provided it has string interpolation tokens.
|
||||
* If no tokens exist then `info` is immutable.
|
||||
*
|
||||
* @param {Info} info Logform info message.
|
||||
* @param {Object} opts Options for this instance.
|
||||
* @returns {Info} Modified info message
|
||||
*/
|
||||
transform(info) {
|
||||
const msg = info.message;
|
||||
const splat = info[SPLAT] || info.splat;
|
||||
|
||||
// No need to process anything if splat is undefined
|
||||
if (!splat || !splat.length) {
|
||||
return info;
|
||||
}
|
||||
|
||||
// Extract tokens, if none available default to empty array to
|
||||
// ensure consistancy in expected results
|
||||
const tokens = msg && msg.match && msg.match(formatRegExp);
|
||||
|
||||
// This condition will take care of inputs with info[SPLAT]
|
||||
// but no tokens present
|
||||
if (!tokens && (splat || splat.length)) {
|
||||
const metas = splat.length > 1
|
||||
? splat.splice(0)
|
||||
: splat;
|
||||
|
||||
// Now that { splat } has been separated from any potential { meta }. we
|
||||
// can assign this to the `info` object and write it to our format stream.
|
||||
// If the additional metas are **NOT** objects or **LACK** enumerable properties
|
||||
// you are going to have a bad time.
|
||||
const metalen = metas.length;
|
||||
if (metalen) {
|
||||
for (let i = 0; i < metalen; i++) {
|
||||
Object.assign(info, metas[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
if (tokens) {
|
||||
return this._splat(info, tokens);
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* function splat (info)
|
||||
* Returns a new instance of the splat format TransformStream
|
||||
* which performs string interpolation from `info` objects. This was
|
||||
* previously exposed implicitly in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = opts => new Splatter(opts);
|
||||
30
resources/app/node_modules/logform/timestamp.js
generated
vendored
Normal file
30
resources/app/node_modules/logform/timestamp.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const fecha = require('fecha');
|
||||
const format = require('./format');
|
||||
|
||||
/*
|
||||
* function timestamp (info)
|
||||
* Returns a new instance of the timestamp Format which adds a timestamp
|
||||
* to the info. It was previously available in winston < 3.0.0 as:
|
||||
*
|
||||
* - { timestamp: true } // `new Date.toISOString()`
|
||||
* - { timestamp: function:String } // Value returned by `timestamp()`
|
||||
*/
|
||||
module.exports = format((info, opts = {}) => {
|
||||
if (opts.format) {
|
||||
info.timestamp = typeof opts.format === 'function'
|
||||
? opts.format()
|
||||
: fecha.format(new Date(), opts.format);
|
||||
}
|
||||
|
||||
if (!info.timestamp) {
|
||||
info.timestamp = new Date().toISOString();
|
||||
}
|
||||
|
||||
if (opts.alias) {
|
||||
info[opts.alias] = info.timestamp;
|
||||
}
|
||||
|
||||
return info;
|
||||
});
|
||||
22
resources/app/node_modules/logform/tsconfig.json
generated
vendored
Normal file
22
resources/app/node_modules/logform/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
27
resources/app/node_modules/logform/uncolorize.js
generated
vendored
Normal file
27
resources/app/node_modules/logform/uncolorize.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
const colors = require('@colors/colors/safe');
|
||||
const format = require('./format');
|
||||
const { MESSAGE } = require('triple-beam');
|
||||
|
||||
/*
|
||||
* function uncolorize (info)
|
||||
* Returns a new instance of the uncolorize Format that strips colors
|
||||
* from `info` objects. This was previously exposed as { stripColors: true }
|
||||
* to transports in `winston < 3.0.0`.
|
||||
*/
|
||||
module.exports = format((info, opts) => {
|
||||
if (opts.level !== false) {
|
||||
info.level = colors.strip(info.level);
|
||||
}
|
||||
|
||||
if (opts.message !== false) {
|
||||
info.message = colors.strip(String(info.message));
|
||||
}
|
||||
|
||||
if (opts.raw !== false && info[MESSAGE]) {
|
||||
info[MESSAGE] = colors.strip(String(info[MESSAGE]));
|
||||
}
|
||||
|
||||
return info;
|
||||
});
|
||||
Reference in New Issue
Block a user