<commit_before>var prompt = require("prompt")
var LoadPackage = require("3vot-cloud/utils/package_loader")

var Create = require("3vot-cloud/app/create")
var Download = require("3vot-cloud/app/download")
var Upload = require("3vot-cloud/app/upload")
var Build = require("3vot-cloud/app/build")

var Install = require("3vot-cloud/app/install")
var Log = require("3vot-cloud/utils/log")

var Stats = require("3vot-cloud/utils/stats")


function static(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name ( The name of the app you want to create )' } ], 
    function (err, result) {
      result.static = true;
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")
      LoadPackage(result)
      .then( Create )
      .then( function(){ Log.info("OK. The App was created. To preview locally type: 3vot server "); } )
      .then( function(){ return Stats.track("app:static", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app",27); });  
    }
  );
}

function create(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name: ( only lowercase letters and numbers )' } 
		], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      LoadPackage(result)
      .then( Create )
      .then( function(){ Log.info("OK. The App was created. To run locally type: clay server -app " + result.app_name); } )
      .then( function(){ return Stats.track("app:create", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app",41); });
  });
}

function download(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_user_name', description: 'Profile: ( The profile name of the owner of the app )' }, 
    { name: 'app_name', description: 'App: ( The App you want to Download )' },
    { name: 'app_version', description: 'Version: ( The App version, hit enter for latest )' } ], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      LoadPackage(result)
      .then( Download )
      .then( function(){ Log.info("The App was downloaded. To preview locally type: clay develop " + result.app_name); } )
      .then( function(){ return Stats.track("app:download", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app", 69 ); });  
   });
}

function template(callback){
  prompt.start();
  prompt.get( [ { name: 'app_name', description: 'App: ( The App you want to Download )' } ], 
    function (err, result) {
      result.app_user_name = "template"
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      LoadPackage(result)
      .then( Download )
      .then( function(){ Log.info("OK. The App Template was downloaded. To preview locally type: clay develop " + result.app_name); } )
      .then( function(){ return Stats.track("app:template", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app", 82 ); });  
   });
}


function upload(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'password', description: 'Salesforce Password: ' },
], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

    LoadPackage(result)
    .then( Upload )
    .then( function(){ Log.info("OK. The App was uploaded."); } )
    .then( function(){ return Stats.track("app:upload", result ) } )
    .then( function(){ if(callback) return callback(); })
    .fail( function(err){ Log.error(err, "./prompt/app",146 ); });

  })
}


function install(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name ( The name of the app you want to install )' } ], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      LoadPackage(result)
      .then( Install )
      .then( function(){ Log.info("OK. The App was installed"); } )
      .then( function(){ return Stats.track("app:install", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){ Log.error(err, "./prompt/app",140 ); });
  });
}


function build(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name ( The name of the app you want to create )' },
    { name: 'target', description: 'Build Target ( localhost, demo, production )' } ], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      Build(result.app_name, result.target)
      .then( function(){ Log.info("OK. The App was build for " + result.target ); } )
      .then( function(){ return Stats.track("app:build", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){ Log.error(err, "./prompt/app",154 ); });
  });
}


module.exports = {
  create: create,
  upload: upload,
  download: download,
  build: build,
  install: install,
  template: template,
  static: static
}
<commit_msg>Update app.js<commit_after>var prompt = require("prompt")
var LoadPackage = require("3vot-cloud/utils/package_loader")

var Create = require("3vot-cloud/app/create")
var Download = require("3vot-cloud/app/download")
var Upload = require("3vot-cloud/app/upload")
var Build = require("3vot-cloud/app/build")

var Install = require("3vot-cloud/app/install")
var Log = require("3vot-cloud/utils/log")

var Stats = require("3vot-cloud/utils/stats")


function static(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name ( The name of the app you want to create )' } ], 
    function (err, result) {
      result.static = true;
      Log.info("---- Clay by 3VOT ----")
      LoadPackage(result)
      .then( Create )
      .then( function(){ Log.info("Your app was created. To preview locally run: clay server "); } )
      .then( function(){ return Stats.track("app:static", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app",27); });  
    }
  );
}

function create(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name: ( only lowercase letters and numbers )' } 
		], 
    function (err, result) {
      Log.info("---- Clay by 3VOT ----")

      LoadPackage(result)
      .then( Create )
      .then( function(){ Log.info("OK. App " + result.app_name " was created. To preview locally run: clay server"); } )
      .then( function(){ return Stats.track("app:create", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app",41); });
  });
}

function download(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_user_name', description: 'Profile: ( The profile name of the owner of the app )' }, 
    { name: 'app_name', description: 'App: ( The App you want to Download )' },
    { name: 'app_version', description: 'Version: ( The App version, hit enter for latest )' } ], 
    function (err, result) {
      Log.info("---- Clay by 3VOT ----")

      LoadPackage(result)
      .then( Download )
      .then( function(){ Log.info("The App was downloaded. To preview locally type: clay server "); } )
      .then( function(){ return Stats.track("app:download", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app", 69 ); });  
   });
}

function template(callback){
  prompt.start();
  prompt.get( [ { name: 'app_name', description: 'App: ( The App you want to Download )' } ], 
    function (err, result) {
      result.app_user_name = "template"
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      LoadPackage(result)
      .then( Download )
      .then( function(){ Log.info("OK. The App Template was downloaded. To preview locally type: clay develop " + result.app_name); } )
      .then( function(){ return Stats.track("app:template", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){  Log.error(err, "./prompt/app", 82 ); });  
   });
}


function upload(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'password', description: 'Salesforce Password: ' },
], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

    LoadPackage(result)
    .then( Upload )
    .then( function(){ Log.info("OK. The App was uploaded."); } )
    .then( function(){ return Stats.track("app:upload", result ) } )
    .then( function(){ if(callback) return callback(); })
    .fail( function(err){ Log.error(err, "./prompt/app",146 ); });

  })
}


function install(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name ( The name of the app you want to install )' } ], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      LoadPackage(result)
      .then( Install )
      .then( function(){ Log.info("OK. The App was installed"); } )
      .then( function(){ return Stats.track("app:install", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){ Log.error(err, "./prompt/app",140 ); });
  });
}


function build(callback){
  prompt.start();
  prompt.get( [ 
    { name: 'app_name', description: 'App Name ( The name of the app you want to create )' },
    { name: 'target', description: 'Build Target ( localhost, demo, production )' } ], 
    function (err, result) {
      Log.info("<:> 3VOT DIGITAL CONTENT CLOUD :=)")

      Build(result.app_name, result.target)
      .then( function(){ Log.info("OK. The App was build for " + result.target ); } )
      .then( function(){ return Stats.track("app:build", result ) } )
      .then( function(){ if(callback) return callback(); })
      .fail( function(err){ Log.error(err, "./prompt/app",154 ); });
  });
}


module.exports = {
  create: create,
  upload: upload,
  download: download,
  build: build,
  install: install,
  template: template,
  static: static
}

{'fraction_non_alphanumeric': 0.1774384236453202, 'fraction_numerical': 0.0064039408866995075, 'mean_word_length': 3.165367254821502, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2421662', 'n_tokens_mistral': 3321, 'n_tokens_neox': 3156, 'n_words': 870}