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

code-push

Package Overview
Dependencies
Maintainers
6
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-push - npm Package Compare versions

Comparing version 1.10.1-beta to 1.10.2-beta

2

package.json
{
"name": "code-push",
"version": "1.10.1-beta",
"version": "1.10.2-beta",
"description": "Management SDK for the CodePush service",

@@ -5,0 +5,0 @@ "main": "script/index.js",

@@ -91,1 +91,13 @@ # CodePush Management SDK (Node.js)

- __transferApp(appName: string, email: string): Promise<void>__ - Transfers the ownership of the specified app to the specified account.
### Error Handling
When an error occurs in any of the methods, the promise will be rejected with a CodePushError object with the following properties:
- __message__: A user-friendly message that describes the error.
- __statusCode__: An HTTP response code that identifies the category of error:
- __CodePush.ERROR_GATEWAY_TIMEOUT__: A network error prevented you from connecting to the CodePush server.
- __CodePush.ERROR_INTERNAL_SERVER__: An error occurred internally on the CodePush server.
- __CodePush.ERROR_NOT_FOUND__: The resource you are attempting to retrieve does not exist.
- __CodePush.ERROR_CONFLICT__: The resource you are attempting to create already exists.
- __CodePush.ERROR_UNAUTHORIZED__: The access key you configured is invalid or expired.

@@ -49,3 +49,3 @@ var os = require("os");

});
AccountManager.prototype.isAuthenticated = function () {
AccountManager.prototype.isAuthenticated = function (throwIfUnauthorized) {
var _this = this;

@@ -64,2 +64,6 @@ return Promise(function (resolve, reject, notify) {

var authenticated = status === 200;
if (!authenticated && throwIfUnauthorized) {
reject(_this.getCodePushError(err, res));
return;
}
resolve(authenticated);

@@ -66,0 +70,0 @@ });

@@ -74,2 +74,14 @@ /// <reference path="../definitions/harness.d.ts" />

});
it("isAuthenticated handles unsuccessful auth with promise rejection", function (done) {
mockReturn("Unauthorized", 401, {});
// use optional parameter to ask for rejection of the promise if not authenticated
manager.isAuthenticated(true)
.done(function (authenticated) {
assert.fail("isAuthenticated should have rejected the promise");
done();
}, function (err) {
assert.equal(err.message, "Unauthorized", "Error message should be 'Unauthorized'");
done();
});
});
it("isAuthenticated handles unexpected status codes", function (done) {

@@ -76,0 +88,0 @@ mockReturn("Not Found", 404, {});

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