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

vinli

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinli - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

lib/device.js

@@ -148,3 +148,3 @@ var Utils = require('./utils');

return Utils.request.post(
'events',
'rules',
'devices/' + this.id + '/rules',

@@ -151,0 +151,0 @@ { rule: _payload }).then(function(resp) {

var Utils = require('./utils');
var Subscription = require('./subscription');
var extend = require('extend');
var Hoek = require('hoek');
var Joi = require('joi');

@@ -10,3 +12,3 @@ var Rule = function(_obj) {

Rule.fetch = function(deviceId, id) {
return Utils.request.get('events', 'devices/' + deviceId + '/rules/' + id).then(function(resp) {
return Utils.request.get('rules', 'devices/' + deviceId + '/rules/' + id).then(function(resp) {
return new Rule(resp.rule);

@@ -46,2 +48,35 @@ });

Rule.prototype.createSubscription = function(_options) {
var self = this;
return Utils.request.post(
'events',
'devices/' + this.deviceId + '/subscriptions',
{ subscription: Hoek.merge(_options, { object: { type: 'rule', id: self.id } }) }
).then(function(resp) {
return new Subscription(resp.subscription);
});
};
Rule.prototype.events = function(_options) {
var self = this;
_options = Hoek.applyToDefaults({ limit: 20, objectId: this.id }, _options || {});
Joi.assert(_options, {
limit: Joi.number().integer().min(0).max(100),
since: Joi.date(),
until: Joi.date(),
type: Joi.string(),
objectId: Joi.string(),
objectType: Joi.string()
});
return Utils.request.get(
'events',
'devices/' + self.deviceId + '/events',
_options).then(function(resp) {
return Utils.streamListResponse(resp, 'events', self.events, self);
});
};
module.exports = Rule;
{
"name": "vinli",
"version": "0.2.1",
"version": "0.2.2",
"description": "Official Node.js SDK for interacting with the Vinli Platform",

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

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