@sentry/node
Advanced tools
Comparing version
import { Backend, Frontend, Options } from '@sentry/core'; | ||
import { SentryEvent } from '@sentry/shim'; | ||
import { Transport } from './raven'; | ||
/** | ||
@@ -58,2 +59,11 @@ * Configuration options for the Sentry Node SDK. | ||
storeContext(): boolean; | ||
/** | ||
* Set the transport module used for submitting events. | ||
* | ||
* This can be set to modules like "http" or "https" or any other object that | ||
* provides a `request` method with options. | ||
* | ||
* @param transport The transport to use for submitting events. | ||
*/ | ||
setTransport(transport: Transport): void; | ||
} |
@@ -134,2 +134,20 @@ "use strict"; | ||
}; | ||
/** | ||
* Set the transport module used for submitting events. | ||
* | ||
* This can be set to modules like "http" or "https" or any other object that | ||
* provides a `request` method with options. | ||
* | ||
* @param transport The transport to use for submitting events. | ||
*/ | ||
NodeBackend.prototype.setTransport = function (transport) { | ||
var dsn = this.frontend.getDSN(); | ||
if (!dsn) { | ||
return; | ||
} | ||
raven_1.Raven.transport = | ||
dsn.protocol === 'http' | ||
? new raven_1.HTTPTransport({ transport: transport }) | ||
: new raven_1.HTTPSTransport({ transport: transport }); | ||
}; | ||
return NodeBackend; | ||
@@ -136,0 +154,0 @@ }()); |
import { Breadcrumb, SentryEvent } from '@sentry/shim'; | ||
export declare type SendMethod = (event: SentryEvent, cb?: (err: any) => void) => void; | ||
/** A HTTP transport module. */ | ||
export interface Transport { | ||
request(options: object | string): void; | ||
} | ||
/** A Raven transport wrapper. */ | ||
export interface RavenTransport { | ||
send(): void; | ||
} | ||
/** A constructor class that creates a RavenTransport. */ | ||
export interface TransportClass { | ||
new (options: { | ||
transport: Transport; | ||
}): RavenTransport; | ||
} | ||
/** Provides access to internal raven functionality. */ | ||
@@ -11,2 +25,3 @@ export interface RavenInternal { | ||
send: SendMethod; | ||
transport: RavenTransport; | ||
version: string; | ||
@@ -16,1 +31,2 @@ } | ||
export declare const Raven: RavenInternal; | ||
export declare const HTTPSTransport: TransportClass, HTTPTransport: TransportClass; |
@@ -7,2 +7,5 @@ "use strict"; | ||
exports.Raven = RavenNode; | ||
exports.HTTPSTransport = (_a = RavenNode | ||
.transports, _a.HTTPSTransport), exports.HTTPTransport = _a.HTTPTransport; | ||
var _a; | ||
//# sourceMappingURL=raven.js.map |
{ | ||
"name": "@sentry/node", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Offical Sentry SDK for Node.js", | ||
@@ -18,5 +18,5 @@ "repository": "git://github.com/getsentry/raven-js.git", | ||
"dependencies": { | ||
"@sentry/core": "0.5.2", | ||
"@sentry/shim": "0.5.2", | ||
"raven": "^2.5.0" | ||
"@sentry/core": "0.5.3", | ||
"@sentry/shim": "0.5.3", | ||
"raven": "^2.6.0" | ||
}, | ||
@@ -27,8 +27,8 @@ "devDependencies": { | ||
"npm-run-all": "^4.1.2", | ||
"prettier": "^1.11.1", | ||
"prettier": "^1.12.1", | ||
"prettier-check": "^2.0.0", | ||
"rimraf": "^2.6.2", | ||
"sinon": "^4.5.0", | ||
"sinon": "^5.0.3", | ||
"tslint": "^5.9.1", | ||
"typescript": "^2.8.1" | ||
"typescript": "^2.8.3" | ||
}, | ||
@@ -35,0 +35,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34612
10.59%456
11.49%+ Added
+ Added
- Removed
- Removed
Updated
Updated
Updated