Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@haventech/supertype

Package Overview
Dependencies
Maintainers
5
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@haventech/supertype - npm Package Compare versions

Comparing version 6.0.0-beta.8 to 6.0.0-beta.n1

2

dist/decorators.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.remote = exports.property = exports.supertypeClass = void 0;
exports.remote = exports.property = exports.supertypeClass = exports.Supertype = void 0;
var Supertype_1 = require("./Supertype");

@@ -5,0 +5,0 @@ Object.defineProperty(exports, "Supertype", { enumerable: true, get: function () { return Supertype_1.Supertype; } });

@@ -23,3 +23,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.SupertypeSession = exports.amorphicStatic = void 0;
exports.remote = exports.property = exports.supertypeClass = exports.Supertype = exports.BuildSupertypeConfig = exports.SupertypeConfig = exports.SupertypeLogger = exports.SupertypeSession = exports.amorphicStatic = exports.StatsdHelper = void 0;
var ObjectTemplate_1 = require("./ObjectTemplate");

@@ -26,0 +26,0 @@ ObjectTemplate_1.ObjectTemplate.init();

@@ -5,3 +5,3 @@ import * as serializer from './serializer';

import { Config, ApplicationNameToConfigMap } from '@haventech/amorphic-contracts';
export declare type CreateTypeForName = {
export type CreateTypeForName = {
name?: string;

@@ -12,3 +12,3 @@ toClient?: boolean;

};
export declare type Getter = {
export type Getter = {
get: any;

@@ -20,3 +20,3 @@ };

*/
export declare type ConstructorTypeBase = Function & {
export type ConstructorTypeBase = Function & {
amorphicClassName: any;

@@ -47,3 +47,3 @@ __shadowParent__: any;

}
export declare type ObjectTemplateClone = typeof ObjectTemplate;
export type ObjectTemplateClone = typeof ObjectTemplate;
/**

@@ -73,3 +73,2 @@ * the og ObjectTemplate, what everything picks off of

static amorphicStatic: typeof ObjectTemplate;
private static moduleName;
static config: {

@@ -76,0 +75,0 @@ nconf: Config;

@@ -1,2 +0,2 @@

declare type hrTime = [number, number];
type hrTime = [number, number];
/**

@@ -3,0 +3,0 @@ * mostly static utility functions to assist supertype in handling statsd operations

import { ObjectTemplate } from './ObjectTemplate';
export declare type Constructable = new (...args: any[]) => {};
export type Constructable = new (...args: any[]) => {};
/**

@@ -4,0 +4,0 @@ * This is the base class for typescript classes.

@@ -54,3 +54,3 @@ "use strict";

if (!rootDir) {
throw new Error("Valid root path expected. rootDir[" + rootDir + "]");
throw new Error("Valid root path expected. rootDir[".concat(rootDir, "]"));
}

@@ -64,3 +64,3 @@ else {

if (envName) {
loadConfigFile(rootConfig.internalConfigStore, 'root_env', rootDir, "config_" + envName + ".json");
loadConfigFile(rootConfig.internalConfigStore, 'root_env', rootDir, "config_".concat(envName, ".json"));
}

@@ -79,4 +79,4 @@ loadConfigFile(rootConfig.internalConfigStore, 'root_secure', rootDir, "config_secure.json");

function buildAppSpecificConfigStore(app, rootDir, envName) {
var appPath = rootDir + "/" + app; // Location of the App relative to root
var appCommonPath = rootDir + "/apps/common"; // Location of the common folder relative to root
var appPath = "".concat(rootDir, "/").concat(app); // Location of the App relative to root
var appCommonPath = "".concat(rootDir, "/apps/common"); // Location of the common folder relative to root
var config = new SupertypeConfig();

@@ -86,3 +86,3 @@ var appCfgApi = config.internalConfigStore;

if (envName) {
loadConfigFile(appCfgApi, 'app_env', appPath, "config_" + envName + ".json");
loadConfigFile(appCfgApi, 'app_env', appPath, "config_".concat(envName, ".json"));
}

@@ -93,3 +93,3 @@ loadConfigFile(appCfgApi, 'app_secure', appPath, "config_secure.json");

if (envName) {
loadConfigFile(appCfgApi, 'common_env', appCommonPath, "config_" + envName + ".json");
loadConfigFile(appCfgApi, 'common_env', appCommonPath, "config_".concat(envName, ".json"));
}

@@ -100,3 +100,3 @@ loadConfigFile(appCfgApi, 'common_secure', appCommonPath, "config_secure.json");

if (envName) {
loadConfigFile(appCfgApi, 'root_env', rootDir, "config_" + envName + ".json");
loadConfigFile(appCfgApi, 'root_env', rootDir, "config_".concat(envName, ".json"));
}

@@ -109,8 +109,8 @@ loadConfigFile(appCfgApi, 'root_secure', rootDir, "config_secure.json");

try {
config.file(name, appPath + "/" + fileName);
config.file(name, "".concat(appPath, "/").concat(fileName));
}
catch (err) {
console.debug("Error loading " + appPath + "/" + fileName + " to config");
console.debug("Error loading ".concat(appPath, "/").concat(fileName, " to config"));
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJ0eXBlQ29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1N1cGVydHlwZUNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2QkFBK0I7QUFLL0IsU0FBUyxzQkFBc0I7SUFDM0IsT0FBTyxJQUFJLEtBQUssQ0FBQyxRQUFRLEVBQUUsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBQyxTQUFTLEVBQUUsSUFBSSxFQUFDLENBQUMsQ0FBQztBQUM5RCxDQUFDO0FBRUQ7O0dBRUc7QUFDSDtJQUdJO1FBQ0ksSUFBSSxDQUFDLG1CQUFtQixHQUFHLHNCQUFzQixFQUFFLENBQUM7SUFDeEQsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsNkJBQUcsR0FBSCxVQUFJLEdBQUc7UUFDSCxPQUFPLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDN0MsQ0FBQztJQUVEOzs7Ozs7T0FNRztJQUNILDZCQUFHLEdBQUgsVUFBSSxHQUFHLEVBQUUsS0FBSztRQUNWLE9BQU8sSUFBSSxDQUFDLG1CQUFtQixDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFDcEQsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsa0NBQVEsR0FBUixVQUFTLE9BQU8sRU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A9IG5ldyBTdXBlcnR5cGVDb25maWcoKTtcbiAgICBpZiAoIXJvb3REaXIpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBWYWxpZCByb290IHBhdGggZXhwZWN0ZWQuIHJvb3REaXJbJHtyb290RGlyfV1gKTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIGNvbnN0IGNvbmZpZ1N0b3JlOiBBcHBsaWNhdGlvbk5hbWVUb0NvbmZpZ01hcCA9IHt9O1xuICAgICAgICBsZXQgZW52TmFtZSA9IHJvb3RDb25maWcuaW50ZXJuYWxDb25maWdTdG9yZS5nZXQoJ0FQUF9FTlYnKTtcblxuICAgICAgICBpZiAoZW52TmFtZSkge1xuICAgICAgICAgICAgZW52TmFtZSA9IGVudk5hbWUudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChlbnZOYW1lKSB7XG4gICAgICAgICAgICBsb2FkQ29uZmlnRmlsZShyb290Q29uZmlnLmludGVybmFsQ29uZmlnU3RvcmUsICdyb290X2VudicsIHJvb3REaXIsIGBjb25maWdfJHtlbnZOYW1lfS5qc29uYCk7XG4gICAgICAgIH1cbiAgICAgICAgbG9hZENvbmZpZ0ZpbGUocm9vdENvbmZpZy5pbnRlcm5hbENvbmZpZ1N0b3JlLCAncm9vdF9zZWN1cmUnLCByb290RGlyLCBgY29uZmlnX3NlY3VyZS5qc29uYCk7XG4gICAgICAgIGxvYWRDb25maWdGaWxlKHJvb3RDb25maWcuaW50ZXJuYWxDb25maWdTdG9yZSwgJ3Jvb3QnLCByb290RGlyLCBgY29uZmlnLmpzb25gKTtcblxuXG4gICAgICAgIGNvbmZpZ1N0b3JlWydyb290J10gPSByb290Q29uZmlnO1xuXG4gICAgICAgIGNvbnN0IGFwcExpc3QgPSByb290Q29uZmlnLmludGVybmFsQ29uZmlnU3RvcmUuZ2V0KCdhcHBsaWNhdGlvbnMnKSB8fCB7fTtcblxuICAgICAgICBmb3IgKGxldCBhcH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AgY29uZmlnLmZpbGUobmFtZSwgYCR7YXBwUGF0aH0vJHtmaWxlTmFtZX1gKTtcbiAgICB9XG4gICAgY2F0Y2ggKGVycikge1xuICAgICAgICBjb25zb2xlLmRlYnVnKGBFcnJvciBsb2FkaW5nICR7YXBwUGF0aH0vJHtmaWxlTmFtZX0gdG8gY29uZmlnYCk7XG4gICAgfVxufSJdfQ==

@@ -0,8 +1,6 @@

type LoggerFunction = (logLevel: string, logObject: any, ...rawLogData: any[]) => void;
export declare class SupertypeLogger {
static moduleName: string;
private _amorphicContext;
context: any;
granularLevels: any;
level: any;
private _clientLogger;
constructor();

@@ -15,11 +13,8 @@ fatal(...data: any[]): void;

trace(...data: any[]): void;
get clientLogger(): any;
/**
* assign a custom send to log functionality.
* @param logger - logger must fit the format of info/error/debug/warn
* @param {(level: string, data: any) => void} loggerFunction
*/
setLogger(logger: any): void;
setLogger(loggerFunction: LoggerFunction): void;
private log;
private setLogsAmorphicContext;
getAmorphicContext(): any;
startContext(context: any): void;

@@ -29,5 +24,4 @@ setContextProps(context: any): {};

clearContextProps(contextToClear: any): void;
createChildLogger(context: any, rootValues?: any, dataValues?: any): SupertypeLogger;
createChildLogger(context: any): SupertypeLogger;
formatDateTime(date: any): string;
private deleteEmptyLogProperties;
/**

@@ -45,1 +39,2 @@ * this function is designed to be replaced by the consumer of this class.

}
export {};
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
return t;
};
return __assign.apply(this, arguments);
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -24,2 +15,9 @@ exports.SupertypeLogger = void 0;

var strToLevel = { 'fatal': 60, 'error': 50, 'warn': 40, 'info': 30, 'debug': 20, 'trace': 10 };
function isObject(obj) {
return obj != null
&& typeof (obj) === 'object'
&& !(obj instanceof Array)
&& !(obj instanceof Date)
&& !(obj instanceof Error);
}
var SupertypeLogger = /** @class */ (function () {

@@ -30,3 +28,2 @@ // for overriding

function SupertypeLogger() {
this._amorphicContext = '__amorphicContext';
this.context = {};

@@ -41,3 +38,3 @@ this.granularLevels = {};

}
this.log.apply(this, __spreadArrays([60], data));
this.log.apply(this, __spreadArray([60], data, false));
};

@@ -49,3 +46,3 @@ SupertypeLogger.prototype.error = function () {

}
this.log.apply(this, __spreadArrays([50], data));
this.log.apply(this, __spreadArray([50], data, false));
};

@@ -57,3 +54,3 @@ SupertypeLogger.prototype.warn = function () {

}
this.log.apply(this, __spreadArrays([40], data));
this.log.apply(this, __spreadArray([40], data, false));
};

@@ -65,3 +62,3 @@ SupertypeLogger.prototype.info = function () {

}
this.log.apply(this, __spreadArrays([30], data));
this.log.apply(this, __spreadArray([30], data, false));
};

@@ -73,3 +70,3 @@ SupertypeLogger.prototype.debug = function () {

}
this.log.apply(this, __spreadArrays([20], data));
this.log.apply(this, __spreadArray([20], data, false));
};

@@ -81,81 +78,58 @@ SupertypeLogger.prototype.trace = function () {

}
this.log.apply(this, __spreadArrays([10], data));
this.log.apply(this, __spreadArray([10], data, false));
};
Object.defineProperty(SupertypeLogger.prototype, "clientLogger", {
get: function () {
return this._clientLogger;
},
enumerable: false,
configurable: true
});
/**
* assign a custom send to log functionality.
* @param logger - logger must fit the format of info/error/debug/warn
* @param {(level: string, data: any) => void} loggerFunction
*/
SupertypeLogger.prototype.setLogger = function (logger) {
if (typeof logger.info !== 'function' ||
typeof logger.error !== 'function' ||
typeof logger.debug !== 'function' ||
typeof logger.warn !== 'function') {
throw new Error('Please specify a logger with the info, error, debug, and warn functions');
}
if (typeof logger.childLogger === 'function') {
this._clientLogger = logger.childLogger({ error: { isHumanRelated: false } });
return;
}
if (typeof logger.child === 'function') {
this._clientLogger = logger.child();
return;
}
this._clientLogger = logger;
SupertypeLogger.prototype.setLogger = function (loggerFunction) {
this.sendToLog = loggerFunction;
};
// Log all arguments assuming the first one is level and the second one might be an object (similar to banyan)
SupertypeLogger.prototype.log = function (level) {
var args = [];
var data = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
data[_i - 1] = arguments[_i];
}
var properties = args && Array.isArray(args) ? args.slice() : args;
if (typeof properties[0] === 'object') {
var logObj = properties[0];
if (!logObj.data) {
logObj.data = {};
var msg = '';
var obj = {
time: (new Date()).toISOString(),
msg: '',
level: 'info',
__amorphicContext: {}
};
var amorphicContext = {};
// Copy amorphic context into the data
for (var prop in this.context) {
obj[prop] = this.context[prop];
amorphicContext[prop] = this.context[prop];
}
obj.level = level;
obj.__amorphicContext = amorphicContext;
data.forEach(function (arg, index) {
if (index === 0 && isObject(arg)) {
for (var proper in arg) {
obj[proper] = arg[proper];
}
}
if (!logObj.context) {
logObj.context = {};
else {
msg += "".concat(arg, " ");
}
this.setLogsAmorphicContext(logObj.context);
logObj['level'] = level;
if (this.isEnabled(levelToStr[logObj['level']], logObj)) {
this.sendToLog.apply(this, __spreadArrays([levelToStr[logObj['level']], logObj], properties.slice(1)));
});
if (obj.msg.length) {
obj.msg += ' ';
}
if (msg.length) {
if (obj.module && obj.activity) {
obj.msg += "".concat(obj.module, "[").concat(obj.activity, "] - ");
}
return;
obj.msg += msg;
}
properties['level'] = level;
if (this.isEnabled(levelToStr[properties['level']], properties)) {
this.sendToLog(levelToStr[properties['level']], properties);
else if (obj.module && obj.activity) {
obj.msg += "".concat(obj.module, "[").concat(obj.activity, "]");
}
return;
};
//This method extracts sessionId from the each request's context
//and places it in the context.sessionId. All other context properties are
//placed in context.data object.
SupertypeLogger.prototype.setLogsAmorphicContext = function (object) {
if (this.context && Object.keys(this.context).length > 0) {
if (!object.data) {
object.data = {};
}
if (typeof object.data === 'object') {
var sessionId = this.context.session;
object.data[this._amorphicContext] = __assign({}, this.context);
if (object.data[this._amorphicContext] && sessionId) {
object.data[this._amorphicContext].session = sessionId;
delete object.data[this._amorphicContext].session;
}
}
if (this.isEnabled(levelToStr[obj.level], obj)) {
this.sendToLog.apply(this, __spreadArray([levelToStr[obj.level], obj], data, false));
}
};
SupertypeLogger.prototype.getAmorphicContext = function () {
return { __amorphicContext: __assign({}, this.context) };
};
SupertypeLogger.prototype.startContext = function (context) {

@@ -199,3 +173,3 @@ this.context = context;

// Create a new logger and copy over it's context
SupertypeLogger.prototype.createChildLogger = function (context, rootValues, dataValues) {
SupertypeLogger.prototype.createChildLogger = function (context) {
var child = {};

@@ -209,13 +183,2 @@ for (var prop in this) {

}
if (this._clientLogger) {
var childLogger = void 0;
if (this._clientLogger.childLogger === 'function') {
childLogger = this._clientLogger.childLogger(rootValues, dataValues);
child = childLogger;
}
else if (this._clientLogger.child === 'function') {
childLogger = this._clientLogger.child(__assign(__assign({}, rootValues), { data: { dataValues: dataValues } }));
child = childLogger;
}
}
return child; // bad practice but should fix

@@ -234,10 +197,2 @@ };

};
SupertypeLogger.prototype.deleteEmptyLogProperties = function (logObject) {
var keys = ['context', 'data'];
keys.forEach(function (key) {
if (logObject[key] && Object.keys(logObject[key]).length < 1) {
delete logObject[key];
}
});
};
/**

@@ -251,3 +206,2 @@ * this function is designed to be replaced by the consumer of this class.

SupertypeLogger.prototype.sendToLog = function (logLevel, logObject) {
var _a, _b, _c, _d;
var rawLogData = [];

@@ -257,35 +211,2 @@ for (var _i = 2; _i < arguments.length; _i++) {

}
var functionName = this.sendToLog.name;
this.deleteEmptyLogProperties(logObject);
if (this._clientLogger) {
var levelForLog = typeof logLevel === 'string' ? strToLevel[logLevel] : logLevel;
switch (levelForLog) {
case 10:
case 20:
(_a = this._clientLogger).debug.apply(_a, __spreadArrays([logObject], rawLogData));
return;
case 30:
(_b = this._clientLogger).info.apply(_b, __spreadArrays([logObject], rawLogData));
return;
case 40:
(_c = this._clientLogger).warn.apply(_c, __spreadArrays([logObject], rawLogData));
return;
case 60:
case 50:
(_d = this._clientLogger).error.apply(_d, __spreadArrays([logObject], rawLogData));
return;
default:
this._clientLogger.error({
module: SupertypeLogger.moduleName,
function: functionName,
category: 'milestone',
message: 'invalid level used',
data: {
logLevel: logLevel,
logObject: logObject
}
});
return;
}
}
console.log(this.prettyPrint(logLevel, logObject)); // eslint-disable-line no-console

@@ -295,3 +216,3 @@ };

var split = this.split(json, { time: 1, msg: 1, level: 1, name: 1 });
return this.formatDateTime(json.time ? new Date(json.time) : new Date()) + ': ' +
return this.formatDateTime(new Date(json.time)) + ': ' +
level.toUpperCase() + ': ' +

@@ -342,6 +263,5 @@ addColonIfToken(split[1].name, ': ') +

};
SupertypeLogger.moduleName = SupertypeLogger.name;
return SupertypeLogger;
}());
exports.SupertypeLogger = SupertypeLogger;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJ0eXBlTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1N1cGVydHlwZUxvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxJQUFNLFVBQVUsR0FBRyxFQUFFLEVBQUUsRUFBRSxPQUFPLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxFQUFFLEVBQUUsRUFBRSxNQUFNLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxFQUFFLEVBQUUsT0FBTyxFQUFFLENBQUM7QUFDbE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RleHQuc2Vzc2lvbklkLiBBbGwgb3RoZXIgY29udGV4dCBwcm9wZXJ0aWVzIGFyZSBcbiAgICAvL3BsYWNlZCBpbiBjb250ZXh0LmRhdGEgb2JqZWN0LlxuICAgIHByaXZhdGUgc2V0TG9nc0Ftb3JwaGljQ29udGV4dChvYmplY3QpIHtcbiAgICAgICAgaWYgKHRoaXMuY29udGV4dCAmJiBPYmplY3Qua2V5cyh0aGlzLmNvbnRleHQpLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGlmICghb2JqZWN0LmRhdGEpIHtcbiAgICAgICAgICAgICAgICBvYmplY3QuZGF0YSA9IHt9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvYmplY3QuZGF0YSA9PT0gJ29iamVjdCcpe1xuICAgICAgICAgICAgICAgIGNvbnN0IHNlc3Npb25JZCA9IHRoaXMuY29udGV4dC5zZXNzaW9uO1xuICAgICAgICAgICAgICAgIG9iamVjdC5kYXRhW3RoaXMuX2Ftb3JwaGljQ29udGV4dF0gPSB7IC4uLnRoaXMuY29udGV4dCB9O1xuICAgICAgICAgICAgICAgIGlmIChvYmplY3QuZGF0YVt0aGlzLl9hbW9ycGhpY0NvbnRleHRdICYmIHNlc3Npb25JZCkge1xuICAgICAgICAgICAgICAgICAgICBvYmplY3QuZGF0YVt0aGlzLl9hbW9ycGhpY0NvbnRleHRdLnNlc3Npb24gPSBzZXNzaW9uSWQ7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBvYmplY3QuZGF0YVt0aGlzLl9hbW9ycGhpY0NvbnRleHRdLnNlc3Npb247XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZ2V0QW1vcnBoaWNDb250ZXh0KCk6IGFueSB7XG4gICAgICAgIHJldHVybiB7IF9fYW1vcnBoaWNDb250ZXh0OiB7IC4uLnRoaXMuY29udGV4dCB9IH07XG4gICAgfVxuXG4gIC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HVucHJvY2Vzc2VkIHZlcnNpb24gb2YgXCJsb2dPYmplY3RcIiBwYXJhbVxuICAgICAqL1xuICAgIHByb3RlY3RlZCBzZW5kVG9Mb2cobG9nTGV2ZWwsIGxvZ09iamVjdCwgLi4ucmF3TG9nRGF0YSkge1xuICAgICAgICBjb25zdCBmdW5jdGlvbk5hbWUgPSB0aGlzLnNlbmRUb0xvZy5uYW1lO1xuICAgICAgICB0aGlzLmRlbGV0ZUVtcHR5TG9nUHJvcGVydGllcyhsb2dPYmplY3QpO1xuICAgICAgICBpZiAodGhpcy5fY2xpZW50TG9nZ2VyKSB7XG4gICAgICAgICAgICBsZXQgbGV2ZWxGb3JMb2cgPSB0eXBlb2YgbG9nTGV2ZWwgPT09ICdzdHJpbmcnID8gc3RyVG9MZXZlbFtsb2dMZXZlbF0gOiBsb2dMZXZlbDtcbiAgICAgICAgICAgIHN3aXRjaCAobGV2ZWxGb3JMb2cpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDEwOlxuICAgICAgICAgICAgICAgIGNhc2UgMjA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5kZWJ1Zyhsb2dPYmplY3QsIC4uLnJhd0xvZ0RhdGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgY2FzZSAzMDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY2xpZW50TG9nZ2VyLmluZm8obG9nT2JqZWN0LCAuLi5yYXdMb2dEYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGNhc2UgNDA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci53YXJuKGxvZ09iamVjdCwgLi4ucmF3TG9nRGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBjYXNlIDYwOlxuICAgICAgICAgICAgICAgIGNhc2UgNTA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5lcnJvcihsb2dPYmplY3QsIC4uLnJhd0xvZ0RhdGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgZGVmYXVsdDogXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5lcnJvcih7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGU6IFN1cGVydHlwZUxvZ2dlci5tb2R1bGVOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb246IGZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5OiAnbWlsZXN0b25lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdpbnZhbGlkIGxldmVsIHVzZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZ0xldmVsOiBsb2dMZXZlbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2dPYmplY3Q6IGxvZ09iamVjdFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNvbnNvbGUubG9nKHRoaXMucHJldHR5UHJpbnQobG9nTGV2ZWwsIGxvZ09iamVjdCkpOyAgICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuXG4gICAgcHJldHR5UHJpbnQobGV2ZWwsIGpzb24pIHtcbiAgICAgICAgbGV0IHNwbGl0ID0gdGhpcy5zcGxpdChqc29uLCB7dGltZTogMSwgbXNnOiAxLCBsZXZlbDogMSwgbmFtZTogMX0pO1xuXG4gICAgICAgIHJldHVybiB0aGlzLmZvcm1hdERhdGVUaW1lKGpzb24udGltZSA/IG5ldyBEYXRlKGpzb24udGltZSkgOiBuZXcgRGF0ZSgpKSArICc6ICcgK1xuICAgICAgICAgICAgbGV2ZWwudG9VcHBlckNhc2UoKSArICc6ICcgK1xuICAgICAgICAgICAgYWRkQ29sb25JZlRva2VuKHNwbGl0WzFdLm5hbWUsICc6ICcpICtcbiAgICAgICAgICAgIGFkZENvbG9uSWZUb2tlbihzcGxpdFsxXS5tc2csICc6ICcpICtcbiAgICAgICAgICAgIHh5KHNwbGl0WzBdKTtcblxuICAgICAgICBmdW5jdGlvbiBhZGRDb2xvbklmVG9rZW4gKHRva2VuLCBjb2xvbkFuZFNwYWNlKSB7XG4gICAgICAgICAgICBpZiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4gKyBjb2xvbkFuZFNwYWNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiB4eShqKSB7XG4gICAgICAgICAgICB2YXIgc3RyID0gJyc7XG4gICAgICAgICAgICB2YXIgc2VwID0gJyc7XG5cbiAgICAgICAgICAgIGZvciAodmFyIHByb3AgaW4gaikge1xuICAgICAgICAgICAgICAgIHN0ciArPSBzZXAgKyBwcm9wICsgJz0nICsgSlNPTi5zdHJpbmdpZnkoaltwcm9wXSk7XG4gICAgICAgICAgICAgICAgc2VwID0gJyAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc3RyLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJygnICsgc3RyICsgJyknO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwcml2YXRlIHNwbGl0KGpzb24sIHByb3BzKTogYW55W10ge1xuICAgICAgICBjb25zdCBhID0ge307XG4gICAgICAgIGNvbnN0IGIgPSB7fTtcblxuICAgICAgICBmb3IgKGNvbnN0IHByb3AgaW4ganNvbikge1xuICAgICAgICAgICAgKHByb3BzW3Byb3BdID8gYiA6IGEpW3Byb3BdID0ganNvbltwcm9wXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBbYSwgYl07XG4gICAgfVxuXG4gICAgLy8gTG9nZ2luZyBpcyBlbmFibGVkIGlmIGVpdGhlciB0aGUgbGV2ZWwgdGhyZXNob2xkIGlzIG1ldCBvciB0aGUgZ3JhbnVsYXIgbGV2ZWwgbWF0Y2hlc1xuICAgIHByaXZhdGUgaXNFbmFibGVkKGxldmVsLCBvYmopIHtcbiAgICAgICAgbGV2ZWwgPSBzdHJUb0xldmVsW2xldmVsXTtcblxuICAgICAgICBpZiAobGV2ZWwgPj0gc3RyVG9MZXZlbFt0aGlzLmxldmVsXSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5ncmFudWxhckxldmVscykge1xuICAgICAgICAgICAgZm9yIChsZXQgbGV2ZWxyIGluIHRoaXMuZ3JhbnVsYXJMZXZlbHMpIHtcbiAgICAgICAgICAgICAgICBpZiAob2JqW2xldmVscl0gJiYgb2JqW2xldmVscl0gPT0gdGhpcy5ncmFudWxhckxldmVsc1tsZXZlbHJdKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn0iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJ0eXBlTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1N1cGVydHlwZUxvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxJQUFNLFVBQVUsR0FBRyxFQUFFLEVBQUUsRUFBRSxPQUFP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250ZXh0O1xuXG4gICAgICAgIGRhdGEuZm9yRWFjaCgoYXJnLCBpbmRleCkgPT4ge1xuICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwICYmIGlzT2JqZWN0KGFyZykpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHByb3BlciBpbiBhcmcpIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqW3Byb3Blcl0gPSBhcmdbcHJvcGVyXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBtc2cgKz0gYCR7YXJnfSBgO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICBpZiAob2JqLm1zZy5sZW5ndGgpIHtcbiAgICAgICAgICAgIG9iai5tc2cgKz0gJyAnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1zZy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChvYmoubW9kdWxlICYmIG9iai5hY3Rpdml0eSkge1xuICAgICAgICAgICAgICAgIG9iai5tc2cgKz0gYCR7b2JqLm1vZHVsZX1bJHtvYmouYWN0aXZpdHl9XSAtIGA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG9iai5tc2cgKz0gbXNnO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKG9iai5tb2R1bGUgJiYgb2JqLmFjdGl2aXR5KSB7XG4gICAgICAgICAgICBvYmoubXNnICs9IGAke29iai5tb2R1bGV9WyR7b2JqLmFjdGl2aXR5fV1gO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuaXNFbmFibGVkKGxldmVsVG9TdHJbb2JqLmxldmVsXSwgb2JqKSkge1xuICAgICAgICAgICAgdGhpcy5zZW5kVG9Mb2cobGV2ZWxUb1N0cltvYmoubGV2ZWxdLCBvYmosIC4uLmRhdGEpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc3RhcnRDb250ZXh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0V4cC4kMV0gPSBSZWdFeHAuJDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxldmVsID0gbGV2ZWxzW2l4XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxldmVsID0gbGV2ZWxhO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmVtb3ZlIGFueSBwcm9wZXJ0aWVzIHJlY29yZGVkIGJ5IHNldENvbnRleHRcbiAgICBjbGVhckNvbnRleHRQcm9wcyhjb250ZXh0VG9DbGVhcikge1xuICAgICAgICBmb3IgKGNvbnN0IHByb3AgaW4gY29udGV4dFRvQ2xlYXIpIHtcbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvbnRleHRbcHJvcF07XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBDcmVhdGUgYSBuZXcgbG9nZ2VyIGFuZCBjb3B5IG92ZXIgaXQncyBjb250ZXh0XG4gICAgY3JlYXRlQ2hpbGRMb2dnZXIoY29udGV4dCk6IFN1cGVydHlwZUxvZ2dlciB7XG4gICAgICAgIGxldCBjaGlsZDogeyBba2V5OiBzdHJpbmddOiBhbnkgfSA9IHt9O1xuXG4gICAgICAgIGZvciAobGV0IHByb3AgaW4gdGhpcykge1xuICAgICAgICAgICAgY2hpbGRbcHJvcF0gPSB0aGlzW3Byb3BdO1xuICAgICAgICB9XG5cbiAgICAgICAgY2hpbGQuY29udGV4dCA9IGNvbnRleHQgfHwge307XG5cbiAgICAgICAgZm9yIChsZXQgcHJvcGVyIGluIHRoaXMuY29udGV4dCkge1xuICAgICAgICAgICAgY2hpbGQuY29udGV4dFtwcm9wZXJdID0gdGhpcy5jb250ZXh0W3Byb3Blcl07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY2hpbG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lZCBhbmQgdW5wcm9jZXNzZWQgdmVyc2lvbiBvZiBcImxvZ09iamVjdFwiIHBhcmFtXG4gICAgICovXG4gICAgcHJvdGVjdGVkIHNlbmRUb0xvZyhsb2dMZXZlbCwgbG9nT2JqZWN0LCAuLi5yYXdMb2dEYXRhKSB7XG4gICAgICAgIGNvbnNvbGUubG9nKHRoaXMucHJldHR5UHJpbnQobG9nTGV2ZWwsIGxvZ09iamVjdCkpOyAgICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuXG4gICAgcHJldHR5UHJpbnQobGV2ZWwsIGpzb24pIHtcbiAgICAgICAgbGV0IHNwbGl0ID0gdGhpcy5zcGxpdChqc29uLCB7dGltZTogMSwgbXNnOiAxLCBsZXZlbDogMSwgbmFtZTogMX0pO1xuXG4gICAgICAgIHJldHVybiB0aGlzLmZvcm1hdERhdGVUaW1lKG5ldyBEYXRlKGpzb24udGltZSkpICsgJzogJyArXG4gICAgICAgICAgICBsZXZlbC50b1VwcGVyQ2FzZSgpICsgJzogJyArXG4gICAgICAgICAgICBhZGRDb2xvbklmVG9rZW4oc3BsaXRbMV0ubmFtZSwgJzogJykgK1xuICAgICAgICAgICAgYWRkQ29sb25JZlRva2VuKHNwbGl0WzFdLm1zZywgJzogJykgK1xuICAgICAgICAgICAgeHkoc3BsaXRbMF0pO1xuXG4gICAgICAgIGZ1bmN0aW9uIGFkZENvbG9uSWZUb2tlbiAodG9rZW4sIGNvbG9uQW5kU3BhY2UpIHtcbiAgICAgICAgICAgIGlmICh0b2tlbikge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbiArIGNvbG9uQW5kU3BhY2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHh5KGopIHtcbiAgICAgICAgICAgIHZhciBzdHIgPSAnJztcbiAgICAgICAgICAgIHZhciBzZXAgPSAnJztcblxuICAgICAgICAgICAgZm9yICh2YXIgcHJvcCBpbiBqKSB7XG4gICAgICAgICAgICAgICAgc3RyICs9IHNlcCArIHByb3AgKyAnPScgKyBKU09OLnN0cmluZ2lmeShqW3Byb3BdKTtcbiAgICAgICAgICAgICAgICBzZXAgPSAnICc7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzdHIubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnKCcgKyBzdHIgKyAnKSc7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHByaXZhdGUgc3BsaXQoanNvbiwgcHJvcHMpOiBhbnlbXSB7XG4gICAgICAgIGNvbnN0IGEgPSB7fTtcbiAgICAgICAgY29uc3QgYiA9IHt9O1xuXG4gICAgICAgIGZvciAoY29uc3QgcHJvcCBpbiBqc29uKSB7XG4gICAgICAgICAgICAocHJvcHNbcHJvcF0gPyBiIDogYSlbcHJvcF0gPSBqc29uW3Byb3BdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIFthLCBiXTtcbiAgICB9XG5cbiAgICAvLyBMb2dnaW5nIGlzIGVuYWJsZWQgaWYgZWl0aGVyIHRoZSBsZXZlbCB0aHJlc2hvbGQgaXMgbWV0IG9yIHRoZSBncmFudWxhciBsZXZlbCBtYXRjaGVzXG4gICAgcHJpdmF0ZSBpc0VuYWJsZWQobGV2ZWwsIG9iaikge1xuICAgICAgICBsZXZlbCA9IHN0clRvTGV2ZWxbbGV2ZWxdO1xuXG4gICAgICAgIGlmIChsZXZlbCA+PSBzdHJUb0xldmVsW3RoaXMubGV2ZWxdKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmdyYW51bGFyTGV2ZWxzKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBsZXZlbHIgaW4gdGhpcy5ncmFudWxhckxldmVscykge1xuICAgICAgICAgICAgICAgIGlmIChvYmpbbGV2ZWxyXSAmJiBvYmpbbGV2ZWxyXSA9PSB0aGlzLmdyYW51bGFyTGV2ZWxzW2xldmVscl0pIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufSJdfQ==
{
"name": "@haventech/supertype",
"description": "A type system for classical inheritence, mix-ins and composition.",
"version": "6.0.0-beta.8",
"version": "6.0.0-beta.n1",
"main": "dist/index.js",

@@ -17,3 +17,3 @@ "types": "dist/index.d.ts",

"@types/nconf": "^0.10.0",
"@types/node": "16.11.22",
"@types/node": "14.18.33",
"chai": "4.3.6",

@@ -26,3 +26,3 @@ "eslint": "8.8.0",

"ts-node": "10.5.0",
"typescript": "3.9.10"
"typescript": "4.9.3"
},

@@ -29,0 +29,0 @@ "scripts": {

@@ -128,3 +128,2 @@ import * as serializer from './serializer';

static amorphicStatic = ObjectTemplate;
private static moduleName = ObjectTemplate.name;

@@ -306,3 +305,2 @@ // Nconf is the SupertypeConfig object for this app, and configStore is the list of AppConfigs

static extend(parentTemplate, name: string | CreateTypeForName, properties) {
const functionName = this.extend.name;
let props;

@@ -337,8 +335,3 @@ let createProps;

// eslint-disable-next-line no-console
this.logger.warn({
module: this.moduleName,
function: functionName,
category: 'milestone',
message: `WARN: Attempt to extend ${parentTemplate.__name__} as ${name} but ${name} was already extended from ${existingTemplate.__parent__.__name__}`
});
console.log(`WARN: Attempt to extend ${parentTemplate.__name__} as ${name} but ${name} was already extended from ${existingTemplate.__parent__.__name__}`);
}

@@ -1244,5 +1237,4 @@ }

createTemplateNow, mixinTemplate) {
const moduleName = bindParams.name;
function template() {
const functionName = template.name;
objectTemplate.createIfNeeded(template, this);

@@ -1273,8 +1265,3 @@ let templateRef: ConstructorType = <ConstructorType><Function>template;

} catch (e) {
objectTemplate.logger.error({
module: moduleName,
const: functionName,
category: 'milestone',
error: e
});
console.log(e); // eslint-disable-line no-console
}

@@ -1281,0 +1268,0 @@

const levelToStr = { 60: 'fatal', 50: 'error', 40: 'warn', 30: 'info', 20: 'debug', 10: 'trace' };
const strToLevel = { 'fatal': 60, 'error': 50, 'warn': 40, 'info': 30, 'debug': 20, 'trace': 10 };
function isObject(obj) {
return obj != null
&& typeof (obj) === 'object'
&& !(obj instanceof Array)
&& !(obj instanceof Date)
&& !(obj instanceof Error);
}
type LoggerFunction = (logLevel: string, logObject: any, ...rawLogData) => void;
type LogObject = {
level: string | number;
time: string;
msg: string;
module?: any;
activity?: any;
__amorphicContext: any;
};
export class SupertypeLogger {
static moduleName: string = SupertypeLogger.name;
private _amorphicContext = '__amorphicContext';
context: any;
granularLevels: any;
level: any;
private _clientLogger: any;

@@ -38,7 +54,5 @@ // for overriding

}
debug(...data: any[]): void {
this.log(20, ...data);
}
trace(...data: any[]): void {

@@ -48,80 +62,61 @@ this.log(10, ...data);

get clientLogger() {
return this._clientLogger;
}
/**
* assign a custom send to log functionality.
* @param logger - logger must fit the format of info/error/debug/warn
* @param {(level: string, data: any) => void} loggerFunction
*/
setLogger(logger) {
if (typeof logger.info !== 'function' ||
typeof logger.error !== 'function' ||
typeof logger.debug !== 'function' ||
typeof logger.warn !== 'function') {
throw new Error('Please specify a logger with the info, error, debug, and warn functions');
}
if (typeof logger.childLogger === 'function') {
this._clientLogger = logger.childLogger({error: {isHumanRelated: false}});
return;
}
if (typeof logger.child === 'function') {
this._clientLogger = logger.child();
return;
}
this._clientLogger = logger;
setLogger(loggerFunction: LoggerFunction) {
this.sendToLog = loggerFunction;
}
// Log all arguments assuming the first one is level and the second one might be an object (similar to banyan)
private log(level: number, ...args: any[]): void {
const properties: any[] = args && Array.isArray(args) ? args.slice() : args;
private log(level: number, ...data: any[]): void {
let msg = '';
const obj: LogObject = {
time: (new Date()).toISOString(),
msg: '',
level: 'info', //default info
__amorphicContext: {}
};
if (typeof properties[0] === 'object') {
let logObj = properties[0];
if (!logObj.data) {
logObj.data = {};
const amorphicContext = {};
// Copy amorphic context into the data
for (const prop in this.context) {
obj[prop] = this.context[prop];
amorphicContext[prop] = this.context[prop];
}
obj.level = level;
obj.__amorphicContext = amorphicContext;
data.forEach((arg, index) => {
if (index === 0 && isObject(arg)) {
for (const proper in arg) {
obj[proper] = arg[proper];
}
}
if (!logObj.context) {
logObj.context = {};
else {
msg += `${arg} `;
}
});
this.setLogsAmorphicContext(logObj.context);
if (obj.msg.length) {
obj.msg += ' ';
}
logObj['level'] = level;
if (this.isEnabled(levelToStr[logObj['level']], logObj)) {
this.sendToLog(levelToStr[logObj['level']], logObj, ...properties.slice(1));
if (msg.length) {
if (obj.module && obj.activity) {
obj.msg += `${obj.module}[${obj.activity}] - `;
}
return;
}
properties['level'] = level;
if (this.isEnabled(levelToStr[properties['level']], properties)) {
this.sendToLog(levelToStr[properties['level']], properties);
obj.msg += msg;
}
return;
}
else if (obj.module && obj.activity) {
obj.msg += `${obj.module}[${obj.activity}]`;
}
//This method extracts sessionId from the each request's context
//and places it in the context.sessionId. All other context properties are
//placed in context.data object.
private setLogsAmorphicContext(object) {
if (this.context && Object.keys(this.context).length > 0) {
if (!object.data) {
object.data = {};
}
if (typeof object.data === 'object'){
const sessionId = this.context.session;
object.data[this._amorphicContext] = { ...this.context };
if (object.data[this._amorphicContext] && sessionId) {
object.data[this._amorphicContext].session = sessionId;
delete object.data[this._amorphicContext].session;
}
}
if (this.isEnabled(levelToStr[obj.level], obj)) {
this.sendToLog(levelToStr[obj.level], obj, ...data);
}
}
getAmorphicContext(): any {
return { __amorphicContext: { ...this.context } };
}
startContext(context) {

@@ -172,3 +167,3 @@ this.context = context;

// Create a new logger and copy over it's context
createChildLogger(context, rootValues?, dataValues?): SupertypeLogger {
createChildLogger(context): SupertypeLogger {
let child: { [key: string]: any } = {};

@@ -185,13 +180,2 @@

}
if (this._clientLogger) {
let childLogger;
if (this._clientLogger.childLogger === 'function') {
childLogger = this._clientLogger.childLogger(rootValues, dataValues);
child = childLogger;
}
else if (this._clientLogger.child === 'function') {
childLogger = this._clientLogger.child({...rootValues, data: {dataValues}});
child = childLogger;
}
}

@@ -215,11 +199,2 @@ return child as SupertypeLogger; // bad practice but should fix

private deleteEmptyLogProperties(logObject: any) {
const keys = ['context', 'data'];
keys.forEach((key) => {
if (logObject[key] && Object.keys(logObject[key]).length < 1) {
delete logObject[key];
}
})
}
/**

@@ -233,35 +208,2 @@ * this function is designed to be replaced by the consumer of this class.

protected sendToLog(logLevel, logObject, ...rawLogData) {
const functionName = this.sendToLog.name;
this.deleteEmptyLogProperties(logObject);
if (this._clientLogger) {
let levelForLog = typeof logLevel === 'string' ? strToLevel[logLevel] : logLevel;
switch (levelForLog) {
case 10:
case 20:
this._clientLogger.debug(logObject, ...rawLogData);
return;
case 30:
this._clientLogger.info(logObject, ...rawLogData);
return;
case 40:
this._clientLogger.warn(logObject, ...rawLogData);
return;
case 60:
case 50:
this._clientLogger.error(logObject, ...rawLogData);
return;
default:
this._clientLogger.error({
module: SupertypeLogger.moduleName,
function: functionName,
category: 'milestone',
message: 'invalid level used',
data: {
logLevel: logLevel,
logObject: logObject
}
});
return;
}
}
console.log(this.prettyPrint(logLevel, logObject)); // eslint-disable-line no-console

@@ -273,3 +215,3 @@ }

return this.formatDateTime(json.time ? new Date(json.time) : new Date()) + ': ' +
return this.formatDateTime(new Date(json.time)) + ': ' +
level.toUpperCase() + ': ' +

@@ -276,0 +218,0 @@ addColonIfToken(split[1].name, ': ') +

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc