<commit_before>module.exports = notifications;
notifications.usage = "fhc notifications [list] <app-guid> [--live] "
                    + "\nfhc notifications auditlog <app-guid> [--live] "
                    + "\nfhc notifications dismiss <app-guid> <notification-guid> [<notification-guid>] [--live]";

var fhc = require("./fhc");
var common = require("./common");
var fhreq = require("./utils/request");
var ini = require('./utils/ini');

// Main update entry point
function notifications (args, cb) {
  if (args.length === 0) return cb(notifications.usage);

  if (args.length === 1){
    return doList(fhc.appId(args[0]), cb);
  } else {
    var act = args[0];
    if(act === "list"){
      return doList(fhc.appId(args[1]), cb);
    } else if(act === "auditlog"){
      return doAuditLog(fhc.appId(args[1]), cb);
    } else if(act === "dismiss"){
      return doDismiss(fhc.appId(args[1]), args.slice(2), cb);
    } else {
      return cb(notifications.usage);
    }
  }
};

function doList(appId, cb){
  return listEventLogs(appId, false, cb);
}

function doAuditLog(appId, cb){
  return listEventLogs(appId, true, cb);
}

function listEventLogs(appId, audit, cb){
  if(!appId){
    return cb("No app guid specified. Usage: " + notifications.usage);
  }
  var env = ini.get('live') ? 'live' : 'dev';
  var uri = "box/srv/1.1/app/eventlog/listEvents";
  var payload = {appGuid: appId, eventGroup:"NOTIFICATION", env: env};
  if(audit){
    payload.audit = true;
  }
  common.doApiCall(fhreq.getFeedHenryUrl(), uri, payload, "Error getting event logs for app: ", function(err, data) {
    if(err) return cb(err);
    if(ini.get('table') === true && data.list) {
      notifications.table = common.createTableForNotifications(data.list);
    }
    return cb(undefined, data);
  });
}

function doDismiss(appId, notificationGuids, cb){
  if(!appId){
    return cb("No app guid specified. Usage: " + notifications.usage);
  }
  var uri = "box/srv/1.1/app/eventlog/dismissEvents";
  console.log(notificationGuids);
  var payload = {appGuid: appId, eventGuids: notificationGuids};
  common.doApiCall(fhreq.getFeedHenryUrl(), uri, payload, "Error dismissing event logs for app: ", function(err, data){
    if(err) return cb(err);
    return cb(undefined, data);
  });
}<commit_msg>remove console log<commit_after>module.exports = notifications;
notifications.usage = "fhc notifications [list] <app-guid> [--live] "
                    + "\nfhc notifications auditlog <app-guid> [--live] "
                    + "\nfhc notifications dismiss <app-guid> <notification-guid> [<notification-guid>] [--live]";

var fhc = require("./fhc");
var common = require("./common");
var fhreq = require("./utils/request");
var ini = require('./utils/ini');

// Main update entry point
function notifications (args, cb) {
  if (args.length === 0) return cb(notifications.usage);

  if (args.length === 1){
    return doList(fhc.appId(args[0]), cb);
  } else {
    var act = args[0];
    if(act === "list"){
      return doList(fhc.appId(args[1]), cb);
    } else if(act === "auditlog"){
      return doAuditLog(fhc.appId(args[1]), cb);
    } else if(act === "dismiss"){
      return doDismiss(fhc.appId(args[1]), args.slice(2), cb);
    } else {
      return cb(notifications.usage);
    }
  }
};

function doList(appId, cb){
  return listEventLogs(appId, false, cb);
}

function doAuditLog(appId, cb){
  return listEventLogs(appId, true, cb);
}

function listEventLogs(appId, audit, cb){
  if(!appId){
    return cb("No app guid specified. Usage: " + notifications.usage);
  }
  var env = ini.get('live') ? 'live' : 'dev';
  var uri = "box/srv/1.1/app/eventlog/listEvents";
  var payload = {appGuid: appId, eventGroup:"NOTIFICATION", env: env};
  if(audit){
    payload.audit = true;
  }
  common.doApiCall(fhreq.getFeedHenryUrl(), uri, payload, "Error getting event logs for app: ", function(err, data) {
    if(err) return cb(err);
    if(ini.get('table') === true && data.list) {
      notifications.table = common.createTableForNotifications(data.list);
    }
    return cb(undefined, data);
  });
}

function doDismiss(appId, notificationGuids, cb){
  if(!appId){
    return cb("No app guid specified. Usage: " + notifications.usage);
  }
  var uri = "box/srv/1.1/app/eventlog/dismissEvents";
  var payload = {appGuid: appId, eventGuids: notificationGuids};
  common.doApiCall(fhreq.getFeedHenryUrl(), uri, payload, "Error dismissing event logs for app: ", function(err, data){
    if(err) return cb(err);
    return cb(undefined, data);
  });
}
{'fraction_non_alphanumeric': 0.1706725468577729, 'fraction_numerical': 0.005292171995589856, 'mean_word_length': 3.681114551083591, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1508028', 'n_tokens_mistral': 1581, 'n_tokens_neox': 1527, 'n_words': 363}