types.tsx 7.0 KB

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