Skip to content

Commit ac58582

Browse files
committed
Release 2.0.4
1 parent 13134e8 commit ac58582

File tree

5 files changed

+42
-4
lines changed

5 files changed

+42
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [v2.0.4](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.0.4) (2017-11-23)
4+
- Add support to invalid scope error [\#9](https://github.com/uphold/uphold-sdk-javascript/pull/9) ([SandroMachado](https://github.com/SandroMachado))
5+
36
## [v2.0.3](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.0.3) (2017-09-20)
47
- Allow for passing body that is already stringified [\#7](https://github.com/uphold/uphold-sdk-javascript/pull/7) ([evq](https://github.com/evq))
58

dist/browser/uphold-sdk-javascript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core/errors/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
6-
exports.ValidationFailedError = exports.UnknownError = exports.UnavailableError = exports.UnauthorizedError = exports.RateLimitError = exports.OTPRequiredError = exports.NotFoundError = exports.InternalServerError = exports.ForbiddenError = exports.BaseError = exports.AuthorizationRequiredError = undefined;
6+
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;
77

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

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

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

16+
var _invalidScope = require('./invalid-scope');
17+
1618
var _notFound = require('./not-found');
1719

1820
var _otpRequired = require('./otp-required');
@@ -31,11 +33,12 @@ exports.AuthorizationRequiredError = _authorizationRequired.AuthorizationRequire
3133
exports.BaseError = _base.BaseError;
3234
exports.ForbiddenError = _forbidden.ForbiddenError;
3335
exports.InternalServerError = _internalServer.InternalServerError;
36+
exports.InvalidScopeError = _invalidScope.InvalidScopeError;
3437
exports.NotFoundError = _notFound.NotFoundError;
3538
exports.OTPRequiredError = _otpRequired.OTPRequiredError;
3639
exports.RateLimitError = _rateLimit.RateLimitError;
3740
exports.UnauthorizedError = _unauthorized.UnauthorizedError;
3841
exports.UnavailableError = _unavailable.UnavailableError;
3942
exports.UnknownError = _unknown.UnknownError;
4043
exports.ValidationFailedError = _validationFailed.ValidationFailedError;
41-
exports.default = [_authorizationRequired.AuthorizationRequiredError, _forbidden.ForbiddenError, _internalServer.InternalServerError, _notFound.NotFoundError, _otpRequired.OTPRequiredError, _rateLimit.RateLimitError, _unauthorized.UnauthorizedError, _unavailable.UnavailableError, _validationFailed.ValidationFailedError, _unknown.UnknownError];
44+
exports.default = [_authorizationRequired.AuthorizationRequiredError, _forbidden.ForbiddenError, _internalServer.InternalServerError, _invalidScope.InvalidScopeError, _notFound.NotFoundError, _otpRequired.OTPRequiredError, _rateLimit.RateLimitError, _unauthorized.UnauthorizedError, _unavailable.UnavailableError, _validationFailed.ValidationFailedError, _unknown.UnknownError];

dist/core/errors/invalid-scope.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict';
2+
3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
6+
exports.InvalidScopeError = undefined;
7+
8+
var _base = require('./base');
9+
10+
class InvalidScopeError extends _base.BaseError {
11+
static hasError() {
12+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13+
14+
let body = _ref.body,
15+
status = _ref.status;
16+
17+
if (!status || !body || !body.error) {
18+
return false;
19+
}
20+
21+
if (status === 400 && body.error === 'invalid_scope') {
22+
return true;
23+
}
24+
25+
return false;
26+
}
27+
28+
constructor() {
29+
super('invalid_scope', ...arguments);
30+
}
31+
}
32+
exports.InvalidScopeError = InvalidScopeError;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uphold/uphold-sdk-javascript",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "Uphold SDK for JavasScript",
55
"keywords": [
66
"api",

0 commit comments

Comments
 (0)