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.
- package/dist/bruce-models.es5.js +26 -7
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +26 -7
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/tileset/tileset.js +25 -6
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/tileset/tileset.d.ts +4 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -7691,12 +7691,16 @@
|
|
|
7691
7691
|
try {
|
|
7692
7692
|
const data = yield api.GET("tileset/getList", reqParams);
|
|
7693
7693
|
// Convert legacy records.
|
|
7694
|
+
// Commented out because it spams :)
|
|
7695
|
+
// Should use the legacy getList perhaps and substitute needed records.
|
|
7696
|
+
/*
|
|
7694
7697
|
for (let i = 0; i < data.length; i++) {
|
|
7695
7698
|
const record = data[i];
|
|
7696
7699
|
if (record.type == EType.LegacyEntitiesSet || record.type == EType.LegacyStatic || record.type == EType.LegacyExternal) {
|
|
7697
|
-
data[i] = convertLegacyRec(
|
|
7700
|
+
data[i] = convertLegacyRec(await api.GET(`ui.tileset/${record.id}`, reqParams), data[i]);
|
|
7698
7701
|
}
|
|
7699
7702
|
}
|
|
7703
|
+
*/
|
|
7700
7704
|
res({
|
|
7701
7705
|
tilesets: data
|
|
7702
7706
|
});
|
|
@@ -7924,7 +7928,7 @@
|
|
|
7924
7928
|
* @returns
|
|
7925
7929
|
*/
|
|
7926
7930
|
function GetFileUrl(params) {
|
|
7927
|
-
let { api, tilesetId, file } = params;
|
|
7931
|
+
let { api, tilesetId, file, cacheToken, legacy, viaCdn } = params;
|
|
7928
7932
|
if (!tilesetId) {
|
|
7929
7933
|
throw ("Tileset ID is required.");
|
|
7930
7934
|
}
|
|
@@ -7934,7 +7938,23 @@
|
|
|
7934
7938
|
if (!file) {
|
|
7935
7939
|
file = "";
|
|
7936
7940
|
}
|
|
7937
|
-
|
|
7941
|
+
let url = null;
|
|
7942
|
+
const cdnBaseUrl = viaCdn ? api.GetCdnBaseUrl() : null;
|
|
7943
|
+
if (cdnBaseUrl) {
|
|
7944
|
+
url = `v3/tilesets/${tilesetId}/files/${legacy ? "" : "files/"}${file}`;
|
|
7945
|
+
const urlParams = new URLSearchParams();
|
|
7946
|
+
if (cacheToken != null) {
|
|
7947
|
+
urlParams.append("cacheToken", String(cacheToken));
|
|
7948
|
+
}
|
|
7949
|
+
url = api.ConstructCdnUrl(url, urlParams);
|
|
7950
|
+
}
|
|
7951
|
+
else {
|
|
7952
|
+
url = api.GetBaseUrl() + `v3/tilesets/${tilesetId}/files/${legacy ? "" : "files/"}${file}`;
|
|
7953
|
+
if (cacheToken != null) {
|
|
7954
|
+
url += `?cacheToken=${cacheToken}`;
|
|
7955
|
+
}
|
|
7956
|
+
}
|
|
7957
|
+
return url;
|
|
7938
7958
|
}
|
|
7939
7959
|
Tileset.GetFileUrl = GetFileUrl;
|
|
7940
7960
|
/**
|
|
@@ -7959,6 +7979,7 @@
|
|
|
7959
7979
|
/**
|
|
7960
7980
|
* Returns file url for a file + tileset.
|
|
7961
7981
|
* @param params
|
|
7982
|
+
* @deprecated Use GetFileUrl instead.
|
|
7962
7983
|
* @returns
|
|
7963
7984
|
*/
|
|
7964
7985
|
function GetPublicFileUrl(params) {
|
|
@@ -7979,9 +8000,7 @@
|
|
|
7979
8000
|
}
|
|
7980
8001
|
return cdnBaseUrl + `tileset/file/${tilesetId}/${file}?accountId=${api.AccountId}&cacheToken=${viaCdnCacheToken}`;
|
|
7981
8002
|
}
|
|
7982
|
-
|
|
7983
|
-
return api.GetBaseUrl() + `tileset/file/${tilesetId}/${file}`;
|
|
7984
|
-
}
|
|
8003
|
+
return api.GetBaseUrl() + `tileset/file/${tilesetId}/${file}`;
|
|
7985
8004
|
}
|
|
7986
8005
|
Tileset.GetPublicFileUrl = GetPublicFileUrl;
|
|
7987
8006
|
/**
|
|
@@ -11384,7 +11403,7 @@
|
|
|
11384
11403
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
11385
11404
|
|
|
11386
11405
|
// This is updated with the package.json version on build.
|
|
11387
|
-
const VERSION = "4.0.
|
|
11406
|
+
const VERSION = "4.0.4";
|
|
11388
11407
|
|
|
11389
11408
|
exports.VERSION = VERSION;
|
|
11390
11409
|
exports.AbstractApi = AbstractApi;
|