run npm install @8k/webhose-query-builder
const { WebhoseQuery } = require('8k/webhose-query-builder');
let filter = new WebhoseQuery(/*Query*/);
filter.post(); //Post filter builder
filter.thread(); //Thread filter builder
...
let url = `http://url.prefix${filter.query}`;
see docs for more info