Skip to content
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

ref(js): Mark exports in sentryTypes as deprecated #28976

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
57 changes: 27 additions & 30 deletions static/app/sentryTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
import PropTypes from 'prop-types';

const Metadata = PropTypes.shape({
value: PropTypes.string,
message: PropTypes.string,
directive: PropTypes.string,
type: PropTypes.string,
title: PropTypes.string,
uri: PropTypes.string,
});

const Avatar = PropTypes.shape({
avatarType: PropTypes.oneOf(['letter_avatar', 'upload', 'gravatar']),
avatarUuid: PropTypes.string,
});

/**
* A User is someone that has registered on Sentry
*/
const User = PropTypes.shape({
avatar: Avatar,
avatarUrl: PropTypes.string,
Expand All @@ -40,16 +28,9 @@ const User = PropTypes.shape({
username: PropTypes.string,
});

const EventOrGroupType = PropTypes.oneOf([
'error',
'csp',
'hpkp',
'expectct',
'expectstaple',
'default',
'transaction',
]);

/**
* @deprecated
*/
const Group = PropTypes.shape({
id: PropTypes.string.isRequired,
annotations: PropTypes.array,
Expand All @@ -64,7 +45,14 @@ const Group = PropTypes.shape({
lastSeen: PropTypes.string,
level: PropTypes.string,
logger: PropTypes.string,
metadata: Metadata,
metadata: PropTypes.shape({
value: PropTypes.string,
message: PropTypes.string,
directive: PropTypes.string,
type: PropTypes.string,
title: PropTypes.string,
uri: PropTypes.string,
}),
numComments: PropTypes.number,
permalink: PropTypes.string,
project: PropTypes.shape({
Expand All @@ -76,7 +64,15 @@ const Group = PropTypes.shape({
status: PropTypes.string,
statusDetails: PropTypes.object,
title: PropTypes.string,
type: EventOrGroupType,
type: PropTypes.oneOf([
'error',
'csp',
'hpkp',
'expectct',
'expectstaple',
'default',
'transaction',
]),
userCount: PropTypes.number,
});

Expand All @@ -85,6 +81,9 @@ const Team = PropTypes.shape({
slug: PropTypes.string.isRequired,
});

/**
* @deprecated
*/
const Project = PropTypes.shape({
// snuba returns id as number
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
Expand All @@ -97,13 +96,11 @@ const Project = PropTypes.shape({
status: PropTypes.string,
});

/**
* @deprecated
*/
const Organization = PropTypes.shape({
id: PropTypes.string.isRequired,
});

export default {
Group,
Organization,
Project,
User,
};
export default {Group, Organization, Project};