types.tsx 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. import {EntryException, ReleaseMeta} from 'sentry/types';
  2. import type {
  3. ReplayError,
  4. ReplayListRecord,
  5. ReplayRecord,
  6. } from 'sentry/views/replays/types';
  7. import type {Replay} from './replay';
  8. import {MockRuleCondition} from './ruleConditions';
  9. type SimpleStub<T = any> = () => T;
  10. type OverridableStub<Params = any, Result = Params> = (
  11. params?: Partial<Params>
  12. ) => Result;
  13. type OverridableVariadicStub<Params = any, Result = Params> = (
  14. ...params: Array<Partial<Params>>
  15. ) => Result;
  16. type OverridableStubList<Params = any, Result = Params> = (
  17. params?: Array<Partial<Params>>
  18. ) => Result[];
  19. type TestStubFixtures = {
  20. AccessRequest: OverridableStub;
  21. AccountEmails: OverridableStubList;
  22. ActivityFeed: OverridableStub;
  23. AllAuthenticators: SimpleStub;
  24. ApiApplication: OverridableStub;
  25. ApiToken: OverridableStub;
  26. AsanaCreate: SimpleStub;
  27. AsanaPlugin: SimpleStub;
  28. AuditLogs: OverridableStubList;
  29. AuditLogsApiEventNames: SimpleStub;
  30. AuthProvider: OverridableStub;
  31. AuthProviders: OverridableStubList;
  32. Authenticators: SimpleStub;
  33. AvailableNotificationActions: OverridableStub;
  34. BitbucketIntegrationConfig: SimpleStub;
  35. Breadcrumb: OverridableStub;
  36. Broadcast: OverridableStub;
  37. BuiltInSymbolSources: OverridableStubList;
  38. CodeOwner: OverridableStub;
  39. Commit: OverridableStub;
  40. CommitAuthor: OverridableStub;
  41. Config: OverridableStub;
  42. Dashboard: OverridableVariadicStub;
  43. DataScrubbingRelayPiiConfig: SimpleStub;
  44. DebugFile: OverridableStub;
  45. DebugSymbols: OverridableStub;
  46. DeprecatedApiKey: OverridableStub;
  47. DetailedEvents: SimpleStub;
  48. DiscoverSavedQuery: OverridableStub;
  49. DocIntegration: OverridableStub;
  50. Entries: SimpleStub;
  51. Environments: SimpleStub;
  52. Event: OverridableStub;
  53. EventAttachment: OverridableStub;
  54. EventEntry: OverridableStub;
  55. EventEntryDebugMeta: OverridableStub;
  56. EventEntryExceptionGroup: SimpleStub<EntryException>;
  57. EventEntryStacktrace: OverridableStub;
  58. EventIdQueryResult: OverridableStub;
  59. EventStacktraceException: OverridableStub;
  60. EventStacktraceMessage: OverridableStub;
  61. EventsStats: OverridableStub;
  62. ExceptionWithMeta: OverridableStubList;
  63. ExceptionWithRawStackTrace: OverridableStub;
  64. Frame: OverridableStub;
  65. GitHubIntegration: OverridableStub;
  66. GitHubIntegrationConfig: SimpleStub;
  67. GitHubIntegrationProvider: OverridableStub;
  68. GitHubRepositoryProvider: OverridableStub;
  69. GlobalSelection: OverridableStub;
  70. Group: OverridableStub;
  71. GroupStats: OverridableStub;
  72. GroupingConfigs: SimpleStub;
  73. GroupingEnhancements: SimpleStub;
  74. Groups: SimpleStub;
  75. HiddenEnvironments: SimpleStub;
  76. Incident: OverridableStub;
  77. IncidentActivity: OverridableStub;
  78. IncidentStats: OverridableStub;
  79. IncidentTrigger: OverridableStub;
  80. InstallWizard: OverridableStub;
  81. JiraIntegration: OverridableStub;
  82. JiraIntegrationProvider: OverridableStub;
  83. MOCK_RESP_INCONSISTENT_INTERVALS: MockRuleCondition;
  84. MOCK_RESP_INCONSISTENT_PLACEHOLDERS: MockRuleCondition;
  85. MOCK_RESP_ONLY_IGNORED_CONDITIONS_INVALID: MockRuleCondition;
  86. MOCK_RESP_PLACEHOLDERS: MockRuleCondition;
  87. MOCK_RESP_VERBOSE: MockRuleCondition;
  88. Member: OverridableStub;
  89. Members: OverridableStubList;
  90. MetricRule: OverridableStub;
  91. MetricsField: OverridableStub;
  92. MetricsMeta: OverridableStub;
  93. MetricsSessionUserCountByStatusByRelease: SimpleStub;
  94. MetricsTotalCountByReleaseIn24h: SimpleStub;
  95. MissingMembers: OverridableStubList;
  96. NotificationDefaults: SimpleStub;
  97. OrgOwnedApps: SimpleStub;
  98. OrgRoleList: OverridableStub;
  99. Organization: OverridableStub;
  100. OrganizationEvent: OverridableStub;
  101. OrganizationIntegrations: OverridableStub;
  102. Organizations: OverridableStub;
  103. Outcomes: SimpleStub;
  104. OutcomesWithLowProcessedEvents: SimpleStub;
  105. OutcomesWithReason: SimpleStub;
  106. OutcomesWithoutClientDiscarded: SimpleStub;
  107. PageFilters: OverridableStub;
  108. PhabricatorCreate: SimpleStub;
  109. PhabricatorPlugin: SimpleStub;
  110. PlatformExternalIssue: OverridableStub;
  111. Plugin: OverridableStub;
  112. PluginListConfig: SimpleStub;
  113. Plugins: OverridableStubList;
  114. Project: OverridableStub;
  115. ProjectAlertRule: OverridableStub;
  116. ProjectAlertRuleConfiguration: OverridableStub;
  117. ProjectDetails: OverridableStub;
  118. ProjectFilters: OverridableStubList;
  119. ProjectKeys: OverridableStubList;
  120. ProviderList: SimpleStub;
  121. PublishedApps: SimpleStub;
  122. PullRequest: OverridableStub;
  123. Release: (params?: any, healthParams?: any) => any;
  124. ReleaseMeta: OverridableStub<ReleaseMeta>;
  125. Replay: typeof Replay;
  126. ReplayError: OverridableStub<ReplayError>;
  127. ReplayList: OverridableStubList<ReplayListRecord>;
  128. ReplayRecord: OverridableStub<ReplayRecord>;
  129. Repository: OverridableStub;
  130. RepositoryProjectPathConfig: OverridableStub;
  131. Search: OverridableStub;
  132. Searches: OverridableStubList;
  133. SentryApp: OverridableStub;
  134. SentryAppComponent: OverridableStub;
  135. SentryAppComponentAsync: OverridableStub;
  136. SentryAppComponentDependent: OverridableStub;
  137. SentryAppInstallation: OverridableStub;
  138. SentryAppInstalls: SimpleStub;
  139. SentryAppToken: OverridableStub;
  140. SentryAppWebhookRequest: OverridableStub;
  141. ServiceIncident: OverridableStub;
  142. SessionEmptyGroupedResponse: SimpleStub;
  143. SessionStatusCountByProjectInPeriod: SimpleStub;
  144. SessionStatusCountByReleaseInPeriod: SimpleStub;
  145. SessionTotalCountByProjectIn24h: SimpleStub;
  146. SessionUserCountByStatus: SimpleStub;
  147. SessionUserCountByStatus2: SimpleStub;
  148. SessionUserCountByStatusByRelease: SimpleStub;
  149. SessionUserStatusCountByProjectInPeriod: SimpleStub;
  150. SessionUserStatusCountByReleaseInPeriod: SimpleStub;
  151. SessionsField: OverridableStub;
  152. SesssionTotalCountByReleaseIn24h: SimpleStub;
  153. ShortIdQueryResult: OverridableStub;
  154. SourceMapArchive: OverridableStub;
  155. SourceMapArtifact: OverridableStub;
  156. SourceMapsDebugIDBundles: OverridableStub;
  157. SourceMapsDebugIDBundlesArtifacts: OverridableStub;
  158. Span: OverridableStub;
  159. Subscriptions: OverridableStubList;
  160. TagValues: OverridableStubList;
  161. Tags: OverridableStubList;
  162. Team: OverridableStub;
  163. TeamAlertsTriggered: SimpleStub;
  164. TeamIssuesBreakdown: SimpleStub;
  165. TeamIssuesReviewed: SimpleStub;
  166. TeamReleaseCounts: SimpleStub;
  167. TeamResolutionTime: SimpleStub;
  168. TeamRoleList: OverridableStub;
  169. Tombstones: OverridableStubList;
  170. TraceError: OverridableStub;
  171. UpdateSdkAndEnableIntegrationSuggestion: SimpleStub;
  172. User: OverridableStub;
  173. UserDetails: OverridableStub;
  174. UserFeedback: OverridableStub;
  175. UserIdentity: SimpleStub;
  176. UserTotalCountByProjectIn24h: SimpleStub;
  177. UserTotalCountByReleaseIn24h: SimpleStub;
  178. VercelProvider: SimpleStub;
  179. VstsCreate: SimpleStub;
  180. VstsIntegrationProvider: OverridableStub;
  181. VstsPlugin: SimpleStub;
  182. Widget: OverridableVariadicStub;
  183. // TODO: These need propertly typed still
  184. // Widget(queries = {...DEFAULT_QUERIES}, options)
  185. // Dashboard(widgets = DEFAULT_WIDGETS, props = {})
  186. // AsanaAutocomplete(type = 'project', values = [DEFAULT_AUTOCOMPLETE])
  187. // PhabricatorAutocomplete(type = 'project', values = null)
  188. // RoleList(params = [], fullAccess = false)
  189. };
  190. export default TestStubFixtures;