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.
@@ -598,7 +598,7 @@ var MessageBroker;
598
598
  }
599
599
  }
600
600
  formatApiUri(uri) {
601
- const ws = "wss";
601
+ const ws = !window.document || window.document.location.protocol === "https:" ? "wss" : "ws";
602
602
  return uri.replace(/^(https|http)/, ws) + "websocket";
603
603
  }
604
604
  onOpen(ev) {
@@ -2081,20 +2081,30 @@ var AnnDocument;
2081
2081
  */
2082
2082
  function GetList(params) {
2083
2083
  return __awaiter(this, void 0, void 0, function* () {
2084
- let { api, docType: type, req: reqParams } = params;
2084
+ let { api, docType: type, req: reqParams, entityId, expandSettings } = params;
2085
2085
  if (!api) {
2086
2086
  api = ENVIRONMENT.Api().GetBruceApi();
2087
2087
  }
2088
2088
  if (!type) {
2089
2089
  type = "";
2090
2090
  }
2091
- const cache = yield api.GetCacheItem(GetListCacheKey(type), reqParams);
2091
+ const cache = yield api.GetCacheItem(GetListCacheKey(type, entityId, expandSettings), reqParams);
2092
2092
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
2093
2093
  return cache.data;
2094
2094
  }
2095
2095
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
2096
2096
  try {
2097
- const url = "documentViews" + (type ? "?type=" + type : "");
2097
+ const urlParams = new URLSearchParams();
2098
+ if (type) {
2099
+ urlParams.append("type", type);
2100
+ }
2101
+ if (entityId) {
2102
+ urlParams.append("entityId", entityId);
2103
+ }
2104
+ if (expandSettings) {
2105
+ urlParams.append("expandSettings", "true");
2106
+ }
2107
+ const url = "documentViews" + `?${urlParams.toString()}`;
2098
2108
  const data = yield api.GET(url, Api.PrepReqParams(reqParams));
2099
2109
  res({
2100
2110
  documents: data.Items
@@ -2105,7 +2115,7 @@ var AnnDocument;
2105
2115
  }
2106
2116
  }));
2107
2117
  yield api.SetCacheItem({
2108
- key: GetListCacheKey(type),
2118
+ key: GetListCacheKey(type, entityId, expandSettings),
2109
2119
  value: req,
2110
2120
  req: reqParams
2111
2121
  });
@@ -2135,10 +2145,18 @@ var AnnDocument;
2135
2145
  * api.Cache.Remove(key);
2136
2146
  * }
2137
2147
  * @param type
2148
+ * @param entityId
2149
+ * @param expandSettings
2138
2150
  * @returns
2139
2151
  */
2140
- function GetListCacheKey(type) {
2141
- return Api.ECacheKey.AnnDocument + type;
2152
+ function GetListCacheKey(type, entityId, expandSettings) {
2153
+ if (!expandSettings) {
2154
+ expandSettings = false;
2155
+ }
2156
+ if (!entityId) {
2157
+ entityId = "";
2158
+ }
2159
+ return Api.ECacheKey.AnnDocument + type + entityId + expandSettings;
2142
2160
  }
2143
2161
  AnnDocument.GetListCacheKey = GetListCacheKey;
2144
2162
  })(AnnDocument || (AnnDocument = {}));
@@ -10943,6 +10961,12 @@ var Plugin;
10943
10961
  }
10944
10962
  const callDispose = window[disposeId];
10945
10963
  return () => {
10964
+ if (elementId) {
10965
+ const element = window.document.getElementById(elementId);
10966
+ if (element && element.parentElement) {
10967
+ element.parentElement.removeChild(element);
10968
+ }
10969
+ }
10946
10970
  callDispose();
10947
10971
  };
10948
10972
  }
@@ -11137,7 +11161,7 @@ var DataSource;
11137
11161
  })(DataSource || (DataSource = {}));
11138
11162
 
11139
11163
  // This is updated with the package.json version on build.
11140
- const VERSION = "3.7.7";
11164
+ const VERSION = "3.7.9";
11141
11165
 
11142
11166
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
11143
11167
  //# sourceMappingURL=bruce-models.es5.js.map