testrail-modern-client
Version:
A modern TypeScript client for TestRail API
27 lines (26 loc) • 913 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoleService = void 0;
const base_1 = require("./base");
/**
* Service for managing TestRail roles.
* @since TestRail 7.3
*/
class RoleService extends base_1.BaseService {
/**
* Returns a list of available roles.
* @param offset - The offset of the first record to return (used for pagination)
* @param limit - The maximum number of records to return (used for pagination, max 250)
* @returns A list of roles
* @throws {Error} 403 - No access to the project
* @throws {Error} 429 - Too many requests (TestRail Cloud only)
* @since TestRail 7.3
*/
async list(offset = 0, limit = 250) {
const response = await this.client.get('/get_roles', {
params: { offset, limit },
});
return response.data.roles;
}
}
exports.RoleService = RoleService;