bruce-models 3.7.6 → 3.7.8
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 +44 -20
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +31 -7
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/abstract-api.js +1 -2
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/client-file/client-file.js +9 -2
- package/dist/lib/client-file/client-file.js.map +1 -1
- package/dist/lib/common/cache.js +0 -1
- package/dist/lib/common/cache.js.map +1 -1
- package/dist/lib/plugin/plugin.js +1 -4
- package/dist/lib/plugin/plugin.js.map +1 -1
- package/dist/lib/server/message-broker.js +1 -3
- package/dist/lib/server/message-broker.js.map +1 -1
- package/dist/lib/util/url-utils.js +14 -0
- package/dist/lib/util/url-utils.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/common/cache.d.ts +0 -2
- package/dist/types/util/url-utils.d.ts +9 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -178,7 +178,6 @@ class CacheControl {
|
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
180
|
id = String(id);
|
|
181
|
-
// Prioritize memory over storage because it's faster to access.
|
|
182
181
|
let record = this.memory.get(id);
|
|
183
182
|
if (!record) {
|
|
184
183
|
return {
|
|
@@ -332,8 +331,7 @@ class AbstractApi {
|
|
|
332
331
|
this.Cache.Set({
|
|
333
332
|
id: key,
|
|
334
333
|
data: value,
|
|
335
|
-
duration
|
|
336
|
-
persistence: "memory"
|
|
334
|
+
duration
|
|
337
335
|
});
|
|
338
336
|
}
|
|
339
337
|
/**
|
|
@@ -600,7 +598,7 @@ var MessageBroker;
|
|
|
600
598
|
}
|
|
601
599
|
}
|
|
602
600
|
formatApiUri(uri) {
|
|
603
|
-
const ws = "wss";
|
|
601
|
+
const ws = !window.document || window.document.location.protocol === "https:" ? "wss" : "ws";
|
|
604
602
|
return uri.replace(/^(https|http)/, ws) + "websocket";
|
|
605
603
|
}
|
|
606
604
|
onOpen(ev) {
|
|
@@ -6736,13 +6734,13 @@ var Uploader;
|
|
|
6736
6734
|
* A client file is a record of a file uploaded to Bruce.
|
|
6737
6735
|
*/
|
|
6738
6736
|
var ClientFile;
|
|
6739
|
-
(function (ClientFile) {
|
|
6737
|
+
(function (ClientFile$$1) {
|
|
6740
6738
|
let EPurpose;
|
|
6741
6739
|
(function (EPurpose) {
|
|
6742
6740
|
// Use this purpose for uploading bookmark thumbnail images.
|
|
6743
6741
|
// This will allow lower level privileges to upload (small) bookmark thumbnails.
|
|
6744
6742
|
EPurpose["BookmarkThumbnail"] = "Bookmark Thumbnail";
|
|
6745
|
-
})(EPurpose = ClientFile.EPurpose || (ClientFile.EPurpose = {}));
|
|
6743
|
+
})(EPurpose = ClientFile$$1.EPurpose || (ClientFile$$1.EPurpose = {}));
|
|
6746
6744
|
/**
|
|
6747
6745
|
* Returns the URL for a client file.
|
|
6748
6746
|
* @param params
|
|
@@ -6758,9 +6756,12 @@ var ClientFile;
|
|
|
6758
6756
|
if (cdnUrl) {
|
|
6759
6757
|
return cdnUrl;
|
|
6760
6758
|
}
|
|
6761
|
-
|
|
6759
|
+
let url = `${api.GetBaseUrl()}${urlSuffix}`;
|
|
6760
|
+
// Invalidating cache manually because we have a wave of invalid headers now cached across devices.
|
|
6761
|
+
url = UrlUtils.AddQueryParam(url, "cc", "1");
|
|
6762
|
+
return url;
|
|
6762
6763
|
}
|
|
6763
|
-
ClientFile.GetUrl = GetUrl;
|
|
6764
|
+
ClientFile$$1.GetUrl = GetUrl;
|
|
6764
6765
|
/**
|
|
6765
6766
|
* Returns the URL for a client file with the extension.
|
|
6766
6767
|
* @param params
|
|
@@ -6776,9 +6777,12 @@ var ClientFile;
|
|
|
6776
6777
|
if (cdnUrl) {
|
|
6777
6778
|
return cdnUrl;
|
|
6778
6779
|
}
|
|
6779
|
-
|
|
6780
|
+
let url = `${api.GetBaseUrl()}${urlSuffix}`;
|
|
6781
|
+
// Invalidating cache manually because we have a wave of invalid headers now cached across devices.
|
|
6782
|
+
url = UrlUtils.AddQueryParam(url, "cc", "1");
|
|
6783
|
+
return url;
|
|
6780
6784
|
}
|
|
6781
|
-
ClientFile.GetUrlWithExt = GetUrlWithExt;
|
|
6785
|
+
ClientFile$$1.GetUrlWithExt = GetUrlWithExt;
|
|
6782
6786
|
/**
|
|
6783
6787
|
* Returns a client file record by ID.
|
|
6784
6788
|
* @param params
|
|
@@ -6817,7 +6821,7 @@ var ClientFile;
|
|
|
6817
6821
|
return prom;
|
|
6818
6822
|
});
|
|
6819
6823
|
}
|
|
6820
|
-
ClientFile.Get = Get;
|
|
6824
|
+
ClientFile$$1.Get = Get;
|
|
6821
6825
|
/**
|
|
6822
6826
|
* Deletes one or many client file records by IDs.
|
|
6823
6827
|
* @param params
|
|
@@ -6841,7 +6845,7 @@ var ClientFile;
|
|
|
6841
6845
|
}
|
|
6842
6846
|
});
|
|
6843
6847
|
}
|
|
6844
|
-
ClientFile.Delete = Delete;
|
|
6848
|
+
ClientFile$$1.Delete = Delete;
|
|
6845
6849
|
/**
|
|
6846
6850
|
* Uploads a file and creates a new client file record.
|
|
6847
6851
|
* @param params
|
|
@@ -6904,7 +6908,7 @@ var ClientFile;
|
|
|
6904
6908
|
};
|
|
6905
6909
|
});
|
|
6906
6910
|
}
|
|
6907
|
-
ClientFile.Upload = Upload;
|
|
6911
|
+
ClientFile$$1.Upload = Upload;
|
|
6908
6912
|
/**
|
|
6909
6913
|
* Updates the purpose of a client file.
|
|
6910
6914
|
* @param params
|
|
@@ -6925,7 +6929,7 @@ var ClientFile;
|
|
|
6925
6929
|
api.Cache.RemoveByContains(cacheKey);
|
|
6926
6930
|
});
|
|
6927
6931
|
}
|
|
6928
|
-
ClientFile.UpdatePurpose = UpdatePurpose;
|
|
6932
|
+
ClientFile$$1.UpdatePurpose = UpdatePurpose;
|
|
6929
6933
|
/**
|
|
6930
6934
|
* Uploads a temp file.
|
|
6931
6935
|
* This will return a temp file ID.
|
|
@@ -6975,7 +6979,7 @@ var ClientFile;
|
|
|
6975
6979
|
};
|
|
6976
6980
|
});
|
|
6977
6981
|
}
|
|
6978
|
-
ClientFile.UploadTemp = UploadTemp;
|
|
6982
|
+
ClientFile$$1.UploadTemp = UploadTemp;
|
|
6979
6983
|
/**
|
|
6980
6984
|
* Filter definitions for requesting a list of client files.
|
|
6981
6985
|
*/
|
|
@@ -7001,7 +7005,7 @@ var ClientFile;
|
|
|
7001
7005
|
ERowOperator["AND"] = "AND";
|
|
7002
7006
|
ERowOperator["OR"] = "OR";
|
|
7003
7007
|
})(ERowOperator = Filter.ERowOperator || (Filter.ERowOperator = {}));
|
|
7004
|
-
})(Filter = ClientFile.Filter || (ClientFile.Filter = {}));
|
|
7008
|
+
})(Filter = ClientFile$$1.Filter || (ClientFile$$1.Filter = {}));
|
|
7005
7009
|
/**
|
|
7006
7010
|
* Returns a list of client files matching the filter.
|
|
7007
7011
|
* @param params
|
|
@@ -7020,7 +7024,7 @@ var ClientFile;
|
|
|
7020
7024
|
};
|
|
7021
7025
|
});
|
|
7022
7026
|
}
|
|
7023
|
-
ClientFile.GetList = GetList;
|
|
7027
|
+
ClientFile$$1.GetList = GetList;
|
|
7024
7028
|
/**
|
|
7025
7029
|
* Utility for processing client files.
|
|
7026
7030
|
* Commonly used to convert a file to a different format. Eg: FBX to GLB.
|
|
@@ -7057,7 +7061,7 @@ var ClientFile;
|
|
|
7057
7061
|
});
|
|
7058
7062
|
}
|
|
7059
7063
|
Processor.ConvertFormat = ConvertFormat;
|
|
7060
|
-
})(Processor = ClientFile.Processor || (ClientFile.Processor = {}));
|
|
7064
|
+
})(Processor = ClientFile$$1.Processor || (ClientFile$$1.Processor = {}));
|
|
7061
7065
|
/**
|
|
7062
7066
|
* Returns cache identifier for a client file by ID.
|
|
7063
7067
|
* Example: {
|
|
@@ -7071,7 +7075,7 @@ var ClientFile;
|
|
|
7071
7075
|
function GetCacheKey(fileId) {
|
|
7072
7076
|
return `${Api.ECacheKey.ClientFile}${Api.ECacheKey.Id}${fileId}`;
|
|
7073
7077
|
}
|
|
7074
|
-
ClientFile.GetCacheKey = GetCacheKey;
|
|
7078
|
+
ClientFile$$1.GetCacheKey = GetCacheKey;
|
|
7075
7079
|
})(ClientFile || (ClientFile = {}));
|
|
7076
7080
|
|
|
7077
7081
|
/**
|
|
@@ -10138,6 +10142,20 @@ var UrlUtils;
|
|
|
10138
10142
|
return str;
|
|
10139
10143
|
}
|
|
10140
10144
|
UrlUtils.ToHumanReadable = ToHumanReadable;
|
|
10145
|
+
/**
|
|
10146
|
+
* Adds a query parameter to a url.
|
|
10147
|
+
* Eg: AddQueryParam('http://example.com', 'key', 'value') => 'http://example.com?key=value'
|
|
10148
|
+
* @param url
|
|
10149
|
+
* @param key
|
|
10150
|
+
* @param value
|
|
10151
|
+
* @returns
|
|
10152
|
+
*/
|
|
10153
|
+
function AddQueryParam(url, key, value) {
|
|
10154
|
+
const urlObj = new URL(url);
|
|
10155
|
+
urlObj.searchParams.append(key, value);
|
|
10156
|
+
return urlObj.toString();
|
|
10157
|
+
}
|
|
10158
|
+
UrlUtils.AddQueryParam = AddQueryParam;
|
|
10141
10159
|
})(UrlUtils || (UrlUtils = {}));
|
|
10142
10160
|
|
|
10143
10161
|
/**
|
|
@@ -10925,6 +10943,12 @@ var Plugin;
|
|
|
10925
10943
|
}
|
|
10926
10944
|
const callDispose = window[disposeId];
|
|
10927
10945
|
return () => {
|
|
10946
|
+
if (elementId) {
|
|
10947
|
+
const element = window.document.getElementById(elementId);
|
|
10948
|
+
if (element && element.parentElement) {
|
|
10949
|
+
element.parentElement.removeChild(element);
|
|
10950
|
+
}
|
|
10951
|
+
}
|
|
10928
10952
|
callDispose();
|
|
10929
10953
|
};
|
|
10930
10954
|
}
|
|
@@ -11119,7 +11143,7 @@ var DataSource;
|
|
|
11119
11143
|
})(DataSource || (DataSource = {}));
|
|
11120
11144
|
|
|
11121
11145
|
// This is updated with the package.json version on build.
|
|
11122
|
-
const VERSION = "3.7.
|
|
11146
|
+
const VERSION = "3.7.8";
|
|
11123
11147
|
|
|
11124
11148
|
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 };
|
|
11125
11149
|
//# sourceMappingURL=bruce-models.es5.js.map
|