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

dtable-web-api

Package Overview
Dependencies
Maintainers
1
Versions
405
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dtable-web-api - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

67

lib/dtable-web-api.js

@@ -452,2 +452,8 @@ "use strict";

}, {
key: "getGroup",
value: function getGroup(groupID) {
var url = this.server + '/api/v2.1/groups/' + groupID + '/';
return this.req.get(url);
}
}, {
key: "createGroup",

@@ -460,2 +466,63 @@ value: function createGroup(name) {

}
}, {
key: "renameGroup",
value: function renameGroup(groupID, name) {
var url = this.server + '/api/v2.1/groups/' + groupID + '/';
var params = {
name: name
};
return this.req.put(url, params);
}
}, {
key: "addGroupMembers",
value: function addGroupMembers(groupID, userNames) {
var url = this.server + '/api/v2.1/groups/' + groupID + '/members/bulk/';
var form = new _formData["default"]();
form.append('emails', userNames.join(','));
return this._sendPostRequest(url, form);
}
}, {
key: "listGroupMembers",
value: function listGroupMembers(groupID) {
var isAdmin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var avatarSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 64;
var url = this.server + '/api/v2.1/groups/' + groupID + '/members/?avatar_size=' + avatarSize + '&is_admin=' + isAdmin;
return this.req.get(url);
}
}, {
key: "setGroupAdmin",
value: function setGroupAdmin(groupID, userName, isAdmin) {
var name = encodeURIComponent(userName);
var url = this.server + '/api/v2.1/groups/' + groupID + '/members/' + name + '/';
var params = {
is_admin: isAdmin
};
return this.req.put(url, params);
}
}, {
key: "deleteGroupMember",
value: function deleteGroupMember(groupID, userName) {
var name = encodeURIComponent(userName);
var url = this.server + '/api/v2.1/groups/' + groupID + '/members/' + name + '/';
return this.req["delete"](url);
} //account api
}, {
key: "getAccountInfo",
value: function getAccountInfo() {
var url = this.server + '/api2/account/info/';
return this.req.get(url);
}
}, {
key: "listGroups",
value: function listGroups() {
var withRepos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var options = {
with_repos: withRepos ? 1 : 0
};
var url = this.server + '/api/v2.1/groups/';
return this.req.get(url, {
params: options
});
}
}]);

@@ -462,0 +529,0 @@

2

package.json
{
"name": "dtable-web-api",
"version": "1.0.3",
"version": "1.0.4",
"description": "an interface for dtable-web",

@@ -5,0 +5,0 @@ "main": "lib/dtable-web-api.js",

@@ -350,2 +350,7 @@ import axios from 'axios';

getGroup(groupID) {
const url = this.server + '/api/v2.1/groups/' + groupID + '/';
return this.req.get(url);
}
createGroup(name) {

@@ -358,4 +363,52 @@ const url = this.server + '/api/v2.1/groups/';

renameGroup(groupID, name) {
const url = this.server + '/api/v2.1/groups/' + groupID + '/';
const params = {
name: name
}
return this.req.put(url, params);
}
addGroupMembers(groupID, userNames) {
const url = this.server + '/api/v2.1/groups/' + groupID + '/members/bulk/';
let form = new FormData();
form.append('emails', userNames.join(','));
return this._sendPostRequest(url, form);
}
listGroupMembers(groupID, isAdmin=false, avatarSize=64) {
let url = this.server + '/api/v2.1/groups/' + groupID + '/members/?avatar_size=' + avatarSize + '&is_admin=' + isAdmin;
return this.req.get(url);
}
setGroupAdmin(groupID, userName, isAdmin) {
let name = encodeURIComponent(userName);
let url = this.server + '/api/v2.1/groups/' + groupID + '/members/' + name + '/';
const params = {
is_admin: isAdmin
}
return this.req.put(url, params);
}
deleteGroupMember(groupID, userName) {
const name = encodeURIComponent(userName);
const url = this.server + '/api/v2.1/groups/' + groupID + '/members/' + name + '/';
return this.req.delete(url);
}
//account api
getAccountInfo() {
const url = this.server + '/api2/account/info/';
return this.req.get(url);
}
listGroups(withRepos = false) {
let options = {with_repos: withRepos ? 1 : 0};
const url = this.server + '/api/v2.1/groups/';
return this.req.get(url, {params: options});
}
}
export default DTableWebAPI;
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