Skip to content

Commit afcec2d

Browse files
authored
fix(types): Improve attachment type (#10832)
- add docstring and comments for all fields - make attachmentType type more specific
1 parent 2a8ef40 commit afcec2d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/types/src/attachment.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1+
/**
2+
* An attachment to an event. This is used to upload arbitrary data to Sentry.
3+
*
4+
* Please take care to not add sensitive information in attachments.
5+
*
6+
* https://develop.sentry.dev/sdk/envelopes/#attachment
7+
*/
18
export interface Attachment {
9+
/**
10+
* The attachment data. Can be a string or a binary data (byte array)
11+
*/
212
data: string | Uint8Array;
13+
/**
14+
* The name of the uploaded file without a path component
15+
*/
316
filename: string;
17+
/**
18+
* The content type of the attachment payload. Defaults to `application/octet-stream` if not specified.
19+
*
20+
* Any valid [media type](https://www.iana.org/assignments/media-types/media-types.xhtml) is allowed.
21+
*/
422
contentType?: string;
5-
attachmentType?: string;
23+
/**
24+
* The type of the attachment. Defaults to `event.attachment` if not specified.
25+
*/
26+
attachmentType?: 'event.attachment' | 'event.minidump' | 'event.applecrashreport' | 'unreal.context' | 'unreal.logs';
627
}

0 commit comments

Comments
 (0)