diff --git a/packages/core/test/lib/transports/base.test.ts b/packages/core/test/lib/transports/base.test.ts index 1425c55c45a7..a8198ce38b3d 100644 --- a/packages/core/test/lib/transports/base.test.ts +++ b/packages/core/test/lib/transports/base.test.ts @@ -22,7 +22,7 @@ const ATTACHMENT_ENVELOPE = createEnvelope( length: 20, filename: 'test-file.txt', content_type: 'text/plain', - attachment_type: 'text', + attachment_type: 'event.attachment', }, 'attachment content', ] as AttachmentItem, diff --git a/packages/types/src/attachment.ts b/packages/types/src/attachment.ts index 44f4123c7ad2..1e619cf108ea 100644 --- a/packages/types/src/attachment.ts +++ b/packages/types/src/attachment.ts @@ -1,3 +1,10 @@ +export type AttachmentType = + | 'event.attachment' + | 'event.minidump' + | 'event.applecrashreport' + | 'unreal.context' + | 'unreal.logs'; + /** * An attachment to an event. This is used to upload arbitrary data to Sentry. * @@ -23,5 +30,5 @@ export interface Attachment { /** * The type of the attachment. Defaults to `event.attachment` if not specified. */ - attachmentType?: 'event.attachment' | 'event.minidump' | 'event.applecrashreport' | 'unreal.context' | 'unreal.logs'; + attachmentType?: AttachmentType; } diff --git a/packages/types/src/envelope.ts b/packages/types/src/envelope.ts index 05db8f118c70..fd421235d483 100644 --- a/packages/types/src/envelope.ts +++ b/packages/types/src/envelope.ts @@ -1,3 +1,4 @@ +import type { AttachmentType } from './attachment'; import type { SerializedCheckIn } from './checkin'; import type { ClientReport } from './clientreport'; import type { DsnComponents } from './dsn'; @@ -66,7 +67,7 @@ type AttachmentItemHeaders = { length: number; filename: string; content_type?: string; - attachment_type?: string; + attachment_type?: AttachmentType; }; type UserFeedbackItemHeaders = { type: 'user_report' }; type FeedbackItemHeaders = { type: 'feedback' };