types.tsx 5.7 KB

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