bruce-models 4.0.3 → 4.0.5
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 +55 -11
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +55 -11
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity-attachment-type.js +34 -5
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/lib/tileset/tileset.js +20 -5
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity-attachment-type.d.ts +14 -2
- package/dist/types/tileset/tileset.d.ts +4 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -4981,21 +4981,50 @@ var EntityAttachmentType;
|
|
|
4981
4981
|
EType["Photo"] = "photo";
|
|
4982
4982
|
EType["Document"] = "document";
|
|
4983
4983
|
})(EType = EntityAttachmentType.EType || (EntityAttachmentType.EType = {}));
|
|
4984
|
+
/**
|
|
4985
|
+
* Gets an attachment type record by ID.
|
|
4986
|
+
* @param params
|
|
4987
|
+
* @returns
|
|
4988
|
+
*/
|
|
4989
|
+
function Get(params) {
|
|
4990
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4991
|
+
let { api, attachmentTypeId, req: reqParams } = params;
|
|
4992
|
+
if (!api) {
|
|
4993
|
+
api = ENVIRONMENT.Api().GetBruceApi();
|
|
4994
|
+
}
|
|
4995
|
+
if (!attachmentTypeId) {
|
|
4996
|
+
throw ("Type ID is required.");
|
|
4997
|
+
}
|
|
4998
|
+
reqParams = Api.PrepReqParams(reqParams);
|
|
4999
|
+
const cacheData = api.GetCacheItem(GetCacheKey(attachmentTypeId), reqParams);
|
|
5000
|
+
if (cacheData === null || cacheData === void 0 ? void 0 : cacheData.found) {
|
|
5001
|
+
return cacheData.data;
|
|
5002
|
+
}
|
|
5003
|
+
const prom = api.GET(`entityAttachmentType/${attachmentTypeId}`, Api.PrepReqParams(reqParams));
|
|
5004
|
+
api.SetCacheItem({
|
|
5005
|
+
key: GetCacheKey(attachmentTypeId),
|
|
5006
|
+
value: prom,
|
|
5007
|
+
req: reqParams
|
|
5008
|
+
});
|
|
5009
|
+
return prom;
|
|
5010
|
+
});
|
|
5011
|
+
}
|
|
5012
|
+
EntityAttachmentType.Get = Get;
|
|
4984
5013
|
/**
|
|
4985
5014
|
* Deletes an attachment type.
|
|
4986
5015
|
* @param params
|
|
4987
5016
|
*/
|
|
4988
5017
|
function Delete(params) {
|
|
4989
5018
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4990
|
-
let { api, attachmentTypeId
|
|
5019
|
+
let { api, attachmentTypeId, req: reqParams } = params;
|
|
4991
5020
|
if (!api) {
|
|
4992
5021
|
api = ENVIRONMENT.Api().GetBruceApi();
|
|
4993
5022
|
}
|
|
4994
|
-
if (!
|
|
5023
|
+
if (!attachmentTypeId) {
|
|
4995
5024
|
throw ("Type ID is required.");
|
|
4996
5025
|
}
|
|
4997
|
-
yield api.DELETE(`entityAttachmentType/${
|
|
4998
|
-
api.Cache.Remove(GetCacheKey(
|
|
5026
|
+
yield api.DELETE(`entityAttachmentType/${attachmentTypeId}`, Api.PrepReqParams(reqParams));
|
|
5027
|
+
api.Cache.Remove(GetCacheKey(attachmentTypeId));
|
|
4999
5028
|
api.Cache.Remove(GetListCacheKey());
|
|
5000
5029
|
});
|
|
5001
5030
|
}
|
|
@@ -5030,7 +5059,7 @@ var EntityAttachmentType;
|
|
|
5030
5059
|
*/
|
|
5031
5060
|
function GetList(params) {
|
|
5032
5061
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5033
|
-
let { api, reqParams } = params;
|
|
5062
|
+
let { api, req: reqParams } = params;
|
|
5034
5063
|
if (!api) {
|
|
5035
5064
|
api = ENVIRONMENT.Api().GetBruceApi();
|
|
5036
5065
|
}
|
|
@@ -8091,7 +8120,7 @@ var Tileset;
|
|
|
8091
8120
|
* @returns
|
|
8092
8121
|
*/
|
|
8093
8122
|
function GetFileUrl(params) {
|
|
8094
|
-
let { api, tilesetId, file } = params;
|
|
8123
|
+
let { api, tilesetId, file, cacheToken, legacy, viaCdn } = params;
|
|
8095
8124
|
if (!tilesetId) {
|
|
8096
8125
|
throw ("Tileset ID is required.");
|
|
8097
8126
|
}
|
|
@@ -8101,7 +8130,23 @@ var Tileset;
|
|
|
8101
8130
|
if (!file) {
|
|
8102
8131
|
file = "";
|
|
8103
8132
|
}
|
|
8104
|
-
|
|
8133
|
+
let url = null;
|
|
8134
|
+
const cdnBaseUrl = viaCdn ? api.GetCdnBaseUrl() : null;
|
|
8135
|
+
if (cdnBaseUrl) {
|
|
8136
|
+
url = `v3/tilesets/${tilesetId}/files/${legacy ? "" : "files/"}${file}`;
|
|
8137
|
+
const urlParams = new URLSearchParams();
|
|
8138
|
+
if (cacheToken != null) {
|
|
8139
|
+
urlParams.append("cacheToken", String(cacheToken));
|
|
8140
|
+
}
|
|
8141
|
+
url = api.ConstructCdnUrl(url, urlParams);
|
|
8142
|
+
}
|
|
8143
|
+
else {
|
|
8144
|
+
url = api.GetBaseUrl() + `v3/tilesets/${tilesetId}/files/${legacy ? "" : "files/"}${file}`;
|
|
8145
|
+
if (cacheToken != null) {
|
|
8146
|
+
url += `?cacheToken=${cacheToken}`;
|
|
8147
|
+
}
|
|
8148
|
+
}
|
|
8149
|
+
return url;
|
|
8105
8150
|
}
|
|
8106
8151
|
Tileset.GetFileUrl = GetFileUrl;
|
|
8107
8152
|
/**
|
|
@@ -8126,6 +8171,7 @@ var Tileset;
|
|
|
8126
8171
|
/**
|
|
8127
8172
|
* Returns file url for a file + tileset.
|
|
8128
8173
|
* @param params
|
|
8174
|
+
* @deprecated Use GetFileUrl instead.
|
|
8129
8175
|
* @returns
|
|
8130
8176
|
*/
|
|
8131
8177
|
function GetPublicFileUrl(params) {
|
|
@@ -8146,9 +8192,7 @@ var Tileset;
|
|
|
8146
8192
|
}
|
|
8147
8193
|
return cdnBaseUrl + `tileset/file/${tilesetId}/${file}?accountId=${api.AccountId}&cacheToken=${viaCdnCacheToken}`;
|
|
8148
8194
|
}
|
|
8149
|
-
|
|
8150
|
-
return api.GetBaseUrl() + `tileset/file/${tilesetId}/${file}`;
|
|
8151
|
-
}
|
|
8195
|
+
return api.GetBaseUrl() + `tileset/file/${tilesetId}/${file}`;
|
|
8152
8196
|
}
|
|
8153
8197
|
Tileset.GetPublicFileUrl = GetPublicFileUrl;
|
|
8154
8198
|
/**
|
|
@@ -11647,7 +11691,7 @@ var DataSource;
|
|
|
11647
11691
|
})(DataSource || (DataSource = {}));
|
|
11648
11692
|
|
|
11649
11693
|
// This is updated with the package.json version on build.
|
|
11650
|
-
const VERSION = "4.0.
|
|
11694
|
+
const VERSION = "4.0.5";
|
|
11651
11695
|
|
|
11652
11696
|
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 };
|
|
11653
11697
|
//# sourceMappingURL=bruce-models.es5.js.map
|