@sentry/node
Advanced tools
Comparing version 5.13.2 to 5.14.0
@@ -14,2 +14,3 @@ /// <reference types="node" /> | ||
interface ParseRequestOptions { | ||
ip?: boolean; | ||
request?: boolean | string[]; | ||
@@ -31,2 +32,9 @@ serverName?: boolean; | ||
[key: string]: any; | ||
user?: { | ||
[key: string]: any; | ||
}; | ||
ip?: string; | ||
connection?: { | ||
remoteAddress?: string; | ||
}; | ||
}, options?: ParseRequestOptions): Event; | ||
@@ -33,0 +41,0 @@ /** |
@@ -139,18 +139,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** JSDoc */ | ||
function extractUserData(req, keys) { | ||
var user = {}; | ||
function extractUserData(user, keys) { | ||
var extractedUser = {}; | ||
var attributes = Array.isArray(keys) ? keys : DEFAULT_USER_KEYS; | ||
attributes.forEach(function (key) { | ||
if (req.user && key in req.user) { | ||
user[key] = req.user[key]; | ||
if (user && key in user) { | ||
extractedUser[key] = user[key]; | ||
} | ||
}); | ||
// client ip: | ||
// node: req.connection.remoteAddress | ||
// express, koa: req.ip | ||
var ip = req.ip || (req.connection && req.connection.remoteAddress); | ||
if (ip) { | ||
user.ip_address = ip; | ||
} | ||
return user; | ||
return extractedUser; | ||
} | ||
@@ -167,3 +160,3 @@ /** | ||
// tslint:disable-next-line:no-parameter-reassignment | ||
options = tslib_1.__assign({ request: true, serverName: true, transaction: true, user: true, version: true }, options); | ||
options = tslib_1.__assign({ ip: false, request: true, serverName: true, transaction: true, user: true, version: true }, options); | ||
if (options.version) { | ||
@@ -178,5 +171,17 @@ event.extra = tslib_1.__assign({}, event.extra, { node: global.process.version }); | ||
} | ||
if (options.user && req.user) { | ||
event.user = tslib_1.__assign({}, event.user, extractUserData(req, options.user)); | ||
if (options.user) { | ||
var extractedUser = req.user ? extractUserData(req.user, options.user) : {}; | ||
if (Object.keys(extractedUser)) { | ||
event.user = tslib_1.__assign({}, event.user, extractedUser); | ||
} | ||
} | ||
// client ip: | ||
// node: req.connection.remoteAddress | ||
// express, koa: req.ip | ||
if (options.ip) { | ||
var ip = req.ip || (req.connection && req.connection.remoteAddress); | ||
if (ip) { | ||
event.user = tslib_1.__assign({}, event.user, { ip_address: ip }); | ||
} | ||
} | ||
if (options.transaction && !event.transaction) { | ||
@@ -183,0 +188,0 @@ var transaction = extractTransaction(req, options.transaction); |
export declare const SDK_NAME = "sentry.javascript.node"; | ||
export declare const SDK_VERSION = "5.13.2"; | ||
export declare const SDK_VERSION = "5.14.0"; | ||
//# sourceMappingURL=version.d.ts.map |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SDK_NAME = 'sentry.javascript.node'; | ||
exports.SDK_VERSION = '5.13.2'; | ||
exports.SDK_VERSION = '5.14.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -14,2 +14,3 @@ /// <reference types="node" /> | ||
interface ParseRequestOptions { | ||
ip?: boolean; | ||
request?: boolean | string[]; | ||
@@ -31,2 +32,9 @@ serverName?: boolean; | ||
[key: string]: any; | ||
user?: { | ||
[key: string]: any; | ||
}; | ||
ip?: string; | ||
connection?: { | ||
remoteAddress?: string; | ||
}; | ||
}, options?: ParseRequestOptions): Event; | ||
@@ -33,0 +41,0 @@ /** |
@@ -137,18 +137,11 @@ import * as tslib_1 from "tslib"; | ||
/** JSDoc */ | ||
function extractUserData(req, keys) { | ||
var user = {}; | ||
function extractUserData(user, keys) { | ||
var extractedUser = {}; | ||
var attributes = Array.isArray(keys) ? keys : DEFAULT_USER_KEYS; | ||
attributes.forEach(function (key) { | ||
if (req.user && key in req.user) { | ||
user[key] = req.user[key]; | ||
if (user && key in user) { | ||
extractedUser[key] = user[key]; | ||
} | ||
}); | ||
// client ip: | ||
// node: req.connection.remoteAddress | ||
// express, koa: req.ip | ||
var ip = req.ip || (req.connection && req.connection.remoteAddress); | ||
if (ip) { | ||
user.ip_address = ip; | ||
} | ||
return user; | ||
return extractedUser; | ||
} | ||
@@ -165,3 +158,3 @@ /** | ||
// tslint:disable-next-line:no-parameter-reassignment | ||
options = tslib_1.__assign({ request: true, serverName: true, transaction: true, user: true, version: true }, options); | ||
options = tslib_1.__assign({ ip: false, request: true, serverName: true, transaction: true, user: true, version: true }, options); | ||
if (options.version) { | ||
@@ -176,5 +169,17 @@ event.extra = tslib_1.__assign({}, event.extra, { node: global.process.version }); | ||
} | ||
if (options.user && req.user) { | ||
event.user = tslib_1.__assign({}, event.user, extractUserData(req, options.user)); | ||
if (options.user) { | ||
var extractedUser = req.user ? extractUserData(req.user, options.user) : {}; | ||
if (Object.keys(extractedUser)) { | ||
event.user = tslib_1.__assign({}, event.user, extractedUser); | ||
} | ||
} | ||
// client ip: | ||
// node: req.connection.remoteAddress | ||
// express, koa: req.ip | ||
if (options.ip) { | ||
var ip = req.ip || (req.connection && req.connection.remoteAddress); | ||
if (ip) { | ||
event.user = tslib_1.__assign({}, event.user, { ip_address: ip }); | ||
} | ||
} | ||
if (options.transaction && !event.transaction) { | ||
@@ -181,0 +186,0 @@ var transaction = extractTransaction(req, options.transaction); |
export declare const SDK_NAME = "sentry.javascript.node"; | ||
export declare const SDK_VERSION = "5.13.2"; | ||
export declare const SDK_VERSION = "5.14.0"; | ||
//# sourceMappingURL=version.d.ts.map |
export var SDK_NAME = 'sentry.javascript.node'; | ||
export var SDK_VERSION = '5.13.2'; | ||
export var SDK_VERSION = '5.14.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@sentry/node", | ||
"version": "5.13.2", | ||
"version": "5.14.0", | ||
"description": "Offical Sentry SDK for Node.js", | ||
@@ -19,7 +19,7 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/apm": "5.13.2", | ||
"@sentry/core": "5.13.2", | ||
"@sentry/hub": "5.13.2", | ||
"@sentry/types": "5.13.2", | ||
"@sentry/utils": "5.13.2", | ||
"@sentry/apm": "5.14.0", | ||
"@sentry/core": "5.14.0", | ||
"@sentry/hub": "5.14.0", | ||
"@sentry/types": "5.14.0", | ||
"@sentry/utils": "5.14.0", | ||
"cookie": "^0.3.1", | ||
@@ -26,0 +26,0 @@ "https-proxy-agent": "^4.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
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
397663
4391
+ Added@sentry/apm@5.14.0(transitive)
+ Added@sentry/browser@5.14.0(transitive)
+ Added@sentry/core@5.14.0(transitive)
+ Added@sentry/hub@5.14.0(transitive)
+ Added@sentry/minimal@5.14.0(transitive)
+ Added@sentry/types@5.14.0(transitive)
+ Added@sentry/utils@5.14.0(transitive)
- Removed@sentry/apm@5.13.2(transitive)
- Removed@sentry/browser@5.13.2(transitive)
- Removed@sentry/core@5.13.2(transitive)
- Removed@sentry/hub@5.13.2(transitive)
- Removed@sentry/minimal@5.13.2(transitive)
- Removed@sentry/types@5.13.2(transitive)
- Removed@sentry/utils@5.13.2(transitive)
Updated@sentry/apm@5.14.0
Updated@sentry/core@5.14.0
Updated@sentry/hub@5.14.0
Updated@sentry/types@5.14.0
Updated@sentry/utils@5.14.0