@sentry/core
Advanced tools
Comparing version 5.16.0-beta.1 to 5.16.0-beta.2
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var hub_1 = require("@sentry/hub"); | ||
var utils_1 = require("@sentry/utils"); | ||
/** Creates a SentryRequest from an event. */ | ||
function eventToSentryRequest(event, api) { | ||
var useEnvelope = event.type === 'transaction'; | ||
var client = hub_1.getCurrentHub().getClient(); | ||
var experimentsOptions = (client && client.getOptions()._experiments) || {}; | ||
var useEnvelope = event.type === 'transaction' && experimentsOptions.useEnvelope; | ||
var req = { | ||
@@ -17,3 +21,5 @@ body: JSON.stringify(event), | ||
event_id: event.event_id, | ||
sent_at: new Date().toISOString(), | ||
// We need to add * 1000 since we divide it by 1000 by default but JS works with ms precision | ||
// The reason we use timestampWithMs here is that all clocks across the SDK use the same clock | ||
sent_at: new Date(utils_1.timestampWithMs() * 1000).toISOString(), | ||
}); | ||
@@ -20,0 +26,0 @@ var itemHeaders = JSON.stringify({ |
@@ -0,4 +1,8 @@ | ||
import { getCurrentHub } from '@sentry/hub'; | ||
import { timestampWithMs } from '@sentry/utils'; | ||
/** Creates a SentryRequest from an event. */ | ||
export function eventToSentryRequest(event, api) { | ||
var useEnvelope = event.type === 'transaction'; | ||
var client = getCurrentHub().getClient(); | ||
var experimentsOptions = (client && client.getOptions()._experiments) || {}; | ||
var useEnvelope = event.type === 'transaction' && experimentsOptions.useEnvelope; | ||
var req = { | ||
@@ -16,3 +20,5 @@ body: JSON.stringify(event), | ||
event_id: event.event_id, | ||
sent_at: new Date().toISOString(), | ||
// We need to add * 1000 since we divide it by 1000 by default but JS works with ms precision | ||
// The reason we use timestampWithMs here is that all clocks across the SDK use the same clock | ||
sent_at: new Date(timestampWithMs() * 1000).toISOString(), | ||
}); | ||
@@ -19,0 +25,0 @@ var itemHeaders = JSON.stringify({ |
{ | ||
"name": "@sentry/core", | ||
"version": "5.16.0-beta.1", | ||
"version": "5.16.0-beta.2", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -19,6 +19,6 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/hub": "5.16.0-beta.1", | ||
"@sentry/minimal": "5.16.0-beta.1", | ||
"@sentry/types": "5.16.0-beta.1", | ||
"@sentry/utils": "5.16.0-beta.1", | ||
"@sentry/hub": "5.16.0-beta.2", | ||
"@sentry/minimal": "5.16.0-beta.2", | ||
"@sentry/types": "5.16.0-beta.2", | ||
"@sentry/utils": "5.16.0-beta.2", | ||
"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
253478
2645
+ Added@sentry/hub@5.16.0-beta.2(transitive)
+ Added@sentry/minimal@5.16.0-beta.2(transitive)
+ Added@sentry/types@5.16.0-beta.2(transitive)
+ Added@sentry/utils@5.16.0-beta.2(transitive)
- Removed@sentry/hub@5.16.0-beta.1(transitive)
- Removed@sentry/minimal@5.16.0-beta.1(transitive)
- Removed@sentry/types@5.16.0-beta.1(transitive)
- Removed@sentry/utils@5.16.0-beta.1(transitive)
Updated@sentry/hub@5.16.0-beta.2
Updated@sentry/types@5.16.0-beta.2
Updated@sentry/utils@5.16.0-beta.2