<commit_before>'use strict'

let co = require('co')
let cli = require('heroku-cli-util')

function * run (context, heroku) {
  let clients = yield heroku.get('/oauth/clients')
  if (context.flags.json) {
    cli.styledJSON(clients)
  } else if (clients.length === 0) {
    cli.log('No OAuth clients.')
  } else {
    cli.table(clients, {
      printHeader: null,
      columns: [
        {key: 'name', format: name => cli.color.green(name)},
        {key: 'id'},
        {key: 'redirect_uri'}
      ]
    })
  }
}

module.exports = {
  topic: 'clients',
  description: 'list your OAuth clients',<commit_msg>sort clients by name<commit_after>'use strict'

const co = require('co')
const cli = require('heroku-cli-util')
const _ = require('lodash')

function * run (context, heroku) {
  let clients = yield heroku.get('/oauth/clients')
  clients = _.sortBy(clients, 'name')

  if (context.flags.json) {
    cli.styledJSON(clients)
  } else if (clients.length === 0) {
    cli.log('No OAuth clients.')
  } else {
    cli.table(clients, {
      printHeader: null,
      columns: [
        {key: 'name', format: name => cli.color.green(name)},
        {key: 'id'},
        {key: 'redirect_uri'}
      ]
    })
  }
}

module.exports = {
  topic: 'clients',
  description: 'list your OAuth clients',
{'fraction_non_alphanumeric': 0.16873065015479877, 'fraction_numerical': 0.0015479876160990713, 'mean_word_length': 2.918181818181818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6032170', 'n_tokens_mistral': 465, 'n_tokens_neox': 455, 'n_words': 103}