codeownersAnalyticsEvents.ts 965 B

123456789101112131415161718192021
  1. import {IntegrationView} from './index';
  2. export enum CodeownersEvents {
  3. SETUP_CTA = 'integrations.code_owners_cta_setup_clicked',
  4. DOCS_CTA = 'integrations.code_owners_cta_docs_clicked',
  5. SHOW_PROMPT = 'integrations.show_code_owners_prompt',
  6. DISMISS_PROMPT = 'integrations.dismissed_code_owners_prompt',
  7. }
  8. // This type allows analytics functions to use the string literal or enum.KEY
  9. type CodeownersEventsLiterals = `${CodeownersEvents}`;
  10. export type CodeownersEventParameters = {
  11. [key in CodeownersEventsLiterals]: {project_id: string} & IntegrationView;
  12. };
  13. export const codeownersEventMap: Record<CodeownersEventsLiterals, string> = {
  14. [CodeownersEvents.SETUP_CTA]: 'Integrations: Code Owners CTA Setup Clicked',
  15. [CodeownersEvents.DOCS_CTA]: 'Integrations: Code Owners CTA Docs Clicked',
  16. [CodeownersEvents.SHOW_PROMPT]: 'Integrations: Show Code Owners Prompt',
  17. [CodeownersEvents.DISMISS_PROMPT]: 'Integrations: Dismissed Code Owners Prompt',
  18. };