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,uBAAoB,EAC3C,YAAa,KAAK,kBAAe,EACjC,sBAAuB,KAAK,4BAAyB,EACrD,mBAAoB,KAAK,yBAAsB,EAC/C,YAAa,KAAK,kBAAe,EACjC,UAAW,KAAK,gBAAa,EAC7B,QAAS,KAAK,cAAW,EACzB,YAAa,KAAK,YAClB,QAAS,OAAO,OAAO,KAAK,QAAS,KAAK,WAAa,CAAC,GAE5D,EAEA,QAAS,CAEP,iBAAkB,WAgBhB,IAAI,EAAmB,KAAK,QAAQ,SAAW,sBAAwB,QAAQ,QAAQ,cACvF,KAAK,YAAY,EAAkB,CAEjC,KAAM,KAAK,QAAQ,KACnB,QAAS,KAAK,KACd,WAAY,KAAK,QAAQ,eACzB,gBAAyC,IAAxB,KAAK,gBAE1B,EAEA,SAAU,WACR,IAAI,KAAK,YAAa,KAAK,QAAQ,cAAnC,CAEA,IAAI,EAAiB,KAAK,QAAQ,SAAW,oBAAsB,QAAQ,QAAQ,YACnF,KAAK,YAAY,EAAgB,CAE/B,WAAY,KAAK,QAAQ,gBALuB,CAOpD,GAGF,IAAK,WASH,GAPA,KAAK,IAAI,eACT,KAAK,MACD,KAAK,mBAAgD,MAA3B,KAAK,oBACjC,KAAK,IAAI,kCACT,KAAK,IAAI,MAAM,MAAM,YAAc,KAAK,oBACxC,KAAK,OAEc,SAAjB,KAAK,QAAoB,CAC3B,IAAI,EAAyB,6BACM,yBAA/B,QAAQ,IAAI,eACd,EAAyB,qCACe,SAA/B,QAAQ,IAAI,iBACrB,EAAyB,8CAG3B,KAAK,IAAI,gCACT,KAAK,IAAI,MAAM,MAAM,IACrB,KAAK,KACP,CACA,KAAK,IAAI,kBACT,KAAK,IAAI,MAAM,MAAM,sBAAwB,KAAK,UAClD,KAAK,KACP,IAEF,OAAO,QAAQ,QAAU","file":"/npm/generator-swiftserver@5.15.1/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/generator-swiftserver@5.15.1/app/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\n * Copyright IBM Corporation 2016-2017\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use strict'\nvar debug = require('debug')('generator-swiftserver:app')\n\nvar Generator = require('yeoman-generator')\nvar chalk = require('chalk')\nvar path = require('path')\nvar Handlebars = require('../lib/handlebars.js')\nvar actions = require('../lib/actions')\nvar helpers = require('../lib/helpers')\nvar validateDirName = helpers.validateDirName\nvar validateAppName = helpers.validateAppName\nvar validateCredential = helpers.validateRequiredCredential\nvar validatePort = helpers.validatePort\nvar generateServiceName = helpers.generateServiceName\n\nmodule.exports = Generator.extend({\n\n  constructor: function () {\n    Generator.apply(this, arguments)\n    // Allow the user to pass the application name into the generator directly\n    this.argument('name', {\n      desc: 'Name of the application to scaffold.',\n      required: false,\n      type: String\n    })\n\n    this.option('init', {\n      type: Boolean,\n      desc: 'Generate basic default scaffold without prompting user for input.',\n      defaults: false\n    })\n\n    this.option('skip-build', {\n      type: Boolean,\n      desc: 'Skip building the generated application',\n      defaults: false\n    })\n\n    this.option('single-shot', {\n      type: Boolean,\n      desc: 'Creates application without including generator metadata files',\n      defaults: false\n    })\n\n    this.option('type', {\n      type: String,\n      desc: 'Give a specific type of application to generate',\n      defaults: 'basic'\n    })\n\n    this.option('metrics', {\n      type: Boolean,\n      desc: 'Add health checking to project',\n      defaults: false\n    })\n\n    this.option('docker', {\n      type: Boolean,\n      desc: 'Generate a Dockerfile for the project',\n      defaults: false\n    })\n\n    this.option('healthcheck', {\n      type: Boolean,\n      desc: 'Add health checking to project',\n      defaults: true\n    })\n\n    this.option('openapi', {\n      type: Boolean,\n      desc: 'Add Kitura-OpenAPI to project',\n      defaults: false\n    })\n  },\n\n  initializing: {\n    ensureNotInProject: actions.ensureNotInProject,\n\n    checkWorkingDirectory: function () {\n        // check for %:;=<>”|\\ since they break xcode if they are\n        //  anywhere in the directory path.\n      if (validateDirName(process.cwd()) !== true) {\n        this.env.error(chalk.red(process.cwd(), 'directory path contains one or more of the following: %:;=<>”|\\\\ and will not compile in Xcode'))\n      }\n    },\n\n    initAppName: function () {\n      // save the initial directory for use by the fromSwagger processing.\n      this.initialWorkingDir = process.cwd()\n\n      this.appname = null // Discard yeoman default appname\n      this.skipPromptingAppName = false\n      if (this.options.name) {\n        // User passed a desired application name as an argument\n        var validation = validateAppName(this.options.name)\n        if (validation === true) {\n          // Desired application name is valid, skip prompting for it\n          // later\n          this.appname = this.options.name\n          this.skipPromptingAppName = true\n        } else {\n          // Log reason for validation failure, if provided\n          validation = validation || 'Application name not valid'\n          debug(this.options.name, ' is not valid because ', validation)\n          this.log(validation)\n        }\n      }\n\n      if (this.appname === null) {\n        // Fall back to name of current working directory\n        var sanitizedCWD = path.basename(process.cwd()).replace(/[åç/]+?/g, '-')\n        // if the name still contains characters %:;=<>”|\\\\ which\n        // will cause Xcode to crash, default to 'app'\n        if (validateAppName(sanitizedCWD) === true) {\n          this.appname = sanitizedCWD\n        } else {\n          // Fall back again to a known valid name\n          this.log('Failed to produce a valid application name from the current working directory')\n          debug(sanitizedCWD, ' is not a valid application name and defaulting to \\'app\\'')\n          this.appname = 'app'\n        }\n      }\n    },\n\n    _writeHandlebarsFile: function (templateFile, destinationFile, data) {\n      var template = this.fs.read(this.templatePath(templateFile))\n      var compiledTemplate = Handlebars.compile(template)\n      var output = compiledTemplate(data)\n      this.fs.write(this.destinationPath(destinationFile), output)\n    },\n\n    initSpec: function () {\n      function isTrue (value) {\n        return (value === true || value === 'true')\n      }\n\n      if (this.options.bluemix) {\n        this.skipPrompting = true\n\n        if (this.options.type) {\n          this.appType = this.options.type\n        }\n\n        if (typeof (this.options.bluemix) === 'string') {\n          this.options.bluemix = JSON.parse(this.options.bluemix)\n        }\n\n        if (typeof (this.options.starterOptions) === 'string') {\n          this.options.starterOptions = JSON.parse(this.options.starterOptions)\n        }\n\n        var appName = this.options.bluemix.name\n        var metrics = isTrue(this.options.metrics) || undefined\n        var docker = isTrue(this.options.docker) || undefined\n        var openapi = isTrue(this.options.openapi) || undefined\n        var usecase = isTrue(this.options.enableUsecase) || undefined\n        var starterOptions = this.options.starterOptions || undefined\n        var healthcheck = (typeof this.options.healthcheck === 'undefined') ? true : isTrue(this.options.healthcheck)\n\n        var web = (this.appType === 'web' || this.appType === 'bff' || undefined)\n        var hostSwagger = (this.appType === 'bff' || undefined)\n        var exampleEndpoints = (this.appType === 'bff' || undefined)\n        var swaggerUI = (this.appType === 'bff' || undefined)\n\n        this.spec = {\n          appName: appName,\n          appType: 'scaffold',\n          appDir: '.',\n          docker: docker,\n          web: web,\n          openapi: openapi,\n          hostSwagger: hostSwagger,\n          exampleEndpoints: exampleEndpoints,\n          swaggerUI: swaggerUI,\n          bluemix: this.options.bluemix,\n          metrics: metrics,\n          repoType: 'clone',\n          healthcheck: healthcheck,\n          usecase: usecase,\n          starterOptions: starterOptions,\n          deploymentOrg: this.options.deploymentOrg,\n          deploymentSpace: this.options.deploymentSpace,\n          deploymentRegion: this.options.deploymentRegion,\n          toolchainName: this.options.toolchainName\n        }\n      } else if (this.options.init) {\n        // User passed the --init flag, so no prompts, just generate basic default scaffold\n        this.destinationSet = true\n        if (this.appname !== path.basename(this.destinationRoot())) {\n          this.destinationRoot(path.resolve(this.appname))\n        }\n        this.skipPrompting = true\n        this.appPattern = 'Basic'\n        this.spec = {\n          appType: 'scaffold',\n          appName: this.appname,\n          docker: true,\n          metrics: true,\n          bluemix: {}\n        }\n      } else if (this.options.spec) {\n        try {\n          this.spec = JSON.parse(this.options.spec)\n          this.skipPrompting = true\n        } catch (err) {\n          this.env.error(chalk.red(err))\n        }\n      }\n    },\n\n    initForPrompting: function () {\n      if (this.skipPrompting) return\n      // initialize for prompting\n      this.bluemix = { server: {} }\n    }\n  },\n\n  _addService: function (serviceType, serviceName) {\n    this.services = this.services || {}\n    var service = {\n      serviceInfo: {\n        label: helpers.getBluemixServiceLabel(serviceType),\n        name: serviceName,\n        plan: helpers.getBluemixDefaultPlan(serviceType)\n      }\n    }\n    if (helpers.isThisServiceAnArray(serviceType)) service = [service]\n    this.services[serviceType] = service\n  },\n\n  prompting: {\n    promptAppName: function () {\n      if (this.skipPrompting) return\n      this.log(chalk.magenta('Initialization prompts'))\n      if (this.skipPromptingAppName) { return }\n\n      var prompts = [\n        {\n          name: 'name',\n          message: 'What\\'s the name of your application?',\n          default: this.appname,\n          validate: validateAppName\n        }\n      ]\n      return this.prompt(prompts).then((props) => {\n        this.appname = props.name\n      })\n    },\n\n    /*\n     * Configure the destination directory, asking the user if required.\n     * Set up the generator environment so that destinationRoot is set\n     * to point to the directory where we want to generate code.\n     */\n    promptAppDir: function () {\n      if (this.skipPrompting) return\n      if (this.appname === path.basename(this.destinationRoot())) {\n        // When the project name is the same as the current directory,\n        // we are assuming the user has already created the project dir\n        this.destinationSet = true\n        return\n      }\n\n      var prompts = [\n        {\n          name: 'dir',\n          message: 'Enter the name of the directory to contain the project:',\n          default: this.appname,\n          validate: validateDirName\n        }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        if (answers.dir !== '.') {\n          this.destinationSet = true\n          this.destinationRoot(path.resolve(answers.dir))\n        }\n      })\n    },\n\n    ensureEmptyDirectory: function () {\n      if (this.skipPrompting) return\n      actions.ensureEmptyDirectory.call(this)\n    },\n\n    promptAppType: function () {\n      if (this.skipPrompting) return\n\n      var prompts = [{\n        name: 'appType',\n        type: 'list',\n        message: 'Select type of project:',\n        choices: [ 'Scaffold a starter', 'Generate a CRUD application' ],\n        default: 'Scaffold a starter'\n      }]\n      return this.prompt(prompts).then((answers) => {\n        switch (answers.appType) {\n          case 'Scaffold a starter': this.appType = 'scaffold'; break\n          case 'Generate a CRUD application': this.appType = 'crud'; break\n          default:\n            this.env.error(chalk.red(`Internal error: unknown application type ${answers.appType}`))\n        }\n      })\n    },\n\n    /*\n     * Determine the application pattern so that the capability\n     * defaults can be set appropriately.\n     */\n    promptApplicationPattern: function () {\n      if (this.skipPrompting) return\n      if (this.appType !== 'scaffold') return\n\n      var prompts = [{\n        name: 'appPattern',\n        type: 'list',\n        message: 'Select capability presets for application pattern:',\n        choices: [ 'Basic', 'Web' ],\n        default: 'Basic'\n      }]\n      return this.prompt(prompts).then((answers) => {\n        switch (answers.appPattern) {\n          case 'Basic': this.appPattern = 'Basic'; break\n          case 'Web': this.appPattern = 'Web'; break\n          default:\n            this.env.error(chalk.red(`Internal error: unknown application pattern ${answers.appPattern}`))\n        }\n      })\n    },\n\n    promptCapabilities: function () {\n      if (this.skipPrompting) return\n\n      var self = this\n      function displayName (property) {\n        switch (property) {\n          case 'web': return 'Static web file serving'\n          case 'swaggerUI': return 'Swagger UI'\n          case 'metrics': return 'Embedded metrics dashboard'\n          case 'docker': return 'Docker files'\n          case 'openapi': return 'Kitura OpenAPI'\n          default:\n            self.env.error(chalk.red(`Internal error: unknown property ${property}`))\n        }\n      }\n\n      function defaultCapabilities (appPattern) {\n        switch (appPattern) {\n          case 'Basic': return [\n            'Docker files',\n            'Embedded metrics dashboard'\n          ]\n          case 'Web': return [\n            'Static web file serving',\n            'Embedded metrics dashboard',\n            'Docker files'\n          ]\n          default:\n            self.env.error(chalk.red(`Internal error: unknown application pattern ${appPattern}`))\n        }\n      }\n\n      var choices = ['metrics', 'docker', 'openapi']\n      var defaults = choices.map(displayName)\n\n      if (this.appType === 'scaffold') {\n        choices.unshift('swaggerUI')\n        choices.unshift('web')\n        defaults = defaultCapabilities(this.appPattern)\n      }\n\n      var prompts = [{\n        name: 'capabilities',\n        type: 'checkbox',\n        message: 'Select capabilities:',\n        choices: choices.map(displayName),\n        default: defaults\n      }]\n      return this.prompt(prompts).then((answers) => {\n        choices.forEach((choice) => {\n          this[choice] = (answers.capabilities.indexOf(displayName(choice)) !== -1)\n        })\n      })\n    },\n\n    promptServicesForScaffold: function () {\n      if (this.skipPrompting) return\n      if (this.appType !== 'scaffold') return\n\n      var choices = [\n        'Cloudant / CouchDB',\n        'Redis',\n        'MongoDB',\n        'PostgreSQL',\n        'ElephantSQL',\n        'AppID',\n        'Auto-scaling',\n        'Watson Assistant, formerly Conversation',\n        'Alert Notification',\n        'Push Notifications'\n      ]\n      var prompts = [{\n        name: 'services',\n        type: 'checkbox',\n        message: 'Generate boilerplate for services:',\n        choices: choices,\n        default: []\n      }]\n      return this.prompt(prompts).then((answers) => {\n        if (answers.services.indexOf('Cloudant / CouchDB') !== -1) {\n          this._addService('cloudant', generateServiceName(this.appname, 'Cloudant'))\n        }\n        if (answers.services.indexOf('Redis') !== -1) {\n          this._addService('redis', generateServiceName(this.appname, 'Redis'))\n        }\n        if (answers.services.indexOf('MongoDB') !== -1) {\n          this._addService('mongodb', generateServiceName(this.appname, 'MongoDB'))\n        }\n        if (answers.services.indexOf('PostgreSQL') !== -1) {\n          this._addService('postgresql', generateServiceName(this.appname, 'PostgreSQL'))\n        }\n        if (answers.services.indexOf('ElephantSQL') !== -1) {\n          this._addService('elephantsql', generateServiceName(this.appname, 'ElephantSQL'))\n        }\n        if (answers.services.indexOf('AppID') !== -1) {\n          this._addService('appid', generateServiceName(this.appname, 'AppID'))\n        }\n        if (answers.services.indexOf('Watson Assistant, formerly Conversation') !== -1) {\n          this._addService('conversation', generateServiceName(this.appname, 'WatsonAssistant'))\n        }\n        if (answers.services.indexOf('Alert Notification') !== -1) {\n          this._addService('alertNotification', generateServiceName(this.appname, 'AlertNotification'))\n        }\n        if (answers.services.indexOf('Push Notifications') !== -1) {\n          this._addService('push', generateServiceName(this.appname, 'PushNotifications'))\n        }\n        if (answers.services.indexOf('Auto-scaling') !== -1) {\n          this._addService('autoscaling', generateServiceName(this.appname, 'AutoScaling'))\n        }\n      })\n    },\n\n    /*\n     * Configure the data store, asking the user what type of data store they\n     * are using and configuring the data store if needed. These answers will\n     * be the basis for the config.json.\n     */\n    promptDataStoreForCRUD: function () {\n      if (this.skipPrompting) return\n      if (this.appType !== 'crud') return\n\n      var prompts = [\n        {\n          name: 'store',\n          message: 'Select data store:',\n          type: 'list',\n          choices: ['Memory (for development purposes)', 'Cloudant / CouchDB'],\n          filter: (store) => store.split(' ')[0]\n        }\n      ]\n      return this.prompt(prompts).then((answer) => {\n        // NOTE(tunniclm): no need to do anything for memory it is the default\n        // if no crudservice is passed to the refresh generator\n        if (answer.store === 'Cloudant') {\n          this._addService('cloudant', 'crudDataStore')\n          this.crudservice = 'crudDataStore'\n        }\n      })\n    },\n\n    promptServicesForCRUD: function () {\n      if (this.skipPrompting) return\n      if (this.appType !== 'crud') return\n\n      var choices = ['Auto-scaling']\n\n      var prompts = [{\n        name: 'services',\n        type: 'checkbox',\n        message: 'Generate boilerplate for services:',\n        choices: choices,\n        default: []\n      }]\n      return this.prompt(prompts).then((answers) => {\n        if (answers.services.indexOf('Auto-scaling') !== -1) {\n          this._addService('autoscaling', generateServiceName(this.appname, 'AutoScaling'))\n        }\n      })\n    },\n\n    // NOTE(tunniclm): This part of the prompting assumes there can only\n    // be one of each type of service.\n    promptConfigureServices: function () {\n      if (this.skipPrompting) return\n      if (!this.services) return\n      if (Object.keys(this.services).length === 0) return\n\n      var self = this\n      function serviceDisplayType (serviceType) {\n        switch (serviceType) {\n          case 'cloudant': return 'Cloudant / CouchDB'\n          case 'redis': return 'Redis'\n          case 'mongodb': return 'MongoDB'\n          case 'postgresql': return 'PostgreSQL'\n          case 'elephantsql': return 'ElephantSQL'\n          case 'appid': return 'AppID'\n          case 'autoscaling': return 'Auto-scaling'\n          case 'conversation': return 'Watson Assistant'\n          case 'alertNotification': return 'Alert Notification'\n          case 'push': return 'Push Notifications'\n          default:\n            self.env.error(chalk.red(`Internal error: unknown service type ${serviceType}`))\n        }\n      }\n\n      var choices = Object.keys(this.services)\n      var prompts = [{\n        name: 'configure',\n        type: 'checkbox',\n        message: 'Configure service credentials (leave unchecked for defaults):',\n        choices: choices.map(serviceDisplayType),\n        default: []\n      }]\n      return this.prompt(prompts).then((answers) => {\n        this.servicesToConfigure = {}\n        choices.forEach((serviceType) => {\n          this.servicesToConfigure[serviceType] =\n            (answers.configure.indexOf(serviceDisplayType(serviceType)) !== -1)\n        })\n      })\n    },\n\n    promptConfigureCloudant: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.cloudant) return\n\n      this.log()\n      this.log('Configure Cloudant / CouchDB')\n      var prompts = [\n        { name: 'cloudantName',\n          message: 'Enter name (blank for default):',\n          when: (answers) => this.appType !== 'crud'\n        },\n        { name: 'cloudantHost', message: 'Enter host name (blank for localhost):' },\n        {\n          name: 'cloudantPort',\n          message: 'Enter port (blank for default):',\n          validate: (port) => validatePort(port),\n          filter: (port) => (port ? parseInt(port) : port)\n        },\n        {\n          name: 'cloudantSecured',\n          message: 'Secure (https)?',\n          type: 'confirm',\n          default: false\n        },\n        { name: 'cloudantUsername', message: 'Enter username (blank for none):' },\n        {\n          name: 'cloudantPassword',\n          message: 'Enter password:',\n          type: 'password',\n          when: (answers) => answers.cloudantUsername,\n          validate: (password) => validateCredential(password)\n        }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var cloudantService = this.services.cloudant[0]\n        this.services.cloudant[0] = {\n          host: answers.cloudantHost || undefined,\n          port: answers.cloudantPort || undefined,\n          secured: answers.cloudantSecured || undefined,\n          username: answers.cloudantUsername || undefined,\n          password: answers.cloudantPassword || undefined,\n          serviceInfo: {\n            label: cloudantService.serviceInfo.label,\n            name: answers.cloudantName || cloudantService.serviceInfo.name,\n            plan: cloudantService.serviceInfo.plan\n          }\n        }\n      })\n    },\n\n    promptConfigureRedis: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.redis) return\n\n      this.log()\n      this.log('Configure Redis')\n      var prompts = [\n        { name: 'redisName',\n          message: 'Enter name (blank for default):'\n        },\n        { name: 'redisHost', message: 'Enter host name:' },\n        {\n          name: 'redisPort',\n          message: 'Enter port:',\n          validate: (port) => validatePort(port),\n          filter: (port) => (port ? parseInt(port) : port)\n        },\n        { name: 'redisPassword', message: 'Enter password:', type: 'password' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var redisService = this.services.redis\n        this.services.redis = {\n          host: answers.redisHost || undefined,\n          port: answers.redisPort || undefined,\n          password: answers.redisPassword || undefined,\n          serviceInfo: {\n            label: redisService.serviceInfo.label,\n            name: answers.redisName || redisService.serviceInfo.name,\n            plan: redisService.serviceInfo.plan\n          }\n        }\n      })\n    },\n\n    promptConfigureMongoDB: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.mongodb) return\n\n      this.log()\n      this.log('Configure MongoDB')\n      var prompts = [\n        { name: 'mongodbName',\n          message: 'Enter name (blank for default):'\n        },\n        { name: 'mongodbHost', message: 'Enter host name:' },\n        {\n          name: 'mongodbPort',\n          message: 'Enter port:',\n          validate: (port) => validatePort(port),\n          filter: (port) => (port ? parseInt(port) : port)\n        },\n        { name: 'mongodbPassword', message: 'Enter password:', type: 'password' },\n        { name: 'mongodbDatabase', message: 'Enter database name:' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var mongoService = this.services.mongodb\n        this.services.mongodb = {\n          host: answers.mongodbHost || undefined,\n          port: answers.mongodbPort || undefined,\n          password: answers.mongodbPassword || undefined,\n          database: answers.mongodbDatabase || undefined,\n          serviceInfo: {\n            label: mongoService.serviceInfo.label,\n            name: answers.mongodbName || mongoService.serviceInfo.name,\n            plan: mongoService.serviceInfo.plan\n          }\n        }\n      })\n    },\n\n    promptConfigurePostgreSQL: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.postgresql) return\n\n      this.log()\n      this.log('Configure PostgreSQL')\n      var prompts = [\n        { name: 'postgresqlName',\n          message: 'Enter name (blank for default):'\n        },\n        { name: 'postgresqlHost', message: 'Enter host name:' },\n        {\n          name: 'postgresqlPort',\n          message: 'Enter port:',\n          validate: (port) => validatePort(port),\n          filter: (port) => (port ? parseInt(port) : port)\n        },\n        { name: 'postgresqlUsername', message: 'Enter username:' },\n        { name: 'postgresqlPassword', message: 'Enter password:', type: 'password' },\n        { name: 'postgresqlDatabase', message: 'Enter database name:' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var postgreService = this.services.postgresql\n        this.services.postgresql = {\n          host: answers.postgresqlHost || undefined,\n          port: answers.postgresqlPort || undefined,\n          username: answers.postgresqlUsername || undefined,\n          password: answers.postgresqlPassword || undefined,\n          database: answers.postgresqlDatabase || undefined,\n          serviceInfo: {\n            label: postgreService.serviceInfo.label,\n            name: answers.postgresqlName || postgreService.serviceInfo.name,\n            plan: postgreService.serviceInfo.plan\n          }\n        }\n      })\n    },\n\n    promptConfigureElephantSQL: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.elephantsql) return\n\n      this.log()\n      this.log('Configure ElephantSQL')\n      var prompts = [\n        { name: 'elephantsqlName',\n          message: 'Enter name (blank for default):'\n        },\n        { name: 'elephantsqlHost', message: 'Enter host name:' },\n        {\n          name: 'elephantsqlPort',\n          message: 'Enter port:',\n          validate: (port) => validatePort(port),\n          filter: (port) => (port ? parseInt(port) : port)\n        },\n        { name: 'elephantsqlUsername', message: 'Enter username:' },\n        { name: 'elephantsqlPassword', message: 'Enter password:', type: 'password' },\n        { name: 'elephantsqlDatabase', message: 'Enter database name:' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var elephantsqlService = this.services.elephantsql\n        this.services.elephantsql = {\n          host: answers.elephantsqlHost || undefined,\n          port: answers.elephantsqlPort || undefined,\n          username: answers.elephantsqlUsername || undefined,\n          password: answers.elephantsqlPassword || undefined,\n          database: answers.elephantsqlDatabase || undefined,\n          serviceInfo: {\n            label: elephantsqlService.serviceInfo.label,\n            name: answers.elephantsqlName || elephantsqlService.serviceInfo.name,\n            plan: elephantsqlService.serviceInfo.plan\n          }\n        }\n      })\n    },\n\n    promptConfigureAutoscaling: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.autoscaling) return\n\n      this.log()\n      this.log('Configure Autoscaling')\n      var prompts = [\n        { name: 'autoscalingName', message: 'Enter name (blank for default):' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        this.services.autoscaling.serviceInfo.name = answers.autoscalingName || this.services.autoscaling.serviceInfo.name\n      })\n    },\n\n    promptConfigureWatsonAssistant: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.conversation) return\n\n      this.log()\n      this.log('Configure Watson Assistant')\n      var prompts = [\n        { name: 'watsonAssistantName', message: 'Enter name (blank for default):' },\n        { name: 'watsonAssistantAPIKey', message: 'Enter API key (blank for none):' },\n        { name: 'watsonAssistantUrl', message: 'Enter url (blank for default):' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var watsonService = this.services.conversation\n        this.services.conversation = {\n          apikey: answers.watsonAssistantAPIKey || undefined,\n          url: answers.watsonAssistantUrl || undefined,\n          serviceInfo: {\n            label: watsonService.serviceInfo.label,\n            name: answers.watsonAssistantName || watsonService.serviceInfo.name,\n            plan: watsonService.serviceInfo.plan\n          }\n        }\n      })\n    },\n\n    promptConfigureAlertNotification: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.alertNotification) return\n      this.log()\n      this.log('Configure Alert Notification')\n      var prompts = [\n        { name: 'alertNotificationName', message: 'Enter service name (blank for default):' },\n        { name: 'alertNotificationUsername', message: 'Enter username (blank for none):' },\n        { name: 'alertNotificationPassword', message: 'Enter password:', type: 'password' },\n        { name: 'alertNotificationUrl', message: 'Enter url (blank for none):' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var alertNotificationService = this.services.alertNotification\n        this.services.alertNotification = {\n          name: answers.alertNotificationUsername || undefined,\n          password: answers.alertNotificationPassword || undefined,\n          url: answers.alertNotificationUrl || undefined,\n          serviceInfo: {\n            label: alertNotificationService.serviceInfo.label,\n            name: answers.alertNotificationName || alertNotificationService.serviceInfo.name,\n            plan: alertNotificationService.plan\n          }\n        }\n      })\n    },\n\n    promptConfigurePushNotifications: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.push) return\n\n      this.log()\n      this.log('Configure Push Notifications')\n\n      var prompts = [\n        { name: 'pushNotificationsName', message: 'Enter service name (blank for default):' },\n        { name: 'pushNotificationsAppGuid', message: 'Enter app GUID (blank for none):' },\n        { name: 'pushNotificationsAPIKey', message: 'Enter API Key (blank for none):', type: 'password' },\n        {\n          name: 'pushNotificationsRegion',\n          type: 'list',\n          message: 'Enter Bluemix region:',\n          choices: [ 'US South', 'United Kingdom', 'Sydney' ],\n          default: 'US South'\n        }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var pushService = this.services.push\n        this.services.push = {\n          appGuid: answers.pushNotificationsAppGuid || undefined,\n          apikey: answers.pushNotificationsAPIKey || undefined,\n          serviceInfo: {\n            label: pushService.serviceInfo.label,\n            name: answers.pushNotificationsName || pushService.serviceInfo.name,\n            plan: pushService.serviceInfo.plan\n          }\n        }\n        switch (answers.pushNotificationsRegion) {\n          case 'US South': this.services.push.url = 'https://imfpush.ng.bluemix.net'; break\n          case 'United Kingdom': this.services.push.url = 'https://imfpush.eu-gb.bluemix.net'; break\n          case 'Sydney': this.services.push.url = 'https://imfpush.au-syd.bluemix.net'; break\n          default:\n            this.env.error(chalk.red(`Internal error: unknown region ${answers.pushNotificationsRegion}`))\n        }\n      })\n    },\n\n    promptConfigureAppID: function () {\n      if (this.skipPrompting) return\n      if (!this.servicesToConfigure) return\n      if (!this.servicesToConfigure.appid) return\n      this.log()\n      this.log('Configure AppID')\n      var prompts = [\n        { name: 'appidName', message: 'Enter name (blank for default):' },\n        { name: 'appidTenantId', message: 'Enter tenant ID:' },\n        { name: 'appidClientId', message: 'Enter client ID:' },\n        { name: 'appidSecret', message: 'Enter secret:', type: 'password' }\n      ]\n      return this.prompt(prompts).then((answers) => {\n        var appidService = this.services.appid\n        this.services.appid = {\n          tenantId: answers.appidTenantId || undefined,\n          clientId: answers.appidClientId || undefined,\n          secret: answers.appidSecret || undefined,\n          serviceInfo: {\n            label: appidService.serviceInfo.label,\n            name: answers.appidName || appidService.serviceInfo.name,\n            plan: appidService.serviceInfo.plan\n          }\n        }\n      })\n    }\n  },\n\n  createSpecFromAnswers: function () {\n    if (this.skipPrompting) return\n    // NOTE(tunniclm): This spec object may not exploit all possible functionality,\n    // some may only be available via non-prompting route.\n    if (this.services) {\n      this.bluemix.server.services = []\n      Object.keys(this.services).forEach(serviceType => {\n        var services = Array.isArray(this.services[serviceType]) ? this.services[serviceType] : [this.services[serviceType]]\n        services.forEach(service => {\n          this.bluemix.server.services.push(service.serviceInfo.name)\n        })\n      })\n    }\n    this.spec = {\n      appType: this.appType,\n      appName: this.appname,\n      docker: this.docker || undefined,\n      web: this.web || undefined,\n      openapi: this.openapi || undefined,\n      exampleEndpoints: this.exampleEndpoints || undefined,\n      fromSwagger: this.fromSwagger || undefined,\n      generateCodableRoutes: this.generateCodableRoutes || undefined,\n      serverSwaggerFiles: this.serverSwaggerFiles || undefined,\n      hostSwagger: this.hostSwagger || undefined,\n      swaggerUI: this.swaggerUI || undefined,\n      metrics: this.metrics || undefined,\n      crudservice: this.crudservice,\n      bluemix: Object.assign(this.bluemix, this.services) || {}\n    }\n  },\n\n  install: {\n\n    buildDefinitions: function () {\n      // this.composeWith() causes problems with testing using yeoman-test.\n      //\n      // When we composeWith() using the namespace:name format, then we\n      // have trouble with errors finding the composed generator when testing\n      // (it works usually when running while not testing.)\n      //\n      // So we resolve the generator to a real path to get around this, which\n      // works in both cases. However, this means the yeoman-test RunContext\n      // call withGenerators() no longer works to stub out dependent generators\n      // with dummies for unit testing.\n      //\n      // This problem is documented in https://github.com/yeoman/yeoman-test/issues/16\n      //\n      // To work around the problem, our unit tests will pass in an option 'testmode'\n      // and we will use the namespace:name form in that case.\n      var refreshGenerator = this.options.testmode ? 'swiftserver:refresh' : require.resolve('../refresh')\n      this.composeWith(refreshGenerator, {\n        // Pass in the option to refresh to decided whether or not we create the *-product.yml\n        apic: this.options.apic,\n        specObj: this.spec,\n        singleShot: this.options['single-shot'],\n        destinationSet: (this.destinationSet === true)\n      })\n    },\n\n    buildApp: function () {\n      if (this.skipBuild || this.options['skip-build']) return\n\n      var buildGenerator = this.options.testmode ? 'swiftserver:build' : require.resolve('../build')\n      this.composeWith(buildGenerator, {\n        // Pass in the option of doing single-shot so the appropriate checks are performed\n        singleShot: this.options['single-shot']\n      })\n    }\n  },\n\n  end: function () {\n    // Inform the user what they should do next\n    this.log('Next steps:')\n    this.log()\n    if (this.destinationRoot() && this.destinationRoot() !== '.') {\n      this.log('  Change directory to your app')\n      this.log(chalk.green('    $ cd ' + this.destinationRoot()))\n      this.log()\n    }\n    if (this.appType === 'crud') {\n      var createModelInstruction = '    $ yo swiftserver:model'\n      if (process.env.RUN_BY_COMMAND === 'swiftservergenerator') {\n        createModelInstruction = '    $ swiftservergenerator --model'\n      } else if (process.env.RUN_BY_COMMAND === 'apic') {\n        createModelInstruction = '    $ apic create --type model-swiftserver'\n      }\n\n      this.log('  Create a model in your app')\n      this.log(chalk.green(createModelInstruction))\n      this.log()\n    }\n    this.log('  Run your app')\n    this.log(chalk.green('    $ .build/debug/' + this.appname))\n    this.log()\n  }\n})\nmodule.exports._yeoman = Generator\n"]}