   expect
   withConvertedUser
   generateRandomString } = require '../../index'
-JStackTemplate = require '../../../../social/lib/social/models/computeproviders/stacktemplate'
+
+JStackTemplate = require  \
+  '../../../../social/lib/social/models/computeproviders/stacktemplate'
 
 
 generateStackTemplateData = (client, data) ->

    { client }        = data
    stackTemplateData = generateStackTemplateData client, options

    JStackTemplate.create client, stackTemplateData, (err, stackTemplate) ->
      expect(err).to.not.exist
      data.stackTemplate     = stackTemplate
      data.stackTemplateData = stackTemplateData
      callback data


module.exports = {
  generateStackTemplateData
  withConvertedUserAndStackTemplate
}

  return stackTemplate


createStackTemplate = (client, options, callback) ->

  stackTemplateData = generateStackTemplateData client, options

  JStackTemplate.create client, stackTemplateData, (err, stackTemplate) ->
    callback err, { stackTemplate, stackTemplateData }


withConvertedUserAndStackTemplate = (options, callback) ->

  [options, callback] = [callback, options]  unless callback
