Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.action( function (webhookFile, options) {
if(options.bstProxy) {
const proxy = BSTProxy.http(3000);
proxy.start(() => {
const data = fs.readFileSync(path.join(getUserHome(), ".bst/config"));
const bstConfig = JSON.parse(data.toString());
const proxyURL = "https://" + bstConfig.sourceID + ".bespoken.link/webhook";
const dashboardURL = "https://bespoken.tools/dashboard?id=" + bstConfig.sourceID + "&key=" + bstConfig.secretKey;
let messageOutput = "Your public URL for accessing your local service:\n";
messageOutput += proxyURL + "\n\n";
messageOutput += "Your URL for viewing requests/responses sent to your service:\n";
messageOutput += dashboardURL + "\n\n";
messageOutput += "Copy and paste this to your browser to view your transaction history and summary data.\n";
console.log(messageOutput);
});
}
const localServerFile = webhookFile ? webhookFile : "index.js";
if (args.options['disable-jovo-debugger']) {
parameters.push('--disable-jovo-debugger');
}
if (args.options['model-test']) {
parameters.push('--model-test');
}
if (args.options['port']) {
parameters.push('--port');
parameters.push(args.options['port']);
}
if (args.options['bst-proxy']) {
const proxy = BSTProxy.http(port);
proxy.start(() => {
const data = fs.readFileSync(path.join(Utils.getUserHome(), '.bst/config'));
const bstConfig = JSON.parse(data.toString());
const proxyURL = 'https://' + bstConfig.sourceID + '.bespoken.link/webhook';
const dashboardURL = 'https://bespoken.tools/dashboard?id=' + bstConfig.sourceID + '&key=' + bstConfig.secretKey;
let messageOutput = 'Your public URL for accessing your local service:\n';
messageOutput += proxyURL + '\n\n';
messageOutput += 'Your URL for viewing requests/responses sent to your service:\n';
messageOutput += dashboardURL + '\n\n';
messageOutput += 'Copy and paste this to your browser to view your transaction history and summary data.\n';
console.log(messageOutput);
});
parameters.push('--bst-proxy');
} else {
if (stage) {
parameters.push('--stage');
parameters.push(stage);
}
if (args.options['disable-jovo-debugger']) {
parameters.push('--disable-jovo-debugger');
}
if (args.options['model-test']) {
parameters.push('--model-test');
}
if (args.options['bst-proxy']) {
const proxy = BSTProxy.http(port);
proxy.start(() => {
const data = fs.readFileSync(path.join(getUserHome(), '.bst/config'));
const bstConfig = JSON.parse(data.toString());
const proxyURL = 'https://' + bstConfig.sourceID + '.bespoken.link/webhook';
const dashboardURL = 'https://bespoken.tools/dashboard?id=' + bstConfig.sourceID + '&key=' + bstConfig.secretKey;
let messageOutput = 'Your public URL for accessing your local service:\n';
messageOutput += proxyURL + '\n\n';
messageOutput += 'Your URL for viewing requests/responses sent to your service:\n';
messageOutput += dashboardURL + '\n\n';
messageOutput += 'Copy and paste this to your browser to view your transaction history and summary data.\n';
console.log(messageOutput);
});
parameters.push('--bst-proxy');
} else if (args.options.ngrok) {
} else {