kinvey-backend-sdk
Advanced tools
Comparing version 0.3.4 to 0.4.0
## Changelog | ||
### 0.4.0 | ||
* Complete rewrite in es6, targeting node 6 | ||
* Back 1531 make backend sdk work externally | ||
### 0.3.4 | ||
@@ -4,0 +8,0 @@ * Parse request.query if it is stringified |
@@ -13,3 +13,2 @@ // Copyright (c) 2016 Kinvey Inc. | ||
require('coffee-script/register') | ||
module.exports = require('./lib/sdk'); |
{ | ||
"name": "kinvey-backend-sdk", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "Backend SDK", | ||
"engines": { | ||
"node": "= 0.10.x" | ||
"node": "= 6.2.x" | ||
}, | ||
"author": "Kinvey <support@kinvey.com>", | ||
"contributors": [ | ||
"Michael Salinger <mjsalinger@kinvey.com>" | ||
"Michael Salinger <mjsalinger@kinvey.com>", | ||
"Sam Levin <sam@kinvey.com>" | ||
], | ||
"repository" : { "type": "git", "url": "Kinvey/backend-sdk" }, | ||
"repository": { | ||
"type": "git", | ||
"url": "Kinvey/backend-sdk" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"coffee-script": "1.7.1", | ||
"request": "2.44.0", | ||
"moment": "2.10.6", | ||
"bson":"0.4.15", | ||
"kinvey-code-task-runner": "0.1.3", | ||
"kinvey-datalink-errors": "0.2.2" | ||
"bson": "0.4.23", | ||
"kinvey-code-task-runner": "0.2.0", | ||
"kinvey-datalink-errors": "0.2.2", | ||
"lodash.forown": "4.2.0", | ||
"lodash.get": "4.3.0", | ||
"lodash.has": "4.4.0", | ||
"lodash.isnil": "4.0.0", | ||
"moment": "2.13.0", | ||
"request": "2.72.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "1.21.4", | ||
"eslint": "2.11.1", | ||
"eslint-config-airbnb-base": "3.0.1", | ||
"eslint-plugin-import": "1.8.1", | ||
"mocha": "2.5.3", | ||
"proxyquire": "1.7.9", | ||
"should": "3.3.2", | ||
"coffeelint": "1.8.1", | ||
"proxyquire": "1.0.1", | ||
"sinon": "1.10.3" | ||
"sinon": "1.17.4" | ||
}, | ||
"scripts": { | ||
"pretest": "./node_modules/.bin/coffeelint --file ./coffeelint.json lib test", | ||
"pretest": "./node_modules/.bin/eslint lib test", | ||
"test": "mocha test/lib/modules/* test/lib/*", | ||
"test-core": "mocha test/lib/*", | ||
"test-sdk": "mocha test/lib/sdk.test.coffee", | ||
"test-datalink": "mocha test/lib/dataLink.test.coffee", | ||
"test-businesslogic": "mocha test/lib/businessLogic.test.coffee", | ||
"test-moduleGenerator": "mocha test/lib/moduleGenerator.test.coffee", | ||
"test-sdk": "mocha test/lib/sdk.test.js", | ||
"test-datalink": "mocha test/lib/dataLink.test.js", | ||
"test-businesslogic": "mocha test/lib/businessLogic.test.js", | ||
"test-moduleGenerator": "mocha test/lib/moduleGenerator.test.js", | ||
"test-modules": "mocha test/lib/modules/*", | ||
"test-backendcontext": "mocha test/lib/modules/backendContext.test.coffee", | ||
"test-email": "mocha test/lib/modules/email.test.coffee", | ||
"test-entity": "mocha test/lib/modules/entity.test.coffee", | ||
"test-kinveydate": "mocha test/lib/modules/kinveyDate.test.coffee", | ||
"test-logger": "mocha test/lib/modules/logger.test.coffee", | ||
"test-push": "mocha test/lib/modules/push.test.coffee", | ||
"test-requestcontext": "mocha test/lib/modules/requestContext.test.coffee", | ||
"test-tempobjectstore": "mocha test/lib/modules/tempObjectStore.test.coffee", | ||
"test-validation": "mocha test/lib/modules/validation.test.coffee" | ||
"test-backendcontext": "mocha test/lib/modules/backendContext.test.js", | ||
"test-email": "mocha test/lib/modules/email.test.js", | ||
"test-entity": "mocha test/lib/modules/entity.test.js", | ||
"test-kinveydate": "mocha test/lib/modules/kinveyDate.test.js", | ||
"test-logger": "mocha test/lib/modules/logger.test.js", | ||
"test-push": "mocha test/lib/modules/push.test.js", | ||
"test-requestcontext": "mocha test/lib/modules/requestContext.test.js", | ||
"test-tempobjectstore": "mocha test/lib/modules/tempObjectStore.test.js", | ||
"test-validation": "mocha test/lib/modules/validation.test.js" | ||
} | ||
} |
@@ -18,3 +18,3 @@ # Kinvey Backend SDK (beta) | ||
``` | ||
var sdk = require('kinvey-backend-sdk'); | ||
const sdk = require('kinvey-backend-sdk'); | ||
``` | ||
@@ -25,3 +25,3 @@ | ||
``` | ||
var service = sdk.service(function(err, service) { | ||
const service = sdk.service((err, service) => { | ||
// code goes here | ||
@@ -31,2 +31,13 @@ }; | ||
When running locally, you can specify a host and port to listen on by passing an options object with an optional host and port. If no host/port is specified, localhost:10001 will be used: | ||
``` | ||
const service = sdk.service({ host: 'somehost', port: 7777 }, (err, service) => { | ||
// code goes here | ||
}; | ||
``` | ||
To run your code locally, execute `node .` in the root of your project. Routes conform to the Kinvey Data Link specification. | ||
## DataLink framework | ||
@@ -37,3 +48,3 @@ | ||
``` | ||
var dataLink = sdk.dataLink; | ||
const dataLink = sdk.dataLink; | ||
``` | ||
@@ -47,3 +58,3 @@ | ||
// To register the 'widgets' ServiceObject: | ||
var widgets = sdk.dataLink.serviceObject('widgets'); | ||
const widgets = sdk.dataLink.serviceObject('widgets'); | ||
``` | ||
@@ -164,12 +175,9 @@ | ||
``` | ||
var sdk = require('kinvey-backend-sdk'); | ||
var service = sdk.service(function(err, service) { | ||
var dataLink = service.dataLink; // gets the datalink object from the service | ||
var notImplementedHandler = function(request, complete) { | ||
complete("These methods are not implemented").notImplemented().done(); | ||
}; | ||
const sdk = require('kinvey-backend-sdk'); | ||
const service = sdk.service(function(err, service) { | ||
const dataLink = service.dataLink; // gets the datalink object from the service | ||
var getRecordById = function(request, complete) { | ||
var entityId = request.entityId; | ||
var entity; | ||
const getRecordById = function(request, complete) { | ||
let entityId = request.entityId; | ||
let entity = null; | ||
@@ -189,3 +197,3 @@ // Do some logic to get the entity id from the remote data store | ||
// set the serviceObject | ||
var widgets = dataLink.serviceObject('widgets'); | ||
const widgets = dataLink.serviceObject('widgets'); | ||
@@ -192,0 +200,0 @@ // wire up the event that we want to process |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance 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
237206
37
4621
215
9
7
3
1
+ Addedlodash.forown@4.2.0
+ Addedlodash.get@4.3.0
+ Addedlodash.has@4.4.0
+ Addedlodash.isnil@4.0.0
+ Addedaccepts@1.2.13(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedarray-flatten@1.1.1(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@0.2.01.0.0(transitive)
+ Addedasync@1.5.22.6.4(transitive)
+ Addedaws-sign2@0.6.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbl@1.1.2(transitive)
+ Addedbody-parser@1.15.0(transitive)
+ Addedboom@2.10.1(transitive)
+ Addedbson@0.4.23(transitive)
+ Addedbytes@2.2.02.4.0(transitive)
+ Addedcaseless@0.11.0(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedcoffee-script@1.10.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedcontent-disposition@0.5.1(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.1.5(transitive)
+ Addedcookie-signature@1.0.6(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcryptiles@2.0.5(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@2.2.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addeddestroy@1.0.4(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedetag@1.7.0(transitive)
+ Addedexpress@4.13.4(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfinalhandler@0.4.1(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@1.0.1(transitive)
+ Addedforwarded@0.1.2(transitive)
+ Addedfresh@0.3.0(transitive)
+ Addedgenerate-function@2.3.1(transitive)
+ Addedgenerate-object-property@1.2.0(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-validator@2.0.6(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhawk@3.1.3(transitive)
+ Addedhoek@2.16.3(transitive)
+ Addedhttp-errors@1.3.11.4.0(transitive)
+ Addedhttp-signature@1.1.1(transitive)
+ Addediconv-lite@0.4.13(transitive)
+ Addedinherits@2.0.1(transitive)
+ Addedipaddr.js@1.0.5(transitive)
+ Addedis-my-ip-valid@1.0.1(transitive)
+ Addedis-my-json-valid@2.20.6(transitive)
+ Addedis-property@1.0.2(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjsonpointer@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedkinvey-code-task-runner@0.2.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash._basefor@3.0.3(transitive)
+ Addedlodash._baseiteratee@4.7.0(transitive)
+ Addedlodash._basetostring@4.12.0(transitive)
+ Addedlodash._stringtopath@4.8.0(transitive)
+ Addedlodash.forown@4.2.0(transitive)
+ Addedlodash.get@4.3.0(transitive)
+ Addedlodash.has@4.4.0(transitive)
+ Addedlodash.isnil@4.0.0(transitive)
+ Addedlodash.keys@4.2.0(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmerge-descriptors@1.0.1(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.3.4(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmoment@2.13.0(transitive)
+ Addedms@0.7.1(transitive)
+ Addednegotiator@0.5.3(transitive)
+ Addedoauth-sign@0.8.2(transitive)
+ Addedon-finished@2.3.0(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.7(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedprocess-nextick-args@1.0.7(transitive)
+ Addedproxy-addr@1.0.10(transitive)
+ Addedqs@4.0.06.1.0(transitive)
+ Addedrange-parser@1.0.3(transitive)
+ Addedraw-body@2.1.7(transitive)
+ Addedreadable-stream@2.0.6(transitive)
+ Addedrequest@2.72.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.13.10.13.2(transitive)
+ Addedserve-static@1.10.3(transitive)
+ Addedsntp@1.0.9(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstatuses@1.2.11.5.0(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedtough-cookie@2.2.2(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedutils-merge@1.0.0(transitive)
+ Addedvary@1.0.1(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedcoffee-script@1.7.1
- Removedasn1@0.1.11(transitive)
- Removedassert-plus@0.1.5(transitive)
- Removedasync@0.9.0(transitive)
- Removedaws-sign2@0.5.0(transitive)
- Removedbl@0.9.5(transitive)
- Removedboom@0.4.2(transitive)
- Removedbson@0.4.15(transitive)
- Removedcaseless@0.6.0(transitive)
- Removedcombined-stream@0.0.7(transitive)
- Removedconfig@0.4.36(transitive)
- Removedcryptiles@0.2.2(transitive)
- Removedctype@0.5.3(transitive)
- Removeddelayed-stream@0.0.5(transitive)
- Removedforever-agent@0.5.2(transitive)
- Removedform-data@0.1.4(transitive)
- Removedhawk@1.1.1(transitive)
- Removedhoek@0.9.1(transitive)
- Removedhttp-signature@0.10.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@0.0.1(transitive)
- Removedkinvey-code-task-runner@0.1.3(transitive)
- Removedmime@1.2.11(transitive)
- Removedmime-types@1.0.2(transitive)
- Removedmoment@2.10.6(transitive)
- Removedoauth-sign@0.4.0(transitive)
- Removedqs@1.2.2(transitive)
- Removedreadable-stream@1.0.34(transitive)
- Removedrequest@2.44.0(transitive)
- Removedsntp@0.2.4(transitive)
- Removedtldts@6.1.70(transitive)
- Removedtldts-core@6.1.70(transitive)
- Removedtough-cookie@5.0.0(transitive)
Updatedbson@0.4.23
Updatedmoment@2.13.0
Updatedrequest@2.72.0