bruce-models 4.0.2 → 4.0.4

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.
@@ -7854,12 +7854,16 @@ var Tileset;
7854
7854
  try {
7855
7855
  const data = yield api.GET("tileset/getList", reqParams);
7856
7856
  // Convert legacy records.
7857
+ // Commented out because it spams :)
7858
+ // Should use the legacy getList perhaps and substitute needed records.
7859
+ /*
7857
7860
  for (let i = 0; i < data.length; i++) {
7858
7861
  const record = data[i];
7859
7862
  if (record.type == EType.LegacyEntitiesSet || record.type == EType.LegacyStatic || record.type == EType.LegacyExternal) {
7860
- data[i] = convertLegacyRec(yield api.GET(`ui.tileset/${record.id}`, reqParams), data[i]);
7863
+ data[i] = convertLegacyRec(await api.GET(`ui.tileset/${record.id}`, reqParams), data[i]);
7861
7864
  }
7862
7865
  }
7866
+ */
7863
7867
  res({
7864
7868
  tilesets: data
7865
7869
  });
@@ -8087,7 +8091,7 @@ var Tileset;
8087
8091
  * @returns
8088
8092
  */
8089
8093
  function GetFileUrl(params) {
8090
- let { api, tilesetId, file } = params;
8094
+ let { api, tilesetId, file, cacheToken, legacy, viaCdn } = params;
8091
8095
  if (!tilesetId) {
8092
8096
  throw ("Tileset ID is required.");
8093
8097
  }
@@ -8097,7 +8101,23 @@ var Tileset;
8097
8101
  if (!file) {
8098
8102
  file = "";
8099
8103
  }
8100
- return api.GetBaseUrl() + `tileset/getFile/${tilesetId}/files/${file}`;
8104
+ let url = null;
8105
+ const cdnBaseUrl = viaCdn ? api.GetCdnBaseUrl() : null;
8106
+ if (cdnBaseUrl) {
8107
+ url = `v3/tilesets/${tilesetId}/files/${legacy ? "" : "files/"}${file}`;
8108
+ const urlParams = new URLSearchParams();
8109
+ if (cacheToken != null) {
8110
+ urlParams.append("cacheToken", String(cacheToken));
8111
+ }
8112
+ url = api.ConstructCdnUrl(url, urlParams);
8113
+ }
8114
+ else {
8115
+ url = api.GetBaseUrl() + `v3/tilesets/${tilesetId}/files/${legacy ? "" : "files/"}${file}`;
8116
+ if (cacheToken != null) {
8117
+ url += `?cacheToken=${cacheToken}`;
8118
+ }
8119
+ }
8120
+ return url;
8101
8121
  }
8102
8122
  Tileset.GetFileUrl = GetFileUrl;
8103
8123
  /**
@@ -8122,6 +8142,7 @@ var Tileset;
8122
8142
  /**
8123
8143
  * Returns file url for a file + tileset.
8124
8144
  * @param params
8145
+ * @deprecated Use GetFileUrl instead.
8125
8146
  * @returns
8126
8147
  */
8127
8148
  function GetPublicFileUrl(params) {
@@ -8142,9 +8163,7 @@ var Tileset;
8142
8163
  }
8143
8164
  return cdnBaseUrl + `tileset/file/${tilesetId}/${file}?accountId=${api.AccountId}&cacheToken=${viaCdnCacheToken}`;
8144
8165
  }
8145
- else {
8146
- return api.GetBaseUrl() + `tileset/file/${tilesetId}/${file}`;
8147
- }
8166
+ return api.GetBaseUrl() + `tileset/file/${tilesetId}/${file}`;
8148
8167
  }
8149
8168
  Tileset.GetPublicFileUrl = GetPublicFileUrl;
8150
8169
  /**
@@ -11643,7 +11662,7 @@ var DataSource;
11643
11662
  })(DataSource || (DataSource = {}));
11644
11663
 
11645
11664
  // This is updated with the package.json version on build.
11646
- const VERSION = "4.0.2";
11665
+ const VERSION = "4.0.4";
11647
11666
 
11648
11667
  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, EntityHistoricData, 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 };
11649
11668
  //# sourceMappingURL=bruce-models.es5.js.map