Socket
Socket
Sign inDemoInstall

@sentry/node

Package Overview
Dependencies
Maintainers
8
Versions
514
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/node - npm Package Compare versions

Comparing version 4.1.1 to 4.2.0

3

dist/backend.js

@@ -63,3 +63,2 @@ "use strict";

var core_1 = require("@sentry/core");
var hub_1 = require("@sentry/hub");
var types_1 = require("@sentry/types");

@@ -91,3 +90,3 @@ var is_1 = require("@sentry/utils/is");

message = "Non-Error exception captured with keys: " + object_1.serializeKeysToEventMessage(keys_1);
hub_1.getCurrentHub().configureScope(function (scope) {
core_1.getCurrentHub().configureScope(function (scope) {
scope.setExtra('__serialized__', object_1.limitObjectDepthToSize(exception));

@@ -94,0 +93,0 @@ scope.setFingerprint([md5(keys_1.join(''))]);

@@ -25,4 +25,2 @@ /// <reference types="node" />

export declare function defaultOnFatalError(error: Error): void;
/** JSDoc */
export declare function makeErrorHandler(onFatalError?: (firstError: Error, secondError?: Error) => void): (error: Error) => void;
export {};

@@ -50,5 +50,4 @@ "use strict";

var core_1 = require("@sentry/core");
var hub_1 = require("@sentry/hub");
var types_1 = require("@sentry/types");
var async_1 = require("@sentry/utils/async");
var logger_1 = require("@sentry/utils/logger");
var object_1 = require("@sentry/utils/object");

@@ -195,3 +194,3 @@ var cookie = require("cookie");

local.run(function () {
hub_1.getCurrentHub().configureScope(function (scope) {
core_1.getCurrentHub().configureScope(function (scope) {
return scope.addEventProcessor(function (event) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {

@@ -219,3 +218,3 @@ return [2 /*return*/, parseRequest(event, req, options)];

}
hub_1.getCurrentHub().captureException(error, { originalException: error });
core_1.getCurrentHub().captureException(error, { originalException: error });
next(error);

@@ -228,8 +227,8 @@ };

console.error(error && error.stack ? error.stack : error);
var options = hub_1.getCurrentHub().getClient().getOptions();
var options = core_1.getCurrentHub().getClient().getOptions();
var timeout = (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||
DEFAULT_SHUTDOWN_TIMEOUT;
async_1.forget(hub_1.getCurrentHub().getClient().close(timeout).then(function (result) {
async_1.forget(core_1.getCurrentHub().getClient().close(timeout).then(function (result) {
if (!result) {
core_1.logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');
logger_1.logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');
}

@@ -240,72 +239,2 @@ global.process.exit(1);

exports.defaultOnFatalError = defaultOnFatalError;
/** JSDoc */
function makeErrorHandler(onFatalError) {
var _this = this;
if (onFatalError === void 0) { onFatalError = defaultOnFatalError; }
var timeout = 2000;
var caughtFirstError = false;
var caughtSecondError = false;
var calledFatalError = false;
var firstError;
return function (error) {
if (!caughtFirstError) {
// this is the first uncaught error and the ultimate reason for shutting down
// we want to do absolutely everything possible to ensure it gets captured
// also we want to make sure we don't go recursion crazy if more errors happen after this one
firstError = error;
caughtFirstError = true;
hub_1.getCurrentHub().withScope(function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
hub_1.getCurrentHub().configureScope(function (scope) {
scope.addEventProcessor(function (event) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, (__assign({}, event, { level: types_1.Severity.Fatal }))];
});
}); });
});
hub_1.getCurrentHub().captureException(error, { originalException: error });
if (!calledFatalError) {
calledFatalError = true;
onFatalError(error);
}
return [2 /*return*/];
});
}); });
}
else if (calledFatalError) {
// we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down
core_1.logger.warn('uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown');
defaultOnFatalError(error);
}
else if (!caughtSecondError) {
// two cases for how we can hit this branch:
// - capturing of first error blew up and we just caught the exception from that
// - quit trying to capture, proceed with shutdown
// - a second independent error happened while waiting for first error to capture
// - want to avoid causing premature shutdown before first error capture finishes
// it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff
// so let's instead just delay a bit before we proceed with our action here
// in case 1, we just wait a bit unnecessarily but ultimately do the same thing
// in case 2, the delay hopefully made us wait long enough for the capture to finish
// two potential nonideal outcomes:
// nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError
// nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error
// note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)
// we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish
caughtSecondError = true;
setTimeout(function () {
if (!calledFatalError) {
// it was probably case 1, let's treat err as the sendErr and call onFatalError
calledFatalError = true;
onFatalError(firstError, error);
}
else {
// it was probably case 2, our first error finished capturing while we waited, cool, do nothing
}
}, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc
}
};
}
exports.makeErrorHandler = makeErrorHandler;
//# sourceMappingURL=handlers.js.map

@@ -19,2 +19,5 @@ export { Breadcrumb, Request, SdkInfo, SentryEvent, SentryException, SentryResponse, Severity, StackFrame, Stacktrace, Status, Thread, User, } from '@sentry/types';

Transaction: typeof NodeIntegrations.Transaction;
getIntegrationsToSetup(options: import("@sentry/core/dist/interfaces").Options): import("@sentry/types").Integration[];
setupIntegration(integration: import("@sentry/types").Integration, options: import("@sentry/core/dist/interfaces").Options): void;
setupIntegrations<O extends import("@sentry/core/dist/interfaces").Options>(options: O): CoreIntegrations.IntegrationIndex;
Dedupe: typeof CoreIntegrations.Dedupe;

@@ -26,3 +29,4 @@ FunctionToString: typeof CoreIntegrations.FunctionToString;

RewriteFrames: typeof CoreIntegrations.RewriteFrames;
installedIntegrations: string[];
};
export { INTEGRATIONS as Integrations, Transports, Handlers };

@@ -11,3 +11,7 @@ import { Integration } from '@sentry/types';

*/
install(): void;
static id: string;
/**
* @inheritDoc
*/
setupOnce(): void;
}

@@ -23,6 +23,30 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var hub_1 = require("@sentry/hub");
var core_1 = require("@sentry/core");
var types_1 = require("@sentry/types");
var object_1 = require("@sentry/utils/object");
var util = require("util");
/** Console module integration */
var Console = /** @class */ (function () {
function Console() {
/**
* @inheritDoc
*/
this.name = 'Console';
}
/**
* @inheritDoc
*/
Console.prototype.setupOnce = function () {
var nativeModule = require('module');
object_1.fill(nativeModule, '_load', loadWrapper(nativeModule));
// special case: since console is built-in and app-level code won't require() it, do that here
require('console');
};
/**
* @inheritDoc
*/
Console.id = 'Console';
return Console;
}());
exports.Console = Console;
/**

@@ -74,10 +98,12 @@ * Wrapper function for internal _load calls within `require`

return function () {
hub_1.getCurrentHub().addBreadcrumb({
category: 'console',
level: sentryLevel,
message: util.format.apply(undefined, arguments),
}, {
input: __spread(arguments),
level: level,
});
if (core_1.getCurrentHub().getIntegration(Console)) {
core_1.getCurrentHub().addBreadcrumb({
category: 'console',
level: sentryLevel,
message: util.format.apply(undefined, arguments),
}, {
input: __spread(arguments),
level: level,
});
}
originalConsoleLevel.apply(originalModule, arguments);

@@ -88,22 +114,2 @@ };

}
/** Console module integration */
var Console = /** @class */ (function () {
function Console() {
/**
* @inheritDoc
*/
this.name = 'Console';
}
/**
* @inheritDoc
*/
Console.prototype.install = function () {
var nativeModule = require('module');
object_1.fill(nativeModule, '_load', loadWrapper(nativeModule));
// special case: since console is built-in and app-level code won't require() it, do that here
require('console');
};
return Console;
}());
exports.Console = Console;
//# sourceMappingURL=console.js.map

@@ -11,3 +11,7 @@ import { Integration } from '@sentry/types';

*/
install(): void;
static id: string;
/**
* @inheritDoc
*/
setupOnce(): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var hub_1 = require("@sentry/hub");
var core_1 = require("@sentry/core");
var object_1 = require("@sentry/utils/object");
var util = require("util");
var lastResponse;
/** http module integration */
var Http = /** @class */ (function () {
function Http() {
/**
* @inheritDoc
*/
this.name = 'Http';
}
/**
* @inheritDoc
*/
Http.prototype.setupOnce = function () {
var nativeModule = require('module');
object_1.fill(nativeModule, '_load', loadWrapper(nativeModule));
// observation: when the https module does its own require('http'), it *does not* hit our hooked require to instrument http on the fly
// but if we've previously instrumented http, https *does* get our already-instrumented version
// this is because raven's transports are required before this instrumentation takes place, which loads https (and http)
// so module cache will have uninstrumented http; proactively loading it here ensures instrumented version is in module cache
// alternatively we could refactor to load our transports later, but this is easier and doesn't have much drawback
require('http');
};
/**
* @inheritDoc
*/
Http.id = 'Http';
return Http;
}());
exports.Http = Http;
/**

@@ -91,3 +119,3 @@ * Function that can combine together a url that'll be used for our breadcrumbs.

}
var dsn = hub_1.getCurrentHub()
var dsn = core_1.getCurrentHub()
.getClient()

@@ -97,4 +125,4 @@ .getDsn();

var isNotSentryRequest = dsn && this.__ravenBreadcrumbUrl && !this.__ravenBreadcrumbUrl.includes(dsn.host);
if (isInterestingEvent && isNotSentryRequest) {
hub_1.getCurrentHub().addBreadcrumb({
if (isInterestingEvent && isNotSentryRequest && core_1.getCurrentHub().getIntegration(Http)) {
core_1.getCurrentHub().addBreadcrumb({
category: 'http',

@@ -116,26 +144,2 @@ data: {

}
/** http module integration */
var Http = /** @class */ (function () {
function Http() {
/**
* @inheritDoc
*/
this.name = 'Http';
}
/**
* @inheritDoc
*/
Http.prototype.install = function () {
var nativeModule = require('module');
object_1.fill(nativeModule, '_load', loadWrapper(nativeModule));
// observation: when the https module does its own require('http'), it *does not* hit our hooked require to instrument http on the fly
// but if we've previously instrumented http, https *does* get our already-instrumented version
// this is because raven's transports are required before this instrumentation takes place, which loads https (and http)
// so module cache will have uninstrumented http; proactively loading it here ensures instrumented version is in module cache
// alternatively we could refactor to load our transports later, but this is easier and doesn't have much drawback
require('http');
};
return Http;
}());
exports.Http = Http;
//# sourceMappingURL=http.js.map

@@ -17,2 +17,6 @@ import { Integration, SentryEvent, SentryEventHint, SentryException } from '@sentry/types';

*/
static id: string;
/**
* @inheritDoc
*/
private readonly key;

@@ -33,3 +37,3 @@ /**

*/
install(): void;
setupOnce(): void;
/**

@@ -36,0 +40,0 @@ * @inheritDoc

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

Object.defineProperty(exports, "__esModule", { value: true });
var hub_1 = require("@sentry/hub");
var core_1 = require("@sentry/core");
var parsers_1 = require("../parsers");

@@ -80,7 +80,14 @@ var DEFAULT_KEY = 'cause';

*/
LinkedErrors.prototype.install = function () {
LinkedErrors.prototype.setupOnce = function () {
var _this = this;
hub_1.getCurrentHub().configureScope(function (scope) {
scope.addEventProcessor(_this.handler.bind(_this));
});
core_1.addGlobalEventProcessor(function (event, hint) { return __awaiter(_this, void 0, void 0, function () {
var self;
return __generator(this, function (_a) {
self = core_1.getCurrentHub().getIntegration(LinkedErrors);
if (self) {
return [2 /*return*/, self.handler(event, hint)];
}
return [2 /*return*/, event];
});
}); });
};

@@ -129,2 +136,6 @@ /**

};
/**
* @inheritDoc
*/
LinkedErrors.id = 'LinkedErrors';
return LinkedErrors;

@@ -131,0 +142,0 @@ }());

@@ -12,2 +12,6 @@ import { Integration } from '@sentry/types';

*/
static id: string;
/**
* @inheritDoc
*/
readonly handler: (error: Error) => void;

@@ -23,3 +27,5 @@ /**

*/
install(): void;
setupOnce(): void;
}
/** JSDoc */
export declare function makeErrorHandler(onFatalError?: (firstError: Error, secondError?: Error) => void): (error: Error) => void;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@sentry/core");
var types_1 = require("@sentry/types");
var logger_1 = require("@sentry/utils/logger");
var handlers_1 = require("../handlers");

@@ -19,3 +57,3 @@ /** Global Promise Rejection handler */

*/
this.handler = handlers_1.makeErrorHandler(
this.handler = makeErrorHandler(
// tslint:disable-next-line

@@ -27,8 +65,84 @@ this.options.onFatalError);

*/
OnUncaughtException.prototype.install = function () {
global.process.on('uncaughtException', this.handler);
OnUncaughtException.prototype.setupOnce = function () {
global.process.on('uncaughtException', this.handler.bind(this));
};
/**
* @inheritDoc
*/
OnUncaughtException.id = 'OnUncaughtException';
return OnUncaughtException;
}());
exports.OnUncaughtException = OnUncaughtException;
/** JSDoc */
function makeErrorHandler(onFatalError) {
var _this = this;
if (onFatalError === void 0) { onFatalError = handlers_1.defaultOnFatalError; }
var timeout = 2000;
var caughtFirstError = false;
var caughtSecondError = false;
var calledFatalError = false;
var firstError;
return function (error) {
if (!caughtFirstError) {
var hub_1 = core_1.getCurrentHub();
// this is the first uncaught error and the ultimate reason for shutting down
// we want to do absolutely everything possible to ensure it gets captured
// also we want to make sure we don't go recursion crazy if more errors happen after this one
firstError = error;
caughtFirstError = true;
if (hub_1.getIntegration(OnUncaughtException)) {
hub_1.withScope(function (scope) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
scope.setLevel(types_1.Severity.Fatal);
hub_1.captureException(error, { originalException: error });
if (!calledFatalError) {
calledFatalError = true;
onFatalError(error);
}
return [2 /*return*/];
});
}); });
}
else {
if (!calledFatalError) {
calledFatalError = true;
onFatalError(error);
}
}
}
else if (calledFatalError) {
// we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down
logger_1.logger.warn('uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown');
handlers_1.defaultOnFatalError(error);
}
else if (!caughtSecondError) {
// two cases for how we can hit this branch:
// - capturing of first error blew up and we just caught the exception from that
// - quit trying to capture, proceed with shutdown
// - a second independent error happened while waiting for first error to capture
// - want to avoid causing premature shutdown before first error capture finishes
// it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff
// so let's instead just delay a bit before we proceed with our action here
// in case 1, we just wait a bit unnecessarily but ultimately do the same thing
// in case 2, the delay hopefully made us wait long enough for the capture to finish
// two potential nonideal outcomes:
// nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError
// nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error
// note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)
// we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish
caughtSecondError = true;
setTimeout(function () {
if (!calledFatalError) {
// it was probably case 1, let's treat err as the sendErr and call onFatalError
calledFatalError = true;
onFatalError(firstError, error);
}
else {
// it was probably case 2, our first error finished capturing while we waited, cool, do nothing
}
}, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc
}
};
}
exports.makeErrorHandler = makeErrorHandler;
//# sourceMappingURL=onuncaughtexception.js.map

@@ -11,4 +11,8 @@ import { Integration } from '@sentry/types';

*/
install(): void;
static id: string;
/**
* @inheritDoc
*/
setupOnce(): void;
/**
* Send an exception with reason

@@ -15,0 +19,0 @@ * @param reason string

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var hub_1 = require("@sentry/hub");
var core_1 = require("@sentry/core");
/** Global Promise Rejection handler */

@@ -15,3 +15,3 @@ var OnUnhandledRejection = /** @class */ (function () {

*/
OnUnhandledRejection.prototype.install = function () {
OnUnhandledRejection.prototype.setupOnce = function () {
global.process.on('unhandledRejection', this.sendUnhandledPromise.bind(this));

@@ -25,24 +25,30 @@ };

OnUnhandledRejection.prototype.sendUnhandledPromise = function (reason, promise) {
var hub = core_1.getCurrentHub();
if (!hub.getIntegration(OnUnhandledRejection)) {
return;
}
var context = (promise.domain && promise.domain.sentryContext) || {};
hub_1.getCurrentHub().withScope(function () {
hub_1.getCurrentHub().configureScope(function (scope) {
// Preserve backwards compatibility with raven-node for now
if (context.user) {
scope.setUser(context.user);
}
if (context.tags) {
Object.keys(context.tags).forEach(function (key) {
scope.setTag(key, context.tags[key]);
});
}
if (context.extra) {
Object.keys(context.extra).forEach(function (key) {
scope.setExtra(key, context.extra[key]);
});
}
scope.setExtra('unhandledPromiseRejection', true);
});
hub_1.getCurrentHub().captureException(reason, { originalException: promise });
hub.withScope(function (scope) {
scope.setExtra('unhandledPromiseRejection', true);
// Preserve backwards compatibility with raven-node for now
if (context.user) {
scope.setUser(context.user);
}
if (context.tags) {
Object.keys(context.tags).forEach(function (key) {
scope.setTag(key, context.tags[key]);
});
}
if (context.extra) {
Object.keys(context.extra).forEach(function (key) {
scope.setExtra(key, context.extra[key]);
});
}
hub.captureException(reason, { originalException: promise });
});
};
/**
* @inheritDoc
*/
OnUnhandledRejection.id = 'OnUnhandledRejection';
return OnUnhandledRejection;

@@ -49,0 +55,0 @@ }());

import { Integration } from '@sentry/types';
import { NodeOptions } from '../../backend';
/** Add node modules / packages to the event */

@@ -12,5 +11,9 @@ export declare class Modules implements Integration {

*/
install(_?: NodeOptions): void;
static id: string;
/**
* @inheritDoc
*/
setupOnce(): void;
/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */
private getModules;
}

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

Object.defineProperty(exports, "__esModule", { value: true });
var hub_1 = require("@sentry/hub");
var core_1 = require("@sentry/core");
var lsmod = require("lsmod");

@@ -64,12 +64,12 @@ var moduleCache;

*/
Modules.prototype.install = function (_) {
Modules.prototype.setupOnce = function () {
var _this = this;
if (_ === void 0) { _ = {}; }
hub_1.getCurrentHub().configureScope(function (scope) {
scope.addEventProcessor(function (event) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, (__assign({}, event, { modules: this.getModules() }))];
});
}); });
});
core_1.addGlobalEventProcessor(function (event) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (!core_1.getCurrentHub().getIntegration(Modules)) {
return [2 /*return*/, event];
}
return [2 /*return*/, __assign({}, event, { modules: this.getModules() })];
});
}); });
};

@@ -84,2 +84,6 @@ /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */

};
/**
* @inheritDoc
*/
Modules.id = 'Modules';
return Modules;

@@ -86,0 +90,0 @@ }());

import { Integration, SentryEvent } from '@sentry/types';
import { NodeOptions } from '../../backend';
/** Add node transaction to the event */

@@ -12,6 +11,10 @@ export declare class Transaction implements Integration {

*/
install(_?: NodeOptions): void;
static id: string;
/**
* @inheritDoc
*/
setupOnce(): void;
/**
* @inheritDoc
*/
process(event: SentryEvent): Promise<SentryEvent>;

@@ -18,0 +21,0 @@ /** JSDoc */

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

Object.defineProperty(exports, "__esModule", { value: true });
var hub_1 = require("@sentry/hub");
var core_1 = require("@sentry/core");
/** Add node transaction to the event */

@@ -51,10 +51,14 @@ var Transaction = /** @class */ (function () {

*/
Transaction.prototype.install = function (_) {
Transaction.prototype.setupOnce = function () {
var _this = this;
if (_ === void 0) { _ = {}; }
hub_1.getCurrentHub().configureScope(function (scope) {
scope.addEventProcessor(function (event) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, this.process(event)];
}); }); });
});
core_1.addGlobalEventProcessor(function (event) { return __awaiter(_this, void 0, void 0, function () {
var self;
return __generator(this, function (_a) {
self = core_1.getCurrentHub().getIntegration(Transaction);
if (self) {
return [2 /*return*/, self.process(event)];
}
return [2 /*return*/, event];
});
}); });
};

@@ -90,2 +94,6 @@ /**

};
/**
* @inheritDoc
*/
Transaction.id = 'Transaction';
return Transaction;

@@ -92,0 +100,0 @@ }());

@@ -49,2 +49,2 @@ import { Integrations as CoreIntegrations } from '@sentry/core';

*/
export declare function init(options: NodeOptions): void;
export declare function init(options?: NodeOptions): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@sentry/core");
var hub_1 = require("@sentry/hub");
var domain = require("domain");
var client_1 = require("./client");

@@ -65,5 +67,12 @@ var integrations_1 = require("./integrations");

function init(options) {
core_1.initAndBind(client_1.NodeClient, options, exports.defaultIntegrations);
if (options === void 0) { options = {}; }
if (options.defaultIntegrations === undefined) {
options.defaultIntegrations = exports.defaultIntegrations;
}
if (domain.active) {
hub_1.setHubOnCarrier(hub_1.getMainCarrier(), core_1.getCurrentHub());
}
core_1.initAndBind(client_1.NodeClient, options);
}
exports.init = init;
//# sourceMappingURL=sdk.js.map
export declare const SDK_NAME = "sentry.javascript.node";
export declare const SDK_VERSION = "4.1.1";
export declare const SDK_VERSION = "4.2.0";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SDK_NAME = 'sentry.javascript.node';
exports.SDK_VERSION = '4.1.1';
exports.SDK_VERSION = '4.2.0';
//# sourceMappingURL=version.js.map
{
"name": "@sentry/node",
"version": "4.1.1",
"version": "4.2.0",
"description": "Offical Sentry SDK for Node.js",

@@ -18,6 +18,6 @@ "repository": "git://github.com/getsentry/raven-js.git",

"dependencies": {
"@sentry/core": "4.1.1",
"@sentry/hub": "4.1.1",
"@sentry/types": "4.1.0",
"@sentry/utils": "4.1.1",
"@sentry/core": "4.2.0",
"@sentry/hub": "4.2.0",
"@sentry/types": "4.2.0",
"@sentry/utils": "4.2.0",
"cookie": "0.3.1",

@@ -24,0 +24,0 @@ "lsmod": "1.0.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

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

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