bruce-models 5.3.6 → 5.3.8

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.
@@ -11583,12 +11583,16 @@
11583
11583
  function GetByName(params) {
11584
11584
  return __awaiter(this, void 0, void 0, function* () {
11585
11585
  let { api, accountId, name, req: reqParams } = params;
11586
- if (!name || !accountId) {
11587
- throw ("Name and AccountID are required.");
11586
+ if (!name) {
11587
+ throw ("Name is required.");
11588
11588
  }
11589
11589
  if (!api) {
11590
11590
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11591
11591
  }
11592
+ // Default groups.
11593
+ if (!accountId) {
11594
+ accountId = "";
11595
+ }
11592
11596
  const data = yield api.GET(`account/${accountId}/userGroupByName/${name}`, reqParams);
11593
11597
  return {
11594
11598
  group: data
@@ -11604,12 +11608,16 @@
11604
11608
  function GetUsers(params) {
11605
11609
  return __awaiter(this, void 0, void 0, function* () {
11606
11610
  let { api, accountId, groupId: id, req: reqParams } = params;
11607
- if (!accountId || !id) {
11608
- throw ("AccountID and ID are required.");
11611
+ if (!id) {
11612
+ throw ("ID is required.");
11609
11613
  }
11610
11614
  if (!api) {
11611
11615
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11612
11616
  }
11617
+ // Default groups.
11618
+ if (!accountId) {
11619
+ accountId = "";
11620
+ }
11613
11621
  const data = yield api.GET(`userGroup/${accountId}/${id}/users`, reqParams);
11614
11622
  return {
11615
11623
  users: data.Items
@@ -11625,12 +11633,16 @@
11625
11633
  function GetListByPerm(params) {
11626
11634
  return __awaiter(this, void 0, void 0, function* () {
11627
11635
  let { api, accountId, perm, req: reqParams } = params;
11628
- if (!accountId || !perm) {
11629
- throw ("AccountID and Perm are required.");
11636
+ if (!perm) {
11637
+ throw ("Perm is required.");
11630
11638
  }
11631
11639
  if (!api) {
11632
11640
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11633
11641
  }
11642
+ // Default groups.
11643
+ if (!accountId) {
11644
+ accountId = "";
11645
+ }
11634
11646
  const data = yield api.GET(`userGroupsByFeature/${accountId}/${perm}`, reqParams);
11635
11647
  return {
11636
11648
  groups: data.Items
@@ -11646,12 +11658,13 @@
11646
11658
  function GetList(params) {
11647
11659
  return __awaiter(this, void 0, void 0, function* () {
11648
11660
  let { api, accountId, req: reqParams } = params;
11649
- if (!accountId) {
11650
- throw ("AccountID is required.");
11651
- }
11652
11661
  if (!api) {
11653
11662
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11654
11663
  }
11664
+ // Default groups.
11665
+ if (!accountId) {
11666
+ accountId = "";
11667
+ }
11655
11668
  const data = yield api.GET(`userGroups/${accountId}`, reqParams);
11656
11669
  return {
11657
11670
  groups: data.Items
@@ -11667,12 +11680,16 @@
11667
11680
  function Delete(params) {
11668
11681
  return __awaiter(this, void 0, void 0, function* () {
11669
11682
  let { api, accountId, groupId: id, req: reqParams } = params;
11670
- if (!accountId || !id) {
11671
- throw ("AccountID and ID are required.");
11683
+ if (!id) {
11684
+ throw ("ID is required.");
11672
11685
  }
11673
11686
  if (!api) {
11674
11687
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11675
11688
  }
11689
+ // Default groups.
11690
+ if (!accountId) {
11691
+ accountId = "";
11692
+ }
11676
11693
  return api.DELETE(`account/${accountId}/userGroupID/${id}`, reqParams);
11677
11694
  });
11678
11695
  }
@@ -11685,8 +11702,12 @@
11685
11702
  function Update(params) {
11686
11703
  return __awaiter(this, void 0, void 0, function* () {
11687
11704
  let { api, group: data, reqParams } = params;
11688
- if (!data.Name || !data["ClientAccount.ID"]) {
11689
- throw ("User group name and client account ID are required.");
11705
+ if (!data.Name) {
11706
+ throw ("User group name is required.");
11707
+ }
11708
+ // Default groups.
11709
+ if (!data["ClientAccount.ID"]) {
11710
+ data["ClientAccount.ID"] = "";
11690
11711
  }
11691
11712
  if (!api) {
11692
11713
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
@@ -14428,7 +14449,7 @@
14428
14449
  })(exports.DataSource || (exports.DataSource = {}));
14429
14450
 
14430
14451
  // This is updated with the package.json version on build.
14431
- const VERSION = "5.3.6";
14452
+ const VERSION = "5.3.8";
14432
14453
 
14433
14454
  exports.VERSION = VERSION;
14434
14455
  exports.AbstractApi = AbstractApi;