@sentry/core
Advanced tools
Comparing version 5.11.2 to 5.12.0
@@ -121,2 +121,13 @@ import { Scope } from '@sentry/hub'; | ||
/** | ||
* Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. | ||
* Normalized keys: | ||
* - `breadcrumbs.data` | ||
* - `user` | ||
* - `contexts` | ||
* - `extra` | ||
* @param event Event | ||
* @returns Normalized event | ||
*/ | ||
protected _normalizeEvent(event: Event | null, depth: number): Event | null; | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
@@ -123,0 +134,0 @@ * @param sdkInfo The sdkInfo of the event that will be filled with all integrations. |
@@ -224,3 +224,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
BaseClient.prototype._prepareEvent = function (event, scope, hint) { | ||
var _a = this.getOptions(), environment = _a.environment, release = _a.release, dist = _a.dist, _b = _a.maxValueLength, maxValueLength = _b === void 0 ? 250 : _b; | ||
var _this = this; | ||
var _a = this.getOptions(), environment = _a.environment, release = _a.release, dist = _a.dist, _b = _a.maxValueLength, maxValueLength = _b === void 0 ? 250 : _b, _c = _a.normalizeDepth, normalizeDepth = _c === void 0 ? 3 : _c; | ||
var prepared = tslib_1.__assign({}, event); | ||
@@ -259,5 +260,38 @@ if (prepared.environment === undefined && environment !== undefined) { | ||
} | ||
return result; | ||
return result.then(function (evt) { | ||
// tslint:disable-next-line:strict-type-predicates | ||
if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { | ||
return _this._normalizeEvent(evt, normalizeDepth); | ||
} | ||
return evt; | ||
}); | ||
}; | ||
/** | ||
* Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. | ||
* Normalized keys: | ||
* - `breadcrumbs.data` | ||
* - `user` | ||
* - `contexts` | ||
* - `extra` | ||
* @param event Event | ||
* @returns Normalized event | ||
*/ | ||
BaseClient.prototype._normalizeEvent = function (event, depth) { | ||
if (!event) { | ||
return null; | ||
} | ||
// tslint:disable:no-unsafe-any | ||
return tslib_1.__assign({}, event, (event.breadcrumbs && { | ||
breadcrumbs: event.breadcrumbs.map(function (b) { return (tslib_1.__assign({}, b, (b.data && { | ||
data: utils_1.normalize(b.data, depth), | ||
}))); }), | ||
}), (event.user && { | ||
user: utils_1.normalize(event.user, depth), | ||
}), (event.contexts && { | ||
contexts: utils_1.normalize(event.contexts, depth), | ||
}), (event.extra && { | ||
extra: utils_1.normalize(event.extra, depth), | ||
})); | ||
}; | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
@@ -264,0 +298,0 @@ * @param sdkInfo The sdkInfo of the event that will be filled with all integrations. |
@@ -121,2 +121,13 @@ import { Scope } from '@sentry/hub'; | ||
/** | ||
* Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. | ||
* Normalized keys: | ||
* - `breadcrumbs.data` | ||
* - `user` | ||
* - `contexts` | ||
* - `extra` | ||
* @param event Event | ||
* @returns Normalized event | ||
*/ | ||
protected _normalizeEvent(event: Event | null, depth: number): Event | null; | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
@@ -123,0 +134,0 @@ * @param sdkInfo The sdkInfo of the event that will be filled with all integrations. |
import * as tslib_1 from "tslib"; | ||
import { Dsn, isPrimitive, isThenable, logger, SyncPromise, truncate, uuid4 } from '@sentry/utils'; | ||
import { Dsn, isPrimitive, isThenable, logger, normalize, SyncPromise, truncate, uuid4 } from '@sentry/utils'; | ||
import { setupIntegrations } from './integration'; | ||
@@ -223,3 +223,4 @@ /** | ||
BaseClient.prototype._prepareEvent = function (event, scope, hint) { | ||
var _a = this.getOptions(), environment = _a.environment, release = _a.release, dist = _a.dist, _b = _a.maxValueLength, maxValueLength = _b === void 0 ? 250 : _b; | ||
var _this = this; | ||
var _a = this.getOptions(), environment = _a.environment, release = _a.release, dist = _a.dist, _b = _a.maxValueLength, maxValueLength = _b === void 0 ? 250 : _b, _c = _a.normalizeDepth, normalizeDepth = _c === void 0 ? 3 : _c; | ||
var prepared = tslib_1.__assign({}, event); | ||
@@ -258,5 +259,38 @@ if (prepared.environment === undefined && environment !== undefined) { | ||
} | ||
return result; | ||
return result.then(function (evt) { | ||
// tslint:disable-next-line:strict-type-predicates | ||
if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { | ||
return _this._normalizeEvent(evt, normalizeDepth); | ||
} | ||
return evt; | ||
}); | ||
}; | ||
/** | ||
* Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. | ||
* Normalized keys: | ||
* - `breadcrumbs.data` | ||
* - `user` | ||
* - `contexts` | ||
* - `extra` | ||
* @param event Event | ||
* @returns Normalized event | ||
*/ | ||
BaseClient.prototype._normalizeEvent = function (event, depth) { | ||
if (!event) { | ||
return null; | ||
} | ||
// tslint:disable:no-unsafe-any | ||
return tslib_1.__assign({}, event, (event.breadcrumbs && { | ||
breadcrumbs: event.breadcrumbs.map(function (b) { return (tslib_1.__assign({}, b, (b.data && { | ||
data: normalize(b.data, depth), | ||
}))); }), | ||
}), (event.user && { | ||
user: normalize(event.user, depth), | ||
}), (event.contexts && { | ||
contexts: normalize(event.contexts, depth), | ||
}), (event.extra && { | ||
extra: normalize(event.extra, depth), | ||
})); | ||
}; | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
@@ -263,0 +297,0 @@ * @param sdkInfo The sdkInfo of the event that will be filled with all integrations. |
{ | ||
"name": "@sentry/core", | ||
"version": "5.11.2", | ||
"version": "5.12.0", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -19,6 +19,6 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/hub": "5.11.2", | ||
"@sentry/minimal": "5.11.2", | ||
"@sentry/types": "5.11.0", | ||
"@sentry/utils": "5.11.1", | ||
"@sentry/hub": "5.12.0", | ||
"@sentry/minimal": "5.12.0", | ||
"@sentry/types": "5.12.0", | ||
"@sentry/utils": "5.12.0", | ||
"tslib": "^1.9.3" | ||
@@ -25,0 +25,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
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
232998
2452
+ Added@sentry/hub@5.12.0(transitive)
+ Added@sentry/minimal@5.12.0(transitive)
+ Added@sentry/types@5.12.0(transitive)
+ Added@sentry/utils@5.12.0(transitive)
- Removed@sentry/hub@5.11.2(transitive)
- Removed@sentry/minimal@5.11.2(transitive)
- Removed@sentry/types@5.11.0(transitive)
- Removed@sentry/utils@5.11.1(transitive)
Updated@sentry/hub@5.12.0
Updated@sentry/minimal@5.12.0
Updated@sentry/types@5.12.0
Updated@sentry/utils@5.12.0