UNPKG

brightbox

Version:

A Node.JS module, which provides an object oriented wrapper for the Brightbox API.

49 lines (47 loc) 1.88 kB
"use strict"; function UserCollaborations() { var Brightbox = this; return { // https://api.gb1.brightbox.com/1.0/#user_collaboration_list_user_collaborations list: function list(opt_opts, opt_callback) { Brightbox.request({ method: "GET", url: "/1.0/user/collaborations", opts: opt_opts }, opt_callback); } // https://api.gb1.brightbox.com/1.0/#user_collaboration_get_user_collaboration , get: function get(opt_opts, opt_callback) { Brightbox.request({ method: "GET", url: "/1.0/user/collaborations/" + opt_opts.id, opts: opt_opts }, opt_callback); } // https://api.gb1.brightbox.com/1.0/#user_collaboration_accept_user_collaboration , accept: function accept(opt_opts, opt_callback) { Brightbox.request({ method: "POST", url: "/1.0/user/collaborations/" + opt_opts.id + "/accept", opts: opt_opts }, opt_callback); } // https://api.gb1.brightbox.com/1.0/#user_collaboration_reject_user_collaboration , reject: function reject(opt_opts, opt_callback) { Brightbox.request({ method: "POST", url: "/1.0/user/collaborations/" + opt_opts.id + "/reject", opts: opt_opts }, opt_callback); } // https://api.gb1.brightbox.com/1.0/#user_collaboration_delete_user_collaboration , delete: function _delete(opt_opts, opt_callback) { Brightbox.request({ method: "DELETE", url: "/1.0/user/collaborations/" + opt_opts.id, opts: opt_opts }, opt_callback); } }; } module.exports = UserCollaborations;