@coveo/platform-client
Version:
The main goal of this package is to provide an easy to configure and straightforward way of querying Coveo Cloud APIs using JavaScript.
61 lines • 2.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const APICore_js_1 = tslib_1.__importDefault(require("../../../APICore.js"));
const Resource_js_1 = tslib_1.__importDefault(require("../../Resource.js"));
class Members extends Resource_js_1.default {
static baseUrl = `/rest/organizations/${APICore_js_1.default.orgPlaceholder}/members`;
/**
* Lists the members of an organization.
*/
getAll() {
return this.api.get(Members.baseUrl);
}
/**
* deletes the member from all groups of an organization.
* Note: Deleted users can still be included by domain.
* @param username The username of the member to delete.
*/
delete(username) {
return this.api.delete(`${Members.baseUrl}/${username}`);
}
/**
* Shows a member of an organization.
* @param username The username of the member to show.
*/
get(username) {
return this.api.get(`${Members.baseUrl}/${username}`);
}
/**
* Lists the privileges for the current user on an organization.
*/
getPrivileges() {
return this.api.get(`${Members.baseUrl}/privileges`);
}
/**
* Updates the members of an organization.
* @param sendEmailToInvitedUsers Whether to send an invitation email alongside the invite(s). Default to true.
* @param model
* @param options
*/
updateOrganizationMembers(model, options) {
return this.api.put(this.buildPath(Members.baseUrl, options), model);
}
/**
* Updates a member of an organization.
* @param username The username of the member to update.
* @param model
*/
updateMember(username, model) {
return this.api.put(`${Members.baseUrl}/${username}`, model);
}
/**
* Lists the groups to which an organization member belongs.
* @param username The username of the user for which to list groups.
*/
getGroups(username) {
return this.api.get(`${Members.baseUrl}/${username}/groups`);
}
}
exports.default = Members;
//# sourceMappingURL=Members.js.map