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
@@ -39,6 +39,7 @@
39
39
  let ECacheKey;
40
40
  (function (ECacheKey) {
41
41
  ECacheKey["Id"] = ":";
42
+ ECacheKey["ListId"] = "::";
42
43
  ECacheKey["Entity"] = "entity";
43
44
  ECacheKey["EntityType"] = "entitytype";
44
45
  ECacheKey["ProjectView"] = "projectview";
@@ -797,51 +798,6 @@
797
798
  // Some accounts may not be "dead" but instead purposely don't have a NextspaceAPI database so we'll avoid them too.
798
799
  const ACCOUNT_EXCLUSIONS = ["hyperportal", "hypeportal", "bviewer"];
799
800
  (function (Account) {
800
- /**
801
- * Returns cache identifier for an account by ID.
802
- * Example: {
803
- * const api: BruceApi.Api = ...;
804
- * const key = GetCacheKey(1);
805
- * api.Cache.Remove(key);
806
- * }
807
- * @param accountId
808
- * @param appSettingsId
809
- * @returns
810
- */
811
- function GetCacheKey(accountId, appSettingsId) {
812
- if (appSettingsId) {
813
- return exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + accountId + exports.Api.ECacheKey + appSettingsId;
814
- }
815
- return exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + accountId;
816
- }
817
- Account.GetCacheKey = GetCacheKey;
818
- /**
819
- * Returns cache identifier for a list of accounts by session ID.
820
- * Example: {
821
- * const api: BruceApi.Api = ...;
822
- * const key = GetListCacheKey(api.GetSessionId());
823
- * api.Cache.Remove(key);
824
- * }
825
- * @param ssid
826
- * @returns
827
- */
828
- function GetListCacheKey(ssid) {
829
- return exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Session + exports.Api.ECacheKey.Id + ssid;
830
- }
831
- Account.GetListCacheKey = GetListCacheKey;
832
- /**
833
- * Returns cache identifier for a list of database regions.
834
- * Example: {
835
- * const api: BruceApi.Api = ...;
836
- * const key = GetDbRegionListCacheKey();
837
- * api.Cache.Remove(key);
838
- * }
839
- * @returns
840
- */
841
- function GetDbRegionListCacheKey() {
842
- return exports.Api.ECacheKey.DatabaseRegion;
843
- }
844
- Account.GetDbRegionListCacheKey = GetDbRegionListCacheKey;
845
801
  /**
846
802
  * Known Nextspace applications we store settings for.
847
803
  */
@@ -1072,6 +1028,51 @@
1072
1028
  });
1073
1029
  }
1074
1030
  Account.Create = Create;
1031
+ /**
1032
+ * Returns cache identifier for an account by ID.
1033
+ * Example: {
1034
+ * const api: BruceApi.Api = ...;
1035
+ * const key = GetCacheKey(1);
1036
+ * api.Cache.Remove(key);
1037
+ * }
1038
+ * @param accountId
1039
+ * @param appSettingsId
1040
+ * @returns
1041
+ */
1042
+ function GetCacheKey(accountId, appSettingsId) {
1043
+ if (appSettingsId) {
1044
+ return exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + accountId + exports.Api.ECacheKey + appSettingsId;
1045
+ }
1046
+ return exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + accountId;
1047
+ }
1048
+ Account.GetCacheKey = GetCacheKey;
1049
+ /**
1050
+ * Returns cache identifier for a list of accounts by session ID.
1051
+ * Example: {
1052
+ * const api: BruceApi.Api = ...;
1053
+ * const key = GetListCacheKey(api.GetSessionId());
1054
+ * api.Cache.Remove(key);
1055
+ * }
1056
+ * @param ssid
1057
+ * @returns
1058
+ */
1059
+ function GetListCacheKey(ssid) {
1060
+ return exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Session + exports.Api.ECacheKey.Id + ssid;
1061
+ }
1062
+ Account.GetListCacheKey = GetListCacheKey;
1063
+ /**
1064
+ * Returns cache identifier for a list of database regions.
1065
+ * Example: {
1066
+ * const api: BruceApi.Api = ...;
1067
+ * const key = GetDbRegionListCacheKey();
1068
+ * api.Cache.Remove(key);
1069
+ * }
1070
+ * @returns
1071
+ */
1072
+ function GetDbRegionListCacheKey() {
1073
+ return exports.Api.ECacheKey.DatabaseRegion;
1074
+ }
1075
+ Account.GetDbRegionListCacheKey = GetDbRegionListCacheKey;
1075
1076
  })(exports.Account || (exports.Account = {}));
1076
1077
 
1077
1078
  (function (HostingLocation) {
@@ -1918,34 +1919,6 @@
1918
1919
  })(exports.ENVIRONMENT || (exports.ENVIRONMENT = {}));
1919
1920
 
1920
1921
  (function (AnnDocument) {
1921
- /**
1922
- * Returns cache identifier for an annotated document by ID.
1923
- * Example: {
1924
- * const api: BruceApi.Api = ...;
1925
- * const key = GetCacheKey(1);
1926
- * api.Cache.Remove(key);
1927
- * }
1928
- * @param id
1929
- * @returns
1930
- */
1931
- function GetCacheKey(id) {
1932
- return `${exports.Api.ECacheKey.AnnDocument}${exports.Api.ECacheKey.Id}${id}`;
1933
- }
1934
- AnnDocument.GetCacheKey = GetCacheKey;
1935
- /**
1936
- * Returns cache identifier for a list of annotated documents by type.
1937
- * Example: {
1938
- * const api: BruceApi.Api = ...;
1939
- * const key = GetListCacheKey("SVG");
1940
- * api.Cache.Remove(key);
1941
- * }
1942
- * @param type
1943
- * @returns
1944
- */
1945
- function GetListCacheKey(type) {
1946
- return exports.Api.ECacheKey.AnnDocument + type;
1947
- }
1948
- AnnDocument.GetListCacheKey = GetListCacheKey;
1949
1922
  /**
1950
1923
  * The types of supported annotated documents.
1951
1924
  */
@@ -2031,11 +2004,8 @@
2031
2004
  });
2032
2005
  }
2033
2006
  AnnDocument.GetList = GetList;
2034
- })(exports.AnnDocument || (exports.AnnDocument = {}));
2035
-
2036
- (function (CustomForm) {
2037
2007
  /**
2038
- * Returns cache identifier for a Custom Form by ID.
2008
+ * Returns cache identifier for an annotated document by ID.
2039
2009
  * Example: {
2040
2010
  * const api: BruceApi.Api = ...;
2041
2011
  * const key = GetCacheKey(1);
@@ -2045,26 +2015,26 @@
2045
2015
  * @returns
2046
2016
  */
2047
2017
  function GetCacheKey(id) {
2048
- return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.Id + id;
2018
+ return `${exports.Api.ECacheKey.AnnDocument}${exports.Api.ECacheKey.Id}${id}`;
2049
2019
  }
2050
- CustomForm.GetCacheKey = GetCacheKey;
2020
+ AnnDocument.GetCacheKey = GetCacheKey;
2051
2021
  /**
2052
- * Returns cache identifier for a list of Custom Forms by Entity Type ID.
2022
+ * Returns cache identifier for a list of annotated documents by type.
2053
2023
  * Example: {
2054
- * const api: BruceApi.Api = ...;
2055
- * const key = GetListCacheKey("123");
2056
- * api.Cache.Remove(key);
2024
+ * const api: BruceApi.Api = ...;
2025
+ * const key = GetListCacheKey("SVG");
2026
+ * api.Cache.Remove(key);
2057
2027
  * }
2058
- * @param typeId
2028
+ * @param type
2059
2029
  * @returns
2060
2030
  */
2061
- function GetListCacheKey(typeId) {
2062
- if (typeId) {
2063
- return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.EntityType + exports.Api.ECacheKey.Id + typeId;
2064
- }
2065
- return exports.Api.ECacheKey.CustomForm;
2031
+ function GetListCacheKey(type) {
2032
+ return exports.Api.ECacheKey.AnnDocument + type;
2066
2033
  }
2067
- CustomForm.GetListCacheKey = GetListCacheKey;
2034
+ AnnDocument.GetListCacheKey = GetListCacheKey;
2035
+ })(exports.AnnDocument || (exports.AnnDocument = {}));
2036
+
2037
+ (function (CustomForm) {
2068
2038
  /**
2069
2039
  * Types of custom forms available.
2070
2040
  */
@@ -2185,6 +2155,37 @@
2185
2155
  });
2186
2156
  }
2187
2157
  CustomForm.Update = Update;
2158
+ /**
2159
+ * Returns cache identifier for a Custom Form by ID.
2160
+ * Example: {
2161
+ * const api: BruceApi.Api = ...;
2162
+ * const key = GetCacheKey(1);
2163
+ * api.Cache.Remove(key);
2164
+ * }
2165
+ * @param id
2166
+ * @returns
2167
+ */
2168
+ function GetCacheKey(id) {
2169
+ return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.Id + id;
2170
+ }
2171
+ CustomForm.GetCacheKey = GetCacheKey;
2172
+ /**
2173
+ * Returns cache identifier for a list of Custom Forms by Entity Type ID.
2174
+ * Example: {
2175
+ * const api: BruceApi.Api = ...;
2176
+ * const key = GetListCacheKey("123");
2177
+ * api.Cache.Remove(key);
2178
+ * }
2179
+ * @param typeId
2180
+ * @returns
2181
+ */
2182
+ function GetListCacheKey(typeId) {
2183
+ if (typeId) {
2184
+ return exports.Api.ECacheKey.CustomForm + exports.Api.ECacheKey.EntityType + exports.Api.ECacheKey.Id + typeId;
2185
+ }
2186
+ return exports.Api.ECacheKey.CustomForm;
2187
+ }
2188
+ CustomForm.GetListCacheKey = GetListCacheKey;
2188
2189
  })(exports.CustomForm || (exports.CustomForm = {}));
2189
2190
 
2190
2191
  /**
@@ -4416,34 +4417,6 @@
4416
4417
  }
4417
4418
 
4418
4419
  (function (EntityAttachmentType) {
4419
- /**
4420
- * Returns cache identifier for an attachment type by ID.
4421
- * Example: {
4422
- * const api: BruceApi.Api = ...;
4423
- * const key = GetCacheKey("123");
4424
- * api.Cache.Remove(key);
4425
- * }
4426
- * @param id
4427
- * @returns
4428
- */
4429
- function GetCacheKey(id) {
4430
- return exports.Api.ECacheKey.AttachmentType + exports.Api.ECacheKey.Id + id;
4431
- }
4432
- EntityAttachmentType.GetCacheKey = GetCacheKey;
4433
- /**
4434
- * Returns cache identifier for a list of attachment types.
4435
- * Example: {
4436
- * const api: BruceApi.Api = ...;
4437
- * const key = GetListCacheKey();
4438
- * api.Cache.Remove(key);
4439
- * }
4440
- * @param typeId
4441
- * @returns
4442
- */
4443
- function GetListCacheKey() {
4444
- return exports.Api.ECacheKey.AttachmentType;
4445
- }
4446
- EntityAttachmentType.GetListCacheKey = GetListCacheKey;
4447
4420
  // Known attachment types.
4448
4421
  let EType;
4449
4422
  (function (EType) {
@@ -4528,11 +4501,8 @@
4528
4501
  });
4529
4502
  }
4530
4503
  EntityAttachmentType.GetList = GetList;
4531
- })(exports.EntityAttachmentType || (exports.EntityAttachmentType = {}));
4532
-
4533
- (function (EntityAttachment) {
4534
4504
  /**
4535
- * Returns cache identifier for an attachment by ID.
4505
+ * Returns cache identifier for an attachment type by ID.
4536
4506
  * Example: {
4537
4507
  * const api: BruceApi.Api = ...;
4538
4508
  * const key = GetCacheKey("123");
@@ -4542,23 +4512,26 @@
4542
4512
  * @returns
4543
4513
  */
4544
4514
  function GetCacheKey(id) {
4545
- return exports.Api.ECacheKey.Attachment + exports.Api.ECacheKey.Id + id;
4515
+ return exports.Api.ECacheKey.AttachmentType + exports.Api.ECacheKey.Id + id;
4546
4516
  }
4547
- EntityAttachment.GetCacheKey = GetCacheKey;
4517
+ EntityAttachmentType.GetCacheKey = GetCacheKey;
4548
4518
  /**
4549
- * Returns cache identifier for a list of attachments for an entity.
4519
+ * Returns cache identifier for a list of attachment types.
4550
4520
  * Example: {
4551
4521
  * const api: BruceApi.Api = ...;
4552
- * const key = GetListCacheKey("abc");
4522
+ * const key = GetListCacheKey();
4553
4523
  * api.Cache.Remove(key);
4554
4524
  * }
4555
4525
  * @param typeId
4556
4526
  * @returns
4557
4527
  */
4558
- function GetListCacheKey(entityId) {
4559
- return exports.Api.ECacheKey.Attachment + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
4528
+ function GetListCacheKey() {
4529
+ return exports.Api.ECacheKey.AttachmentType;
4560
4530
  }
4561
- EntityAttachment.GetListCacheKey = GetListCacheKey;
4531
+ EntityAttachmentType.GetListCacheKey = GetListCacheKey;
4532
+ })(exports.EntityAttachmentType || (exports.EntityAttachmentType = {}));
4533
+
4534
+ (function (EntityAttachment) {
4562
4535
  /**
4563
4536
  * Updates one or many attachment records.
4564
4537
  * @param params
@@ -4699,6 +4672,34 @@
4699
4672
  });
4700
4673
  }
4701
4674
  EntityAttachment.Upload = Upload;
4675
+ /**
4676
+ * Returns cache identifier for an attachment by ID.
4677
+ * Example: {
4678
+ * const api: BruceApi.Api = ...;
4679
+ * const key = GetCacheKey("123");
4680
+ * api.Cache.Remove(key);
4681
+ * }
4682
+ * @param id
4683
+ * @returns
4684
+ */
4685
+ function GetCacheKey(id) {
4686
+ return exports.Api.ECacheKey.Attachment + exports.Api.ECacheKey.Id + id;
4687
+ }
4688
+ EntityAttachment.GetCacheKey = GetCacheKey;
4689
+ /**
4690
+ * Returns cache identifier for a list of attachments for an entity.
4691
+ * Example: {
4692
+ * const api: BruceApi.Api = ...;
4693
+ * const key = GetListCacheKey("abc");
4694
+ * api.Cache.Remove(key);
4695
+ * }
4696
+ * @param typeId
4697
+ * @returns
4698
+ */
4699
+ function GetListCacheKey(entityId) {
4700
+ return exports.Api.ECacheKey.Attachment + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
4701
+ }
4702
+ EntityAttachment.GetListCacheKey = GetListCacheKey;
4702
4703
  })(exports.EntityAttachment || (exports.EntityAttachment = {}));
4703
4704
 
4704
4705
  (function (EntityComment) {
@@ -5935,9 +5936,24 @@
5935
5936
  const reqs = [];
5936
5937
  for (let i = 0; i < tagIds.length; i++) {
5937
5938
  const tagId = tagIds[i];
5938
- const cache = yield api.GetCacheItem(GetCacheKey(tagId), reqParams);
5939
+ const cache = api.GetCacheItem(GetCacheKey(tagId), reqParams);
5939
5940
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
5940
- reqs.push(cache.data);
5941
+ if (cache.data instanceof Promise) {
5942
+ // Request that is in progress.
5943
+ reqs.push(cache.data);
5944
+ }
5945
+ else if (cache.data) {
5946
+ // Direct tag record.
5947
+ if (cache.data.ID) {
5948
+ reqs.push({
5949
+ tag: cache.data
5950
+ });
5951
+ }
5952
+ // Resolved promise. So an object with a "tag" property that contains the record.
5953
+ else {
5954
+ reqs.push(cache.data);
5955
+ }
5956
+ }
5941
5957
  }
5942
5958
  else {
5943
5959
  reqIds.push(tagId);
@@ -6474,20 +6490,6 @@
6474
6490
  })(exports.Uploader || (exports.Uploader = {}));
6475
6491
 
6476
6492
  (function (ClientFile) {
6477
- /**
6478
- * Returns cache identifier for a client file by ID.
6479
- * Example: {
6480
- * const api: BruceApi.Api = ...;
6481
- * const key = GetCacheKey("123");
6482
- * api.Cache.Remove(key);
6483
- * }
6484
- * @param fileId
6485
- * @returns
6486
- */
6487
- function GetCacheKey(fileId) {
6488
- return `${exports.Api.ECacheKey.ClientFile}${exports.Api.ECacheKey.Id}${fileId}`;
6489
- }
6490
- ClientFile.GetCacheKey = GetCacheKey;
6491
6493
  let EPurpose;
6492
6494
  (function (EPurpose) {
6493
6495
  // Use this purpose for uploading bookmark thumbnail images.
@@ -6809,6 +6811,20 @@
6809
6811
  }
6810
6812
  Processor.ConvertFormat = ConvertFormat;
6811
6813
  })(Processor = ClientFile.Processor || (ClientFile.Processor = {}));
6814
+ /**
6815
+ * Returns cache identifier for a client file by ID.
6816
+ * Example: {
6817
+ * const api: BruceApi.Api = ...;
6818
+ * const key = GetCacheKey("123");
6819
+ * api.Cache.Remove(key);
6820
+ * }
6821
+ * @param fileId
6822
+ * @returns
6823
+ */
6824
+ function GetCacheKey(fileId) {
6825
+ return `${exports.Api.ECacheKey.ClientFile}${exports.Api.ECacheKey.Id}${fileId}`;
6826
+ }
6827
+ ClientFile.GetCacheKey = GetCacheKey;
6812
6828
  })(exports.ClientFile || (exports.ClientFile = {}));
6813
6829
 
6814
6830
  (function (ProgramKey) {
@@ -7917,36 +7933,15 @@
7917
7933
  })(exports.ProjectViewBookmark || (exports.ProjectViewBookmark = {}));
7918
7934
 
7919
7935
  (function (ProjectView) {
7920
- /**
7921
- * Returns cache identifier for a project view.
7922
- * Example: {
7923
- * const api: BruceApi.Api = ...;
7924
- * const key = GetCacheKey("abc");
7925
- * api.Cache.Remove(key);
7926
- * }
7927
- * @param viewId
7928
- * @returns
7929
- */
7930
- function GetCacheKey(viewId) {
7931
- return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.Id}${viewId}`;
7932
- }
7933
- ProjectView.GetCacheKey = GetCacheKey;
7934
- /**
7935
- * Returns cache identifier for a list of project views.
7936
- * Example: {
7937
- * const api: BruceApi.Api = ...;
7938
- * const key = GetListCacheKey();
7939
- * api.Cache.Remove(key);
7940
- * }
7941
- * @returns
7942
- */
7943
- function GetListCacheKey() {
7944
- return exports.Api.ECacheKey.ProjectView;
7945
- }
7946
- ProjectView.GetListCacheKey = GetListCacheKey;
7947
7936
  // This is the expected default version for the DataVersion value.
7948
7937
  // This value should NOT be changed without looking at our API and seeing what the default value is.
7949
7938
  ProjectView.DEFAULT_DATA_VERSION = 2;
7939
+ // Our Cesium web navigator.
7940
+ ProjectView.TYPE_WEB_3D_NAVIGATOR = "WEB_3D_NAVIGATOR";
7941
+ // Our (currently WIP) 2D web navigator.
7942
+ ProjectView.TYPE_WEB_2D_NAVIGATOR = "WEB_2D_NAVIGATOR";
7943
+ // Defaulting to 3D navigator for backwards compatibility.
7944
+ ProjectView.DEFAULT_TYPE = ProjectView.TYPE_WEB_3D_NAVIGATOR;
7950
7945
  /**
7951
7946
  * Gets a project view record.
7952
7947
  * @param params
@@ -7993,11 +7988,11 @@
7993
7988
  */
7994
7989
  function GetList(params) {
7995
7990
  return __awaiter(this, void 0, void 0, function* () {
7996
- let { api, req: reqParams } = params;
7991
+ let { api, req: reqParams, type } = params;
7997
7992
  if (!api) {
7998
7993
  api = exports.ENVIRONMENT.Api().GetBruceApi();
7999
7994
  }
8000
- const cache = yield api.GetCacheItem(GetListCacheKey(), reqParams);
7995
+ const cache = yield api.GetCacheItem(GetListCacheKey(type), reqParams);
8001
7996
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
8002
7997
  return cache.data;
8003
7998
  }
@@ -8013,7 +8008,7 @@
8013
8008
  }
8014
8009
  }));
8015
8010
  yield api.SetCacheItem({
8016
- key: GetListCacheKey(),
8011
+ key: GetListCacheKey(type),
8017
8012
  value: prom,
8018
8013
  req: reqParams
8019
8014
  });
@@ -8036,7 +8031,7 @@
8036
8031
  }
8037
8032
  yield api.DELETE(`ui.view/${viewId}`, exports.Api.PrepReqParams(reqParams));
8038
8033
  api.Cache.Remove(GetCacheKey(viewId));
8039
- api.Cache.Remove(GetListCacheKey());
8034
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
8040
8035
  });
8041
8036
  }
8042
8037
  ProjectView.Delete = Delete;
@@ -8073,13 +8068,44 @@
8073
8068
  data = yield api.PUT(`ui.view/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
8074
8069
  }
8075
8070
  api.Cache.Remove(GetCacheKey(data.ID));
8076
- api.Cache.Remove(GetListCacheKey());
8071
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
8077
8072
  return {
8078
8073
  view: data
8079
8074
  };
8080
8075
  });
8081
8076
  }
8082
8077
  ProjectView.Update = Update;
8078
+ /**
8079
+ * Returns cache identifier for a project view.
8080
+ * Example: {
8081
+ * const api: BruceApi.Api = ...;
8082
+ * const key = GetCacheKey("abc");
8083
+ * api.Cache.Remove(key);
8084
+ * }
8085
+ * @param viewId
8086
+ * @returns
8087
+ */
8088
+ function GetCacheKey(viewId) {
8089
+ return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.Id}${viewId}`;
8090
+ }
8091
+ ProjectView.GetCacheKey = GetCacheKey;
8092
+ /**
8093
+ * Returns cache identifier for a list of project views.
8094
+ * Example: {
8095
+ * const api: BruceApi.Api = ...;
8096
+ * const key = GetListCacheKey();
8097
+ * api.Cache.Remove(key);
8098
+ * }
8099
+ * @param type optional filter for the type of project view.
8100
+ * @returns
8101
+ */
8102
+ function GetListCacheKey(type) {
8103
+ if (type) {
8104
+ return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.ListId}${type}`;
8105
+ }
8106
+ return `${exports.Api.ECacheKey.ProjectView}${exports.Api.ECacheKey.ListId}`;
8107
+ }
8108
+ ProjectView.GetListCacheKey = GetListCacheKey;
8083
8109
  })(exports.ProjectView || (exports.ProjectView = {}));
8084
8110
 
8085
8111
  function getTemplateSettings(apiGetter, reqParams) {
@@ -10365,40 +10391,40 @@
10365
10391
  window[paramsId] = pluginParams ? pluginParams : {};
10366
10392
  const disposeId = exports.ObjectUtils.UId();
10367
10393
  const elementId = exports.ObjectUtils.UId();
10368
- let script = `
10369
- function run() {
10370
- ${fileContent}
10371
-
10372
- const paramsId = "${paramsId}";
10373
- const containerId = "${containerId}";
10374
- let container;
10375
- if (containerId) {
10376
- container = document.getElementById("${containerId}");
10377
- }
10378
-
10379
- let pluginHTML = null;
10380
- if (container) {
10381
- pluginHTML = document.createElement("div");
10382
- pluginHTML.id = "${elementId}";
10383
- container.appendChild(pluginHTML);
10384
- }
10385
-
10386
- {TEMPLATE_CODE}
10387
- const params = window["${paramsId}"];
10388
-
10389
- window["${disposeId}"] = Run({
10390
- element: pluginHTML,
10391
- container: container,
10392
- pluginParams: params
10393
- });
10394
- }
10395
- run();
10394
+ let script = `
10395
+ function run() {
10396
+ ${fileContent}
10397
+
10398
+ const paramsId = "${paramsId}";
10399
+ const containerId = "${containerId}";
10400
+ let container;
10401
+ if (containerId) {
10402
+ container = document.getElementById("${containerId}");
10403
+ }
10404
+
10405
+ let pluginHTML = null;
10406
+ if (container) {
10407
+ pluginHTML = document.createElement("div");
10408
+ pluginHTML.id = "${elementId}";
10409
+ container.appendChild(pluginHTML);
10410
+ }
10411
+
10412
+ {TEMPLATE_CODE}
10413
+ const params = window["${paramsId}"];
10414
+
10415
+ window["${disposeId}"] = Run({
10416
+ element: pluginHTML,
10417
+ container: container,
10418
+ pluginParams: params
10419
+ });
10420
+ }
10421
+ run();
10396
10422
  `;
10397
10423
  if (script.includes("var template")) {
10398
- script = script.replace("{TEMPLATE_CODE}", `
10399
- if (pluginHTML && template) {
10400
- pluginHTML.innerHTML = template;
10401
- }
10424
+ script = script.replace("{TEMPLATE_CODE}", `
10425
+ if (pluginHTML && template) {
10426
+ pluginHTML.innerHTML = template;
10427
+ }
10402
10428
  `);
10403
10429
  }
10404
10430
  else {
@@ -10426,33 +10452,6 @@
10426
10452
  })(exports.Plugin || (exports.Plugin = {}));
10427
10453
 
10428
10454
  (function (DataSource) {
10429
- /**
10430
- * Returns cache identifier for a data source by ID.
10431
- * Example: {
10432
- * const api: BruceApi.Api = ...;
10433
- * const key = GetCacheKey(1);
10434
- * api.Cache.Remove(key);
10435
- * }
10436
- * @param id
10437
- * @returns
10438
- */
10439
- function GetCacheKey(id) {
10440
- return exports.Api.ECacheKey.DataSource + exports.Api.ECacheKey.Id + id;
10441
- }
10442
- DataSource.GetCacheKey = GetCacheKey;
10443
- /**
10444
- * Returns cache identifier for a list of data sources.
10445
- * Example: {
10446
- * const api: BruceApi.Api = ...;
10447
- * const key = GetListCacheKey();
10448
- * api.Cache.Remove(key);
10449
- * }
10450
- * @returns
10451
- */
10452
- function GetListCacheKey() {
10453
- return exports.Api.ECacheKey.DataSource;
10454
- }
10455
- DataSource.GetListCacheKey = GetListCacheKey;
10456
10455
  // Known data source types.
10457
10456
  let EType;
10458
10457
  (function (EType) {
@@ -10569,9 +10568,37 @@
10569
10568
  });
10570
10569
  }
10571
10570
  DataSource.GetList = GetList;
10571
+ /**
10572
+ * Returns cache identifier for a data source by ID.
10573
+ * Example: {
10574
+ * const api: BruceApi.Api = ...;
10575
+ * const key = GetCacheKey(1);
10576
+ * api.Cache.Remove(key);
10577
+ * }
10578
+ * @param id
10579
+ * @returns
10580
+ */
10581
+ function GetCacheKey(id) {
10582
+ return exports.Api.ECacheKey.DataSource + exports.Api.ECacheKey.Id + id;
10583
+ }
10584
+ DataSource.GetCacheKey = GetCacheKey;
10585
+ /**
10586
+ * Returns cache identifier for a list of data sources.
10587
+ * Example: {
10588
+ * const api: BruceApi.Api = ...;
10589
+ * const key = GetListCacheKey();
10590
+ * api.Cache.Remove(key);
10591
+ * }
10592
+ * @returns
10593
+ */
10594
+ function GetListCacheKey() {
10595
+ return exports.Api.ECacheKey.DataSource;
10596
+ }
10597
+ DataSource.GetListCacheKey = GetListCacheKey;
10572
10598
  })(exports.DataSource || (exports.DataSource = {}));
10573
10599
 
10574
- const VERSION = "3.5.1";
10600
+ // This is updated with the package.json version on build.
10601
+ const VERSION = "3.5.3";
10575
10602
 
10576
10603
  exports.VERSION = VERSION;
10577
10604
  exports.AbstractApi = AbstractApi;