types.tsx 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. import {EntryException} from 'sentry/types';
  2. import type {
  3. ReplayListRecord,
  4. ReplayRecord,
  5. ReplaySpan,
  6. } from 'sentry/views/replays/types';
  7. type SimpleStub<T = any> = () => T;
  8. type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
  9. type OverridableStub<Params = any, Result = Params> = (
  10. params?: Partial<Params>
  11. ) => Result;
  12. type OverridableStubList<Params = any, Result = Params> = (
  13. params?: Array<Partial<Params>>
  14. ) => Result[];
  15. type TestStubFixtures = {
  16. AccessRequest: OverridableStub;
  17. AccountAppearance: OverridableStub;
  18. AccountEmails: OverridableStubList;
  19. ActivityFeed: OverridableStub;
  20. AllAuthenticators: SimpleStub;
  21. ApiApplication: OverridableStub;
  22. ApiKey: OverridableStub;
  23. ApiToken: OverridableStub;
  24. AsanaCreate: SimpleStub;
  25. AsanaPlugin: SimpleStub;
  26. AuditLogs: OverridableStubList;
  27. AuditLogsApiEventNames: SimpleStub;
  28. AuthProvider: OverridableStub;
  29. AuthProviders: OverridableStubList;
  30. Authenticators: SimpleStub;
  31. AvailableNotificationActions: OverridableStub;
  32. BitbucketIntegrationConfig: SimpleStub;
  33. Breadcrumb: OverridableStub;
  34. Broadcast: OverridableStub;
  35. BuiltInSymbolSources: OverridableStubList;
  36. CodeOwner: OverridableStub;
  37. Commit: OverridableStub;
  38. CommitAuthor: OverridableStub;
  39. Config: OverridableStub;
  40. DataScrubbingRelayPiiConfig: SimpleStub;
  41. DebugFile: OverridableStub;
  42. DebugSymbols: OverridableStub;
  43. DetailedEvents: SimpleStub;
  44. DiscoverSavedQuery: OverridableStub;
  45. DocIntegration: OverridableStub;
  46. Entries: SimpleStub;
  47. Environments: OverridableStub;
  48. Event: OverridableStub;
  49. EventAttachment: OverridableStub;
  50. EventEntry: OverridableStub;
  51. EventEntryDebugMeta: OverridableStub;
  52. EventEntryExceptionGroup: SimpleStub<EntryException>;
  53. EventEntryStacktrace: OverridableStub;
  54. EventIdQueryResult: OverridableStub;
  55. EventStacktraceException: OverridableStub;
  56. EventStacktraceMessage: OverridableStub;
  57. Events: OverridableStubList;
  58. EventsStats: OverridableStub;
  59. ExceptionWithMeta: OverridableStubList;
  60. ExceptionWithRawStackTrace: OverridableStub;
  61. GitHubIntegration: OverridableStub;
  62. GitHubIntegrationConfig: SimpleStub;
  63. GitHubIntegrationProvider: OverridableStub;
  64. GitHubRepositoryProvider: OverridableStub;
  65. GlobalSelection: OverridableStub;
  66. Group: OverridableStub;
  67. GroupStats: OverridableStub;
  68. GroupingConfigs: SimpleStub;
  69. GroupingEnhancements: SimpleStub;
  70. Groups: SimpleStub;
  71. Incident: OverridableStub;
  72. IncidentActivity: OverridableStub;
  73. IncidentStats: OverridableStub;
  74. IncidentTrigger: OverridableStub;
  75. InstallWizard: OverridableStub;
  76. JiraIntegration: OverridableStub;
  77. JiraIntegrationProvider: OverridableStub;
  78. Member: OverridableStub;
  79. Members: OverridableStubList;
  80. MetricRule: OverridableStub;
  81. MetricsField: OverridableStub;
  82. MetricsMeta: OverridableStub;
  83. MetricsSessionUserCountByStatusByRelease: SimpleStub;
  84. MetricsTotalCountByReleaseIn24h: SimpleStub;
  85. OrgOwnedApps: SimpleStub;
  86. Organization: OverridableStub;
  87. OrganizationEvent: OverridableStub;
  88. OrganizationIntegrations: OverridableStub;
  89. Organizations: OverridableStub;
  90. Outcomes: SimpleStub;
  91. OutcomesWithLowProcessedEvents: SimpleStub;
  92. OutcomesWithReason: SimpleStub;
  93. OutcomesWithoutClientDiscarded: SimpleStub;
  94. PhabricatorCreate: SimpleStub;
  95. PhabricatorPlugin: SimpleStub;
  96. PlatformExternalIssue: OverridableStub;
  97. Plugin: OverridableStub;
  98. PluginListConfig: SimpleStub;
  99. Plugins: OverridableStubList;
  100. Project: OverridableStub;
  101. ProjectAlertRule: OverridableStub;
  102. ProjectAlertRuleConfiguration: OverridableStub;
  103. ProjectDetails: OverridableStub;
  104. ProjectFilters: OverridableStubList;
  105. ProjectKeys: OverridableStubList;
  106. ProviderList: SimpleStub;
  107. PublishedApps: SimpleStub;
  108. PullRequest: OverridableStub;
  109. Release: (params?: any, healthParams?: any) => any;
  110. ReplayError: OverridableStub;
  111. ReplayList: OverridableStubList<ReplayListRecord>;
  112. ReplayRRWebDivHelloWorld: OverridableStub;
  113. ReplayRRWebNode: OverridableStub;
  114. ReplayRecord: OverridableStub<ReplayRecord>;
  115. ReplaySegmentBreadcrumb: OverridableStub;
  116. ReplaySegmentConsole: OverridableStub;
  117. ReplaySegmentFullsnapshot: OverridableStub;
  118. ReplaySegmentInit: OverridableStub;
  119. ReplaySegmentNavigation: OverridableStub;
  120. ReplaySegmentSpan: OverridableStub;
  121. ReplaySpanPayload: OverridableStub<
  122. Overwrite<ReplaySpan, {endTimestamp: Date; startTimestamp: Date}>,
  123. ReplaySpan
  124. >;
  125. ReplaySpanPayloadNavigate: OverridableStub<
  126. Overwrite<ReplaySpan, {endTimestamp: Date; startTimestamp: Date}>,
  127. ReplaySpan
  128. >;
  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. TeamResolutionTime: SimpleStub;
  167. Tombstones: OverridableStubList;
  168. TraceError: OverridableStub;
  169. UpdateSdkAndEnableIntegrationSuggestion: SimpleStub;
  170. User: OverridableStub;
  171. UserDetails: OverridableStub;
  172. UserFeedback: OverridableStub;
  173. UserIdentity: SimpleStub;
  174. UserTotalCountByProjectIn24h: SimpleStub;
  175. UserTotalCountByReleaseIn24h: SimpleStub;
  176. VercelProvider: SimpleStub;
  177. VstsCreate: SimpleStub;
  178. VstsIntegrationProvider: OverridableStub;
  179. VstsPlugin: SimpleStub;
  180. // TODO: These need propertly typed still
  181. // Widget(queries = {...DEFAULT_QUERIES}, options)
  182. // Dashboard(widgets = DEFAULT_WIDGETS, props = {})
  183. // AsanaAutocomplete(type = 'project', values = [DEFAULT_AUTOCOMPLETE])
  184. // PhabricatorAutocomplete(type = 'project', values = null)
  185. // RoleList(params = [], fullAccess = false)
  186. // const MOCK_RESP_VERBOSE
  187. // const MOCK_RESP_ONLY_IGNORED_CONDITIONS_INVALID
  188. // const MOCK_RESP_INCONSISTENT_PLACEHOLDERS
  189. // const MOCK_RESP_INCONSISTENT_INTERVALS
  190. };
  191. export default TestStubFixtures;