Socket
Socket
Sign inDemoInstall

dispatch-node-sdk

Package Overview
Dependencies
Maintainers
3
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dispatch-node-sdk - npm Package Compare versions

Comparing version 2.7.2 to 2.8.0

39

dist/lib/products.js

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

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
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; }; }();

@@ -40,2 +42,39 @@

}
/**
* Add a premium product for a certain entity. Optionally specify some config for it.
*
* @param {String} entityType The entity's type. E.g. "organization"
* @param {Number} entityID The entity's ID
* @param {String} name The product name
* @param {Object} [config] An object with public_config and private_config properties.
* Both of these are objects that can contain any properties.
* @return {Promise}
*/
}, {
key: 'addForEntity',
value: function addForEntity(entityType, entityID, name) {
var config = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
var body = _extends({
name: name
}, config);
return this.client.doAuthenticatedRequest('POST', '/products/' + entityType + '/' + entityID, body);
}
/**
* Remove a premium product for a certain entity.
*
* @param {String} entityType The entity's type. E.g. "organization"
* @param {Number} entityID The entity's ID
* @param {String} name The product name
* @return {Promise}
*/
}, {
key: 'removeForEntity',
value: function removeForEntity(entityType, entityID, name) {
return this.client.doAuthenticatedRequest('DELETE', '/products/' + entityType + '/' + entityID + '/' + name);
}
}]);

@@ -42,0 +81,0 @@

@@ -23,2 +23,32 @@ import { stringify } from './queryString';

}
/**
* Add a premium product for a certain entity. Optionally specify some config for it.
*
* @param {String} entityType The entity's type. E.g. "organization"
* @param {Number} entityID The entity's ID
* @param {String} name The product name
* @param {Object} [config] An object with public_config and private_config properties.
* Both of these are objects that can contain any properties.
* @return {Promise}
*/
addForEntity(entityType, entityID, name, config = {}) {
const body = {
name,
...config,
};
return this.client.doAuthenticatedRequest('POST', `/products/${entityType}/${entityID}`, body);
}
/**
* Remove a premium product for a certain entity.
*
* @param {String} entityType The entity's type. E.g. "organization"
* @param {Number} entityID The entity's ID
* @param {String} name The product name
* @return {Promise}
*/
removeForEntity(entityType, entityID, name) {
return this.client.doAuthenticatedRequest('DELETE', `/products/${entityType}/${entityID}/${name}`);
}
}

2

package.json
{
"name": "dispatch-node-sdk",
"version": "2.7.2",
"version": "2.8.0",
"description": "High- and low-level libraries for interacting with the Dispatch API",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc