Skip to content

Commit b33ff6a

Browse files
committed
ref(types): do not export the status enum
1 parent 9a427a3 commit b33ff6a

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

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

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export type EventStatus =
2+
/** The status could not be determined. */
3+
| 'unknown'
4+
/** The event was skipped due to configuration or callbacks. */
5+
| 'skipped'
6+
/** The event was sent to Sentry successfully. */
7+
| 'rate_limit'
8+
/** The client is currently rate limited and will try again later. */
9+
| 'invalid'
10+
/** The event could not be processed. */
11+
| 'failed'
12+
/** A server-side error occurred during submission. */
13+
| 'success';

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export { Dsn, DsnComponents, DsnLike, DsnProtocol } from './dsn';
55
export { DebugImage, DebugImageType, DebugMeta } from './debugMeta';
66
export { ExtendedError } from './error';
77
export { Event, EventHint } from './event';
8+
export { EventStatus } from './eventstatus';
89
export { EventProcessor } from './eventprocessor';
910
export { Exception } from './exception';
1011
export { Extra, Extras } from './extra';
@@ -38,9 +39,6 @@ export { SeverityLevel, SeverityLevels } from './severity';
3839
export { Span, SpanContext } from './span';
3940
export { StackFrame } from './stackframe';
4041
export { Stacktrace } from './stacktrace';
41-
/* eslint-disable-next-line deprecation/deprecation */
42-
export { Status } from './status';
43-
export { StatusType } from './status';
4442
export {
4543
CustomSamplingContext,
4644
Measurements,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Event, EventType } from './event';
2+
import { EventStatus } from './eventstatus';
23
import { Session } from './session';
3-
import { StatusType } from './status';
44

55
/** JSDoc */
66
export interface Response {
7-
status: StatusType;
7+
status: EventStatus;
88
event?: Event | Session;
99
type?: EventType;
1010
reason?: string;

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** JSDoc
2-
* @deprecated Use string literals - if you require type casting, cast to StatusType type
2+
* @deprecated Use string literals - if you require type casting, cast to EventStatus type
33
*/
44
export enum Status {
55
/** The status could not be determined. */
@@ -15,5 +15,3 @@ export enum Status {
1515
/** A server-side error occurred during submission. */
1616
Failed = 'failed',
1717
}
18-
19-
export type StatusType = 'unknown' | 'skipped' | 'rate_limit' | 'invalid' | 'failed' | 'success';

Diff for: packages/utils/src/status.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { StatusType } from '@sentry/types';
1+
import { EventStatus } from '@sentry/types';
22
/**
3-
* Converts an HTTP status code to sentry status {@link StatusType}.
3+
* Converts an HTTP status code to sentry status {@link EventStatus}.
44
*
55
* @param code number HTTP status code
6-
* @returns StatusType
6+
* @returns EventStatus
77
*/
8-
export function statusFromHttpCode(code: number): StatusType {
8+
export function statusFromHttpCode(code: number): EventStatus {
99
if (code >= 200 && code < 300) {
1010
return 'success';
1111
}

0 commit comments

Comments
 (0)