Skip to content

Commit 75571a7

Browse files
committed
packages(types): fix exports
1 parent 599f3f9 commit 75571a7

File tree

10 files changed

+33
-34
lines changed

10 files changed

+33
-34
lines changed

Diff for: packages/browser/src/exports.ts

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export {
77
EventHint,
88
Exception,
99
Response,
10-
Severity,
1110
SeverityLevel,
1211
StackFrame,
1312
Stacktrace,

Diff for: packages/hub/src/hub.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
Primitive,
1515
SessionContext,
1616
SessionStatus,
17-
Severity,
17+
SeverityLevel,
1818
Span,
1919
SpanContext,
2020
Transaction,
@@ -216,7 +216,7 @@ export class Hub implements HubInterface {
216216
/**
217217
* @inheritDoc
218218
*/
219-
public captureMessage(message: string, level?: Severity, hint?: EventHint): string {
219+
public captureMessage(message: string, level?: SeverityLevel, hint?: EventHint): string {
220220
const eventId = (this._lastEventId = uuid4());
221221
let finalHint = hint;
222222

Diff for: packages/hub/test/scope.test.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Event, EventHint, RequestSessionStatus, Severity } from '@sentry/types';
1+
import { Event, EventHint, RequestSessionStatus } from '@sentry/types';
22
import { getGlobalObject } from '@sentry/utils';
33

44
import { addGlobalEventProcessor, Scope } from '../src';
@@ -85,8 +85,8 @@ describe('Scope', () => {
8585

8686
test('setLevel', () => {
8787
const scope = new Scope();
88-
scope.setLevel(Severity.Critical);
89-
expect((scope as any)._level).toEqual(Severity.Critical);
88+
scope.setLevel('critical');
89+
expect((scope as any)._level).toEqual('critical');
9090
});
9191

9292
test('setTransactionName', () => {
@@ -131,8 +131,8 @@ describe('Scope', () => {
131131

132132
test('chaining', () => {
133133
const scope = new Scope();
134-
scope.setLevel(Severity.Critical).setUser({ id: '1' });
135-
expect((scope as any)._level).toEqual(Severity.Critical);
134+
scope.setLevel('critical').setUser({ id: '1' });
135+
expect((scope as any)._level).toEqual('critical');
136136
expect((scope as any)._user).toEqual({ id: '1' });
137137
});
138138
});
@@ -195,7 +195,7 @@ describe('Scope', () => {
195195
scope.setTag('a', 'b');
196196
scope.setUser({ id: '1' });
197197
scope.setFingerprint(['abcd']);
198-
scope.setLevel(Severity.Warning);
198+
scope.setLevel('warning');
199199
scope.setTransactionName('/abc');
200200
scope.addBreadcrumb({ message: 'test' });
201201
scope.setContext('os', { id: '1' });
@@ -284,9 +284,9 @@ describe('Scope', () => {
284284
test('scope level should have priority over event level', () => {
285285
expect.assertions(1);
286286
const scope = new Scope();
287-
scope.setLevel(Severity.Warning);
287+
scope.setLevel('warning');
288288
const event: Event = {};
289-
event.level = Severity.Critical;
289+
event.level = 'critical';
290290
return scope.applyToEvent(event).then(processedEvent => {
291291
expect(processedEvent!.level).toEqual('warning');
292292
});
@@ -400,7 +400,7 @@ describe('Scope', () => {
400400
scope.setContext('foo', { id: '1' });
401401
scope.setContext('bar', { id: '2' });
402402
scope.setUser({ id: '1337' });
403-
scope.setLevel(Severity.Info);
403+
scope.setLevel('info');
404404
scope.setFingerprint(['foo']);
405405
scope.setRequestSession({ status: RequestSessionStatus.Ok });
406406
});
@@ -448,7 +448,7 @@ describe('Scope', () => {
448448
localScope.setContext('bar', { id: '3' });
449449
localScope.setContext('baz', { id: '4' });
450450
localScope.setUser({ id: '42' });
451-
localScope.setLevel(Severity.Warning);
451+
localScope.setLevel('warning');
452452
localScope.setFingerprint(['bar']);
453453
(localScope as any)._requestSession = { status: RequestSessionStatus.Ok };
454454

@@ -470,7 +470,7 @@ describe('Scope', () => {
470470
foo: { id: '1' },
471471
});
472472
expect(updatedScope._user).toEqual({ id: '42' });
473-
expect(updatedScope._level).toEqual(Severity.Warning);
473+
expect(updatedScope._level).toEqual('warning');
474474
expect(updatedScope._fingerprint).toEqual(['bar']);
475475
expect(updatedScope._requestSession.status).toEqual(RequestSessionStatus.Ok);
476476
});
@@ -491,7 +491,7 @@ describe('Scope', () => {
491491
foo: { id: '1' },
492492
});
493493
expect(updatedScope._user).toEqual({ id: '1337' });
494-
expect(updatedScope._level).toEqual(Severity.Info);
494+
expect(updatedScope._level).toEqual('info');
495495
expect(updatedScope._fingerprint).toEqual(['foo']);
496496
expect(updatedScope._requestSession.status).toEqual(RequestSessionStatus.Ok);
497497
});
@@ -501,7 +501,7 @@ describe('Scope', () => {
501501
contexts: { bar: { id: '3' }, baz: { id: '4' } },
502502
extra: { bar: '3', baz: '4' },
503503
fingerprint: ['bar'],
504-
level: Severity.Warning,
504+
level: 'warning',
505505
tags: { bar: '3', baz: '4' },
506506
user: { id: '42' },
507507
requestSession: { status: RequestSessionStatus.Errored },
@@ -524,7 +524,7 @@ describe('Scope', () => {
524524
foo: { id: '1' },
525525
});
526526
expect(updatedScope._user).toEqual({ id: '42' });
527-
expect(updatedScope._level).toEqual(Severity.Warning);
527+
expect(updatedScope._level).toEqual('warning');
528528
expect(updatedScope._fingerprint).toEqual(['bar']);
529529
expect(updatedScope._requestSession).toEqual({ status: RequestSessionStatus.Errored });
530530
});

Diff for: packages/minimal/test/lib/minimal.test.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { getCurrentHub, getHubFromCarrier, Scope } from '@sentry/hub';
2-
import { Severity } from '@sentry/types';
32

43
import {
54
_callOnClient,
@@ -96,10 +95,10 @@ describe('Minimal', () => {
9695
getCurrentHub().withScope(() => {
9796
getCurrentHub().bindClient(client);
9897
const message = 'yo';
99-
const level = Severity.Warning;
98+
const level = 'warning';
10099
captureMessage(message, level);
101100
expect(client.captureMessage.mock.calls[0][0]).toBe(message);
102-
expect(client.captureMessage.mock.calls[0][1]).toBe(Severity.Warning);
101+
expect(client.captureMessage.mock.calls[0][1]).toBe('warning');
103102
});
104103
});
105104

@@ -165,8 +164,8 @@ describe('Minimal', () => {
165164
const client: any = new TestClient({});
166165
const scope = getCurrentHub().pushScope();
167166
getCurrentHub().bindClient(client);
168-
scope.setLevel(Severity.Warning);
169-
expect(global.__SENTRY__.hub._stack[1].scope._level).toEqual(Severity.Warning);
167+
scope.setLevel('warning');
168+
expect(global.__SENTRY__.hub._stack[1].scope._level).toEqual('warning');
170169
});
171170
});
172171

@@ -245,16 +244,16 @@ describe('Minimal', () => {
245244

246245
test('withScope', () => {
247246
withScope(scope => {
248-
scope.setLevel(Severity.Warning);
247+
scope.setLevel('warning');
249248
scope.setFingerprint(['1']);
250249
withScope(scope2 => {
251-
scope2.setLevel(Severity.Info);
250+
scope2.setLevel('info');
252251
scope2.setFingerprint(['2']);
253252
withScope(scope3 => {
254253
scope3.clear();
255-
expect(global.__SENTRY__.hub._stack[1].scope._level).toEqual(Severity.Warning);
254+
expect(global.__SENTRY__.hub._stack[1].scope._level).toEqual('warning');
256255
expect(global.__SENTRY__.hub._stack[1].scope._fingerprint).toEqual(['1']);
257-
expect(global.__SENTRY__.hub._stack[2].scope._level).toEqual(Severity.Info);
256+
expect(global.__SENTRY__.hub._stack[2].scope._level).toEqual('info');
258257
expect(global.__SENTRY__.hub._stack[2].scope._fingerprint).toEqual(['2']);
259258
expect(global.__SENTRY__.hub._stack[3].scope._level).toBeUndefined();
260259
});

Diff for: packages/node/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export {
77
EventHint,
88
Exception,
99
Response,
10-
Severity,
10+
SeverityLevel,
1111
StackFrame,
1212
Stacktrace,
1313
Status,

Diff for: packages/tracing/src/index.bundle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export {
55
Event,
66
Exception,
77
Response,
8-
Severity,
8+
SeverityLevel,
99
StackFrame,
1010
Stacktrace,
1111
Status,

Diff for: packages/types/src/client.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Integration, IntegrationClass } from './integration';
44
import { Options } from './options';
55
import { Scope } from './scope';
66
import { Session } from './session';
7-
import { Severity } from './severity';
7+
import { SeverityLevel } from './severity';
88
import { Transport } from './transport';
99

1010
/**
@@ -36,7 +36,7 @@ export interface Client<O extends Options = Options> {
3636
* @param scope An optional scope containing event metadata.
3737
* @returns The event id
3838
*/
39-
captureMessage(message: string, level?: Severity, hint?: EventHint, scope?: Scope): string | undefined;
39+
captureMessage(message: string, level?: SeverityLevel, hint?: EventHint, scope?: Scope): string | undefined;
4040

4141
/**
4242
* Captures a manually created event and sends it to Sentry.

Diff for: packages/types/src/hub.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Integration, IntegrationClass } from './integration';
66
import { Primitive } from './misc';
77
import { Scope } from './scope';
88
import { Session, SessionContext } from './session';
9-
import { Severity } from './severity';
9+
import { SeverityLevel } from './severity';
1010
import { Span, SpanContext } from './span';
1111
import { CustomSamplingContext, Transaction, TransactionContext } from './transaction';
1212
import { User } from './user';
@@ -88,7 +88,7 @@ export interface Hub {
8888
* @param hint May contain additional information about the original exception.
8989
* @returns The generated eventId.
9090
*/
91-
captureMessage(message: string, level?: Severity, hint?: EventHint): string;
91+
captureMessage(message: string, level?: SeverityLevel, hint?: EventHint): string;
9292

9393
/**
9494
* Captures a manually created event and sends it to Sentry.

Diff for: packages/utils/test/severity.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { SeverityLevels } from '@sentry/types';
2-
import { severityFromString } from './../src/severity';
2+
3+
import { severityFromString } from '../src/severity';
34

45
describe('severityFromString()', () => {
56
describe('normalize warn and warning', () => {

Diff for: packages/vue/src/index.bundle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export {
55
Event,
66
Exception,
77
Response,
8-
Severity,
8+
SeverityLevel,
99
StackFrame,
1010
Stacktrace,
1111
Status,

0 commit comments

Comments
 (0)