New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

syncano-server

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syncano-server - npm Package Compare versions

Comparing version 0.8.1-3 to 0.8.1-4

.nyc_output/13e815d25ee6d80195c2c9f348cda22e.json

39

lib/data.js

@@ -7,2 +7,4 @@ 'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -527,2 +529,7 @@

* ])
* data.posts.update({title: 'Update all posts title'})
* data.flights
* .where('active', 1)
* .where('destination', 'Warsaw')
* .update({delayed: 1})
*/

@@ -533,2 +540,5 @@

value: function update(id, body) {
var _this5 = this;
var isQueryUpdate = (typeof id === 'undefined' ? 'undefined' : _typeof(id)) === 'object' && id !== null && !Array.isArray(id);
var fetchObject = {

@@ -540,2 +550,14 @@ url: this.url(id),

if (isQueryUpdate) {
return this.list().then(function (items) {
var ids = items.map(function (item) {
return [item.id, id];
});
fetchObject = _this5._batchFetchObject(ids);
return _this5.fetch(fetchObject.url, fetchObject);
});
}
if (Array.isArray(id)) {

@@ -556,2 +578,4 @@ fetchObject = this._batchFetchObject(id);

* data.posts.delete([55, 56, 57])
* data.posts.delete()
* data.posts.where('draft', 1).delete()
*/

@@ -562,2 +586,5 @@

value: function _delete(id) {
var _this6 = this;
var isQueryDelete = id === undefined;
var fetchObject = {

@@ -568,2 +595,14 @@ url: this.url(id),

if (isQueryDelete) {
return this.list().then(function (items) {
var ids = items.map(function (item) {
return item.id;
});
fetchObject = _this6._batchFetchObject(ids);
return _this6.fetch(fetchObject.url, fetchObject);
});
}
if (Array.isArray(id)) {

@@ -570,0 +609,0 @@ fetchObject = this._batchFetchObject(id);

2

package.json
{
"name": "syncano-server",
"version": "0.8.1-3",
"version": "0.8.1-4",
"description": "A library to intereact with the Syncano API on a server side",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -432,4 +432,10 @@ import querystring from 'querystring'

* ])
* data.posts.update({title: 'Update all posts title'})
* data.flights
* .where('active', 1)
* .where('destination', 'Warsaw')
* .update({delayed: 1})
*/
update(id, body) {
const isQueryUpdate = typeof id === 'object' && id !== null && !Array.isArray(id)
let fetchObject = {

@@ -441,2 +447,14 @@ url: this.url(id),

if (isQueryUpdate) {
return this
.list()
.then(items => {
const ids = items.map(item => [item.id, id])
fetchObject = this._batchFetchObject(ids)
return this.fetch(fetchObject.url, fetchObject)
})
}
if (Array.isArray(id)) {

@@ -457,4 +475,7 @@ fetchObject = this._batchFetchObject(id)

* data.posts.delete([55, 56, 57])
* data.posts.delete()
* data.posts.where('draft', 1).delete()
*/
delete(id) {
const isQueryDelete = id === undefined
let fetchObject = {

@@ -465,2 +486,14 @@ url: this.url(id),

if (isQueryDelete) {
return this
.list()
.then(items => {
const ids = items.map(item => item.id)
fetchObject = this._batchFetchObject(ids)
return this.fetch(fetchObject.url, fetchObject)
})
}
if (Array.isArray(id)) {

@@ -467,0 +500,0 @@ fetchObject = this._batchFetchObject(id)

@@ -125,2 +125,13 @@ /* eslint-disable no-unused-expressions */

it('can update multiple objects by query', function (done) {
data[testClassName]
.where('id', 'gte', 4)
.update({test: 'Query update', test2: 'secret query update'})
.then(() => done())
.catch(err => {
console.log('ERROR: ', err)
done(err)
})
})
it('can delete single object', function (done) {

@@ -138,3 +149,3 @@ data[testClassName]

data[testClassName]
.delete([2, 3, 4, 5])
.delete([2, 3])
.then(() => done())

@@ -147,2 +158,13 @@ .catch(err => {

it('can delete multiple objects by query', function (done) {
data[testClassName]
.where('id', 'gte', 4)
.delete()
.then(() => done())
.catch(err => {
console.log('ERROR: ', err)
done(err)
})
})
it('can be sorted', function (done) {

@@ -149,0 +171,0 @@ let firstObject = null

@@ -286,2 +286,4 @@ import nock from 'nock'

})
it.skip('should be able to create multiple objects')
})

@@ -310,2 +312,5 @@

})
it.skip('should be able to update multiple objects')
it.skip('should be able to update objects by query')
})

@@ -330,3 +335,6 @@

})
it.skip('should be able to delete objects by array of ids')
it.skip('should be able to delete objects by query')
})
})

Sorry, the diff of this file is not supported yet

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