Q:

Convert callback to Promise

I want to convert the below callEndPointWrapper to return a Promise instead of callback.
I have tested with the below code, but awaiting on Promise for callEndpointWrapper() the request is timing out.
Am I missing any thing below?
(While debugging I see the request times out on below line of code while awaiting for Promise:
return (function callEndpoint(callback): any {
CallBack:
    function callEndPointWrapper(): any {
        return function callEndpoint(callback) {
            try {
                // gRPC call
                client[methodName](req, options, callback);
            }
            catch (err) {
                callback(err);
            }
        };
    }
const result = yield callEndpointWrapper();
// I get the correct result from callback above (both on success or error)

Promise:
function callEndPointWrapper(): Promise<any> {
  return new Promise( (resolve, reject) => {
    return (function callEndpoint(callback): any {
      try {
        // gRPC call
        resolve(client[methodName](req, options, callback));
      } catch (err) {
        reject(callback(err));
      }
    });
  });
const result = await callEndpointWrapper();
// Above request times out.

A:

The desired result of callEndPointWrapper seems to be a function (callEndPoint) that does some asynchronous work which you can further invoke to do something.
In your callback approach you are producing this callEndPoint function.
----> callEndPointWrapper returns callEndPoint which does async work.
In your promise based approach on the other hand, you are attempting to produce the result of callEndPoint rather than return callEndPoint itself. In fact, callEndPoint is never invoked within the Promise constructor. 
----> callEndPointWrapper returns a promise which never resolves and internally creates the callEndPoint function that does nothing because it's never invoked.
It's important to note that a single call to callEndPointWrapper is not async. The actual async part (assuming client methods are async) happens in callEndpoint so an async invocation for your callback-based approach would be something like:
callEndPointWrapper()(
  function callback(responseFromEndpoint) {
    // ...
  }
)

// or something like
let caller = callEndPointWrapper();
caller(function callback(responseFromEndpoint) {
    // ...
});

From this follows that the promise based approach would require two invocations as well:
await callEndPointWrapper()(); // call a wrapper which returns a function which returns a promise

A functionally equivalent (in terms of the produced result) promise-based code for your callback code is the following:
function callEndPointWrapper(): any {
    return function callEndpoint() {
      return new Promise((resolve, reject) => {
        try {
          client[methodName](req, options, (err, result) => {
            if (err) return reject(err);
            resolve(result);
          });
        } catch (err) {
          // Note: this rejection will only happen on any sync errors
          // with the above code, such as trying to invoke a non-existing
          // method on the client. This type of error is a programmer error
          // rather than an operational error in the system so you should
          // consider if such errors should even by caught by your code.
          reject(err);
        }
      });
   };
}

However, this leads to the question of what's the point of having the wrapper function at all if you're not passing any config options to be available in the closure of the callEndpoint function? 
Based on your example usage, all you need is the callEndpoint method.

It comes to mind that you might be using something like co which allows you to yield functions (thunks) and invokes them internally with a callback. 
So when you do 
yield callEndpointWrapper()

you are actually calling 
yield function callEndpoint(callback) {
  // ...
}

And then co does some magic under the hood for you.
This is a pattern that is deprecated by co and is overall ill-advised to use. Not to mention that it's very confusing (and ugly IMHO) behavior that requires knowledge of the particular library.
To use promises with co, you don't need the wrapper function. Just yield or await the result of calling callEndPoint (the same one from my promise example above), which will be a promise.
yield callEndPoint()
// or
await callEndPoint()

