bruce-models 3.5.2 → 3.5.3

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.
@@ -34,6 +34,7 @@ var Api;
34
34
  let ECacheKey;
35
35
  (function (ECacheKey) {
36
36
  ECacheKey["Id"] = ":";
37
+ ECacheKey["ListId"] = "::";
37
38
  ECacheKey["Entity"] = "entity";
38
39
  ECacheKey["EntityType"] = "entitytype";
39
40
  ECacheKey["ProjectView"] = "projectview";
@@ -8113,36 +8114,15 @@ var ProjectViewBookmark;
8113
8114
  */
8114
8115
  var ProjectView;
8115
8116
  (function (ProjectView) {
8116
- /**
8117
- * Returns cache identifier for a project view.
8118
- * Example: {
8119
- * const api: BruceApi.Api = ...;
8120
- * const key = GetCacheKey("abc");
8121
- * api.Cache.Remove(key);
8122
- * }
8123
- * @param viewId
8124
- * @returns
8125
- */
8126
- function GetCacheKey(viewId) {
8127
- return `${Api.ECacheKey.ProjectView}${Api.ECacheKey.Id}${viewId}`;
8128
- }
8129
- ProjectView.GetCacheKey = GetCacheKey;
8130
- /**
8131
- * Returns cache identifier for a list of project views.
8132
- * Example: {
8133
- * const api: BruceApi.Api = ...;
8134
- * const key = GetListCacheKey();
8135
- * api.Cache.Remove(key);
8136
- * }
8137
- * @returns
8138
- */
8139
- function GetListCacheKey() {
8140
- return Api.ECacheKey.ProjectView;
8141
- }
8142
- ProjectView.GetListCacheKey = GetListCacheKey;
8143
8117
  // This is the expected default version for the DataVersion value.
8144
8118
  // This value should NOT be changed without looking at our API and seeing what the default value is.
8145
8119
  ProjectView.DEFAULT_DATA_VERSION = 2;
8120
+ // Our Cesium web navigator.
8121
+ ProjectView.TYPE_WEB_3D_NAVIGATOR = "WEB_3D_NAVIGATOR";
8122
+ // Our (currently WIP) 2D web navigator.
8123
+ ProjectView.TYPE_WEB_2D_NAVIGATOR = "WEB_2D_NAVIGATOR";
8124
+ // Defaulting to 3D navigator for backwards compatibility.
8125
+ ProjectView.DEFAULT_TYPE = ProjectView.TYPE_WEB_3D_NAVIGATOR;
8146
8126
  /**
8147
8127
  * Gets a project view record.
8148
8128
  * @param params
@@ -8189,11 +8169,11 @@ var ProjectView;
8189
8169
  */
8190
8170
  function GetList(params) {
8191
8171
  return __awaiter(this, void 0, void 0, function* () {
8192
- let { api, req: reqParams } = params;
8172
+ let { api, req: reqParams, type } = params;
8193
8173
  if (!api) {
8194
8174
  api = ENVIRONMENT.Api().GetBruceApi();
8195
8175
  }
8196
- const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
8176
+ const cache = yield api.GetCacheItem(GetListCacheKey(type), reqParams);
8197
8177
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
8198
8178
  return cache.data;
8199
8179
  }
@@ -8209,7 +8189,7 @@ var ProjectView;
8209
8189
  }
8210
8190
  }));
8211
8191
  yield api.SetCacheItem({
8212
- key: GetListCacheKey(),
8192
+ key: GetListCacheKey(type),
8213
8193
  value: prom,
8214
8194
  req: reqParams
8215
8195
  });
@@ -8232,7 +8212,7 @@ var ProjectView;
8232
8212
  }
8233
8213
  yield api.DELETE(`ui.view/${viewId}`, Api.PrepReqParams(reqParams));
8234
8214
  api.Cache.Remove(GetCacheKey(viewId));
8235
- api.Cache.Remove(GetListCacheKey());
8215
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
8236
8216
  });
8237
8217
  }
8238
8218
  ProjectView.Delete = Delete;
@@ -8269,13 +8249,44 @@ var ProjectView;
8269
8249
  data = yield api.PUT(`ui.view/${data.ID}`, data, Api.PrepReqParams(reqParams));
8270
8250
  }
8271
8251
  api.Cache.Remove(GetCacheKey(data.ID));
8272
- api.Cache.Remove(GetListCacheKey());
8252
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
8273
8253
  return {
8274
8254
  view: data
8275
8255
  };
8276
8256
  });
8277
8257
  }
8278
8258
  ProjectView.Update = Update;
8259
+ /**
8260
+ * Returns cache identifier for a project view.
8261
+ * Example: {
8262
+ * const api: BruceApi.Api = ...;
8263
+ * const key = GetCacheKey("abc");
8264
+ * api.Cache.Remove(key);
8265
+ * }
8266
+ * @param viewId
8267
+ * @returns
8268
+ */
8269
+ function GetCacheKey(viewId) {
8270
+ return `${Api.ECacheKey.ProjectView}${Api.ECacheKey.Id}${viewId}`;
8271
+ }
8272
+ ProjectView.GetCacheKey = GetCacheKey;
8273
+ /**
8274
+ * Returns cache identifier for a list of project views.
8275
+ * Example: {
8276
+ * const api: BruceApi.Api = ...;
8277
+ * const key = GetListCacheKey();
8278
+ * api.Cache.Remove(key);
8279
+ * }
8280
+ * @param type optional filter for the type of project view.
8281
+ * @returns
8282
+ */
8283
+ function GetListCacheKey(type) {
8284
+ if (type) {
8285
+ return `${Api.ECacheKey.ProjectView}${Api.ECacheKey.ListId}${type}`;
8286
+ }
8287
+ return `${Api.ECacheKey.ProjectView}${Api.ECacheKey.ListId}`;
8288
+ }
8289
+ ProjectView.GetListCacheKey = GetListCacheKey;
8279
8290
  })(ProjectView || (ProjectView = {}));
8280
8291
 
8281
8292
  function getTemplateSettings(apiGetter, reqParams) {
@@ -10840,7 +10851,7 @@ var DataSource;
10840
10851
  })(DataSource || (DataSource = {}));
10841
10852
 
10842
10853
  // This is updated with the package.json version on build.
10843
- const VERSION = "3.5.2";
10854
+ const VERSION = "3.5.3";
10844
10855
 
10845
10856
  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 };
10846
10857
  //# sourceMappingURL=bruce-models.es5.js.map