encompassconnect
Version:
An Unofficial, (mostly) typed Node SDK that wraps around Ellie Mae's Encompass RESTful API.
30 lines (29 loc) • 1.1 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const service_1 = __importDefault(require("./service"));
const utils_1 = require("../utils");
class UserService extends service_1.default {
/**
* Gets a list of user profiles from the organization. Takes an optional
* argument to apply a filter.
*/
async getList(options) {
const urlOptions = utils_1.objectToURLString(options, true);
const url = `/company/users${urlOptions}`;
const data = await this.context.fetchWithRetry(url);
return data;
}
/**
* Returns a user profile. If no user profile is provided, will return
* the profile matching the currently stored token.
*/
async getProfile(losId) {
const url = `/company/users/${losId || 'me'}`;
const data = await this.context.fetchWithRetry(url);
return data;
}
}
exports.default = UserService;