bruce-models 5.3.5 → 5.3.7

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.
@@ -9955,15 +9955,6 @@
9955
9955
  // This is the expected default version for the DataVersion value.
9956
9956
  // This value should NOT be changed without looking at our API and seeing what the default value is.
9957
9957
  ProjectViewBookmark.DEFAULT_DATA_VERSION = 2;
9958
- /**
9959
- * Describes a bookmark file node.
9960
- */
9961
- let EBookmarkType;
9962
- (function (EBookmarkType) {
9963
- EBookmarkType["BOOKMARK"] = "bookmark";
9964
- EBookmarkType["FOLDER"] = "folder";
9965
- EBookmarkType["EXTRANODE"] = "extranode";
9966
- })(EBookmarkType = ProjectViewBookmark.EBookmarkType || (ProjectViewBookmark.EBookmarkType = {}));
9967
9958
  /**
9968
9959
  * Describes the content of a bookmark.
9969
9960
  * As part of a deal we've been commissioned to create an alternative bookmark type to embed content.
@@ -11592,12 +11583,16 @@
11592
11583
  function GetByName(params) {
11593
11584
  return __awaiter(this, void 0, void 0, function* () {
11594
11585
  let { api, accountId, name, req: reqParams } = params;
11595
- if (!name || !accountId) {
11596
- throw ("Name and AccountID are required.");
11586
+ if (!name) {
11587
+ throw ("Name is required.");
11597
11588
  }
11598
11589
  if (!api) {
11599
11590
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11600
11591
  }
11592
+ // Default groups.
11593
+ if (!accountId) {
11594
+ accountId = "";
11595
+ }
11601
11596
  const data = yield api.GET(`account/${accountId}/userGroupByName/${name}`, reqParams);
11602
11597
  return {
11603
11598
  group: data
@@ -11613,12 +11608,16 @@
11613
11608
  function GetUsers(params) {
11614
11609
  return __awaiter(this, void 0, void 0, function* () {
11615
11610
  let { api, accountId, groupId: id, req: reqParams } = params;
11616
- if (!accountId || !id) {
11617
- throw ("AccountID and ID are required.");
11611
+ if (!id) {
11612
+ throw ("ID is required.");
11618
11613
  }
11619
11614
  if (!api) {
11620
11615
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11621
11616
  }
11617
+ // Default groups.
11618
+ if (!accountId) {
11619
+ accountId = "";
11620
+ }
11622
11621
  const data = yield api.GET(`userGroup/${accountId}/${id}/users`, reqParams);
11623
11622
  return {
11624
11623
  users: data.Items
@@ -11634,12 +11633,16 @@
11634
11633
  function GetListByPerm(params) {
11635
11634
  return __awaiter(this, void 0, void 0, function* () {
11636
11635
  let { api, accountId, perm, req: reqParams } = params;
11637
- if (!accountId || !perm) {
11638
- throw ("AccountID and Perm are required.");
11636
+ if (!perm) {
11637
+ throw ("Perm is required.");
11639
11638
  }
11640
11639
  if (!api) {
11641
11640
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11642
11641
  }
11642
+ // Default groups.
11643
+ if (!accountId) {
11644
+ accountId = "";
11645
+ }
11643
11646
  const data = yield api.GET(`userGroupsByFeature/${accountId}/${perm}`, reqParams);
11644
11647
  return {
11645
11648
  groups: data.Items
@@ -11655,12 +11658,13 @@
11655
11658
  function GetList(params) {
11656
11659
  return __awaiter(this, void 0, void 0, function* () {
11657
11660
  let { api, accountId, req: reqParams } = params;
11658
- if (!accountId) {
11659
- throw ("AccountID is required.");
11660
- }
11661
11661
  if (!api) {
11662
11662
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11663
11663
  }
11664
+ // Default groups.
11665
+ if (!accountId) {
11666
+ accountId = "";
11667
+ }
11664
11668
  const data = yield api.GET(`userGroups/${accountId}`, reqParams);
11665
11669
  return {
11666
11670
  groups: data.Items
@@ -11676,12 +11680,16 @@
11676
11680
  function Delete(params) {
11677
11681
  return __awaiter(this, void 0, void 0, function* () {
11678
11682
  let { api, accountId, groupId: id, req: reqParams } = params;
11679
- if (!accountId || !id) {
11680
- throw ("AccountID and ID are required.");
11683
+ if (!id) {
11684
+ throw ("ID is required.");
11681
11685
  }
11682
11686
  if (!api) {
11683
11687
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
11684
11688
  }
11689
+ // Default groups.
11690
+ if (!accountId) {
11691
+ accountId = "";
11692
+ }
11685
11693
  return api.DELETE(`account/${accountId}/userGroupID/${id}`, reqParams);
11686
11694
  });
11687
11695
  }
@@ -11694,8 +11702,12 @@
11694
11702
  function Update(params) {
11695
11703
  return __awaiter(this, void 0, void 0, function* () {
11696
11704
  let { api, group: data, reqParams } = params;
11697
- if (!data.Name || !data["ClientAccount.ID"]) {
11698
- 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"] = "";
11699
11711
  }
11700
11712
  if (!api) {
11701
11713
  api = exports.ENVIRONMENT.Api().GetGuardianApi();
@@ -14437,7 +14449,7 @@
14437
14449
  })(exports.DataSource || (exports.DataSource = {}));
14438
14450
 
14439
14451
  // This is updated with the package.json version on build.
14440
- const VERSION = "5.3.5";
14452
+ const VERSION = "5.3.7";
14441
14453
 
14442
14454
  exports.VERSION = VERSION;
14443
14455
  exports.AbstractApi = AbstractApi;