Fibers and meteor-promise npm pacakge

My project had a change in plans and that feature was delayed so I haven’t had a chance to try this out but the following should work.

The gist is that the promise library was overwriting the global promise which removed the await method.

Meteor.methods({
  getUrl: function(){
    var promise = hellosign.signatureRequest.createEmbedded(options)
        .then(function(response){
          var signatureId = response.signature_request.signatures[0].signature_id;
          return hellosign.embedded.getSignUrl(signatureId);
        })
        .then(function(response){
          return response.embedded.sign_url;
        });

    // promise is from when.js
    // coerce it to a Meteor promise so we know for sure
    // it will have an await() method that does the right thing
    return Promise.resolve(promise).await();
  }
})