Skip to content

Commit

Permalink
Release 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ruipenso committed Nov 23, 2017
1 parent 13134e8 commit ac58582
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [v2.0.4](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.0.4) (2017-11-23)
- Add support to invalid scope error [\#9](https://github.com/uphold/uphold-sdk-javascript/pull/9) ([SandroMachado](https://github.com/SandroMachado))

## [v2.0.3](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.0.3) (2017-09-20)
- Allow for passing body that is already stringified [\#7](https://github.com/uphold/uphold-sdk-javascript/pull/7) ([evq](https://github.com/evq))

Expand Down
2 changes: 1 addition & 1 deletion dist/browser/uphold-sdk-javascript.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/core/errors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ValidationFailedError = exports.UnknownError = exports.UnavailableError = exports.UnauthorizedError = exports.RateLimitError = exports.OTPRequiredError = exports.NotFoundError = exports.InternalServerError = exports.ForbiddenError = exports.BaseError = exports.AuthorizationRequiredError = undefined;
exports.ValidationFailedError = exports.UnknownError = exports.UnavailableError = exports.UnauthorizedError = exports.RateLimitError = exports.OTPRequiredError = exports.NotFoundError = exports.InvalidScopeError = exports.InternalServerError = exports.ForbiddenError = exports.BaseError = exports.AuthorizationRequiredError = undefined;

var _authorizationRequired = require('./authorization-required');

Expand All @@ -13,6 +13,8 @@ var _forbidden = require('./forbidden');

var _internalServer = require('./internal-server');

var _invalidScope = require('./invalid-scope');

var _notFound = require('./not-found');

var _otpRequired = require('./otp-required');
Expand All @@ -31,11 +33,12 @@ exports.AuthorizationRequiredError = _authorizationRequired.AuthorizationRequire
exports.BaseError = _base.BaseError;
exports.ForbiddenError = _forbidden.ForbiddenError;
exports.InternalServerError = _internalServer.InternalServerError;
exports.InvalidScopeError = _invalidScope.InvalidScopeError;
exports.NotFoundError = _notFound.NotFoundError;
exports.OTPRequiredError = _otpRequired.OTPRequiredError;
exports.RateLimitError = _rateLimit.RateLimitError;
exports.UnauthorizedError = _unauthorized.UnauthorizedError;
exports.UnavailableError = _unavailable.UnavailableError;
exports.UnknownError = _unknown.UnknownError;
exports.ValidationFailedError = _validationFailed.ValidationFailedError;
exports.default = [_authorizationRequired.AuthorizationRequiredError, _forbidden.ForbiddenError, _internalServer.InternalServerError, _notFound.NotFoundError, _otpRequired.OTPRequiredError, _rateLimit.RateLimitError, _unauthorized.UnauthorizedError, _unavailable.UnavailableError, _validationFailed.ValidationFailedError, _unknown.UnknownError];
exports.default = [_authorizationRequired.AuthorizationRequiredError, _forbidden.ForbiddenError, _internalServer.InternalServerError, _invalidScope.InvalidScopeError, _notFound.NotFoundError, _otpRequired.OTPRequiredError, _rateLimit.RateLimitError, _unauthorized.UnauthorizedError, _unavailable.UnavailableError, _validationFailed.ValidationFailedError, _unknown.UnknownError];
32 changes: 32 additions & 0 deletions dist/core/errors/invalid-scope.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.InvalidScopeError = undefined;

var _base = require('./base');

class InvalidScopeError extends _base.BaseError {
static hasError() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

let body = _ref.body,
status = _ref.status;

if (!status || !body || !body.error) {
return false;
}

if (status === 400 && body.error === 'invalid_scope') {
return true;
}

return false;
}

constructor() {
super('invalid_scope', ...arguments);
}
}
exports.InvalidScopeError = InvalidScopeError;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uphold/uphold-sdk-javascript",
"version": "2.0.3",
"version": "2.0.4",
"description": "Uphold SDK for JavasScript",
"keywords": [
"api",
Expand Down

0 comments on commit ac58582

Please sign in to comment.