You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@betit/orion-node-sdk

Package Overview
Dependencies
Maintainers
50
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betit/orion-node-sdk - npm Package Compare versions

Comparing version

to
3.1.0

.idea/codeStyles/codeStyleConfig.xml

5

lib/logger/message.d.ts

@@ -11,5 +11,9 @@ import { Logger, Message as MessageInterface } from '../types/interfaces';

private _stack;
private _error;
private _args;
constructor(_client: Logger, _host: string, _message: string);
setLevel(level: number): this;
/**
* @deprecated
*/
setLOC(err: Error): this;

@@ -19,3 +23,4 @@ setId(id: string): this;

setMap(params: object): this;
setError(err: Error): this;
send(): void;
}

20

lib/logger/message.js

@@ -14,2 +14,5 @@ "use strict";

}
/**
* @deprecated
*/
setLOC(err) {

@@ -35,2 +38,12 @@ const LOC = index_1.getLineFromError(err);

}
setError(err) {
const parsed = index_1.parseError(err);
const error = {
message: parsed.message,
stack: parsed.stack,
code: parsed.code,
};
this._error = JSON.stringify(error);
return this;
}
send() {

@@ -48,8 +61,5 @@ let m = {

}
if (this._loc !== undefined) {
m.loc = this._loc;
if (this._error !== undefined) {
m.error = this._error;
}
if (this._stack !== undefined) {
m.stack = this._stack;
}
if (this._id !== undefined) {

@@ -56,0 +66,0 @@ m['x-trace-id'] = this._id;

@@ -39,2 +39,3 @@ import { Request } from '../request/request';

setLOC(err: Error): this;
setError(err: Error): this;
send(): any;

@@ -41,0 +42,0 @@ }

@@ -17,3 +17,4 @@ import { OrionError } from '../error/error';

};
export declare function parseError(err: Error): any;
export declare function StringifyError(e: Error | OrionError): string;
export declare function sleep(ms: any): Promise<void>;

@@ -78,2 +78,26 @@ "use strict";

exports.getLineFromError = getLineFromError;
function parseError(err) {
// Maximum error stack size
const STACK_SIZE = 5;
const properties = {};
properties.isError = true;
if (!err || !err.message || !err.stack) {
properties.isError = false;
err = new Error(JSON.stringify(err));
}
Object.getOwnPropertyNames(err).forEach(function (key) {
properties[key] = err[key];
}, err);
// Example: https://nodejs.org/api/errors.html#errors_error_stack
if (properties.stack) {
const lines = properties.stack.split('\n');
const stack = [];
for (let i = 1; i < lines.length && i < STACK_SIZE; i++) {
stack.push(lines[i].replace(' at ', ''));
}
properties.stack = stack.join('');
}
return properties;
}
exports.parseError = parseError;
function StringifyError(e) {

@@ -80,0 +104,0 @@ if (e instanceof error_1.OrionError) {

{
"name": "@betit/orion-node-sdk",
"version": "3.0.0",
"version": "3.1.0",
"description": "SDK for orion",

@@ -5,0 +5,0 @@ "license": "MIT",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet