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

cordova-plugin-intercom

Package Overview
Dependencies
Maintainers
6
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-intercom - npm Package Compare versions

Comparing version 6.2.0 to 7.0.0

2

package.json
{
"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) {

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