aboutsummaryrefslogtreecommitdiff
path: root/web/ui/src/lib/datasets.ts
blob: 83c2e4eac113fc41cfbd3edd84e2e0b4c786ad1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
 * The shared list of dataset slugs a user can scope an API key to.
 * Used by the create-key form, the key scope display, and the usage
 * breakdown. The order here is the order they show up in the UI.
 */
export const DATASETS = [
  'irs-990',
  'irs-990pf',
  'sec-edgar',
  'sec-13f',
  'sec-form4',
  'fec-contributions',
  'lobbying-federal',
  'usaspending',
  'pacer',
  'state-corps',
  'ucc-filings',
  'fda-faers',
  'osha',
  'nih-reporter',
  'cfpb-complaints'
] as const;

export type DatasetSlug = (typeof DATASETS)[number];

/** Friendly short label for a dataset slug. */
export function datasetLabel(slug: string): string {
  switch (slug) {
    case 'irs-990':           return 'IRS 990';
    case 'irs-990pf':         return 'IRS 990-PF';
    case 'sec-edgar':         return 'SEC EDGAR';
    case 'sec-13f':           return 'SEC 13-F';
    case 'sec-form4':         return 'SEC Form 4';
    case 'fec-contributions': return 'FEC contributions';
    case 'lobbying-federal':  return 'Federal lobbying';
    case 'usaspending':       return 'USAspending';
    case 'pacer':             return 'PACER';
    case 'state-corps':       return 'State incorporation';
    case 'ucc-filings':       return 'UCC filings';
    case 'fda-faers':         return 'FDA FAERS';
    case 'osha':              return 'OSHA inspections';
    case 'nih-reporter':      return 'NIH RePORTER';
    case 'cfpb-complaints':   return 'CFPB complaints';
    default:                  return slug;
  }
}