bruce-models 3.5.1 → 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.
Files changed (46) hide show
  1. package/README.md +31 -0
  2. package/dist/bruce-models.es5.js +275 -248
  3. package/dist/bruce-models.es5.js.map +1 -1
  4. package/dist/bruce-models.umd.js +264 -237
  5. package/dist/bruce-models.umd.js.map +1 -1
  6. package/dist/lib/account/account.js +45 -45
  7. package/dist/lib/account/account.js.map +1 -1
  8. package/dist/lib/ann-document/ann-document.js +28 -28
  9. package/dist/lib/ann-document/ann-document.js.map +1 -1
  10. package/dist/lib/api/api.js +1 -0
  11. package/dist/lib/api/api.js.map +1 -1
  12. package/dist/lib/bruce-models.js +2 -1
  13. package/dist/lib/bruce-models.js.map +1 -1
  14. package/dist/lib/client-file/client-file.js +14 -14
  15. package/dist/lib/client-file/client-file.js.map +1 -1
  16. package/dist/lib/custom-form/custom-form.js +31 -31
  17. package/dist/lib/custom-form/custom-form.js.map +1 -1
  18. package/dist/lib/data-lab/data-lab.js.map +1 -1
  19. package/dist/lib/data-source/data-source.js +27 -27
  20. package/dist/lib/data-source/data-source.js.map +1 -1
  21. package/dist/lib/entity/entity-attachment-type.js +28 -28
  22. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  23. package/dist/lib/entity/entity-attachment.js +28 -28
  24. package/dist/lib/entity/entity-attachment.js.map +1 -1
  25. package/dist/lib/entity/entity-attribute.js.map +1 -1
  26. package/dist/lib/entity/entity-tag.js +17 -2
  27. package/dist/lib/entity/entity-tag.js.map +1 -1
  28. package/dist/lib/plugin/plugin.js +32 -32
  29. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  30. package/dist/lib/project/project-view.js +42 -32
  31. package/dist/lib/project/project-view.js.map +1 -1
  32. package/dist/lib/project/zoom-control.js.map +1 -1
  33. package/dist/types/account/account.d.ts +47 -47
  34. package/dist/types/ann-document/ann-document.d.ts +42 -42
  35. package/dist/types/api/api.d.ts +1 -0
  36. package/dist/types/bruce-models.d.ts +1 -1
  37. package/dist/types/client-file/client-file.d.ts +11 -11
  38. package/dist/types/custom-form/custom-form.d.ts +22 -22
  39. package/dist/types/data-lab/data-lab.d.ts +4 -4
  40. package/dist/types/data-source/data-source.d.ts +21 -21
  41. package/dist/types/entity/entity-attachment-type.d.ts +22 -22
  42. package/dist/types/entity/entity-attachment.d.ts +22 -22
  43. package/dist/types/entity/entity-attribute.d.ts +9 -9
  44. package/dist/types/project/project-view.d.ts +27 -21
  45. package/dist/types/project/zoom-control.d.ts +9 -9
  46. package/package.json +78 -78
@@ -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";
@@ -806,51 +807,6 @@ const ACCOUNT_EXCLUSIONS = ["hyperportal", "hypeportal", "bviewer"];
806
807
  */
807
808
  var Account;
808
809
  (function (Account) {
809
- /**
810
- * Returns cache identifier for an account by ID.
811
- * Example: {
812
- * const api: BruceApi.Api = ...;
813
- * const key = GetCacheKey(1);
814
- * api.Cache.Remove(key);
815
- * }
816
- * @param accountId
817
- * @param appSettingsId
818
- * @returns
819
- */
820
- function GetCacheKey(accountId, appSettingsId) {
821
- if (appSettingsId) {
822
- return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey + appSettingsId;
823
- }
824
- return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId;
825
- }
826
- Account.GetCacheKey = GetCacheKey;
827
- /**
828
- * Returns cache identifier for a list of accounts by session ID.
829
- * Example: {
830
- * const api: BruceApi.Api = ...;
831
- * const key = GetListCacheKey(api.GetSessionId());
832
- * api.Cache.Remove(key);
833
- * }
834
- * @param ssid
835
- * @returns
836
- */
837
- function GetListCacheKey(ssid) {
838
- return Api.ECacheKey.Account + Api.ECacheKey.Session + Api.ECacheKey.Id + ssid;
839
- }
840
- Account.GetListCacheKey = GetListCacheKey;
841
- /**
842
- * Returns cache identifier for a list of database regions.
843
- * Example: {
844
- * const api: BruceApi.Api = ...;
845
- * const key = GetDbRegionListCacheKey();
846
- * api.Cache.Remove(key);
847
- * }
848
- * @returns
849
- */
850
- function GetDbRegionListCacheKey() {
851
- return Api.ECacheKey.DatabaseRegion;
852
- }
853
- Account.GetDbRegionListCacheKey = GetDbRegionListCacheKey;
854
810
  /**
855
811
  * Known Nextspace applications we store settings for.
856
812
  */
@@ -1081,6 +1037,51 @@ var Account;
1081
1037
  });
1082
1038
  }
1083
1039
  Account.Create = Create;
1040
+ /**
1041
+ * Returns cache identifier for an account by ID.
1042
+ * Example: {
1043
+ * const api: BruceApi.Api = ...;
1044
+ * const key = GetCacheKey(1);
1045
+ * api.Cache.Remove(key);
1046
+ * }
1047
+ * @param accountId
1048
+ * @param appSettingsId
1049
+ * @returns
1050
+ */
1051
+ function GetCacheKey(accountId, appSettingsId) {
1052
+ if (appSettingsId) {
1053
+ return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey + appSettingsId;
1054
+ }
1055
+ return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId;
1056
+ }
1057
+ Account.GetCacheKey = GetCacheKey;
1058
+ /**
1059
+ * Returns cache identifier for a list of accounts by session ID.
1060
+ * Example: {
1061
+ * const api: BruceApi.Api = ...;
1062
+ * const key = GetListCacheKey(api.GetSessionId());
1063
+ * api.Cache.Remove(key);
1064
+ * }
1065
+ * @param ssid
1066
+ * @returns
1067
+ */
1068
+ function GetListCacheKey(ssid) {
1069
+ return Api.ECacheKey.Account + Api.ECacheKey.Session + Api.ECacheKey.Id + ssid;
1070
+ }
1071
+ Account.GetListCacheKey = GetListCacheKey;
1072
+ /**
1073
+ * Returns cache identifier for a list of database regions.
1074
+ * Example: {
1075
+ * const api: BruceApi.Api = ...;
1076
+ * const key = GetDbRegionListCacheKey();
1077
+ * api.Cache.Remove(key);
1078
+ * }
1079
+ * @returns
1080
+ */
1081
+ function GetDbRegionListCacheKey() {
1082
+ return Api.ECacheKey.DatabaseRegion;
1083
+ }
1084
+ Account.GetDbRegionListCacheKey = GetDbRegionListCacheKey;
1084
1085
  })(Account || (Account = {}));
1085
1086
 
1086
1087
  /**
@@ -1949,34 +1950,6 @@ var ENVIRONMENT;
1949
1950
  */
1950
1951
  var AnnDocument;
1951
1952
  (function (AnnDocument) {
1952
- /**
1953
- * Returns cache identifier for an annotated document by ID.
1954
- * Example: {
1955
- * const api: BruceApi.Api = ...;
1956
- * const key = GetCacheKey(1);
1957
- * api.Cache.Remove(key);
1958
- * }
1959
- * @param id
1960
- * @returns
1961
- */
1962
- function GetCacheKey(id) {
1963
- return `${Api.ECacheKey.AnnDocument}${Api.ECacheKey.Id}${id}`;
1964
- }
1965
- AnnDocument.GetCacheKey = GetCacheKey;
1966
- /**
1967
- * Returns cache identifier for a list of annotated documents by type.
1968
- * Example: {
1969
- * const api: BruceApi.Api = ...;
1970
- * const key = GetListCacheKey("SVG");
1971
- * api.Cache.Remove(key);
1972
- * }
1973
- * @param type
1974
- * @returns
1975
- */
1976
- function GetListCacheKey(type) {
1977
- return Api.ECacheKey.AnnDocument + type;
1978
- }
1979
- AnnDocument.GetListCacheKey = GetListCacheKey;
1980
1953
  /**
1981
1954
  * The types of supported annotated documents.
1982
1955
  */
@@ -2062,16 +2035,8 @@ var AnnDocument;
2062
2035
  });
2063
2036
  }
2064
2037
  AnnDocument.GetList = GetList;
2065
- })(AnnDocument || (AnnDocument = {}));
2066
-
2067
- /**
2068
- * Describes the "Custom Form" concept within Nextspace.
2069
- * Custom forms are dynamic dialogs that get populated with Entity data.
2070
- */
2071
- var CustomForm;
2072
- (function (CustomForm) {
2073
2038
  /**
2074
- * Returns cache identifier for a Custom Form by ID.
2039
+ * Returns cache identifier for an annotated document by ID.
2075
2040
  * Example: {
2076
2041
  * const api: BruceApi.Api = ...;
2077
2042
  * const key = GetCacheKey(1);
@@ -2081,26 +2046,31 @@ var CustomForm;
2081
2046
  * @returns
2082
2047
  */
2083
2048
  function GetCacheKey(id) {
2084
- return Api.ECacheKey.CustomForm + Api.ECacheKey.Id + id;
2049
+ return `${Api.ECacheKey.AnnDocument}${Api.ECacheKey.Id}${id}`;
2085
2050
  }
2086
- CustomForm.GetCacheKey = GetCacheKey;
2051
+ AnnDocument.GetCacheKey = GetCacheKey;
2087
2052
  /**
2088
- * Returns cache identifier for a list of Custom Forms by Entity Type ID.
2053
+ * Returns cache identifier for a list of annotated documents by type.
2089
2054
  * Example: {
2090
- * const api: BruceApi.Api = ...;
2091
- * const key = GetListCacheKey("123");
2092
- * api.Cache.Remove(key);
2055
+ * const api: BruceApi.Api = ...;
2056
+ * const key = GetListCacheKey("SVG");
2057
+ * api.Cache.Remove(key);
2093
2058
  * }
2094
- * @param typeId
2059
+ * @param type
2095
2060
  * @returns
2096
2061
  */
2097
- function GetListCacheKey(typeId) {
2098
- if (typeId) {
2099
- return Api.ECacheKey.CustomForm + Api.ECacheKey.EntityType + Api.ECacheKey.Id + typeId;
2100
- }
2101
- return Api.ECacheKey.CustomForm;
2062
+ function GetListCacheKey(type) {
2063
+ return Api.ECacheKey.AnnDocument + type;
2102
2064
  }
2103
- CustomForm.GetListCacheKey = GetListCacheKey;
2065
+ AnnDocument.GetListCacheKey = GetListCacheKey;
2066
+ })(AnnDocument || (AnnDocument = {}));
2067
+
2068
+ /**
2069
+ * Describes the "Custom Form" concept within Nextspace.
2070
+ * Custom forms are dynamic dialogs that get populated with Entity data.
2071
+ */
2072
+ var CustomForm;
2073
+ (function (CustomForm) {
2104
2074
  /**
2105
2075
  * Types of custom forms available.
2106
2076
  */
@@ -2221,6 +2191,37 @@ var CustomForm;
2221
2191
  });
2222
2192
  }
2223
2193
  CustomForm.Update = Update;
2194
+ /**
2195
+ * Returns cache identifier for a Custom Form by ID.
2196
+ * Example: {
2197
+ * const api: BruceApi.Api = ...;
2198
+ * const key = GetCacheKey(1);
2199
+ * api.Cache.Remove(key);
2200
+ * }
2201
+ * @param id
2202
+ * @returns
2203
+ */
2204
+ function GetCacheKey(id) {
2205
+ return Api.ECacheKey.CustomForm + Api.ECacheKey.Id + id;
2206
+ }
2207
+ CustomForm.GetCacheKey = GetCacheKey;
2208
+ /**
2209
+ * Returns cache identifier for a list of Custom Forms by Entity Type ID.
2210
+ * Example: {
2211
+ * const api: BruceApi.Api = ...;
2212
+ * const key = GetListCacheKey("123");
2213
+ * api.Cache.Remove(key);
2214
+ * }
2215
+ * @param typeId
2216
+ * @returns
2217
+ */
2218
+ function GetListCacheKey(typeId) {
2219
+ if (typeId) {
2220
+ return Api.ECacheKey.CustomForm + Api.ECacheKey.EntityType + Api.ECacheKey.Id + typeId;
2221
+ }
2222
+ return Api.ECacheKey.CustomForm;
2223
+ }
2224
+ CustomForm.GetListCacheKey = GetListCacheKey;
2224
2225
  })(CustomForm || (CustomForm = {}));
2225
2226
 
2226
2227
  /**
@@ -4491,34 +4492,6 @@ class LRUCache {
4491
4492
  */
4492
4493
  var EntityAttachmentType;
4493
4494
  (function (EntityAttachmentType) {
4494
- /**
4495
- * Returns cache identifier for an attachment type by ID.
4496
- * Example: {
4497
- * const api: BruceApi.Api = ...;
4498
- * const key = GetCacheKey("123");
4499
- * api.Cache.Remove(key);
4500
- * }
4501
- * @param id
4502
- * @returns
4503
- */
4504
- function GetCacheKey(id) {
4505
- return Api.ECacheKey.AttachmentType + Api.ECacheKey.Id + id;
4506
- }
4507
- EntityAttachmentType.GetCacheKey = GetCacheKey;
4508
- /**
4509
- * Returns cache identifier for a list of attachment types.
4510
- * Example: {
4511
- * const api: BruceApi.Api = ...;
4512
- * const key = GetListCacheKey();
4513
- * api.Cache.Remove(key);
4514
- * }
4515
- * @param typeId
4516
- * @returns
4517
- */
4518
- function GetListCacheKey() {
4519
- return Api.ECacheKey.AttachmentType;
4520
- }
4521
- EntityAttachmentType.GetListCacheKey = GetListCacheKey;
4522
4495
  // Known attachment types.
4523
4496
  let EType;
4524
4497
  (function (EType) {
@@ -4603,17 +4576,8 @@ var EntityAttachmentType;
4603
4576
  });
4604
4577
  }
4605
4578
  EntityAttachmentType.GetList = GetList;
4606
- })(EntityAttachmentType || (EntityAttachmentType = {}));
4607
-
4608
- /**
4609
- * Describes the "Entity Attachment" concept within Nextspace.
4610
- * An entity attachment is an arbitrary file record that is linked to an entity record.
4611
- * The same file can be attached to multiple entities.
4612
- */
4613
- var EntityAttachment;
4614
- (function (EntityAttachment) {
4615
4579
  /**
4616
- * Returns cache identifier for an attachment by ID.
4580
+ * Returns cache identifier for an attachment type by ID.
4617
4581
  * Example: {
4618
4582
  * const api: BruceApi.Api = ...;
4619
4583
  * const key = GetCacheKey("123");
@@ -4623,23 +4587,32 @@ var EntityAttachment;
4623
4587
  * @returns
4624
4588
  */
4625
4589
  function GetCacheKey(id) {
4626
- return Api.ECacheKey.Attachment + Api.ECacheKey.Id + id;
4590
+ return Api.ECacheKey.AttachmentType + Api.ECacheKey.Id + id;
4627
4591
  }
4628
- EntityAttachment.GetCacheKey = GetCacheKey;
4592
+ EntityAttachmentType.GetCacheKey = GetCacheKey;
4629
4593
  /**
4630
- * Returns cache identifier for a list of attachments for an entity.
4594
+ * Returns cache identifier for a list of attachment types.
4631
4595
  * Example: {
4632
4596
  * const api: BruceApi.Api = ...;
4633
- * const key = GetListCacheKey("abc");
4597
+ * const key = GetListCacheKey();
4634
4598
  * api.Cache.Remove(key);
4635
4599
  * }
4636
4600
  * @param typeId
4637
4601
  * @returns
4638
4602
  */
4639
- function GetListCacheKey(entityId) {
4640
- return Api.ECacheKey.Attachment + Api.ECacheKey.Entity + Api.ECacheKey.Id + entityId;
4603
+ function GetListCacheKey() {
4604
+ return Api.ECacheKey.AttachmentType;
4641
4605
  }
4642
- EntityAttachment.GetListCacheKey = GetListCacheKey;
4606
+ EntityAttachmentType.GetListCacheKey = GetListCacheKey;
4607
+ })(EntityAttachmentType || (EntityAttachmentType = {}));
4608
+
4609
+ /**
4610
+ * Describes the "Entity Attachment" concept within Nextspace.
4611
+ * An entity attachment is an arbitrary file record that is linked to an entity record.
4612
+ * The same file can be attached to multiple entities.
4613
+ */
4614
+ var EntityAttachment;
4615
+ (function (EntityAttachment) {
4643
4616
  /**
4644
4617
  * Updates one or many attachment records.
4645
4618
  * @param params
@@ -4780,6 +4753,34 @@ var EntityAttachment;
4780
4753
  });
4781
4754
  }
4782
4755
  EntityAttachment.Upload = Upload;
4756
+ /**
4757
+ * Returns cache identifier for an attachment by ID.
4758
+ * Example: {
4759
+ * const api: BruceApi.Api = ...;
4760
+ * const key = GetCacheKey("123");
4761
+ * api.Cache.Remove(key);
4762
+ * }
4763
+ * @param id
4764
+ * @returns
4765
+ */
4766
+ function GetCacheKey(id) {
4767
+ return Api.ECacheKey.Attachment + Api.ECacheKey.Id + id;
4768
+ }
4769
+ EntityAttachment.GetCacheKey = GetCacheKey;
4770
+ /**
4771
+ * Returns cache identifier for a list of attachments for an entity.
4772
+ * Example: {
4773
+ * const api: BruceApi.Api = ...;
4774
+ * const key = GetListCacheKey("abc");
4775
+ * api.Cache.Remove(key);
4776
+ * }
4777
+ * @param typeId
4778
+ * @returns
4779
+ */
4780
+ function GetListCacheKey(entityId) {
4781
+ return Api.ECacheKey.Attachment + Api.ECacheKey.Entity + Api.ECacheKey.Id + entityId;
4782
+ }
4783
+ EntityAttachment.GetListCacheKey = GetListCacheKey;
4783
4784
  })(EntityAttachment || (EntityAttachment = {}));
4784
4785
 
4785
4786
  /**
@@ -6065,9 +6066,24 @@ var EntityTag;
6065
6066
  const reqs = [];
6066
6067
  for (let i = 0; i < tagIds.length; i++) {
6067
6068
  const tagId = tagIds[i];
6068
- const cache = yield api.GetCacheItem(GetCacheKey(tagId), reqParams);
6069
+ const cache = api.GetCacheItem(GetCacheKey(tagId), reqParams);
6069
6070
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
6070
- reqs.push(cache.data);
6071
+ if (cache.data instanceof Promise) {
6072
+ // Request that is in progress.
6073
+ reqs.push(cache.data);
6074
+ }
6075
+ else if (cache.data) {
6076
+ // Direct tag record.
6077
+ if (cache.data.ID) {
6078
+ reqs.push({
6079
+ tag: cache.data
6080
+ });
6081
+ }
6082
+ // Resolved promise. So an object with a "tag" property that contains the record.
6083
+ else {
6084
+ reqs.push(cache.data);
6085
+ }
6086
+ }
6071
6087
  }
6072
6088
  else {
6073
6089
  reqIds.push(tagId);
@@ -6620,20 +6636,6 @@ var Uploader;
6620
6636
  */
6621
6637
  var ClientFile;
6622
6638
  (function (ClientFile) {
6623
- /**
6624
- * Returns cache identifier for a client file by ID.
6625
- * Example: {
6626
- * const api: BruceApi.Api = ...;
6627
- * const key = GetCacheKey("123");
6628
- * api.Cache.Remove(key);
6629
- * }
6630
- * @param fileId
6631
- * @returns
6632
- */
6633
- function GetCacheKey(fileId) {
6634
- return `${Api.ECacheKey.ClientFile}${Api.ECacheKey.Id}${fileId}`;
6635
- }
6636
- ClientFile.GetCacheKey = GetCacheKey;
6637
6639
  let EPurpose;
6638
6640
  (function (EPurpose) {
6639
6641
  // Use this purpose for uploading bookmark thumbnail images.
@@ -6955,6 +6957,20 @@ var ClientFile;
6955
6957
  }
6956
6958
  Processor.ConvertFormat = ConvertFormat;
6957
6959
  })(Processor = ClientFile.Processor || (ClientFile.Processor = {}));
6960
+ /**
6961
+ * Returns cache identifier for a client file by ID.
6962
+ * Example: {
6963
+ * const api: BruceApi.Api = ...;
6964
+ * const key = GetCacheKey("123");
6965
+ * api.Cache.Remove(key);
6966
+ * }
6967
+ * @param fileId
6968
+ * @returns
6969
+ */
6970
+ function GetCacheKey(fileId) {
6971
+ return `${Api.ECacheKey.ClientFile}${Api.ECacheKey.Id}${fileId}`;
6972
+ }
6973
+ ClientFile.GetCacheKey = GetCacheKey;
6958
6974
  })(ClientFile || (ClientFile = {}));
6959
6975
 
6960
6976
  /**
@@ -8098,36 +8114,15 @@ var ProjectViewBookmark;
8098
8114
  */
8099
8115
  var ProjectView;
8100
8116
  (function (ProjectView) {
8101
- /**
8102
- * Returns cache identifier for a project view.
8103
- * Example: {
8104
- * const api: BruceApi.Api = ...;
8105
- * const key = GetCacheKey("abc");
8106
- * api.Cache.Remove(key);
8107
- * }
8108
- * @param viewId
8109
- * @returns
8110
- */
8111
- function GetCacheKey(viewId) {
8112
- return `${Api.ECacheKey.ProjectView}${Api.ECacheKey.Id}${viewId}`;
8113
- }
8114
- ProjectView.GetCacheKey = GetCacheKey;
8115
- /**
8116
- * Returns cache identifier for a list of project views.
8117
- * Example: {
8118
- * const api: BruceApi.Api = ...;
8119
- * const key = GetListCacheKey();
8120
- * api.Cache.Remove(key);
8121
- * }
8122
- * @returns
8123
- */
8124
- function GetListCacheKey() {
8125
- return Api.ECacheKey.ProjectView;
8126
- }
8127
- ProjectView.GetListCacheKey = GetListCacheKey;
8128
8117
  // This is the expected default version for the DataVersion value.
8129
8118
  // This value should NOT be changed without looking at our API and seeing what the default value is.
8130
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;
8131
8126
  /**
8132
8127
  * Gets a project view record.
8133
8128
  * @param params
@@ -8174,11 +8169,11 @@ var ProjectView;
8174
8169
  */
8175
8170
  function GetList(params) {
8176
8171
  return __awaiter(this, void 0, void 0, function* () {
8177
- let { api, req: reqParams } = params;
8172
+ let { api, req: reqParams, type } = params;
8178
8173
  if (!api) {
8179
8174
  api = ENVIRONMENT.Api().GetBruceApi();
8180
8175
  }
8181
- const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
8176
+ const cache = yield api.GetCacheItem(GetListCacheKey(type), reqParams);
8182
8177
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
8183
8178
  return cache.data;
8184
8179
  }
@@ -8194,7 +8189,7 @@ var ProjectView;
8194
8189
  }
8195
8190
  }));
8196
8191
  yield api.SetCacheItem({
8197
- key: GetListCacheKey(),
8192
+ key: GetListCacheKey(type),
8198
8193
  value: prom,
8199
8194
  req: reqParams
8200
8195
  });
@@ -8217,7 +8212,7 @@ var ProjectView;
8217
8212
  }
8218
8213
  yield api.DELETE(`ui.view/${viewId}`, Api.PrepReqParams(reqParams));
8219
8214
  api.Cache.Remove(GetCacheKey(viewId));
8220
- api.Cache.Remove(GetListCacheKey());
8215
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
8221
8216
  });
8222
8217
  }
8223
8218
  ProjectView.Delete = Delete;
@@ -8254,13 +8249,44 @@ var ProjectView;
8254
8249
  data = yield api.PUT(`ui.view/${data.ID}`, data, Api.PrepReqParams(reqParams));
8255
8250
  }
8256
8251
  api.Cache.Remove(GetCacheKey(data.ID));
8257
- api.Cache.Remove(GetListCacheKey());
8252
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
8258
8253
  return {
8259
8254
  view: data
8260
8255
  };
8261
8256
  });
8262
8257
  }
8263
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;
8264
8290
  })(ProjectView || (ProjectView = {}));
8265
8291
 
8266
8292
  function getTemplateSettings(apiGetter, reqParams) {
@@ -10617,40 +10643,40 @@ var Plugin;
10617
10643
  window[paramsId] = pluginParams ? pluginParams : {};
10618
10644
  const disposeId = ObjectUtils.UId();
10619
10645
  const elementId = ObjectUtils.UId();
10620
- let script = `
10621
- function run() {
10622
- ${fileContent}
10623
-
10624
- const paramsId = "${paramsId}";
10625
- const containerId = "${containerId}";
10626
- let container;
10627
- if (containerId) {
10628
- container = document.getElementById("${containerId}");
10629
- }
10630
-
10631
- let pluginHTML = null;
10632
- if (container) {
10633
- pluginHTML = document.createElement("div");
10634
- pluginHTML.id = "${elementId}";
10635
- container.appendChild(pluginHTML);
10636
- }
10637
-
10638
- {TEMPLATE_CODE}
10639
- const params = window["${paramsId}"];
10640
-
10641
- window["${disposeId}"] = Run({
10642
- element: pluginHTML,
10643
- container: container,
10644
- pluginParams: params
10645
- });
10646
- }
10647
- run();
10646
+ let script = `
10647
+ function run() {
10648
+ ${fileContent}
10649
+
10650
+ const paramsId = "${paramsId}";
10651
+ const containerId = "${containerId}";
10652
+ let container;
10653
+ if (containerId) {
10654
+ container = document.getElementById("${containerId}");
10655
+ }
10656
+
10657
+ let pluginHTML = null;
10658
+ if (container) {
10659
+ pluginHTML = document.createElement("div");
10660
+ pluginHTML.id = "${elementId}";
10661
+ container.appendChild(pluginHTML);
10662
+ }
10663
+
10664
+ {TEMPLATE_CODE}
10665
+ const params = window["${paramsId}"];
10666
+
10667
+ window["${disposeId}"] = Run({
10668
+ element: pluginHTML,
10669
+ container: container,
10670
+ pluginParams: params
10671
+ });
10672
+ }
10673
+ run();
10648
10674
  `;
10649
10675
  if (script.includes("var template")) {
10650
- script = script.replace("{TEMPLATE_CODE}", `
10651
- if (pluginHTML && template) {
10652
- pluginHTML.innerHTML = template;
10653
- }
10676
+ script = script.replace("{TEMPLATE_CODE}", `
10677
+ if (pluginHTML && template) {
10678
+ pluginHTML.innerHTML = template;
10679
+ }
10654
10680
  `);
10655
10681
  }
10656
10682
  else {
@@ -10679,33 +10705,6 @@ var Plugin;
10679
10705
 
10680
10706
  var DataSource;
10681
10707
  (function (DataSource) {
10682
- /**
10683
- * Returns cache identifier for a data source by ID.
10684
- * Example: {
10685
- * const api: BruceApi.Api = ...;
10686
- * const key = GetCacheKey(1);
10687
- * api.Cache.Remove(key);
10688
- * }
10689
- * @param id
10690
- * @returns
10691
- */
10692
- function GetCacheKey(id) {
10693
- return Api.ECacheKey.DataSource + Api.ECacheKey.Id + id;
10694
- }
10695
- DataSource.GetCacheKey = GetCacheKey;
10696
- /**
10697
- * Returns cache identifier for a list of data sources.
10698
- * Example: {
10699
- * const api: BruceApi.Api = ...;
10700
- * const key = GetListCacheKey();
10701
- * api.Cache.Remove(key);
10702
- * }
10703
- * @returns
10704
- */
10705
- function GetListCacheKey() {
10706
- return Api.ECacheKey.DataSource;
10707
- }
10708
- DataSource.GetListCacheKey = GetListCacheKey;
10709
10708
  // Known data source types.
10710
10709
  let EType;
10711
10710
  (function (EType) {
@@ -10822,9 +10821,37 @@ var DataSource;
10822
10821
  });
10823
10822
  }
10824
10823
  DataSource.GetList = GetList;
10824
+ /**
10825
+ * Returns cache identifier for a data source by ID.
10826
+ * Example: {
10827
+ * const api: BruceApi.Api = ...;
10828
+ * const key = GetCacheKey(1);
10829
+ * api.Cache.Remove(key);
10830
+ * }
10831
+ * @param id
10832
+ * @returns
10833
+ */
10834
+ function GetCacheKey(id) {
10835
+ return Api.ECacheKey.DataSource + Api.ECacheKey.Id + id;
10836
+ }
10837
+ DataSource.GetCacheKey = GetCacheKey;
10838
+ /**
10839
+ * Returns cache identifier for a list of data sources.
10840
+ * Example: {
10841
+ * const api: BruceApi.Api = ...;
10842
+ * const key = GetListCacheKey();
10843
+ * api.Cache.Remove(key);
10844
+ * }
10845
+ * @returns
10846
+ */
10847
+ function GetListCacheKey() {
10848
+ return Api.ECacheKey.DataSource;
10849
+ }
10850
+ DataSource.GetListCacheKey = GetListCacheKey;
10825
10851
  })(DataSource || (DataSource = {}));
10826
10852
 
10827
- const VERSION = "3.5.1";
10853
+ // This is updated with the package.json version on build.
10854
+ const VERSION = "3.5.3";
10828
10855
 
10829
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 };
10830
10857
  //# sourceMappingURL=bruce-models.es5.js.map