openings.ts 643 B

1234567891011121314151617181920
  1. import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
  2. import { displayTable } from '../../helpers/display'
  3. export default class WorkingGroupsOpenings extends WorkingGroupsCommandBase {
  4. static description = 'Shows an overview of given working group openings'
  5. static flags = {
  6. ...WorkingGroupsCommandBase.flags,
  7. }
  8. async run(): Promise<void> {
  9. const openings = await this.getApi().openingsByGroup(this.group)
  10. const openingsRows = openings.map((o) => ({
  11. 'Opening ID': o.openingId,
  12. Type: o.type.type,
  13. Applications: o.applications.length,
  14. }))
  15. displayTable(openingsRows, 5)
  16. }
  17. }