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

backtrace-node

Package Overview
Dependencies
Maintainers
4
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backtrace-node - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

5

CHANGELOG.md
# Backtrace Node Release Notes
## Version 1.0.6 30.10.2019
* Added sourcemap support to Backtrace-node
* Fixed type attributes for report function
* Changed a unit test result - removed console.log and check data instead.
## Version 1.0.5 28.08.2019

@@ -4,0 +9,0 @@ * Fixed invalid source code line number

3

lib/backtraceApi.js

@@ -16,6 +16,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -22,0 +23,0 @@ });

@@ -27,6 +27,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -80,3 +81,3 @@ });

}
_this.options = __assign({}, new backtraceClientOptions_1.BacktraceClientOptions(), clientOptions);
_this.options = __assign(__assign({}, new backtraceClientOptions_1.BacktraceClientOptions()), clientOptions);
_this._backtraceApi = new backtraceApi_1.BacktraceApi(_this.getSubmitUrl(), _this.options.timeout);

@@ -229,3 +230,3 @@ _this._clientRateLimit = new clientRateLimit_1.ClientRateLimit(_this.options.rateLimit);

}
return __assign({}, attributes, this.options.attributes, this.getMemorizedAttributes());
return __assign(__assign(__assign({}, attributes), this.options.attributes), this.getMemorizedAttributes());
};

@@ -232,0 +233,0 @@ BacktraceClient.prototype.getMemorizedAttributes = function () {

@@ -25,3 +25,3 @@ import { BacktraceClient } from './backtraceClient';

*/
export declare function report(arg: () => void | Error | string | object, arg2?: object | undefined, arg3?: string[] | ((data?: Error) => void), arg4?: string[]): Promise<BacktraceResult>;
export declare function report(arg: Error | string | object | ((data?: Error) => void), arg2?: object | undefined, arg3?: string[] | ((data?: Error) => void), arg4?: string[]): Promise<BacktraceResult>;
/**

@@ -28,0 +28,0 @@ * Send report synchronosuly to Backtrace

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -162,3 +163,3 @@ });

}
backtraceClient.reportSync(err, __assign({}, req, resp));
backtraceClient.reportSync(err, __assign(__assign({}, req), resp));
next(err);

@@ -165,0 +166,0 @@ }

@@ -7,2 +7,3 @@ import { ISourceCode } from './sourceCode';

langVersion: string;
symbolication?: 'sourcemap';
agent: string;

@@ -9,0 +10,0 @@ agentVersion: string;

@@ -14,6 +14,7 @@ "use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -165,3 +166,3 @@ });

BacktraceReport.prototype.addObjectAttributes = function (attributes) {
this.clientAttributes = __assign({}, this.clientAttributes, this.attributes, attributes);
this.clientAttributes = __assign(__assign(__assign({}, this.clientAttributes), this.attributes), attributes);
};

@@ -179,2 +180,3 @@ BacktraceReport.prototype.addAttribute = function (key, value) {

return __awaiter(this, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {

@@ -192,16 +194,20 @@ switch (_a.label) {

_a.sent();
return [2 /*return*/, {
uuid: this.uuid,
timestamp: this.timestamp,
lang: this.lang,
langVersion: this.langVersion,
mainThread: this.mainThread,
classifiers: this.classifiers,
threads: { main: this.stackTrace.toJson() },
agent: this.agent,
agentVersion: this.agentVersion,
annotations: this.annotations,
attributes: this.attributes,
sourceCode: this.stackTrace.getSourceCode(),
}];
result = {
uuid: this.uuid,
timestamp: this.timestamp,
lang: this.lang,
langVersion: this.langVersion,
mainThread: this.mainThread,
classifiers: this.classifiers,
threads: { main: this.stackTrace.toJson() },
agent: this.agent,
agentVersion: this.agentVersion,
annotations: this.annotations,
attributes: this.attributes,
sourceCode: this.stackTrace.getSourceCode(),
};
if (this.attributes['symbolication_id']) {
result.symbolication = 'sourcemap';
}
return [2 /*return*/, result];
}

@@ -230,3 +236,3 @@ });

// combine attributes
this.attributes = __assign({}, this.readBuiltInAttributes(), this.clientAttributes);
this.attributes = __assign(__assign({}, this.readBuiltInAttributes()), this.clientAttributes);
// combine annotations

@@ -240,3 +246,3 @@ this.annotations = this.readAnnotation();

BacktraceReport.prototype.readBuiltInAttributes = function () {
return __assign({}, processHelper_1.readMemoryInformation(), processHelper_1.readProcessStatus(), this.readAttributes(), this.readErrorAttributes());
return __assign(__assign(__assign(__assign({}, processHelper_1.readMemoryInformation()), processHelper_1.readProcessStatus()), this.readAttributes()), this.readErrorAttributes());
};

@@ -307,3 +313,3 @@ BacktraceReport.prototype.detectReportType = function (err) {

}
return __assign({}, result, this.annotations);
return __assign(__assign({}, result), this.annotations);
};

@@ -310,0 +316,0 @@ BacktraceReport.prototype.splitAttributesFromAnnotations = function (clientAttributes) {

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -8,0 +9,0 @@ });

{
"name": "backtrace-node",
"version": "1.0.5",
"version": "1.0.6",
"description": "Backtrace error reporting tool",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -38,3 +38,3 @@ import { BacktraceClient } from './backtraceClient';

export async function report(
arg: () => void | Error | string | object,
arg: Error | string | object | ((data?: Error) => void),
arg2: object | undefined = {},

@@ -41,0 +41,0 @@ // tslint:disable-next-line: ban-types

@@ -8,2 +8,3 @@ import { ISourceCode } from './sourceCode';

langVersion: string;
symbolication?: 'sourcemap';
agent: string;

@@ -10,0 +11,0 @@ agentVersion: string;

@@ -171,3 +171,3 @@ // tslint:disable-next-line: no-var-requires

return {
const result = {
uuid: this.uuid,

@@ -185,3 +185,8 @@ timestamp: this.timestamp,

sourceCode: this.stackTrace.getSourceCode(),
};
} as IBacktraceData;
if (this.attributes['symbolication_id']) {
result.symbolication = 'sourcemap';
}
return result;
}

@@ -188,0 +193,0 @@

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

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