kinvey-flex-sdk
Advanced tools
Comparing version 2.0.1 to 2.0.2
## Changelog | ||
### 2.0.2 | ||
* Fixed top-level errors to return JSON, fixing the bug where an invalid shared secret would generate the wrong error | ||
* Set maxSockets to 100 for both http and https agents | ||
### 2.0.1 | ||
@@ -4,0 +8,0 @@ * Fix stringification bug on some done() calls. |
@@ -15,2 +15,4 @@ /** | ||
const http = require('http'); | ||
const https = require('https'); | ||
const data = require('./service/data'); | ||
@@ -26,2 +28,5 @@ const isNil = require('lodash.isnil'); | ||
http.globalAgent.maxSockets = 100; | ||
https.globalAgent.maxSockets = 100; | ||
class Flex { | ||
@@ -59,4 +64,5 @@ constructor(options, callback) { | ||
const result = task.response; | ||
result.body = kinveyErrors.generateKinveyError('Unauthorized', 'The Authorization Key was not valid or missing.'); | ||
result.body = kinveyErrors.generateKinveyError('Unauthorized', 'The Authorization Key was not valid or missing.').toJSON(); | ||
result.statusCode = result.body.statusCode; | ||
delete result.body.statusCode; | ||
return completionCallback(task); | ||
@@ -69,3 +75,3 @@ } | ||
const result = task.response; | ||
result.body = kinveyErrors.generateKinveyError('BadRequest', 'Invalid task Type'); | ||
result.body = kinveyErrors.generateKinveyError('BadRequest', 'Invalid task Type').toJSON(); | ||
result.statusCode = result.body.statusCode; | ||
@@ -72,0 +78,0 @@ delete result.body.statusCode; |
{ | ||
"name": "kinvey-flex-sdk", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "SDK for creating Kinvey Flex Services", | ||
@@ -21,3 +21,3 @@ "engines": { | ||
"kinvey-code-task-runner": "2.1.0", | ||
"kinvey-datalink-errors": "0.2.2", | ||
"kinvey-datalink-errors": "0.3.0", | ||
"lodash.forown": "4.2.0", | ||
@@ -24,0 +24,0 @@ "lodash.get": "4.3.0", |
@@ -230,3 +230,3 @@ /** | ||
mockTaskReceiver.taskReceived()(task, (err, result) => { | ||
err.response.body.message.should.eql('InvalidCredentials'); | ||
err.response.body.error.should.eql('InvalidCredentials'); | ||
err.response.body.description.should.eql('Invalid credentials. Please retry your request with correct credentials.'); | ||
@@ -275,3 +275,3 @@ err.response.statusCode.should.eql(401); | ||
mockTaskReceiver.taskReceived()(task, (err, result) => { | ||
err.response.body.message.should.eql('InvalidCredentials'); | ||
err.response.body.error.should.eql('InvalidCredentials'); | ||
err.response.body.description.should.eql('Invalid credentials. Please retry your request with correct credentials.'); | ||
@@ -278,0 +278,0 @@ err.response.statusCode.should.eql(401); |
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
Network access
Supply chain riskThis module accesses the network.
Found 2 instances 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
493790
9238
2
+ Addedkinvey-datalink-errors@0.3.0(transitive)
- Removedkinvey-datalink-errors@0.2.2(transitive)
Updatedkinvey-datalink-errors@0.3.0