Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var resourcesLib = require('./lib/resources.js');
var operations = '';
var events = '';
var operationTemplate = fs.readFileSync(
'./dev/operation.mustache',
'utf-8'
);
var eventTemplate = fs.readFileSync(
'./dev/event.mustache',
'utf-8'
);
var parsedUrl = url.parse(options.baseUrl);
swagger.authorizations.add(
'basic-auth',
new swagger.PasswordAuthorization(
parsedUrl.hostname,
options.username,
options.password
)
);
// Connect to API using swagger and attach resources on Client instance
var resourcesUrl = util.format(
'%s//%s/ari/api-docs/resources.json',
parsedUrl.protocol,
parsedUrl.host
);
var swaggerClient = new swagger.SwaggerApi({
url: resourcesUrl,
return new Promise(function(resolve, reject) {
swagger.authorizations.add(
'basic-auth',
new swagger.PasswordAuthorization(
self._connection.hostname,
self._connection.user,
self._connection.pass
)
);
// Connect to API using swagger and attach resources on Client instance
var ariUrl = util.format(
'%s//%s/ari/api-docs/resources.json',
self._connection.protocol,
self._connection.host
);
request(ariUrl, function (err) {