types.tsx 5.8 KB

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