bruce-models 7.1.64 → 7.1.66

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.
@@ -39,6 +39,7 @@ var Api;
39
39
  ECacheKey["Assembly"] = "assembly";
40
40
  ECacheKey["Entity"] = "entity";
41
41
  ECacheKey["EntityType"] = "entitytype";
42
+ ECacheKey["Ontology"] = "ontology";
42
43
  ECacheKey["EntityTypeTrigger"] = "entitytypetrigger";
43
44
  ECacheKey["DataFeed"] = "datafeed";
44
45
  ECacheKey["ProjectView"] = "projectview";
@@ -5295,7 +5296,7 @@ var EntityType;
5295
5296
  */
5296
5297
  function GetList(params) {
5297
5298
  return __awaiter(this, void 0, void 0, function* () {
5298
- let { entityTypeIds, api, req: reqParams, parentTypeId, expandSettings, search, expandLODs, expandOntologyDiagramSettings } = params;
5299
+ let { entityTypeIds, api, req: reqParams, parentTypeId, ontologyId, expandSettings, search, expandLODs, expandOntologyDiagramSettings } = params;
5299
5300
  if (!api) {
5300
5301
  api = ENVIRONMENT.Api().GetBruceApi();
5301
5302
  }
@@ -5325,6 +5326,10 @@ var EntityType;
5325
5326
  if (parentTypeId) {
5326
5327
  urlParams.append("ParentTypeID", parentTypeId);
5327
5328
  }
5329
+ if (ontologyId != null && ontologyId !== "") {
5330
+ urlParams.append("Ontology.ID", String(ontologyId));
5331
+ urlParams.append("ontologyId", String(ontologyId));
5332
+ }
5328
5333
  appendEntityTypeExpandParams(urlParams, {
5329
5334
  expandSettings,
5330
5335
  expandLODs,
@@ -5341,6 +5346,10 @@ var EntityType;
5341
5346
  if (parentTypeId) {
5342
5347
  urlParams.append("ParentTypeID", parentTypeId);
5343
5348
  }
5349
+ if (ontologyId != null && ontologyId !== "") {
5350
+ urlParams.append("Ontology.ID", String(ontologyId));
5351
+ urlParams.append("ontologyId", String(ontologyId));
5352
+ }
5344
5353
  appendEntityTypeExpandParams(urlParams, {
5345
5354
  expandSettings,
5346
5355
  expandLODs,
@@ -5378,7 +5387,8 @@ var EntityType;
5378
5387
  expandSettings,
5379
5388
  expandLODs,
5380
5389
  expandOntologyDiagramSettings,
5381
- search
5390
+ search,
5391
+ ontologyId
5382
5392
  }),
5383
5393
  value: req,
5384
5394
  req: reqParams,
@@ -5806,7 +5816,7 @@ var EntityType;
5806
5816
  if (!params) {
5807
5817
  params = {};
5808
5818
  }
5809
- let { typeIds, expandSettings, parentTypeId, expandLODs, expandOntologyDiagramSettings, search } = params;
5819
+ let { typeIds, expandSettings, parentTypeId, ontologyId, expandLODs, expandOntologyDiagramSettings, search } = params;
5810
5820
  let key = Api.ECacheKey.EntityType;
5811
5821
  if (!typeIds) {
5812
5822
  typeIds = [];
@@ -5815,6 +5825,9 @@ var EntityType;
5815
5825
  if (parentTypeId) {
5816
5826
  key += "_PARENT_" + parentTypeId;
5817
5827
  }
5828
+ if (ontologyId != null && ontologyId !== "") {
5829
+ key += "_ONTOLOGY_" + ontologyId;
5830
+ }
5818
5831
  if (!expandSettings) {
5819
5832
  expandSettings = false;
5820
5833
  }
@@ -8840,6 +8853,65 @@ var ClientFile;
8840
8853
  });
8841
8854
  }
8842
8855
  ClientFile.GetList = GetList;
8856
+ function GetFindGeneratedTextureCacheKey(entityTypeSourceId, attribute) {
8857
+ return `client-file-find-generated-texture-${entityTypeSourceId}-${attribute}`;
8858
+ }
8859
+ /**
8860
+ * Returns a generated texture file for given source ID + attribute combination.
8861
+ */
8862
+ function FindGeneratedTexture(params) {
8863
+ return __awaiter(this, void 0, void 0, function* () {
8864
+ let { api, entityTypeSourceId, attribute, req: reqParams } = params;
8865
+ if (!api) {
8866
+ api = ENVIRONMENT.Api().GetBruceApi();
8867
+ }
8868
+ const key = GetFindGeneratedTextureCacheKey(entityTypeSourceId, attribute);
8869
+ const cache = api.GetCacheItem(key, reqParams);
8870
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
8871
+ return cache.data;
8872
+ }
8873
+ const prom = (() => __awaiter(this, void 0, void 0, function* () {
8874
+ var _a;
8875
+ const res = yield GetList({
8876
+ api,
8877
+ filter: {
8878
+ PageSize: 1,
8879
+ PageIndex: 0,
8880
+ Purpose: "Polygon Texture",
8881
+ FilterRows: [
8882
+ {
8883
+ column: Filter.EColumn.Data,
8884
+ path: "generation/EntityType.Source.ID",
8885
+ rowOperator: Filter.ERowOperator.AND,
8886
+ value: String(entityTypeSourceId),
8887
+ includes: true,
8888
+ valueOperator: "equals",
8889
+ rows: []
8890
+ },
8891
+ {
8892
+ column: Filter.EColumn.Data,
8893
+ path: "generation/Attribute",
8894
+ rowOperator: Filter.ERowOperator.AND,
8895
+ value: attribute,
8896
+ includes: true,
8897
+ valueOperator: "equals",
8898
+ rows: []
8899
+ }
8900
+ ]
8901
+ },
8902
+ req: reqParams
8903
+ });
8904
+ return ((_a = res.clientFiles) === null || _a === void 0 ? void 0 : _a[0]) || null;
8905
+ }))();
8906
+ api.SetCacheItem({
8907
+ key,
8908
+ value: prom,
8909
+ req: reqParams
8910
+ });
8911
+ return prom;
8912
+ });
8913
+ }
8914
+ ClientFile.FindGeneratedTexture = FindGeneratedTexture;
8843
8915
  /**
8844
8916
  * Deletes a list of client files matching the filter.
8845
8917
  * @param params
@@ -13900,6 +13972,155 @@ function parseObject$3(data) {
13900
13972
  return data;
13901
13973
  }
13902
13974
 
13975
+ /**
13976
+ * Describes the "Ontology" concept within Nextspace.
13977
+ * Ontologies group Entity Types and can be used to filter entity-type listings.
13978
+ */
13979
+ var Ontology;
13980
+ (function (Ontology) {
13981
+ function Get(params) {
13982
+ return __awaiter(this, void 0, void 0, function* () {
13983
+ let { api, ontologyId, req: reqParams } = params;
13984
+ if (ontologyId == null || ontologyId === "") {
13985
+ throw ("Ontology ID is required.");
13986
+ }
13987
+ if (!api) {
13988
+ api = ENVIRONMENT.Api().GetBruceApi();
13989
+ }
13990
+ const key = GetCacheKey(ontologyId);
13991
+ const cache = api.GetCacheItem(key, reqParams);
13992
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
13993
+ return cache.data;
13994
+ }
13995
+ const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
13996
+ try {
13997
+ const data = yield api.GET(`ontology/${ontologyId}`, Api.PrepReqParams(reqParams));
13998
+ res({
13999
+ ontology: ParseResponse(data)
14000
+ });
14001
+ }
14002
+ catch (e) {
14003
+ rej(e);
14004
+ }
14005
+ }));
14006
+ api.SetCacheItem({
14007
+ key,
14008
+ value: req,
14009
+ req: reqParams
14010
+ });
14011
+ return req;
14012
+ });
14013
+ }
14014
+ Ontology.Get = Get;
14015
+ function GetList(params) {
14016
+ return __awaiter(this, void 0, void 0, function* () {
14017
+ let { api, req: reqParams } = params;
14018
+ if (!api) {
14019
+ api = ENVIRONMENT.Api().GetBruceApi();
14020
+ }
14021
+ const key = GetListCacheKey();
14022
+ const cache = api.GetCacheItem(key, reqParams);
14023
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
14024
+ return cache.data;
14025
+ }
14026
+ const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
14027
+ try {
14028
+ const data = yield api.GET("ontologies", Api.PrepReqParams(reqParams));
14029
+ res({
14030
+ ontologies: ParseListResponse(data)
14031
+ });
14032
+ }
14033
+ catch (e) {
14034
+ rej(e);
14035
+ }
14036
+ }));
14037
+ api.SetCacheItem({
14038
+ key,
14039
+ value: req,
14040
+ req: reqParams
14041
+ });
14042
+ return req;
14043
+ });
14044
+ }
14045
+ Ontology.GetList = GetList;
14046
+ function Update(params) {
14047
+ return __awaiter(this, void 0, void 0, function* () {
14048
+ let { api, ontology: data, req: reqParams } = params;
14049
+ if (!api) {
14050
+ api = ENVIRONMENT.Api().GetBruceApi();
14051
+ }
14052
+ if (!data) {
14053
+ data = {};
14054
+ }
14055
+ if (data.ID == null || data.ID === "") {
14056
+ data.ID = ObjectUtils.UId();
14057
+ }
14058
+ const res = yield api.POST(`ontology/${data.ID}`, data, Api.PrepReqParams(reqParams));
14059
+ api.Cache.Remove(GetCacheKey(data.ID));
14060
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
14061
+ return {
14062
+ ontology: ParseResponse(res)
14063
+ };
14064
+ });
14065
+ }
14066
+ Ontology.Update = Update;
14067
+ function Delete(params) {
14068
+ return __awaiter(this, void 0, void 0, function* () {
14069
+ let { api, ontologyId, req: reqParams } = params;
14070
+ if (ontologyId == null || ontologyId === "") {
14071
+ throw ("Ontology ID is required.");
14072
+ }
14073
+ if (!api) {
14074
+ api = ENVIRONMENT.Api().GetBruceApi();
14075
+ }
14076
+ yield api.DELETE(`ontology/${ontologyId}`, Api.PrepReqParams(reqParams));
14077
+ api.Cache.Remove(GetCacheKey(ontologyId));
14078
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
14079
+ });
14080
+ }
14081
+ Ontology.Delete = Delete;
14082
+ function ParseResponse(response) {
14083
+ var _a, _b, _c, _d, _e, _f;
14084
+ const parsed = parseObject$4(response);
14085
+ const parsedResult = (_a = parseObject$4(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
14086
+ return (_f = (_e = (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.Ontology) !== null && _b !== void 0 ? _b : parsed === null || parsed === void 0 ? void 0 : parsed.BruceOntology) !== null && _c !== void 0 ? _c : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Ontology) !== null && _d !== void 0 ? _d : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.BruceOntology) !== null && _e !== void 0 ? _e : parsedResult) !== null && _f !== void 0 ? _f : parsed;
14087
+ }
14088
+ Ontology.ParseResponse = ParseResponse;
14089
+ function ParseListResponse(response) {
14090
+ var _a, _b, _c, _d, _e, _f, _g, _h;
14091
+ const parsed = parseObject$4(response);
14092
+ const parsedResult = (_a = parseObject$4(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
14093
+ const list = (_h = (_g = (_f = (_e = (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.Items) !== null && _b !== void 0 ? _b : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Items) !== null && _c !== void 0 ? _c : parsed === null || parsed === void 0 ? void 0 : parsed.Ontologies) !== null && _d !== void 0 ? _d : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Ontologies) !== null && _e !== void 0 ? _e : parsed === null || parsed === void 0 ? void 0 : parsed.BruceOntologies) !== null && _f !== void 0 ? _f : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.BruceOntologies) !== null && _g !== void 0 ? _g : parsedResult) !== null && _h !== void 0 ? _h : parsed;
14094
+ if (Array.isArray(list)) {
14095
+ return list;
14096
+ }
14097
+ return [];
14098
+ }
14099
+ Ontology.ParseListResponse = ParseListResponse;
14100
+ function GetCacheKey(id) {
14101
+ return `${Api.ECacheKey.Ontology}${Api.ECacheKey.Id}${id}`;
14102
+ }
14103
+ Ontology.GetCacheKey = GetCacheKey;
14104
+ function GetListCacheKey() {
14105
+ return Api.ECacheKey.Ontology;
14106
+ }
14107
+ Ontology.GetListCacheKey = GetListCacheKey;
14108
+ })(Ontology || (Ontology = {}));
14109
+ function parseObject$4(data) {
14110
+ if (data == null || data == undefined) {
14111
+ return null;
14112
+ }
14113
+ if (typeof data == "string") {
14114
+ try {
14115
+ return JSON.parse(data);
14116
+ }
14117
+ catch (_a) {
14118
+ return null;
14119
+ }
14120
+ }
14121
+ return data;
14122
+ }
14123
+
13903
14124
  var ExportBrz;
13904
14125
  (function (ExportBrz) {
13905
14126
  function Export(params) {
@@ -19354,7 +19575,7 @@ var UrlUtils;
19354
19575
  })(UrlUtils || (UrlUtils = {}));
19355
19576
 
19356
19577
  // This is updated with the package.json version on build.
19357
- const VERSION = "7.1.64";
19578
+ const VERSION = "7.1.66";
19358
19579
 
19359
- export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeTrigger, ENVIRONMENT, ExportBrz, ExportUsd, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportedFile, Uploader, Markup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils };
19580
+ export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeTrigger, Ontology, ENVIRONMENT, ExportBrz, ExportUsd, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportedFile, Uploader, Markup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils };
19360
19581
  //# sourceMappingURL=bruce-models.es5.js.map