-{ ObjectId, signature }  = require 'bongo'
-{ Module, Relationship } = require 'jraphical'
-KodingError              = require '../../error'
+{ ObjectId, signature, daisy }  = require 'bongo'
+{ Module, Relationship }        = require 'jraphical'
+KodingError                     = require '../../error'
 
 
 module.exports = class JStackTemplate extends Module

}

###



      @update { $set: data }, (err) => callback err, this


  cloneCustomCredentials = (client, credentials, callback) ->

    JCredential = require './credential'
    clonedCreds = []
    queue       = []

    credentials.forEach (identifier) -> queue.push ->
      JCredential.fetchByIdentifier client, identifier, (err, credential) ->
        if not err and credential
          credential.clone client, (err, cloneCredential) ->
            if err
              console.warn "Clone failed:", err
            else
              clonedCreds.push cloneCredential.identifier
            queue.next()
        else
          queue.next()

    queue.push ->
      callback null, clonedCreds

    daisy queue


  clone: permit

    advanced: [
