backtrace-node
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.4
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -65,2 +65,3 @@ "use strict"; | ||
var fs = __importStar(require("fs")); | ||
var json_stringify_safe_1 = __importDefault(require("json-stringify-safe")); | ||
var path = __importStar(require("path")); | ||
@@ -117,3 +118,3 @@ var backtraceResult_1 = require("./model/backtraceResult"); | ||
formData = new form_data_1.default(); | ||
json = JSON.stringify(data); | ||
json = json_stringify_safe_1.default(data); | ||
formData.append('upload_file', json, 'upload_file.json'); | ||
@@ -120,0 +121,0 @@ report.getAttachments().forEach(function (filePath) { |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { BacktraceReport } from './model/backtraceReport'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
export declare function readProcessStatus(): object; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -25,3 +25,3 @@ import { BacktraceClient } from './backtraceClient'; | ||
*/ | ||
export declare function reportAsync(arg: () => void | Error | string | object, arg2?: object | undefined, arg3?: string[]): Promise<BacktraceResult>; | ||
export declare function report(arg: () => void | Error | string | object, arg2?: object | undefined, arg3?: string[]): Promise<BacktraceResult>; | ||
/** | ||
@@ -28,0 +28,0 @@ * Send report synchronosuly to Backtrace |
"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]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -72,3 +83,3 @@ return new (P || (P = Promise))(function (resolve, reject) { | ||
*/ | ||
function reportAsync(arg, arg2, arg3) { | ||
function report(arg, arg2, arg3) { | ||
if (arg2 === void 0) { arg2 = {}; } | ||
@@ -102,3 +113,3 @@ if (arg3 === void 0) { arg3 = []; } | ||
} | ||
exports.reportAsync = reportAsync; | ||
exports.report = report; | ||
/** | ||
@@ -133,7 +144,7 @@ * Send report synchronosuly to Backtrace | ||
} | ||
var report = backtraceClient.createReport(''); | ||
report.send = function () { | ||
backtraceClient.sendReport(report); | ||
var backtraceReport = backtraceClient.createReport(''); | ||
backtraceReport.send = function () { | ||
backtraceClient.sendReport(backtraceReport); | ||
}; | ||
return report; | ||
return backtraceReport; | ||
} | ||
@@ -145,3 +156,3 @@ exports.BacktraceReport = BacktraceReport; | ||
} | ||
backtraceClient.reportSync(err, req); | ||
backtraceClient.reportSync(err, __assign({}, req, resp)); | ||
next(err); | ||
@@ -148,0 +159,0 @@ } |
@@ -0,0 +0,0 @@ export declare class BacktraceClientOptions { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ISourceCode } from './sourceCode'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=backtraceData.js.map |
@@ -0,0 +0,0 @@ import { IBacktraceData } from './backtraceData'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { BacktraceReport } from './backtraceReport'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ISourceCode } from './sourceCode'; |
@@ -177,3 +177,3 @@ "use strict"; | ||
parameter = { | ||
startLine: Math.max(minLine - 1 - this.contextLineCount, 0), | ||
startLine: Math.max(minLine - this.contextLineCount, 0), | ||
endLine: maxLine + this.contextLineCount, | ||
@@ -180,0 +180,0 @@ filePath: key, |
@@ -0,0 +0,0 @@ export interface ISourceCode { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=sourceCode.js.map |
{ | ||
"name": "backtrace-node", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.4", | ||
"description": "Backtrace error reporting tool", | ||
@@ -35,2 +35,3 @@ "main": "./lib/index.js", | ||
"form-data": "^2.3.3", | ||
"json-stringify-safe": "^5.0.1", | ||
"node-machine-id": "^1.1.10", | ||
@@ -43,2 +44,3 @@ "source-scan": "~1.0.1" | ||
"@types/form-data": "^2.2.1", | ||
"@types/json-stringify-safe": "^5.0.0", | ||
"@types/mocha": "^5.2.6", | ||
@@ -45,0 +47,0 @@ "@types/nock": "^9.3.1", |
@@ -5,2 +5,3 @@ import axios from 'axios'; | ||
import * as fs from 'fs'; | ||
import stringify from 'json-stringify-safe'; | ||
import * as path from 'path'; | ||
@@ -39,3 +40,3 @@ import { IBacktraceData } from './model/backtraceData'; | ||
const formData = new FormData(); | ||
const json: string = JSON.stringify(data); | ||
const json: string = stringify(data); | ||
formData.append('upload_file', json, 'upload_file.json'); | ||
@@ -42,0 +43,0 @@ |
@@ -37,3 +37,3 @@ import { BacktraceClient } from './backtraceClient'; | ||
*/ | ||
export async function reportAsync( | ||
export async function report( | ||
arg: () => void | Error | string | object, | ||
@@ -91,8 +91,8 @@ arg2: object | undefined = {}, | ||
} | ||
const report = backtraceClient.createReport(''); | ||
report.send = () => { | ||
backtraceClient.sendReport(report); | ||
const backtraceReport = backtraceClient.createReport(''); | ||
backtraceReport.send = () => { | ||
backtraceClient.sendReport(backtraceReport); | ||
}; | ||
return report; | ||
return backtraceReport; | ||
} | ||
@@ -104,4 +104,4 @@ | ||
} | ||
backtraceClient.reportSync(err, req); | ||
backtraceClient.reportSync(err, { ...req, ...resp }); | ||
next(err); | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2718
0
142263
5
13
+ Addedjson-stringify-safe@^5.0.1
+ Addedjson-stringify-safe@5.0.1(transitive)