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.7 to 6.0.0-beta.8

1

dist/SupertypeLogger.d.ts

@@ -22,3 +22,2 @@ export declare class SupertypeLogger {

private log;
private setLogsSessionId;
private setLogsAmorphicContext;

@@ -25,0 +24,0 @@ getAmorphicContext(): any;

27

dist/SupertypeLogger.js

@@ -119,4 +119,3 @@ "use strict";

}
this.setLogsAmorphicContext(logObj.data);
this.setLogsSessionId(logObj);
this.setLogsAmorphicContext(logObj.context);
logObj['level'] = level;

@@ -134,12 +133,18 @@ if (this.isEnabled(levelToStr[logObj['level']], logObj)) {

};
SupertypeLogger.prototype.setLogsSessionId = function (logObj) {
var _a, _b;
if ((_b = (_a = logObj.data) === null || _a === void 0 ? void 0 : _a.__amorphicContext) === null || _b === void 0 ? void 0 : _b.session) {
logObj.context.sessionId = logObj.data.__amorphicContext.session;
delete logObj.data.__amorphicContext.session;
}
};
//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) {
object[this._amorphicContext] = __assign({}, this.context);
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;
}
}
}

@@ -329,2 +334,2 @@ };

exports.SupertypeLogger = SupertypeLogger;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJ0eXBlTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4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AgIGlmICh0eXBlb2YgcHJvcGVydGllc1swXSA9PT0gJ29iamVjdCcpICB7XG4gICAgICAgICAgICBsZXQgbG9nT2JqID0gcHJvcGVydGllc1swXTtcbiAgICAgICAgICAgIGlmICghbG9nT2JqLmRhdGEpIHtcbiAgICAgICAgICAgICAgICBsb2dPYmouZGF0YSA9IHt9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFsb2dPYmouY29udGV4dCkge1xuICAgICAgICAgICAgICAgIGxvZ09iai5jb250ZXh0ID0ge307XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuc2V0TG9nc0Ftb3JwaGljQ29udGV4dChsb2dPYmouZGF0YSk7XG4gICAgICAgICAgICB0aGlzLnNldExvZ3NTZXNzaW9uSWQobG9nT2JqKTtcblxuICAgICAgICAgICAgbG9nT2JqWydsZXZlbCddID0gbGV2ZWw7XG4gICAgICAgICAgICBpZiAodGhpcy5pc0VuYWJsZWQobGV2ZWxUb1N0cltsb2dPYmpbJ2xldmVsJ11dLCBsb2dPYmopKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZW5kVG9Mb2cobGV2ZWxUb1N0cltsb2dPYmpbJ2xldmVsJ11dLCBsb2dPYmosIC4uLnByb3BlcnRpZXMuc2xpY2UoMSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgcHJvcGVydGllc1snbGV2ZWwnXSA9IGxldmVsO1xuICAgICAgICBpZiAodGhpcy5pc0VuYWJsZWQobGV2ZWxUb1N0cltwcm9wZXJ0aWVzWydsZXZlbCddXSwgcHJvcGVydGllcykpIHtcbiAgICAgICAgICAgIHRoaXMuc2VuZFRvTG9nKGxldmVsVG9TdHJbcHJvcGVydGllc1snbGV2ZWwnXV0sIHByb3BlcnRpZXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICBwcml2YXRlIHNldExvZ3NTZXNz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AgICAgICAgICAgcmV2ZXJzZVtwcm9wXSA9IHRydWU7XG4gICAgICAgICAgICB0aGlzLmNvbnRleHRbcHJvcF0gPSBjb250ZXh0W3Byb3BdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJldmVyc2U7XG4gICAgfVxuICAgIC8vIFBhcnNlIGxvZyBsZXZlbHMgc3VjaCBhcyB3YXJuLmFjdGl2aXR5XG4gICAgc2V0TGV2ZWwobGV2ZWwpIHtcbiAgICAgICAgdmFyIGxldmVscyA9IGxldmVsLnNwbGl0KCc7Jyk7XG5cbiAgICAgICAgZm9yICh2YXIgaXggPSAwOyBpeCA8IGxldmVscy5sZW5ndGg7ICsraXgpIHtcbiAgICAgICAgICAgIHZhciBsZXZlbGEgPSBsZXZlbHNbaXhdO1xuXG4gICAgICAgICAgICBpZiAobGV2ZWxhLm1hdGNoKC86LykpIHtcbiAgICAgICAgICAgICAgICBpZiAobGV2ZWxzW2l4XS5tYXRjaCgvKC4qKTooLiopLykpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ncmFudWxhckxldmVsc1tSZWdFeHAuJDFdID0gdGhpcy5ncmFudWxhckxldmVsc1tSZWdFeHAuJDFdIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmdyYW51bGFyTGV2ZWxzW1JlZ0V4cC4kMV0gPSBSZWdFeHAuJDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxldmVsID0gbGV2ZWxzW2l4XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxldmVsID0gbGV2ZWxhO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gUmVtb3ZlIGFueSBwcm9wZXJ0aWVzIHJlY29yZGVkIGJ5IHNldENvbnRleHRcbiA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lb2YgbG9nTGV2ZWwgPT09ICdzdHJpbmcnID8gc3RyVG9MZXZlbFtsb2dMZXZlbF0gOiBsb2dMZXZlbDtcbiAgICAgICAgICAgIHN3aXRjaCAobGV2ZWxGb3JMb2cpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDEwOlxuICAgICAgICAgICAgICAgIGNhc2UgMjA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5kZWJ1Zyhsb2dPYmplY3QsIC4uLnJhd0xvZ0RhdGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgY2FzZSAzMDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY2xpZW50TG9nZ2VyLmluZm8obG9nT2JqZWN0LCAuLi5yYXdMb2dEYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGNhc2UgNDA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci53YXJuKGxvZ09iamVjdCwgLi4ucmF3TG9nRGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBjYXNlIDYwOlxuICAgICAgICAgICAgICAgIGNhc2UgNTA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5lcnJvcihsb2dPYmplY3QsIC4uLnJhd0xvZ0RhdGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgZGVmYXVsdDogXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5lcnJvcih7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGU6IFN1cGVydHlwZUxvZ2dlci5tb2R1bGVOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb246IGZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5OiAnbWlsZXN0b25lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdpbnZhbGlkIGxldmVsIHVzZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZ0xldmVsOiBsb2dMZXZlbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2dPYmplY3Q6IGxvZ09iamVjdFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNvbnNvbGUubG9nKHRoaXMucHJldHR5UHJpbnQobG9nTGV2ZWwsIGxvZ09iamVjdCkpOyAgICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuXG4gICAgcHJldHR5UHJpbnQobGV2ZWwsIGpzb24pIHtcbiAgICAgICAgbGV0IHNwbGl0ID0gdGhpcy5zcGxpdChqc29uLCB7dGltZTogMSwgbXNnOiAxLCBsZXZlbDogMSwgbmFtZTogMX0pO1xuXG4gICAgICAgIHJldHVybiB0aGlzLmZvcm1hdERhdGVUaW1lKGpzb24udGltZSA/IG5ldyBEYXRlKGpzb24udGltZSkgOiBuZXcgRGF0ZSgpKSArICc6ICcgK1xuICAgICAgICAgICAgbGV2ZWwudG9VcHBlckNhc2UoKSArICc6ICcgK1xuICAgICAgICAgICAgYWRkQ29sb25JZlRva2VuKHNwbGl0WzFdLm5hbWUsICc6ICcpICtcbiAgICAgICAgICAgIGFkZENvbG9uSWZUb2tlbihzcGxpdFsxXS5tc2csICc6ICcpICtcbiAgICAgICAgICAgIHh5KHNwbGl0WzBdKTtcblxuICAgICAgICBmdW5jdGlvbiBhZGRDb2xvbklmVG9rZW4gKHRva2VuLCBjb2xvbkFuZFNwYWNlKSB7XG4gICAgICAgICAgICBpZiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4gKyBjb2xvbkFuZFNwYWNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiB4eShqKSB7XG4gICAgICAgICAgICB2YXIgc3RyID0gJyc7XG4gICAgICAgICAgICB2YXIgc2VwID0gJyc7XG5cbiAgICAgICAgICAgIGZvciAodmFyIHByb3AgaW4gaikge1xuICAgICAgICAgICAgICAgIHN0ciArPSBzZXAgKyBwcm9wICsgJz0nICsgSlNPTi5zdHJpbmdpZnkoaltwcm9wXSk7XG4gICAgICAgICAgICAgICAgc2VwID0gJyAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc3RyLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJygnICsgc3RyICsgJyknO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwcml2YXRlIHNwbGl0KGpzb24sIHByb3BzKTogYW55W10ge1xuICAgICAgICBjb25zdCBhID0ge307XG4gICAgICAgIGNvbnN0IGIgPSB7fTtcblxuICAgICAgICBmb3IgKGNvbnN0IHByb3AgaW4ganNvbikge1xuICAgICAgICAgICAgKHByb3BzW3Byb3BdID8gYiA6IGEpW3Byb3BdID0ganNvbltwcm9wXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBbYSwgYl07XG4gICAgfVxuXG4gICAgLy8gTG9nZ2luZyBpcyBlbmFibGVkIGlmIGVpdGhlciB0aGUgbGV2ZWwgdGhyZXNob2xkIGlzIG1ldCBvciB0aGUgZ3JhbnVsYXIgbGV2ZWwgbWF0Y2hlc1xuICAgIHByaXZhdGUgaXNFbmFibGVkKGxldmVsLCBvYmopIHtcbiAgICAgICAgbGV2ZWwgPSBzdHJUb0xldmVsW2xldmV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Y29udGV4dCAmJiBPYmplY3Qua2V5cyh0aGlzLmNvbnRleHQpLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGlmICghb2JqZWN0LmRhdGEpIHtcbiAgICAgICAgICAgICAgICBvYmplY3QuZGF0YSA9IHt9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBvYmplY3QuZGF0YSA9PT0gJ29iamVjdCcpe1xuICAgICAgICAgICAgICAgIGNvbnN0IHNlc3Npb25JZCA9IHRoaXMuY29udGV4dC5zZXNzaW9uO1xuICAgICAgICAgICAgICAgIG9iamVjdC5kYXRhW3RoaXMuX2Ftb3JwaGljQ29udGV4dF0gPSB7IC4uLnRoaXMuY29udGV4dCB9O1xuICAgICAgICAgICAgICAgIGlmIChvYmplY3QuZGF0YVt0aGlzLl9hbW9ycGhpY0NvbnRleHRdICYmIHNlc3Npb25JZCkge1xuICAgICAgICAgICAgICAgICAgICBvYmplY3QuZGF0YVt0aGlzLl9hbW9ycGhpY0NvbnRleHRdLnNlc3Npb24gPSBzZXNzaW9uSWQ7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBvYmplY3QuZGF0YVt0aGlzLl9hbW9ycGhpY0NvbnRleHRdLnNlc3Npb247XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZ2V0QW1vcnBoaWNDb250ZXh0KCk6IGFueSB7XG4gICAgICAgIHJldHVybiB7IF9fYW1vcnBoaWNDb250ZXh0OiB7IC4uLnRoaXMuY29udGV4dCB9IH07XG4gICAgfVxuXG4gICAgc3RhcnRDb250ZXh0KGNvbnRleHQpIHtcbiAgICAgICAgdGhpcy5jb250ZXh0ID0gY29udGV4dDtcbiAgICB9XG5cbiAgICAvLyBTYXZlIHRoZSBwcm9wZXJ0aWVzIGluIHRoZSBjb250ZXh0IGFuZCByZXR1cm4gYSBuZXcgb2JqZWN0IHRoYXQgaGFzIHRoZSBwcm9wZXJ0aWVzIG9ubHkgc28gdGhleSBjYW4gYmUgY2xlYXJlZFxuICAgIHNldENvbnRleHRQcm9wcyhjb250ZXh0KSB7XG4gICAgICAgIGNvbnN0IHJldmVyc2UgPSB7fTtcblxuICAgICAgICBmb3IgKGNvbnN0IHByb3AgaW4gY29udGV4dCkge1xuICAgICAgICAgICAgcmV2ZXJzZVtwcm9wXSA9IHRydWU7XG4gICAgICAgICAgICB0aGlzLmNvbnRleHRbcHJvcF0gPSBjb250ZXh0W3Byb3BdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJldmVyc2U7XG4gICAgfVxuICAgIC8vIFBhcnNlIGxvZyBsZXZlbHMgc3VjaCBhcyB3YXJuLmFjdGl2aXR5XG4gICAgc2V0TGV2ZWwobGV2ZWwpIHtcbiAgICAgICAgdmFyIGxldmVscyA9IGxldmVsLnNwbGl0KCc7Jyk7XG5cbiAgICAgICAgZm9yICh2YXIgaXggPSAwOyBpeCA8IGxldmVscy5sZW5ndGg7ICsraXgpIHtcbiAgICAgICAgICAgIHZhciBsZXZlbGEgPSBsZXZlbHNbaXhdO1xuXG4gICAgICAgICAgICBpZiAobGV2ZWxhLm1hdGNoKC86LykpIHtcbiAgICAgICAgICAgICAgICBpZiAobGV2ZWxzW2l4XS5tYXRjaCgvKC4qKTooLiopLykpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ncmFudWxhckxldmVsc1tSZWdFeHAuJDFdID0gdGhpcy5ncmFudWxhckxldmVsc1tSZWdFeHAuJDFdIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmdyYW51bGFyTGV2ZWxzW1JlZ0V4cC4kMV0gPSBSZWdFeHAuJDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxldmVsID0gbGV2ZWxzW2l4XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAg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lbmRUb0xvZy5uYW1lO1xuICAgICAgICB0aGlzLmRlbGV0ZUVtcHR5TG9nUHJvcGVydGllcyhsb2dPYmplY3QpO1xuICAgICAgICBpZiAodGhpcy5fY2xpZW50TG9nZ2VyKSB7XG4gICAgICAgICAgICBsZXQgbGV2ZWxGb3JMb2cgPSB0eXBlb2YgbG9nTGV2ZWwgPT09ICdzdHJpbmcnID8gc3RyVG9MZXZlbFtsb2dMZXZlbF0gOiBsb2dMZXZlbDtcbiAgICAgICAgICAgIHN3aXRjaCAobGV2ZWxGb3JMb2cpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDEwOlxuICAgICAgICAgICAgICAgIGNhc2UgMjA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5kZWJ1Zyhsb2dPYmplY3QsIC4uLnJhd0xvZ0RhdGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgY2FzZSAzMDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY2xpZW50TG9nZ2VyLmluZm8obG9nT2JqZWN0LCAuLi5yYXdMb2dEYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIGNhc2UgNDA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci53YXJuKGxvZ09iamVjdCwgLi4ucmF3TG9nRGF0YSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICBjYXNlIDYwOlxuICAgICAgICAgICAgICAgIGNhc2UgNTA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5lcnJvcihsb2dPYmplY3QsIC4uLnJhd0xvZ0RhdGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgZGVmYXVsdDogXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NsaWVudExvZ2dlci5lcnJvcih7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGU6IFN1cGVydHlwZUxvZ2dlci5tb2R1bGVOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb246IGZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5OiAnbWlsZXN0b25lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdpbnZhbGlkIGxldmVsIHVzZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZ0xldmVsOiBsb2dMZXZlbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2dPYmplY3Q6IGxvZ09iamVjdFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNvbnNvbGUubG9nKHRoaXMucHJldHR5UHJpbnQobG9nTGV2ZWwsIGxvZ09iamVjdCkpOyAgICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuXG4gICAgcHJldHR5UHJpbnQobGV2ZWwsIGpzb24pIHtcbiAgICAgICAgbGV0IHNwbGl0ID0gdGhpcy5zcGxpdChqc29uLCB7dGltZTogMSwgbXNnOiAxLCBsZXZlbDogMSwgbmFtZTogMX0pO1xuXG4gICAgICAgIHJldHVybiB0aGlzLmZvcm1hdERhdGVUaW1lKGpzb24udGltZSA/IG5ldyBEYXRlKGpzb24udGltZSkgOiBuZXcgRGF0ZSgpKSArICc6ICcgK1xuICAgICAgICAgICAgbGV2ZWwudG9VcHBlckNhc2UoKSArICc6ICcgK1xuICAgICAgICAgICAgYWRkQ29sb25JZlRva2VuKHNwbGl0WzFdLm5hbWUsICc6ICcpICtcbiAgICAgICAgICAgIGFkZENvbG9uSWZUb2tlbihzcGxpdFsxXS5tc2csICc6ICcpICtcbiAgICAgICAgICAgIHh5KHNwbGl0WzBdKTtcblxuICAgICAgICBmdW5jdGlvbiBhZGRDb2xvbklmVG9rZW4gKHRva2VuLCBjb2xvbkFuZFNwYWNlKSB7XG4gICAgICAgICAgICBpZiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4gKyBjb2xvbkFuZFNwYWNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiB4eShqKSB7XG4gICAgICAgICAgICB2YXIgc3RyID0gJyc7XG4gICAgICAgICAgICB2YXIgc2VwID0gJyc7XG5cbiAgICAgICAgICAgIGZvciAodmFyIHByb3AgaW4gaikge1xuICAgICAgICAgICAgICAgIHN0ciArPSBzZXAgKyBwcm9wICsgJz0nICsgSlNPTi5zdHJpbmdpZnkoaltwcm9wXSk7XG4gICAgICAgICAgICAgICAgc2VwID0gJyAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc3RyLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJygnICsgc3RyICsgJyknO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwcml2YXRlIHNwbGl0KGpzb24sIHByb3BzKTogYW55W10ge1xuICAgICAgICBjb25zdCBhID0ge307XG4gICAgICAgIGNvbnN0IGIgPSB7fTtcblxuICAgICAgICBmb3IgKGNvbnN0IHByb3AgaW4ganNvbikge1xuICAgICAgICAgICAgKHByb3BzW3Byb3BdID8gYiA6IGEpW3Byb3BdID0ganNvbltwcm9wXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBbYSwgYl07XG4gICAgfVxuXG4gICAgLy8gTG9nZ2luZyBpcyBlbmFibGVkIGlmIGVpdGhlciB0aGUgbGV2ZWwgdGhyZXNob2xkIGlzIG1ldCBvciB0aGUgZ3JhbnVsYXIgbGV2ZWwgbWF0Y2hlc1xuICAgIHByaXZhdGUgaXNFbmFibGVkKGxldmVsLCBvYmopIHtcbiAgICAgICAgbGV2ZWwgPSBzdHJUb0xldmVsW2xldmVsXTtcblxuICAgICAgICBpZiAobGV2ZWwgPj0gc3RyVG9MZXZlbFt0aGlzLmxldmVsXSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5ncmFudWxhckxldmVscykge1xuICAgICAgICAgICAgZm9yIChsZXQgbGV2ZWxyIGluIHRoaXMuZ3JhbnVsYXJMZXZlbHMpIHtcbiAgICAgICAgICAgICAgICBpZiAob2JqW2xldmVscl0gJiYgb2JqW2xldmVscl0gPT0gdGhpcy5ncmFudWxhckxldmVsc1tsZXZlbHJdKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn0iXX0=
{
"name": "@haventech/supertype",
"description": "A type system for classical inheritence, mix-ins and composition.",
"version": "6.0.0-beta.7",
"version": "6.0.0-beta.8",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

@@ -86,4 +86,3 @@ const levelToStr = { 60: 'fatal', 50: 'error', 40: 'warn', 30: 'info', 20: 'debug', 10: 'trace' };

this.setLogsAmorphicContext(logObj.data);
this.setLogsSessionId(logObj);
this.setLogsAmorphicContext(logObj.context);

@@ -104,12 +103,18 @@ logObj['level'] = level;

private setLogsSessionId(logObj: any) {
if (logObj.data?.__amorphicContext?.session) {
logObj.context.sessionId = logObj.data.__amorphicContext.session;
delete logObj.data.__amorphicContext.session;
}
}
//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) {
object[this._amorphicContext] = { ...this.context };
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;
}
}
}

@@ -116,0 +121,0 @@ }

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