bruce-models 3.6.9 → 3.7.0

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.
@@ -9985,6 +9985,98 @@ var AccountInvite;
9985
9985
  AccountInvite.Create = Create;
9986
9986
  })(AccountInvite || (AccountInvite = {}));
9987
9987
 
9988
+ /**
9989
+ * Account Features are a set of flags that can be enabled or disabled for an account.
9990
+ * These flags usually represent how data is stored and managed.
9991
+ */
9992
+ var AccountFeatures;
9993
+ (function (AccountFeatures) {
9994
+ let EFeature;
9995
+ (function (EFeature) {
9996
+ // Flag to enable data to be stored in the JSON column type.
9997
+ // This will enable conversion of the data, and will also enable searches to use that instead.
9998
+ EFeature["EntityJsonData"] = "Feature_Entity_JSONData";
9999
+ // Flag to enable a text search against JSON data values.
10000
+ // 'EntityJsonData' must also be enabled.
10001
+ EFeature["EntityLexicalSearch"] = "Feature_Entity_Lexical_Search";
10002
+ })(EFeature = AccountFeatures.EFeature || (AccountFeatures.EFeature = {}));
10003
+ /**
10004
+ * Gets account features corresponding to an account ID.
10005
+ * @param params
10006
+ * @returns
10007
+ */
10008
+ function Get(params) {
10009
+ return __awaiter(this, void 0, void 0, function* () {
10010
+ let { api, accountId: id, req: reqParams } = params;
10011
+ if (!api) {
10012
+ api = ENVIRONMENT.Api().GetBruceApi();
10013
+ }
10014
+ const cache = yield api.GetCacheItem(GetCacheKey(id), reqParams);
10015
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
10016
+ return cache.data;
10017
+ }
10018
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
10019
+ try {
10020
+ const data = yield api.GET("features", reqParams);
10021
+ const features = data === null || data === void 0 ? void 0 : data.Features;
10022
+ res({
10023
+ features: features ? features : {}
10024
+ });
10025
+ }
10026
+ catch (e) {
10027
+ rej(e);
10028
+ }
10029
+ }));
10030
+ api.SetCacheItem({
10031
+ key: GetCacheKey(id),
10032
+ value: prom,
10033
+ req: reqParams
10034
+ });
10035
+ return prom;
10036
+ });
10037
+ }
10038
+ AccountFeatures.Get = Get;
10039
+ function Update(params) {
10040
+ return __awaiter(this, void 0, void 0, function* () {
10041
+ let { api, accountId: id, features, req: reqParams } = params;
10042
+ if (!api) {
10043
+ api = ENVIRONMENT.Api().GetBruceApi();
10044
+ }
10045
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
10046
+ try {
10047
+ const data = yield api.POST("features", {
10048
+ Features: features
10049
+ }, reqParams);
10050
+ const updated = data === null || data === void 0 ? void 0 : data.Features;
10051
+ res({
10052
+ features: updated ? updated : {}
10053
+ });
10054
+ }
10055
+ catch (e) {
10056
+ rej(e);
10057
+ }
10058
+ }));
10059
+ api.Cache.Remove(GetCacheKey(id));
10060
+ return prom;
10061
+ });
10062
+ }
10063
+ AccountFeatures.Update = Update;
10064
+ /**
10065
+ * Returns cache identifier for an account by ID.
10066
+ * Example: {
10067
+ * const api: BruceApi.Api = ...;
10068
+ * const key = GetCacheKey("my-account-id");
10069
+ * api.Cache.Remove(key);
10070
+ * }
10071
+ * @param accountId
10072
+ * @returns
10073
+ */
10074
+ function GetCacheKey(accountId) {
10075
+ return Api.ECacheKey.AccountFeatures + Api.ECacheKey.Id + accountId;
10076
+ }
10077
+ AccountFeatures.GetCacheKey = GetCacheKey;
10078
+ })(AccountFeatures || (AccountFeatures = {}));
10079
+
9988
10080
  var EncryptUtils;
9989
10081
  (function (EncryptUtils) {
9990
10082
  // https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript
@@ -10997,7 +11089,7 @@ var DataSource;
10997
11089
  })(DataSource || (DataSource = {}));
10998
11090
 
10999
11091
  // This is updated with the package.json version on build.
11000
- const VERSION = "3.6.9";
11092
+ const VERSION = "3.7.0";
11001
11093
 
11002
- 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, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
11094
+ 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 };
11003
11095
  //# sourceMappingURL=bruce-models.es5.js.map