Not so difficult, actually.
You know amount of radial segments, you know amount of tubular segments, so you can get information about vertices of start and end segments:

https://jsfiddle.net/prisoner849/6jp3snvq/
Another thing you’ll need are points for start and end of the curve.
Something like:
var curve = _your_curve_;
var pointStart = curve.getPoint(0);
var pointEnd = curve.getPoint(1);

https://jsfiddle.net/prisoner849/25mLpg3r/
The last thing is to set .index for geometries so you’ll have faces:

https://jsfiddle.net/prisoner849/yueLpdb2/
Or you can set index without setting that mid point, using just points of the tube’s ends
Creativity is up to you 