@sentry/core
Advanced tools
Comparing version 5.0.0-rc.3 to 5.0.0
import { Scope } from '@sentry/hub'; | ||
import { Client, Event, EventHint, Integration, IntegrationClass, Options, Severity } from '@sentry/types'; | ||
import { Client, Event, EventHint, Integration, IntegrationClass, Options, SdkInfo, Severity } from '@sentry/types'; | ||
import { SyncPromise } from '@sentry/utils/syncpromise'; | ||
@@ -119,2 +119,7 @@ import { Backend, BackendClass } from './basebackend'; | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
* @param sdkInfo The sdkInfo of the event that will be filled with all integrations. | ||
*/ | ||
protected _addIntegrations(sdkInfo?: SdkInfo): void; | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -121,0 +126,0 @@ * |
@@ -267,2 +267,3 @@ "use strict"; | ||
} | ||
this._addIntegrations(prepared.sdk); | ||
// We prepare the result here with a resolved Event. | ||
@@ -279,2 +280,12 @@ var result = syncpromise_1.SyncPromise.resolve(prepared); | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
* @param sdkInfo The sdkInfo of the event that will be filled with all integrations. | ||
*/ | ||
BaseClient.prototype._addIntegrations = function (sdkInfo) { | ||
var integrationsArray = Object.keys(this._integrations); | ||
if (sdkInfo && integrationsArray.length > 0) { | ||
sdkInfo.integrations = integrationsArray; | ||
} | ||
}; | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -281,0 +292,0 @@ * |
@@ -17,6 +17,6 @@ "use strict"; | ||
defaultIntegrations.forEach(function (defaultIntegration) { | ||
if (userIntegrationsNames_1.indexOf(getIntegrationName(defaultIntegration)) === -1 && | ||
pickedIntegrationsNames_1.indexOf(getIntegrationName(defaultIntegration)) === -1) { | ||
if (userIntegrationsNames_1.indexOf(defaultIntegration.name) === -1 && | ||
pickedIntegrationsNames_1.indexOf(defaultIntegration.name) === -1) { | ||
integrations.push(defaultIntegration); | ||
pickedIntegrationsNames_1.push(getIntegrationName(defaultIntegration)); | ||
pickedIntegrationsNames_1.push(defaultIntegration.name); | ||
} | ||
@@ -26,5 +26,5 @@ }); | ||
userIntegrations.forEach(function (userIntegration) { | ||
if (pickedIntegrationsNames_1.indexOf(getIntegrationName(userIntegration)) === -1) { | ||
if (pickedIntegrationsNames_1.indexOf(userIntegration.name) === -1) { | ||
integrations.push(userIntegration); | ||
pickedIntegrationsNames_1.push(getIntegrationName(userIntegration)); | ||
pickedIntegrationsNames_1.push(userIntegration.name); | ||
} | ||
@@ -45,8 +45,8 @@ }); | ||
function setupIntegration(integration) { | ||
if (exports.installedIntegrations.indexOf(getIntegrationName(integration)) !== -1) { | ||
if (exports.installedIntegrations.indexOf(integration.name) !== -1) { | ||
return; | ||
} | ||
integration.setupOnce(hub_1.addGlobalEventProcessor, hub_1.getCurrentHub); | ||
exports.installedIntegrations.push(getIntegrationName(integration)); | ||
logger_1.logger.log("Integration installed: " + getIntegrationName(integration)); | ||
exports.installedIntegrations.push(integration.name); | ||
logger_1.logger.log("Integration installed: " + integration.name); | ||
} | ||
@@ -63,3 +63,3 @@ exports.setupIntegration = setupIntegration; | ||
getIntegrationsToSetup(options).forEach(function (integration) { | ||
integrations[getIntegrationName(integration)] = integration; | ||
integrations[integration.name] = integration; | ||
setupIntegration(integration); | ||
@@ -70,13 +70,2 @@ }); | ||
exports.setupIntegrations = setupIntegrations; | ||
/** | ||
* Returns the integration static id. | ||
* @param integration Integration to retrieve id | ||
*/ | ||
function getIntegrationName(integration) { | ||
/** | ||
* @depracted | ||
*/ | ||
// tslint:disable-next-line:no-unsafe-any | ||
return integration.constructor.id || integration.name; | ||
} | ||
//# sourceMappingURL=integration.js.map |
import { Scope } from '@sentry/hub'; | ||
import { Client, Event, EventHint, Integration, IntegrationClass, Options, Severity } from '@sentry/types'; | ||
import { Client, Event, EventHint, Integration, IntegrationClass, Options, SdkInfo, Severity } from '@sentry/types'; | ||
import { SyncPromise } from '@sentry/utils/syncpromise'; | ||
@@ -119,2 +119,7 @@ import { Backend, BackendClass } from './basebackend'; | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
* @param sdkInfo The sdkInfo of the event that will be filled with all integrations. | ||
*/ | ||
protected _addIntegrations(sdkInfo?: SdkInfo): void; | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -121,0 +126,0 @@ * |
@@ -240,2 +240,3 @@ import * as tslib_1 from "tslib"; | ||
} | ||
this._addIntegrations(prepared.sdk); | ||
// We prepare the result here with a resolved Event. | ||
@@ -252,2 +253,12 @@ let result = SyncPromise.resolve(prepared); | ||
/** | ||
* This function adds all used integrations to the SDK info in the event. | ||
* @param sdkInfo The sdkInfo of the event that will be filled with all integrations. | ||
*/ | ||
_addIntegrations(sdkInfo) { | ||
const integrationsArray = Object.keys(this._integrations); | ||
if (sdkInfo && integrationsArray.length > 0) { | ||
sdkInfo.integrations = integrationsArray; | ||
} | ||
} | ||
/** | ||
* Processes an event (either error or message) and sends it to Sentry. | ||
@@ -254,0 +265,0 @@ * |
@@ -14,6 +14,6 @@ import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub'; | ||
defaultIntegrations.forEach(defaultIntegration => { | ||
if (userIntegrationsNames.indexOf(getIntegrationName(defaultIntegration)) === -1 && | ||
pickedIntegrationsNames.indexOf(getIntegrationName(defaultIntegration)) === -1) { | ||
if (userIntegrationsNames.indexOf(defaultIntegration.name) === -1 && | ||
pickedIntegrationsNames.indexOf(defaultIntegration.name) === -1) { | ||
integrations.push(defaultIntegration); | ||
pickedIntegrationsNames.push(getIntegrationName(defaultIntegration)); | ||
pickedIntegrationsNames.push(defaultIntegration.name); | ||
} | ||
@@ -23,5 +23,5 @@ }); | ||
userIntegrations.forEach(userIntegration => { | ||
if (pickedIntegrationsNames.indexOf(getIntegrationName(userIntegration)) === -1) { | ||
if (pickedIntegrationsNames.indexOf(userIntegration.name) === -1) { | ||
integrations.push(userIntegration); | ||
pickedIntegrationsNames.push(getIntegrationName(userIntegration)); | ||
pickedIntegrationsNames.push(userIntegration.name); | ||
} | ||
@@ -41,8 +41,8 @@ }); | ||
export function setupIntegration(integration) { | ||
if (installedIntegrations.indexOf(getIntegrationName(integration)) !== -1) { | ||
if (installedIntegrations.indexOf(integration.name) !== -1) { | ||
return; | ||
} | ||
integration.setupOnce(addGlobalEventProcessor, getCurrentHub); | ||
installedIntegrations.push(getIntegrationName(integration)); | ||
logger.log(`Integration installed: ${getIntegrationName(integration)}`); | ||
installedIntegrations.push(integration.name); | ||
logger.log(`Integration installed: ${integration.name}`); | ||
} | ||
@@ -58,3 +58,3 @@ /** | ||
getIntegrationsToSetup(options).forEach(integration => { | ||
integrations[getIntegrationName(integration)] = integration; | ||
integrations[integration.name] = integration; | ||
setupIntegration(integration); | ||
@@ -64,13 +64,2 @@ }); | ||
} | ||
/** | ||
* Returns the integration static id. | ||
* @param integration Integration to retrieve id | ||
*/ | ||
function getIntegrationName(integration) { | ||
/** | ||
* @depracted | ||
*/ | ||
// tslint:disable-next-line:no-unsafe-any | ||
return integration.constructor.id || integration.name; | ||
} | ||
//# sourceMappingURL=integration.js.map |
{ | ||
"name": "@sentry/core", | ||
"version": "5.0.0-rc.3", | ||
"version": "5.0.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.0.0-rc.3", | ||
"@sentry/minimal": "5.0.0-rc.3", | ||
"@sentry/types": "5.0.0-rc.3", | ||
"@sentry/utils": "5.0.0-rc.3", | ||
"@sentry/hub": "5.0.0", | ||
"@sentry/minimal": "5.0.0", | ||
"@sentry/types": "5.0.0", | ||
"@sentry/utils": "5.0.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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
224998
2600
0
+ Added@sentry/hub@5.0.0(transitive)
+ Added@sentry/minimal@5.0.0(transitive)
+ Added@sentry/types@5.0.0(transitive)
+ Added@sentry/utils@5.0.0(transitive)
- Removed@sentry/hub@5.0.0-rc.3(transitive)
- Removed@sentry/minimal@5.0.0-rc.3(transitive)
- Removed@sentry/types@5.0.0-rc.3(transitive)
- Removed@sentry/utils@5.0.0-rc.3(transitive)
Updated@sentry/hub@5.0.0
Updated@sentry/minimal@5.0.0
Updated@sentry/types@5.0.0
Updated@sentry/utils@5.0.0