bruce-models 3.7.7 → 3.7.9

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.
@@ -599,7 +599,7 @@
599
599
  }
600
600
  }
601
601
  formatApiUri(uri) {
602
- const ws = "wss";
602
+ const ws = !window.document || window.document.location.protocol === "https:" ? "wss" : "ws";
603
603
  return uri.replace(/^(https|http)/, ws) + "websocket";
604
604
  }
605
605
  onOpen(ev) {
@@ -2050,20 +2050,30 @@
2050
2050
  */
2051
2051
  function GetList(params) {
2052
2052
  return __awaiter(this, void 0, void 0, function* () {
2053
- let { api, docType: type, req: reqParams } = params;
2053
+ let { api, docType: type, req: reqParams, entityId, expandSettings } = params;
2054
2054
  if (!api) {
2055
2055
  api = exports.ENVIRONMENT.Api().GetBruceApi();
2056
2056
  }
2057
2057
  if (!type) {
2058
2058
  type = "";
2059
2059
  }
2060
- const cache = yield api.GetCacheItem(GetListCacheKey(type), reqParams);
2060
+ const cache = yield api.GetCacheItem(GetListCacheKey(type, entityId, expandSettings), reqParams);
2061
2061
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
2062
2062
  return cache.data;
2063
2063
  }
2064
2064
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
2065
2065
  try {
2066
- const url = "documentViews" + (type ? "?type=" + type : "");
2066
+ const urlParams = new URLSearchParams();
2067
+ if (type) {
2068
+ urlParams.append("type", type);
2069
+ }
2070
+ if (entityId) {
2071
+ urlParams.append("entityId", entityId);
2072
+ }
2073
+ if (expandSettings) {
2074
+ urlParams.append("expandSettings", "true");
2075
+ }
2076
+ const url = "documentViews" + `?${urlParams.toString()}`;
2067
2077
  const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
2068
2078
  res({
2069
2079
  documents: data.Items
@@ -2074,7 +2084,7 @@
2074
2084
  }
2075
2085
  }));
2076
2086
  yield api.SetCacheItem({
2077
- key: GetListCacheKey(type),
2087
+ key: GetListCacheKey(type, entityId, expandSettings),
2078
2088
  value: req,
2079
2089
  req: reqParams
2080
2090
  });
@@ -2104,10 +2114,18 @@
2104
2114
  * api.Cache.Remove(key);
2105
2115
  * }
2106
2116
  * @param type
2117
+ * @param entityId
2118
+ * @param expandSettings
2107
2119
  * @returns
2108
2120
  */
2109
- function GetListCacheKey(type) {
2110
- return exports.Api.ECacheKey.AnnDocument + type;
2121
+ function GetListCacheKey(type, entityId, expandSettings) {
2122
+ if (!expandSettings) {
2123
+ expandSettings = false;
2124
+ }
2125
+ if (!entityId) {
2126
+ entityId = "";
2127
+ }
2128
+ return exports.Api.ECacheKey.AnnDocument + type + entityId + expandSettings;
2111
2129
  }
2112
2130
  AnnDocument.GetListCacheKey = GetListCacheKey;
2113
2131
  })(exports.AnnDocument || (exports.AnnDocument = {}));
@@ -10686,6 +10704,12 @@
10686
10704
  }
10687
10705
  const callDispose = window[disposeId];
10688
10706
  return () => {
10707
+ if (elementId) {
10708
+ const element = window.document.getElementById(elementId);
10709
+ if (element && element.parentElement) {
10710
+ element.parentElement.removeChild(element);
10711
+ }
10712
+ }
10689
10713
  callDispose();
10690
10714
  };
10691
10715
  }
@@ -10879,7 +10903,7 @@
10879
10903
  })(exports.DataSource || (exports.DataSource = {}));
10880
10904
 
10881
10905
  // This is updated with the package.json version on build.
10882
- const VERSION = "3.7.7";
10906
+ const VERSION = "3.7.9";
10883
10907
 
10884
10908
  exports.VERSION = VERSION;
10885
10909
  exports.AbstractApi = AbstractApi;