cordova-plugin-hotpushes
Advanced tools
Comparing version 0.4.3 to 0.4.4
{ | ||
"name": "cordova-plugin-hotpushes", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"cordova": { | ||
@@ -5,0 +5,0 @@ "id": "cordova-plugin-hotpushes", |
@@ -10,10 +10,23 @@ /* global cordova:false */ | ||
var HOTPUSH_TYPE = { | ||
'MERGE': 'merge', | ||
'REPLACE': 'replace' | ||
'MERGE': 'merge', | ||
'REPLACE': 'replace' | ||
}; | ||
var HOTPUSH_CHECK_TYPE = { | ||
'VERSION': 'version', | ||
'TIMESTAMP': 'timestamp' | ||
'VERSION': 'version', | ||
'TIMESTAMP': 'timestamp' | ||
}; | ||
var PROGRESS_STATE: { | ||
0: 'STOPPED', | ||
1: 'DOWNLOADING', | ||
2: 'EXTRACTING', | ||
3: 'COMPLETE' | ||
}; | ||
var ERROR_STATE = { | ||
1: 'INVALID_URL_ERR', | ||
2: 'CONNECTION_ERR', | ||
3: 'UNZIP_ERR' | ||
}; | ||
/** | ||
@@ -232,3 +245,3 @@ * HotPush constructor. | ||
this._syncs[0].on('progress', function(data) { | ||
this.debug('progress: ' + data); | ||
this.debug('progress: ' + PROGRESS_STATE(data.status) + ' - ' data.progress); | ||
this.emit('progress', data); | ||
@@ -247,3 +260,3 @@ }.bind(this)); | ||
this._syncs[0].on('error', function(err) { | ||
this.debug(err, 'error'); | ||
this.debug(ERROR_STATE[err], 'error'); | ||
this.emit('error', err); | ||
@@ -441,19 +454,7 @@ }.bind(this)); | ||
/** | ||
* PROGRESS_STATE enumeration. | ||
* | ||
* Maps to the `progress` event's `status` object. | ||
* The plugin user can customize the enumeration's mapped string | ||
* to a value that's appropriate for their app. | ||
*/ | ||
PROGRESS_STATE: PROGRESS_STATE, | ||
ERROR_STATE: ERROR_STATE, | ||
PROGRESS_STATE: { | ||
0: 'STOPPED', | ||
1: 'DOWNLOADING', | ||
2: 'EXTRACTING', | ||
3: 'COMPLETE' | ||
}, | ||
HOTPUSH_TYPE: HOTPUSH_TYPE, | ||
HOTPUSH_CHECK_TYPE: HOTPUSH_CHECK_TYPE | ||
}; |
Sorry, the diff of this file is not supported yet
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
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
23732