Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

loopback-bluemix

Package Overview
Dependencies
Maintainers
19
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-bluemix - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

.idea/loopback-bluemix.iml

19

lib/cf.js

@@ -96,3 +96,19 @@ // Copyright IBM Corp. 2017. All Rights Reserved.

}
request(httpReq, cb);
request(httpReq, function(err, res) {
if (err) return cb(err);
if (res.statusCode >= 300) {
var errObj = {};
if (res.body && typeof res.body === 'object') {
errObj = res.body;
}
var msg = errObj.description || ('Bluemix api error: ' + res.statusCode);
err = new Error(msg);
for (var i in errObj) {
err[i] = res.body[i];
}
cb(err);
} else {
cb(err, res);
}
});
}

@@ -407,2 +423,3 @@

getServices(parent, accessToken, options, function(err, services) {
if (err) return cb(err);
var supportedServices = {};

@@ -409,0 +426,0 @@ services.forEach(function(resource) {

30

lib/datasource.js

@@ -13,3 +13,2 @@ // Copyright IBM Corp. 2017. All Rights Reserved.

var cf = require('./cf');
var cfConfig = cf.getCfConfig();
var templatesDir = path.resolve(__dirname, '..', 'templates');

@@ -22,2 +21,11 @@ var datasourcesConfigPath = path.join(templatesDir, 'bluemix', 'bluemix',

var cfConfig;
function getCfConfig() {
if (cfConfig) return cfConfig;
else {
cfConfig = cf.getCfConfig();
return cfConfig;
}
}
/**

@@ -31,3 +39,3 @@ * Present Bluemix datasource selection options

datasource.log('Finding Bluemix data service instances...');
cf.getDataServiceInstances(null, cfConfig.accessToken,
cf.getDataServiceInstances(null, getCfConfig().accessToken,
function(err, resources) {

@@ -104,4 +112,6 @@ if (err) return done(err);

datasource.name = answers.serviceName;
datasource.connector = services[datasource.name].connector;
datasource.serviceGUID = services[datasource.name].guid;
var service = services[datasource.name];
if (!service) return done(new Error('Invalid service: ' + datasource.name));
datasource.connector = service.connector;
datasource.serviceGUID = service.guid;
}

@@ -149,3 +159,3 @@ return done();

var done = datasource.async();
cf.getSupportedServices(null, cfConfig.accessToken, function(err, serviceDetails) {
cf.getSupportedServices(null, getCfConfig().accessToken, function(err, serviceDetails) {
if (err) return done(err);

@@ -166,3 +176,3 @@ datasource.dataServices = serviceDetails;

datasource.servicePlans = {};
cf.getServicePlans(null, cfConfig.accessToken, service.plansUrl,
cf.getServicePlans(null, getCfConfig().accessToken, service.plansUrl,
function(err, servicePlans) {

@@ -197,4 +207,4 @@ if (err) return done(err);

details['service_plan_guid'] = datasource.servicePlans[answers.servicePlan];
details['space_guid'] = cfConfig.space.guid;
cf.provisionService(cfConfig.accessToken, details, function(err, res, service) {
details['space_guid'] = getCfConfig().space.guid;
cf.provisionService(getCfConfig().accessToken, details, function(err, res, service) {
if (err) return done(err);

@@ -213,3 +223,3 @@ datasource.serviceGUID = service.metadata.guid;

var done = datasource.async();
cf.getApps(null, cfConfig.accessToken, function(err, resources) {
cf.getApps(null, getCfConfig().accessToken, function(err, resources) {
if (err) return done(err);

@@ -225,3 +235,3 @@ var matchedApp = false;

};
cf.bindService(cfConfig.accessToken, details, function(err) {
cf.bindService(getCfConfig().accessToken, details, function(err) {
return done(err);

@@ -228,0 +238,0 @@ });

{
"name": "loopback-bluemix",
"version": "1.1.0",
"version": "1.1.1",
"description": "Utilities for generating generate Bluemix artefacts",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc