From a0415ad054d8d8bfdafa56e2edba80df23864156 Mon Sep 17 00:00:00 2001 From: tablee Date: Sat, 24 Aug 2019 16:51:52 +0800 Subject: [PATCH] adaptor code-push 3.0.1 --- core/services/client-manager.js | 4 ++++ routes/indexV1.js | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/core/services/client-manager.js b/core/services/client-manager.js index db1d084b..87a16625 100644 --- a/core/services/client-manager.js +++ b/core/services/client-manager.js @@ -125,8 +125,10 @@ proto.updateCheck = function(deploymentKey, appVersion, label, packageHash, clie downloadUrl: "", description: "", isAvailable: false, + isDisabled: true, isMandatory: false, appVersion: appVersion, + targetBinaryRange: "", packageHash: "", label: "", packageSize: 0, @@ -178,9 +180,11 @@ proto.updateCheck = function(deploymentKey, appVersion, label, packageHash, clie && _.eq(packages.deployment_id, deploymentsVersions.deployment_id) && !_.eq(packages.package_hash, packageHash)) { rs.packageId = packageId; + rs.targetBinaryRange = deploymentsVersions.app_version; rs.downloadUrl = rs.downloadURL = common.getBlobDownloadUrl(_.get(packages, 'blob_url')); rs.description = _.get(packages, 'description', ''); rs.isAvailable = _.eq(packages.is_disabled, 1) ? false : true; + rs.isDisabled = _.eq(packages.is_disabled, 1) ? true : false; rs.isMandatory = _.eq(packages.is_mandatory, 1) ? true : false; rs.appVersion = appVersion; rs.packageHash = _.get(packages, 'package_hash', ''); diff --git a/routes/indexV1.js b/routes/indexV1.js index fc9e825f..1720f1a8 100644 --- a/routes/indexV1.js +++ b/routes/indexV1.js @@ -33,17 +33,17 @@ router.get('/update_check', (req, res, next) => { delete rs.packageId; delete rs.rollout; var update_info = { - download_url : rs.downloadUrl; - description : rs.description; - is_available : rs.isAvailable; - is_disabled : rs.isDisabled; - target_binary_range: rs.targetBinaryRange; - label: rs.label; - package_hash: rs.packageHash; - package_size: rs.packageSize; - should_run_binary_version: rs.shouldRunBinaryVersion; - update_app_version: rs.updateAppVersion; - is_mandatory: rs.isMandatory; + download_url : rs.downloadUrl, + description : rs.description, + is_available : rs.isAvailable, + is_disabled : rs.isDisabled, + target_binary_range: rs.targetBinaryRange, + label: rs.label, + package_hash: rs.packageHash, + package_size: rs.packageSize, + should_run_binary_version: rs.shouldRunBinaryVersion, + update_app_version: rs.updateAppVersion, + is_mandatory: rs.isMandatory, }; res.send({"update_info": update_info}); })