Skip to content

fix(types): Improve attachment type #10832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion packages/types/src/attachment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
/**
* An attachment to an event. This is used to upload arbitrary data to Sentry.
*
* Please take care to not add sensitive information in attachments.
*
* https://develop.sentry.dev/sdk/envelopes/#attachment
*/
export interface Attachment {
/**
* The attachment data. Can be a string or a binary data (byte array)
*/
data: string | Uint8Array;
/**
* The name of the uploaded file without a path component
*/
filename: string;
/**
* The content type of the attachment payload. Defaults to `application/octet-stream` if not specified.
*
* Any valid [media type](https://www.iana.org/assignments/media-types/media-types.xhtml) is allowed.
*/
contentType?: string;
attachmentType?: string;
/**
* The type of the attachment. Defaults to `event.attachment` if not specified.
*/
attachmentType?: 'event.attachment' | 'event.minidump' | 'event.applecrashreport' | 'unreal.context' | 'unreal.logs';
}