bruce-models 5.6.5 → 5.6.6

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.
@@ -10582,6 +10582,98 @@
10582
10582
  ProjectViewLegacyBookmark.DATA_VERSION = 1;
10583
10583
  })(exports.ProjectViewLegacyBookmark || (exports.ProjectViewLegacyBookmark = {}));
10584
10584
 
10585
+ (function (ProjectViewBookmarkGroup) {
10586
+ // Cache key for bookmark groups.
10587
+ const GROUPS_CACHE_KEY = "ProjectViewBookmarkGroupsList";
10588
+ /**
10589
+ * Retrieves a list of bookmark groups for a given project view.
10590
+ * @param params
10591
+ * @returns List of bookmark groups.
10592
+ */
10593
+ function GetGroups(params) {
10594
+ return __awaiter(this, void 0, void 0, function* () {
10595
+ let { api, viewId, req: reqParams } = params;
10596
+ if (!viewId) {
10597
+ throw "View ID is required.";
10598
+ }
10599
+ if (!api) {
10600
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10601
+ }
10602
+ const cache = api.GetCacheItem(GROUPS_CACHE_KEY, reqParams);
10603
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
10604
+ return cache.data;
10605
+ }
10606
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
10607
+ try {
10608
+ const { Items } = yield api.GET(`ui.view/${viewId}/slideGroups`, exports.Api.PrepReqParams(reqParams));
10609
+ res(Items || []);
10610
+ }
10611
+ catch (e) {
10612
+ rej(e);
10613
+ }
10614
+ }));
10615
+ api.SetCacheItem({
10616
+ key: GROUPS_CACHE_KEY,
10617
+ value: prom,
10618
+ req: reqParams,
10619
+ duration: exports.Api.DEFAULT_CACHE_DURATION,
10620
+ });
10621
+ return prom;
10622
+ });
10623
+ }
10624
+ ProjectViewBookmarkGroup.GetGroups = GetGroups;
10625
+ /**
10626
+ * Updates or creates a bookmark group.
10627
+ * @param params
10628
+ * @returns Updated group data.
10629
+ */
10630
+ function UpdateGroup(params) {
10631
+ return __awaiter(this, void 0, void 0, function* () {
10632
+ let { api, viewId, group, req: reqParams } = params;
10633
+ if (!api) {
10634
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10635
+ }
10636
+ const res = yield api.POST(`ui.view/${viewId}/slideGroup/${group.ID ? group.ID : 0}`, group, exports.Api.PrepReqParams(reqParams));
10637
+ api.Cache.Remove(GROUPS_CACHE_KEY);
10638
+ return res;
10639
+ });
10640
+ }
10641
+ ProjectViewBookmarkGroup.UpdateGroup = UpdateGroup;
10642
+ /**
10643
+ * Updates the display order of bookmark groups.
10644
+ * @param params
10645
+ */
10646
+ function UpdateGroupOrder(params) {
10647
+ return __awaiter(this, void 0, void 0, function* () {
10648
+ let { api, viewId, groupIds, req: reqParams } = params;
10649
+ if (!(groupIds === null || groupIds === void 0 ? void 0 : groupIds.length)) {
10650
+ return;
10651
+ }
10652
+ if (!api) {
10653
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10654
+ }
10655
+ yield api.POST(`ui.view/${viewId}/slideGroups/setOrder`, { "UI.SlideGroup.ID": groupIds }, exports.Api.PrepReqParams(reqParams));
10656
+ api.Cache.Remove(GROUPS_CACHE_KEY);
10657
+ });
10658
+ }
10659
+ ProjectViewBookmarkGroup.UpdateGroupOrder = UpdateGroupOrder;
10660
+ /**
10661
+ * Deletes a bookmark group.
10662
+ * @param params
10663
+ */
10664
+ function DeleteGroup(params) {
10665
+ return __awaiter(this, void 0, void 0, function* () {
10666
+ let { api, viewId, groupId, req: reqParams } = params;
10667
+ if (!api) {
10668
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
10669
+ }
10670
+ yield api.DELETE(`ui.view/${viewId}/slideGroup/${groupId}`, exports.Api.PrepReqParams(reqParams));
10671
+ api.Cache.Remove(GROUPS_CACHE_KEY);
10672
+ });
10673
+ }
10674
+ ProjectViewBookmarkGroup.DeleteGroup = DeleteGroup;
10675
+ })(exports.ProjectViewBookmarkGroup || (exports.ProjectViewBookmarkGroup = {}));
10676
+
10585
10677
  (function (PendingAction) {
10586
10678
  /**
10587
10679
  * Available pending action statuses.
@@ -14810,7 +14902,7 @@
14810
14902
  })(exports.Scenario || (exports.Scenario = {}));
14811
14903
 
14812
14904
  // This is updated with the package.json version on build.
14813
- const VERSION = "5.6.5";
14905
+ const VERSION = "5.6.6";
14814
14906
 
14815
14907
  exports.VERSION = VERSION;
14816
14908
  exports.AbstractApi = AbstractApi;