var yeoman = require('yeoman-generator'),
    chalk = require('chalk'),
    yosay = require('yosay'),
    crypto = require('crypto');

/**
 * List of questions
 * @type {Array}
 * @private
 */
var QUESTIONS_LIST = [{
    type: 'input',
    name: 'project:name',
    message: 'Type your project name',
    default: 'sails-rest-api'
}, {
    type: 'list',
    name: 'database:adapter',
    message: 'Choose database adapter',
    choices: [
        'MySQL',
        'Mongo',
        'PostgreSQL',
        'Redis'
    ],
    default: 1
}, {
    type: 'input',
    name: 'database:user',
    message: 'Type database username (if need)',
    default: ''
}, {
    type: 'password',
    name: 'database:password',
    message: 'Type database password (if need)',
    default: ''
}, {
    type: 'input',
    name: 'database:host',
    message: 'Type your database host',
    default: 'localhost'
}, {
    type: 'input',
    name: 'database:name',
    message: 'Type your database name',
    default: 'sails-rest-api'
}, {
    type: 'input',
    name: 'application:app-secret-token',
    message: 'Type application token (checking for isOurApp policy)',
    default: crypto.randomBytes(32).toString('hex')
}, {
    type: 'input',
    name: 'application:jwt-secret-token',
    message: 'Type JWT secret (overrides)',
    default: crypto.randomBytes(32).toString('hex')
}];

module.exports = yeoman.generators.Base.extend({
    initializing: function () {
        this.pkg = require('../package.json');
    },

    prompting: function () {
        var done = this.async();

        this.log(yosay('Welcome to the laudable ' + chalk.red('Sails REST API') + ' generator!'));

        this.prompt(QUESTIONS_LIST, function (answers) {
            this.answers = answers;
            done();
        }.bind(this));
    },

    configuring: function () {
        // TODO: maybe implement
    },

    writing: function () {
        this.directory(
            this.sourceRoot(),
            this.destinationRoot()
        )
    },

    conflicts: function () {
        // TODO: maybe implement
    },

    install: function () {
        this.log(
            '\n\n' +
            chalk.yellow("NOTE: Don't forgot configure your app in") +
            chalk.red(" config/**/*.js ") +
            chalk.yellow("and") +
            chalk.red(" api/services/*.js") +
            '\n\n'
        );
    },

    end: function () {
        // TODO: maybe implement
    }
});

@@ -2116,85 +2116,340 @@
     
-this.log(%0A            '%5Cn%5Cn' +%0A            chalk.yellow(%22NOTE: Don't forgot c
+// TODO: implement npm install%0A    %7D,%0A%0A    end: function () %7B%0A        this.log(%0A            '%5Cn%5Cn' +%0A            chalk.red(%221) %22) +%0A            chalk.yellow(%22Install dependencies via%22) +%0A            chalk.red(%22 npm install%22) +%0A            '%5Cn'%0A        );%0A%0A        this.log(%0A            chalk.red(%222) %22) +%0A            chalk.yellow(%22C
 onfi
@@ -2456,17 +2456,16 @@
 gure you
-r
  app in%22
@@ -2626,72 +2626,8 @@
  );%0A
-    %7D,%0A%0A    end: function () %7B%0A        // TODO: maybe implement%0A
     

Change notification text