cordova-plugin-intercom
Advanced tools
Comparing version 6.2.0 to 7.0.0
{ | ||
"name": "cordova-plugin-intercom", | ||
"version": "6.2.0", | ||
"version": "7.0.0", | ||
"description": "Official Cordova/PhoneGap plugin for Intercom", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -1,4 +0,4 @@ | ||
function fetchUpdateInfo(context, callback) { | ||
var fs = context.requireCordovaModule('fs'); | ||
var fs = require('fs'); | ||
function fetchUpdateInfo(callback) { | ||
var updateInfo = { | ||
@@ -21,4 +21,3 @@ releaseDate: 0, | ||
function writeUpdateInfo(context, updateInfo, callback) { | ||
var fs = context.requireCordovaModule('fs'); | ||
function writeUpdateInfo(updateInfo, callback) { | ||
fs.writeFile('platforms/ios/.intercom_update', JSON.stringify(updateInfo), 'utf8', function (err,data) { | ||
@@ -29,11 +28,10 @@ callback(); | ||
function updateIntercomIfNeeded(context, updateInfo, callback) { | ||
var exec = context.requireCordovaModule('child_process').exec; | ||
function updateIntercomIfNeeded(updateInfo, callback) { | ||
var exec = require('child_process').exec; | ||
var completion = function() { | ||
writeUpdateInfo(context, updateInfo, function() { | ||
writeUpdateInfo(updateInfo, function() { | ||
callback(); | ||
}); | ||
}; | ||
if (updateInfo.releaseDate > updateInfo.podUpdateDate) { | ||
@@ -53,4 +51,4 @@ console.log("Updating Intercom"); | ||
function fetchLatestRelease(context, callback) { | ||
var https = context.requireCordovaModule('https'); | ||
function fetchLatestRelease(callback) { | ||
var https = require('https'); | ||
@@ -84,14 +82,14 @@ var req = https.get({ | ||
module.exports = function(context) { | ||
var Q = context.requireCordovaModule('q'); | ||
var deferral = new Q.defer(); | ||
module.exports = function() { | ||
var q = require('q'); | ||
var deferral = new q.defer(); | ||
fetchUpdateInfo(context, function(updateInfo) { | ||
fetchUpdateInfo(function(updateInfo) { | ||
// Check at most once every 48 hours | ||
if (Date.now() - updateInfo.lastCheckDate > 1000 * 60 * 60 * 48) { | ||
fetchLatestRelease(context, function(releaseData) { | ||
fetchLatestRelease(function(releaseData) { | ||
updateInfo.lastCheckDate = Date.now(); | ||
if (releaseData != null) { | ||
updateInfo.releaseDate = Date.parse(releaseData['published_at']); | ||
updateInfo.releaseDate = Date.parse(releaseData['published_at']); | ||
} else { | ||
@@ -102,3 +100,3 @@ // last release date is unavailable, set it to today so that the pod is installed | ||
updateIntercomIfNeeded(context, updateInfo, function() { | ||
updateIntercomIfNeeded(updateInfo, function() { | ||
deferral.resolve(); | ||
@@ -105,0 +103,0 @@ }); |
@@ -1,6 +0,7 @@ | ||
module.exports = function(context) { | ||
var Q = context.requireCordovaModule('q'); | ||
var deferral = new Q.defer(); | ||
var exec = context.requireCordovaModule('child_process').exec; | ||
module.exports = function() { | ||
var q = require('q'); | ||
var exec = require('child_process').exec; | ||
var deferral = new q.defer(); | ||
console.log('Updating CocoaPods specs repo'); | ||
@@ -7,0 +8,0 @@ exec('pod repo update master', function(error, stdout, stderr) { |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
43164
165
1
3