bruce-models 7.1.80 → 7.1.82

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["EntityTypeRelation"] = "entitytyperelation";
42
43
  ECacheKey["Ontology"] = "ontology";
43
44
  ECacheKey["EntityTypeTrigger"] = "entitytypetrigger";
44
45
  ECacheKey["DataFeed"] = "datafeed";
@@ -11003,6 +11004,26 @@ var DataLab;
11003
11004
  });
11004
11005
  }
11005
11006
  DataLab.Run = Run;
11007
+ /**
11008
+ * Runs one or more DataLab actions.
11009
+ * This calls: POST v3/datalab/runAction
11010
+ */
11011
+ function RunAction(params) {
11012
+ return __awaiter(this, void 0, void 0, function* () {
11013
+ let { api, body, req } = params;
11014
+ if (!body) {
11015
+ throw new Error("body is required.");
11016
+ }
11017
+ if (!api) {
11018
+ api = ENVIRONMENT.Api().GetBruceApi();
11019
+ }
11020
+ const res = yield api.POST("v3/datalab/runAction", body, Api.PrepReqParams(req));
11021
+ return {
11022
+ action: res
11023
+ };
11024
+ });
11025
+ }
11026
+ DataLab.RunAction = RunAction;
11006
11027
  })(DataLab || (DataLab = {}));
11007
11028
 
11008
11029
  var DataLabGroup;
@@ -14260,6 +14281,172 @@ var EntityTag;
14260
14281
  EntityTag.GetListCacheKey = GetListCacheKey;
14261
14282
  })(EntityTag || (EntityTag = {}));
14262
14283
 
14284
+ /**
14285
+ * Describes the "Entity Type Relation" concept within Nextspace.
14286
+ * An Entity Type Relation registers a relationship that may exist between entities of two specified Entity Types.
14287
+ */
14288
+ var EntityTypeRelation;
14289
+ (function (EntityTypeRelation) {
14290
+ /**
14291
+ * Gets a single Entity Type Relation record.
14292
+ * This calls: GET entityType/{entityType_id}/relation/{entity_type_relation_id}
14293
+ */
14294
+ function Get(params) {
14295
+ return __awaiter(this, void 0, void 0, function* () {
14296
+ let { api, entityTypeId, entityTypeRelationId, req } = params;
14297
+ if (!entityTypeId) {
14298
+ throw ("Entity Type ID is required.");
14299
+ }
14300
+ if (!entityTypeRelationId) {
14301
+ throw ("Entity Type Relation ID is required.");
14302
+ }
14303
+ if (!api) {
14304
+ api = ENVIRONMENT.Api().GetBruceApi();
14305
+ }
14306
+ const key = GetCacheKey(entityTypeId, entityTypeRelationId);
14307
+ const cache = api.GetCacheItem(key, req);
14308
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
14309
+ return cache.data;
14310
+ }
14311
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
14312
+ try {
14313
+ const data = yield api.GET(`entityType/${entityTypeId}/relation/${entityTypeRelationId}`, Api.PrepReqParams(req));
14314
+ res({
14315
+ relation: data
14316
+ });
14317
+ }
14318
+ catch (e) {
14319
+ rej(e);
14320
+ }
14321
+ }));
14322
+ api.SetCacheItem({
14323
+ key,
14324
+ value: prom,
14325
+ req
14326
+ });
14327
+ return prom;
14328
+ });
14329
+ }
14330
+ EntityTypeRelation.Get = Get;
14331
+ /**
14332
+ * Gets Entity Type Relation records for the specified Entity Type.
14333
+ * This calls: GET entityType/{entityType_id}/relations
14334
+ */
14335
+ function GetList(params) {
14336
+ return __awaiter(this, void 0, void 0, function* () {
14337
+ let { api, entityTypeId, req } = params;
14338
+ if (!entityTypeId) {
14339
+ throw ("Entity Type ID is required.");
14340
+ }
14341
+ if (!api) {
14342
+ api = ENVIRONMENT.Api().GetBruceApi();
14343
+ }
14344
+ const key = GetListCacheKey(entityTypeId);
14345
+ const cache = api.GetCacheItem(key, req);
14346
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
14347
+ return cache.data;
14348
+ }
14349
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
14350
+ try {
14351
+ const data = yield api.GET(`entityType/${entityTypeId}/relations`, Api.PrepReqParams(req));
14352
+ res({
14353
+ relations: Array.isArray(data === null || data === void 0 ? void 0 : data.Items) ? data.Items : []
14354
+ });
14355
+ }
14356
+ catch (e) {
14357
+ rej(e);
14358
+ }
14359
+ }));
14360
+ api.SetCacheItem({
14361
+ key,
14362
+ value: prom,
14363
+ req
14364
+ });
14365
+ return prom;
14366
+ });
14367
+ }
14368
+ EntityTypeRelation.GetList = GetList;
14369
+ /**
14370
+ * Creates or updates an Entity Type Relation record.
14371
+ * This calls: POST entityType/{entityType_id}/relation/{entity_type_relation_id}
14372
+ */
14373
+ function Update(params) {
14374
+ var _a;
14375
+ return __awaiter(this, void 0, void 0, function* () {
14376
+ let { api, entityTypeId, relation: data, entityTypeRelationId, req } = params;
14377
+ if (!entityTypeId) {
14378
+ throw ("Entity Type ID is required.");
14379
+ }
14380
+ if (!data) {
14381
+ throw ("Entity Type Relation is required.");
14382
+ }
14383
+ if (!api) {
14384
+ api = ENVIRONMENT.Api().GetBruceApi();
14385
+ }
14386
+ const relationId = (_a = entityTypeRelationId !== null && entityTypeRelationId !== void 0 ? entityTypeRelationId : data.ID) !== null && _a !== void 0 ? _a : 0;
14387
+ if (isCreateRoute(relationId) && (!data["A.EntityType.ID"] || !data["B.EntityType.ID"] || !data["EntityRelationType.ID"])) {
14388
+ throw ("A.EntityType.ID, B.EntityType.ID, and EntityRelationType.ID are required.");
14389
+ }
14390
+ const res = yield api.POST(`entityType/${entityTypeId}/relation/${relationId}`, data, Api.PrepReqParams(req));
14391
+ removeRelationCache(api, entityTypeId, relationId, res);
14392
+ return {
14393
+ relation: res
14394
+ };
14395
+ });
14396
+ }
14397
+ EntityTypeRelation.Update = Update;
14398
+ /**
14399
+ * Deletes an Entity Type Relation record.
14400
+ * This calls: DELETE entityType/{entityType_id}/relation/{entity_type_relation_id}
14401
+ */
14402
+ function Delete(params) {
14403
+ return __awaiter(this, void 0, void 0, function* () {
14404
+ let { api, entityTypeId, entityTypeRelationId, req } = params;
14405
+ if (!entityTypeId) {
14406
+ throw ("Entity Type ID is required.");
14407
+ }
14408
+ if (!entityTypeRelationId) {
14409
+ throw ("Entity Type Relation ID is required.");
14410
+ }
14411
+ if (!api) {
14412
+ api = ENVIRONMENT.Api().GetBruceApi();
14413
+ }
14414
+ yield api.DELETE(`entityType/${entityTypeId}/relation/${entityTypeRelationId}`, Api.PrepReqParams(req));
14415
+ removeRelationCache(api, entityTypeId, entityTypeRelationId);
14416
+ });
14417
+ }
14418
+ EntityTypeRelation.Delete = Delete;
14419
+ /**
14420
+ * Returns cache identifier for an Entity Type Relation record.
14421
+ */
14422
+ function GetCacheKey(entityTypeId, entityTypeRelationId) {
14423
+ return Api.ECacheKey.EntityTypeRelation + Api.ECacheKey.Id + entityTypeId + Api.ECacheKey.Id + entityTypeRelationId;
14424
+ }
14425
+ EntityTypeRelation.GetCacheKey = GetCacheKey;
14426
+ /**
14427
+ * Returns cache identifier for the list of Entity Type Relation records for an Entity Type.
14428
+ */
14429
+ function GetListCacheKey(entityTypeId) {
14430
+ return Api.ECacheKey.EntityTypeRelation + Api.ECacheKey.Id + entityTypeId;
14431
+ }
14432
+ EntityTypeRelation.GetListCacheKey = GetListCacheKey;
14433
+ function isCreateRoute(entityTypeRelationId) {
14434
+ return entityTypeRelationId === 0 || entityTypeRelationId === "0";
14435
+ }
14436
+ function removeRelationCache(api, entityTypeId, entityTypeRelationId, relation) {
14437
+ api.Cache.RemoveByStartsWith(GetListCacheKey(entityTypeId));
14438
+ if (!isCreateRoute(entityTypeRelationId)) {
14439
+ api.Cache.Remove(GetCacheKey(entityTypeId, entityTypeRelationId));
14440
+ }
14441
+ if ((relation === null || relation === void 0 ? void 0 : relation["A.EntityType.ID"]) && relation["A.EntityType.ID"] !== entityTypeId) {
14442
+ api.Cache.RemoveByStartsWith(GetListCacheKey(relation["A.EntityType.ID"]));
14443
+ }
14444
+ if ((relation === null || relation === void 0 ? void 0 : relation["B.EntityType.ID"]) && relation["B.EntityType.ID"] !== entityTypeId) {
14445
+ api.Cache.RemoveByStartsWith(GetListCacheKey(relation["B.EntityType.ID"]));
14446
+ }
14447
+ }
14448
+ })(EntityTypeRelation || (EntityTypeRelation = {}));
14449
+
14263
14450
  /**
14264
14451
  * Describes the "BruceEntityTypeTrigger" concept within Nextspace.
14265
14452
  * These records define trigger rules that are scoped to an Entity Type.
@@ -14787,6 +14974,71 @@ var ExportBrz;
14787
14974
  ExportBrz.Export = Export;
14788
14975
  })(ExportBrz || (ExportBrz = {}));
14789
14976
 
14977
+ var ExportCsv;
14978
+ (function (ExportCsv) {
14979
+ /**
14980
+ * Exports CSV for Entities selected by Filter.
14981
+ * This calls: GET entities/ExportCSV
14982
+ */
14983
+ function Export(params) {
14984
+ return __awaiter(this, void 0, void 0, function* () {
14985
+ let { api, fileExport, req } = params;
14986
+ if (!api) {
14987
+ api = ENVIRONMENT.Api().GetBruceApi();
14988
+ }
14989
+ if (!(fileExport === null || fileExport === void 0 ? void 0 : fileExport.BruceEntityType)) {
14990
+ throw ("fileExport.BruceEntityType is required.");
14991
+ }
14992
+ const urlParams = new URLSearchParams();
14993
+ urlParams.append("BruceEntityType", fileExport.BruceEntityType);
14994
+ appendStringParam(urlParams, "OrderBy", fileExport.OrderBy);
14995
+ appendStringParam(urlParams, "SortOrder", fileExport.SortOrder);
14996
+ appendStringParam(urlParams, "Filter", fileExport.Filter);
14997
+ appendStringParam(urlParams, "LODType", fileExport.LODType);
14998
+ if (fileExport.ZIP != null) {
14999
+ urlParams.append("ZIP", String(fileExport.ZIP));
15000
+ }
15001
+ if (fileExport.ColumnSettings) {
15002
+ urlParams.append("ColumnSettings", JSON.stringify(fileExport.ColumnSettings));
15003
+ }
15004
+ return api.GET(`entities/ExportCSV?${urlParams.toString()}`, Api.PrepReqParams(req));
15005
+ });
15006
+ }
15007
+ ExportCsv.Export = Export;
15008
+ /**
15009
+ * Exports CSV for a provided list of Entity IDs.
15010
+ * This calls: POST entities/ExportCSV/{entityType_ID}
15011
+ */
15012
+ function ExportEntities(params) {
15013
+ var _a;
15014
+ return __awaiter(this, void 0, void 0, function* () {
15015
+ let { api, entityTypeId, fileExport, zip, req } = params;
15016
+ if (!api) {
15017
+ api = ENVIRONMENT.Api().GetBruceApi();
15018
+ }
15019
+ if (!entityTypeId) {
15020
+ throw ("entityTypeId is required.");
15021
+ }
15022
+ if (!((_a = fileExport === null || fileExport === void 0 ? void 0 : fileExport.EntityIDs) === null || _a === void 0 ? void 0 : _a.length)) {
15023
+ throw ("fileExport.EntityIDs is required and must be a non-empty list.");
15024
+ }
15025
+ let url = `entities/ExportCSV/${Api.Encode(entityTypeId)}`;
15026
+ if (zip != null) {
15027
+ const urlParams = new URLSearchParams();
15028
+ urlParams.append("ZIP", String(zip));
15029
+ url += `?${urlParams.toString()}`;
15030
+ }
15031
+ return api.POST(url, fileExport, Api.PrepReqParams(req));
15032
+ });
15033
+ }
15034
+ ExportCsv.ExportEntities = ExportEntities;
15035
+ function appendStringParam(urlParams, key, value) {
15036
+ if (value != null && value !== "") {
15037
+ urlParams.append(key, String(value));
15038
+ }
15039
+ }
15040
+ })(ExportCsv || (ExportCsv = {}));
15041
+
14790
15042
  var ExportUsd;
14791
15043
  (function (ExportUsd) {
14792
15044
  function Export(params) {
@@ -20450,7 +20702,7 @@ var UrlUtils;
20450
20702
  })(UrlUtils || (UrlUtils = {}));
20451
20703
 
20452
20704
  // This is updated with the package.json version on build.
20453
- const VERSION = "7.1.80";
20705
+ const VERSION = "7.1.82";
20454
20706
 
20455
- 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, Hexbin, 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 };
20707
+ 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, EntityTypeRelation, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportUsd, Hexbin, 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 };
20456
20708
  //# sourceMappingURL=bruce-models.es5.js.map