bruce-models 6.7.0 → 6.7.1
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.
- package/dist/bruce-models.es5.js +8 -30
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +8 -30
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/project/project-view-bookmark.js +7 -29
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/project/project-view-bookmark.d.ts +2 -11
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -10824,7 +10824,6 @@
|
|
|
10824
10824
|
}
|
|
10825
10825
|
yield api.DELETE(`ui.view/${viewId}/slide/${bookmarkId}`, exports.Api.PrepReqParams(reqParams));
|
|
10826
10826
|
api.Cache.Remove(GetCacheKey(viewId, bookmarkId));
|
|
10827
|
-
api.Cache.Remove(GetListCacheKey(viewId));
|
|
10828
10827
|
});
|
|
10829
10828
|
}
|
|
10830
10829
|
ProjectViewBookmark.Delete = Delete;
|
|
@@ -10835,23 +10834,23 @@
|
|
|
10835
10834
|
*/
|
|
10836
10835
|
function GetList(params) {
|
|
10837
10836
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10838
|
-
let { api, viewId, req: reqParams } = params;
|
|
10837
|
+
let { api, viewId, req: reqParams, drafts } = params;
|
|
10839
10838
|
if (!viewId) {
|
|
10840
10839
|
throw ("View ID is required.");
|
|
10841
10840
|
}
|
|
10842
10841
|
if (!api) {
|
|
10843
10842
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
10844
10843
|
}
|
|
10845
|
-
const cache = api.GetCacheItem(GetListCacheKey(viewId), reqParams);
|
|
10846
|
-
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10847
|
-
return cache.data;
|
|
10848
|
-
}
|
|
10849
10844
|
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
10850
10845
|
try {
|
|
10851
|
-
const
|
|
10846
|
+
const query = new URLSearchParams();
|
|
10847
|
+
if (drafts) {
|
|
10848
|
+
query.set("Drafts", "true");
|
|
10849
|
+
}
|
|
10850
|
+
const url = `ui.view/${viewId}/slides?${query.toString()}`;
|
|
10851
|
+
const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
|
|
10852
10852
|
const items = data.Items ? data.Items : [];
|
|
10853
10853
|
// Cache individual items.
|
|
10854
|
-
// Maybe better to load list cache when getting 1 slide and seeing if it's in there.
|
|
10855
10854
|
// WARNING: Right now the data matches, in the future the list may contain a shortened result.
|
|
10856
10855
|
for (let i = 0; i < items.length; i++) {
|
|
10857
10856
|
const item = items[i];
|
|
@@ -10874,11 +10873,6 @@
|
|
|
10874
10873
|
rej(e);
|
|
10875
10874
|
}
|
|
10876
10875
|
}));
|
|
10877
|
-
api.SetCacheItem({
|
|
10878
|
-
key: GetListCacheKey(viewId),
|
|
10879
|
-
value: req,
|
|
10880
|
-
req: reqParams
|
|
10881
|
-
});
|
|
10882
10876
|
return req;
|
|
10883
10877
|
});
|
|
10884
10878
|
}
|
|
@@ -10899,7 +10893,6 @@
|
|
|
10899
10893
|
}
|
|
10900
10894
|
const res = yield api.POST(`ui.view/${viewId}/slide/${data.ID ? data.ID : ""}`, data, exports.Api.PrepReqParams(reqParams));
|
|
10901
10895
|
api.Cache.Remove(GetCacheKey(viewId, data.ID));
|
|
10902
|
-
api.Cache.Remove(GetListCacheKey(viewId));
|
|
10903
10896
|
return {
|
|
10904
10897
|
bookmark: res
|
|
10905
10898
|
};
|
|
@@ -10921,7 +10914,6 @@
|
|
|
10921
10914
|
"DisplayOrder.Start": 0
|
|
10922
10915
|
};
|
|
10923
10916
|
yield api.POST(`ui.view/${viewId}/slides/setOrder`, reqData, exports.Api.PrepReqParams(reqParams));
|
|
10924
|
-
api.Cache.RemoveByStartsWith(GetListCacheKey(viewId));
|
|
10925
10917
|
});
|
|
10926
10918
|
}
|
|
10927
10919
|
ProjectViewBookmark.SetOrder = SetOrder;
|
|
@@ -10940,20 +10932,6 @@
|
|
|
10940
10932
|
return `${exports.Api.ECacheKey.ProjectViewBookmark}${exports.Api.ECacheKey.Id}${viewId}${exports.Api.ECacheKey.Id}${bookmarkId}`;
|
|
10941
10933
|
}
|
|
10942
10934
|
ProjectViewBookmark.GetCacheKey = GetCacheKey;
|
|
10943
|
-
/**
|
|
10944
|
-
* Returns cache identifier for a list of bookmarks.
|
|
10945
|
-
* Example: {
|
|
10946
|
-
* const api: BruceApi.Api = ...;
|
|
10947
|
-
* const key = GetListCacheKey("abc");
|
|
10948
|
-
* api.Cache.Remove(key);
|
|
10949
|
-
* }
|
|
10950
|
-
* @param viewId
|
|
10951
|
-
* @returns
|
|
10952
|
-
*/
|
|
10953
|
-
function GetListCacheKey(viewId) {
|
|
10954
|
-
return `${exports.Api.ECacheKey.ProjectViewBookmark}${exports.Api.ECacheKey.Id}${viewId}`;
|
|
10955
|
-
}
|
|
10956
|
-
ProjectViewBookmark.GetListCacheKey = GetListCacheKey;
|
|
10957
10935
|
})(exports.ProjectViewBookmark || (exports.ProjectViewBookmark = {}));
|
|
10958
10936
|
|
|
10959
10937
|
(function (ProjectView) {
|
|
@@ -16123,7 +16101,7 @@
|
|
|
16123
16101
|
})(exports.Tracking || (exports.Tracking = {}));
|
|
16124
16102
|
|
|
16125
16103
|
// This is updated with the package.json version on build.
|
|
16126
|
-
const VERSION = "6.7.
|
|
16104
|
+
const VERSION = "6.7.1";
|
|
16127
16105
|
|
|
16128
16106
|
exports.VERSION = VERSION;
|
|
16129
16107
|
exports.AbstractApi = AbstractApi;
|