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

kinvey-backend-sdk

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kinvey-backend-sdk - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

6

CHANGELOG.md
## Changelog
### 0.4.1
* BACK-1670: Added support for business logic handler discovery
* Modified service discovery response structure
### 0.4.0
* Complete rewrite in es6, targeting node 6
* Back 1531 make backend sdk work externally
* BACK-1531: make backend sdk work externally

@@ -7,0 +11,0 @@ ### 0.3.4

@@ -40,4 +40,12 @@ /**

return this.dataLink.process(task, this.moduleGenerator.generate(task), completionCallback);
} else if (task.taskType === 'dataLinkDiscovery') {
return this.dataLink.getServiceObjects(task, completionCallback);
} else if (task.taskType === 'serviceDiscovery') {
task.discoveryObjects = {
dataLink: {
serviceObjects: this.dataLink.getServiceObjects()
},
businessLogic: {
handlers: this.businessLogic.getHandlers()
}
};
return completionCallback(null, task);
} else if (task.taskType === 'businessLogic') {

@@ -44,0 +52,0 @@ return this.businessLogic.process(task, this.moduleGenerator.generate(task), completionCallback);

@@ -21,2 +21,6 @@ /**

function getHandlers() {
return [...registeredFunctions.keys()];
}
function register(taskName, functionToExecute) {

@@ -62,2 +66,3 @@ registeredFunctions.set(taskName, functionToExecute);

exports.getHandlers = getHandlers;
exports.register = register;

@@ -64,0 +69,0 @@ exports.resolve = resolve;

5

lib/service/dataLink.js

@@ -108,5 +108,4 @@ /**

function getServiceObjects(task, callback) {
task.serviceObjects = [...registeredServiceObjects.keys()];
callback(null, task);
function getServiceObjects() {
return [...registeredServiceObjects.keys()];
}

@@ -113,0 +112,0 @@

{
"name": "kinvey-backend-sdk",
"version": "0.4.0",
"version": "0.4.1",
"description": "Backend SDK",

@@ -5,0 +5,0 @@ "engines": {

@@ -58,2 +58,6 @@ /**

describe('logic registration', () => {
afterEach((done) => {
logic.clearAll();
return done();
});
it('can register a logic task', (done) => {

@@ -67,2 +71,17 @@ logic.register(testTaskName, (request, complete) => {

});
describe('discovery', () => {
afterEach((done) => {
logic.clearAll();
return done();
});
it('returns an array of all registered business logic handlers', (done) => {
const testHandlerName = 'testObj';
logic.register(testHandlerName, () => {});
const discoveredHandlers = logic.getHandlers();
should.exist(discoveredHandlers[0]);
discoveredHandlers.length.should.eql(1);
discoveredHandlers[0].should.eql(testHandlerName);
done();
});
});
describe('completion handlers', () => {

@@ -69,0 +88,0 @@ afterEach((done) => {

@@ -116,11 +116,14 @@ /**

describe('discovery', () => {
afterEach((done) => {
data.clearAll();
return done();
});
it('returns an array of all registered serviceObjects', (done) => {
const testName = 'testObj';
const sampleTask = {};
data.serviceObject(testName);
data.getServiceObjects(sampleTask, () => {
should.exist(sampleTask.serviceObjects[0]);
sampleTask.serviceObjects[0].should.eql(testName);
done();
});
const discoveredServiceObjects = data.getServiceObjects();
discoveredServiceObjects.length.should.eql(1);
should.exist(discoveredServiceObjects[0]);
discoveredServiceObjects[0].should.eql(testName);
done();
});

@@ -127,0 +130,0 @@ });

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