@docbrasil/api-systemmanager 1.1.41 → 1.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -517,6 +517,7 @@ class Process {
517
517
  * @description Get Org Users
518
518
  * @param {object} params Params to get Org Users
519
519
  * @param {string} params.orgId Organization id (_id database);
520
+ * @param {array} params.userIds UserIds
520
521
  * @param {string} session Session, token JWT
521
522
  * @return {Promise}
522
523
  * @public
@@ -527,6 +528,7 @@ class Process {
527
528
  * const api = new API();
528
529
  * const params = {
529
530
  * orgId: '5edd11c46b6ce9729c2c297c',
531
+ * userIds: []
530
532
  * }
531
533
  * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
532
534
  * await api.user.process.getOrgUsers(params, session);
@@ -537,10 +539,15 @@ class Process {
537
539
  try {
538
540
  Joi.assert(params, Joi.object().required());
539
541
  Joi.assert(params.orgId, Joi.string().required());
542
+ Joi.assert(params.userIds, Joi.array().required());
540
543
  Joi.assert(session, Joi.string().required());
541
544
 
542
- const {orgId} = params;
543
- const apiCall = self._client.get(`/organizations/${orgId}/users`, self._setHeader(session));
545
+ const {orgId, userIds} = params;
546
+ let queryString = '';
547
+ if(!_.isEmpty(userIds)) {
548
+ queryString = `?userIds=${JSON.stringify(userIds)}&{"sort":{"name":1}}`;
549
+ }
550
+ const apiCall = self._client.get(`/admin/organizations/${orgId}/orgusers${queryString}`, self._setHeader(session));
544
551
  return self._returnData(await apiCall);
545
552
  } catch (ex) {
546
553
  throw ex;
package/dist/bundle.cjs CHANGED
@@ -2325,6 +2325,7 @@ class Process {
2325
2325
  * @description Get Org Users
2326
2326
  * @param {object} params Params to get Org Users
2327
2327
  * @param {string} params.orgId Organization id (_id database);
2328
+ * @param {array} params.userIds UserIds
2328
2329
  * @param {string} session Session, token JWT
2329
2330
  * @return {Promise}
2330
2331
  * @public
@@ -2335,6 +2336,7 @@ class Process {
2335
2336
  * const api = new API();
2336
2337
  * const params = {
2337
2338
  * orgId: '5edd11c46b6ce9729c2c297c',
2339
+ * userIds: []
2338
2340
  * }
2339
2341
  * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2340
2342
  * await api.user.process.getOrgUsers(params, session);
@@ -2345,10 +2347,15 @@ class Process {
2345
2347
  try {
2346
2348
  Joi__default["default"].assert(params, Joi__default["default"].object().required());
2347
2349
  Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required());
2350
+ Joi__default["default"].assert(params.userIds, Joi__default["default"].array().required());
2348
2351
  Joi__default["default"].assert(session, Joi__default["default"].string().required());
2349
2352
 
2350
- const {orgId} = params;
2351
- const apiCall = self._client.get(`/organizations/${orgId}/users`, self._setHeader(session));
2353
+ const {orgId, userIds} = params;
2354
+ let queryString = '';
2355
+ if(!___default["default"].isEmpty(userIds)) {
2356
+ queryString = `?userIds=${JSON.stringify(userIds)}&{"sort":{"name":1}}`;
2357
+ }
2358
+ const apiCall = self._client.get(`/admin/organizations/${orgId}/orgusers${queryString}`, self._setHeader(session));
2352
2359
  return self._returnData(await apiCall);
2353
2360
  } catch (ex) {
2354
2361
  throw ex;