Comparing version 1.5.2-beta to 1.6.0-beta
{ | ||
"name": "code-push", | ||
"version": "1.5.2-beta", | ||
"version": "1.6.0-beta", | ||
"description": "Management SDK for the CodePush service", | ||
@@ -18,8 +18,7 @@ "main": "script/index.js", | ||
"base-64": "^0.1.0", | ||
"fs": "0.0.2", | ||
"node-uuid": "^1.4.3", | ||
"q": "^1.4.1", | ||
"superagent": "git://github.com/visionmedia/superagent.git#45a1290b2fe5a56a1d77ca74e0b236178d58d848", | ||
"superagent": "^1.7.2", | ||
"try-json": "^1.0.0" | ||
} | ||
} |
@@ -17,2 +17,7 @@ var base64 = require("base-64"); | ||
} | ||
var Permissions; | ||
(function (Permissions) { | ||
Permissions.Owner = "Owner"; | ||
Permissions.Collaborator = "Collaborator"; | ||
})(Permissions = exports.Permissions || (exports.Permissions = {})); | ||
var AccountManager = (function () { | ||
@@ -463,2 +468,113 @@ function AccountManager(serverUrl, userAgent) { | ||
}; | ||
AccountManager.prototype.transferApp = function (appId, email) { | ||
var _this = this; | ||
return Promise(function (resolve, reject, notify) { | ||
var requester = (_this._authedAgent ? _this._authedAgent : request); | ||
var req = requester.post(_this.serverUrl + "/apps/" + appId + "/transfer/" + email); | ||
_this.attachCredentials(req, requester); | ||
req.end(function (err, res) { | ||
if (err) { | ||
reject({ message: _this.getErrorMessage(err, res) }); | ||
return; | ||
} | ||
if (res.ok) { | ||
resolve(null); | ||
} | ||
else { | ||
var body = tryJSON(res.text); | ||
if (body) { | ||
reject(body); | ||
} | ||
else { | ||
reject({ message: res.text, statusCode: res.status }); | ||
} | ||
} | ||
}); | ||
}); | ||
}; | ||
// Collaborators | ||
AccountManager.prototype.getCollaboratorsList = function (appId) { | ||
var _this = this; | ||
return Promise(function (resolve, reject, notify) { | ||
var requester = (_this._authedAgent ? _this._authedAgent : request); | ||
var req = requester.get(_this.serverUrl + "/apps/" + appId + "/collaborators"); | ||
_this.attachCredentials(req, requester); | ||
req.end(function (err, res) { | ||
if (err) { | ||
reject({ message: _this.getErrorMessage(err, res) }); | ||
return; | ||
} | ||
var body = tryJSON(res.text); | ||
if (res.ok) { | ||
if (body) { | ||
resolve(body.collaborators); | ||
} | ||
else { | ||
reject({ message: "Could not parse response: " + res.text, statusCode: res.status }); | ||
} | ||
} | ||
else { | ||
if (body) { | ||
reject(body); | ||
} | ||
else { | ||
reject({ message: res.text, statusCode: res.status }); | ||
} | ||
} | ||
}); | ||
}); | ||
}; | ||
AccountManager.prototype.addCollaborator = function (appId, email) { | ||
var _this = this; | ||
return Promise(function (resolve, reject, notify) { | ||
var requester = (_this._authedAgent ? _this._authedAgent : request); | ||
var req = requester.post(_this.serverUrl + "/apps/" + appId + "/collaborators/" + email); | ||
_this.attachCredentials(req, requester); | ||
req.end(function (err, res) { | ||
if (err) { | ||
reject({ message: _this.getErrorMessage(err, res) }); | ||
return; | ||
} | ||
if (res.ok) { | ||
resolve(null); | ||
} | ||
else { | ||
var body = tryJSON(res.text); | ||
if (body) { | ||
reject(body); | ||
} | ||
else { | ||
reject({ message: res.text, statusCode: res.status }); | ||
} | ||
} | ||
}); | ||
}); | ||
}; | ||
AccountManager.prototype.removeCollaborator = function (app, email) { | ||
var _this = this; | ||
return Promise(function (resolve, reject, notify) { | ||
var id = (typeof app === "string") ? app : app.id; | ||
var requester = (_this._authedAgent ? _this._authedAgent : request); | ||
var req = requester.del(_this.serverUrl + "/apps/" + id + "/collaborators/" + email); | ||
_this.attachCredentials(req, requester); | ||
req.end(function (err, res) { | ||
if (err) { | ||
reject({ message: _this.getErrorMessage(err, res) }); | ||
return; | ||
} | ||
if (res.ok) { | ||
resolve(null); | ||
} | ||
else { | ||
var body = tryJSON(res.text); | ||
if (body) { | ||
reject(body); | ||
} | ||
else { | ||
reject({ message: res.text, statusCode: res.status }); | ||
} | ||
} | ||
}); | ||
}); | ||
}; | ||
// Deployments | ||
@@ -465,0 +581,0 @@ AccountManager.prototype.addDeployment = function (appId, name) { |
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
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
73685
5
1785
0
+ Addedasync@1.5.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcomponent-emitter@1.2.1(transitive)
+ Addedcookiejar@2.0.6(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedextend@3.0.0(transitive)
+ Addedform-data@1.0.0-rc3(transitive)
+ Addedformidable@1.0.17(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.3.4(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.0.0(transitive)
+ Addedqs@2.3.3(transitive)
+ Addedreadable-stream@1.0.27-1(transitive)
+ Addedreduce-component@1.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedsuperagent@1.8.5(transitive)
- Removedfs@0.0.2
- Removedfs@0.0.2(transitive)
Updatedsuperagent@^1.7.2