Comparing version 0.0.18 to 0.0.19
@@ -57,14 +57,18 @@ | ||
if(err) { | ||
throw new Error(err); | ||
if(err) { | ||
throw new Error(err); | ||
con.end(); | ||
} | ||
con.end(); | ||
} | ||
con.end(); | ||
var modified_result ={}; | ||
modified_result["access_token"] = result[0].accesstoken; | ||
modified_result["refresh_token"] = result[0].refreshtoken; | ||
modified_result["expires_in"] = result[0].expirytime; | ||
modified_result["user_identifier"] = result[0].useridentifier; | ||
resolve(modified_result); | ||
if(result != undefined && result.length != 0) | ||
{ | ||
var modified_result ={}; | ||
modified_result["access_token"] = result[0].accesstoken; | ||
modified_result["refresh_token"] = result[0].refreshtoken; | ||
modified_result["expires_in"] = result[0].expirytime; | ||
modified_result["user_identifier"] = result[0].useridentifier; | ||
resolve(modified_result); | ||
} | ||
resolve(result); | ||
}); | ||
@@ -71,0 +75,0 @@ |
@@ -8,5 +8,5 @@ | ||
return new Promise(function(resolve,reject){ | ||
var mysql_util = require(crmclient.getMySQLModule()); | ||
var persistenceModule = require(crmclient.getPersistenceModule()); | ||
mysql_util.getOAuthTokens(crmclient.getUserIdentifier()).then(function(response){ | ||
persistenceModule.getOAuthTokens(crmclient.getUserIdentifier()).then(function(response){ | ||
@@ -29,3 +29,3 @@ var date = new Date(); | ||
mysql_util.updateOAuthTokens(result_obj).then(function(response){ | ||
persistenceModule.updateOAuthTokens(result_obj).then(function(response){ | ||
@@ -61,6 +61,6 @@ makeapicall(request).then(function(response){ | ||
var OAuth = require('./OAuth'); | ||
var mysql_util = require(crmclient.getMySQLModule()); | ||
var persistenceModule = require(crmclient.getPersistenceModule()); | ||
var qs = require('querystring'); | ||
mysql_util.getOAuthTokens(crmclient.getUserIdentifier()).then(function(result_obj){ | ||
persistenceModule.getOAuthTokens(crmclient.getUserIdentifier()).then(function(result_obj){ | ||
var access_token = result_obj.access_token; | ||
@@ -67,0 +67,0 @@ var baseUrl = "https://"+crmclient.getAPIURL()+"/crm/"+crmclient.getVersion() +"/"+ request.url; |
var OAuth = require('./OAuth'); | ||
var path = require("path"); | ||
@@ -8,3 +9,3 @@ var client_id = null; | ||
var user_identifier = null; | ||
var mysql_module = "./mysql/mysql_util" ; | ||
var persistenceModule = path.dirname(__filename)+"/mysql/mysql_util" ; | ||
var iamurl = "accounts.zoho.com"; | ||
@@ -40,3 +41,3 @@ var baseURL = "www.zohoapis.com"; | ||
mysql_module = config_properties.get('crm.api.tokenmanagement')?config_properties.get('crm.api.tokenmanagement'):mysql_module; | ||
persistenceModule = config_properties.get('crm.api.tokenmanagement')?config_properties.get('crm.api.tokenmanagement'):persistenceModule; | ||
@@ -94,3 +95,3 @@ baseURL = config_properties.get('crm.api.url')?config_properties.get('crm.api.url'):baseURL; | ||
version = configJSON.version?configJSON.version:version; | ||
mysql_module = configJSON.tokenmanagement?configJSON.tokenmanagement:mysql_module; | ||
persistenceModule = configJSON.tokenmanagement?configJSON.tokenmanagement:persistenceModule; | ||
@@ -126,3 +127,3 @@ ZCRMRestClient.setClientId(client_id); | ||
var mysql_util = require(mysql_module); | ||
var persistence_module = require(persistenceModule); | ||
var resultObj = ZCRMRestClient.parseAndConstructObject(response); | ||
@@ -133,3 +134,3 @@ resultObj.user_identifier = user_identifier; | ||
mysql_util.saveOAuthTokens(resultObj).then(function(save_resp){ | ||
persistence_module.saveOAuthTokens(resultObj).then(function(save_resp){ | ||
@@ -173,3 +174,3 @@ ZCRMRestClient.setUserIdentifier(user_identifier), | ||
} | ||
var mysql_util = require(mysql_module); | ||
var persistence_module = require(persistenceModule); | ||
var resultObj = ZCRMRestClient.parseAndConstructObject(response); | ||
@@ -182,3 +183,3 @@ | ||
mysql_util.saveOAuthTokens(resultObj).then(function(save_response){ | ||
persistence_module.saveOAuthTokens(resultObj).then(function(save_response){ | ||
@@ -288,5 +289,5 @@ ZCRMRestClient.setUserIdentifier(user_identifier), | ||
ZCRMRestClient.getMySQLModule = function(){ | ||
ZCRMRestClient.getPersistenceModule = function(){ | ||
return mysql_module; | ||
return persistenceModule; | ||
} | ||
@@ -293,0 +294,0 @@ |
{ | ||
"name": "zcrmsdk", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Node SDK for Zoho CRM", | ||
@@ -5,0 +5,0 @@ "main": "lib/js/ZCRMRestClient", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
37646
743