types.tsx 5.6 KB

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