bruce-models 7.1.72 → 7.1.74

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.
@@ -14046,6 +14046,153 @@ function parseObject$3(data) {
14046
14046
  return data;
14047
14047
  }
14048
14048
 
14049
+ var OntologyDocument;
14050
+ (function (OntologyDocument) {
14051
+ function GetListByOntologyId(params) {
14052
+ return __awaiter(this, void 0, void 0, function* () {
14053
+ let { api, ontologyId, req: reqParams } = params;
14054
+ if (ontologyId == null || ontologyId === "") {
14055
+ throw ("Ontology ID is required.");
14056
+ }
14057
+ if (!api) {
14058
+ api = ENVIRONMENT.Api().GetBruceApi();
14059
+ }
14060
+ const key = GetListCacheKey(ontologyId);
14061
+ const cache = api.GetCacheItem(key, reqParams);
14062
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
14063
+ return cache.data;
14064
+ }
14065
+ const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
14066
+ try {
14067
+ const data = yield api.GET(`ontology/documents?ontology_id=${encodeURIComponent(String(ontologyId))}`, Api.PrepReqParams(reqParams));
14068
+ res({
14069
+ ontologyDocuments: ParseListResponse(data)
14070
+ });
14071
+ }
14072
+ catch (e) {
14073
+ rej(e);
14074
+ }
14075
+ }));
14076
+ api.SetCacheItem({
14077
+ key,
14078
+ value: req,
14079
+ req: reqParams
14080
+ });
14081
+ return req;
14082
+ });
14083
+ }
14084
+ OntologyDocument.GetListByOntologyId = GetListByOntologyId;
14085
+ function GetListByClientFileId(params) {
14086
+ return __awaiter(this, void 0, void 0, function* () {
14087
+ let { api, clientFileId, req: reqParams } = params;
14088
+ if (!clientFileId) {
14089
+ throw ("Client file ID is required.");
14090
+ }
14091
+ if (!api) {
14092
+ api = ENVIRONMENT.Api().GetBruceApi();
14093
+ }
14094
+ const key = GetListCacheKey(clientFileId);
14095
+ const cache = api.GetCacheItem(key, reqParams);
14096
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
14097
+ return cache.data;
14098
+ }
14099
+ const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
14100
+ try {
14101
+ const data = yield api.GET(`ontology/documents?client_file_id=${encodeURIComponent(clientFileId)}`, Api.PrepReqParams(reqParams));
14102
+ res({
14103
+ ontologyDocuments: ParseListResponse(data)
14104
+ });
14105
+ }
14106
+ catch (e) {
14107
+ rej(e);
14108
+ }
14109
+ }));
14110
+ api.SetCacheItem({
14111
+ key,
14112
+ value: req,
14113
+ req: reqParams
14114
+ });
14115
+ return req;
14116
+ });
14117
+ }
14118
+ OntologyDocument.GetListByClientFileId = GetListByClientFileId;
14119
+ function Update(params) {
14120
+ return __awaiter(this, void 0, void 0, function* () {
14121
+ let { api, ontologyDocument: data, req: reqParams } = params;
14122
+ if (!api) {
14123
+ api = ENVIRONMENT.Api().GetBruceApi();
14124
+ }
14125
+ if (!data) {
14126
+ data = {};
14127
+ }
14128
+ const res = yield api.POST("ontology/document", data, Api.PrepReqParams(reqParams));
14129
+ if (data.ID) {
14130
+ api.Cache.Remove(GetCacheKey(data.ID));
14131
+ }
14132
+ api.Cache.RemoveByStartsWith(GetListCacheKey(data["Ontology.ID"]));
14133
+ return {
14134
+ ontologyDocument: ParseResponse(res)
14135
+ };
14136
+ });
14137
+ }
14138
+ OntologyDocument.Update = Update;
14139
+ function Delete(params) {
14140
+ return __awaiter(this, void 0, void 0, function* () {
14141
+ let { api, documentId, req: reqParams } = params;
14142
+ if (documentId == null || documentId === "") {
14143
+ throw ("Ontology document ID is required.");
14144
+ }
14145
+ if (!api) {
14146
+ api = ENVIRONMENT.Api().GetBruceApi();
14147
+ }
14148
+ yield api.DELETE(`ontology/document/${documentId}`, Api.PrepReqParams(reqParams));
14149
+ api.Cache.Remove(GetCacheKey(documentId));
14150
+ api.Cache.RemoveByStartsWith(GetListCacheKey(documentId));
14151
+ });
14152
+ }
14153
+ OntologyDocument.Delete = Delete;
14154
+ function ParseResponse(response) {
14155
+ var _a, _b, _c, _d;
14156
+ const parsed = parseObject$4(response);
14157
+ 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;
14158
+ return (_d = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.OntologyDocument) !== null && _b !== void 0 ? _b : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.OntologyDocument) !== null && _c !== void 0 ? _c : parsedResult) !== null && _d !== void 0 ? _d : parsed;
14159
+ }
14160
+ OntologyDocument.ParseResponse = ParseResponse;
14161
+ function ParseListResponse(response) {
14162
+ var _a, _b, _c, _d, _e, _f;
14163
+ const parsed = parseObject$4(response);
14164
+ 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;
14165
+ const list = (_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.OntologyDocuments) !== null && _d !== void 0 ? _d : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.OntologyDocuments) !== null && _e !== void 0 ? _e : parsedResult) !== null && _f !== void 0 ? _f : parsed;
14166
+ if (Array.isArray(list)) {
14167
+ return list;
14168
+ }
14169
+ return [];
14170
+ }
14171
+ OntologyDocument.ParseListResponse = ParseListResponse;
14172
+ function GetCacheKey(id) {
14173
+ return Api.ECacheKey.Ontology + ":document:" + id;
14174
+ }
14175
+ OntologyDocument.GetCacheKey = GetCacheKey;
14176
+ function GetListCacheKey(id) {
14177
+ return Api.ECacheKey.Ontology + ":documents:" + id;
14178
+ }
14179
+ OntologyDocument.GetListCacheKey = GetListCacheKey;
14180
+ })(OntologyDocument || (OntologyDocument = {}));
14181
+ function parseObject$4(data) {
14182
+ if (data == null || data == undefined) {
14183
+ return null;
14184
+ }
14185
+ if (typeof data == "string") {
14186
+ try {
14187
+ return JSON.parse(data);
14188
+ }
14189
+ catch (_a) {
14190
+ return null;
14191
+ }
14192
+ }
14193
+ return data;
14194
+ }
14195
+
14049
14196
  /**
14050
14197
  * Describes the "Ontology" concept within Nextspace.
14051
14198
  * Ontologies group Entity Types and can be used to filter entity-type listings.
@@ -14153,17 +14300,34 @@ var Ontology;
14153
14300
  });
14154
14301
  }
14155
14302
  Ontology.Delete = Delete;
14303
+ function Describe(params) {
14304
+ var _a, _b;
14305
+ return __awaiter(this, void 0, void 0, function* () {
14306
+ let { api, ontologyId, req: reqParams } = params;
14307
+ if (ontologyId == null || ontologyId === "") {
14308
+ throw ("Ontology ID is required.");
14309
+ }
14310
+ if (!api) {
14311
+ api = ENVIRONMENT.Api().GetBruceApi();
14312
+ }
14313
+ const res = yield api.POST(`ontology/${ontologyId}/describe`, {}, Api.PrepReqParams(reqParams));
14314
+ return {
14315
+ markdown: typeof res === "string" ? res : (_b = (_a = res === null || res === void 0 ? void 0 : res.markdown) !== null && _a !== void 0 ? _a : res === null || res === void 0 ? void 0 : res.Markdown) !== null && _b !== void 0 ? _b : ""
14316
+ };
14317
+ });
14318
+ }
14319
+ Ontology.Describe = Describe;
14156
14320
  function ParseResponse(response) {
14157
14321
  var _a, _b, _c, _d, _e, _f;
14158
- const parsed = parseObject$4(response);
14159
- 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;
14322
+ const parsed = parseObject$5(response);
14323
+ const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
14160
14324
  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;
14161
14325
  }
14162
14326
  Ontology.ParseResponse = ParseResponse;
14163
14327
  function ParseListResponse(response) {
14164
14328
  var _a, _b, _c, _d, _e, _f, _g, _h;
14165
- const parsed = parseObject$4(response);
14166
- 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;
14329
+ const parsed = parseObject$5(response);
14330
+ const parsedResult = (_a = parseObject$5(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
14167
14331
  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;
14168
14332
  if (Array.isArray(list)) {
14169
14333
  return list;
@@ -14180,7 +14344,7 @@ var Ontology;
14180
14344
  }
14181
14345
  Ontology.GetListCacheKey = GetListCacheKey;
14182
14346
  })(Ontology || (Ontology = {}));
14183
- function parseObject$4(data) {
14347
+ function parseObject$5(data) {
14184
14348
  if (data == null || data == undefined) {
14185
14349
  return null;
14186
14350
  }
@@ -19797,7 +19961,7 @@ var UrlUtils;
19797
19961
  })(UrlUtils || (UrlUtils = {}));
19798
19962
 
19799
19963
  // This is updated with the package.json version on build.
19800
- const VERSION = "7.1.72";
19964
+ const VERSION = "7.1.74";
19801
19965
 
19802
- 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, UIMarkup, 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 };
19966
+ 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, OntologyDocument, ENVIRONMENT, ExportBrz, ExportUsd, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportedFile, Uploader, Markup, UIMarkup, 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 };
19803
19967
  //# sourceMappingURL=bruce-models.es5.js.map