bruce-models 7.1.111 → 7.1.113

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.
@@ -24396,6 +24396,39 @@ var WorkflowItem;
24396
24396
  });
24397
24397
  }
24398
24398
  WorkflowItem.GetList = GetList;
24399
+ /**
24400
+ * Gets Workflow Item counts grouped by the Entity Types of their Subject Entities.
24401
+ * Parent Entity Type and Ontology breakdowns are returned only when expanded.
24402
+ */
24403
+ function GetStatistics(params) {
24404
+ return __awaiter(this, void 0, void 0, function* () {
24405
+ if (!params) {
24406
+ params = {};
24407
+ }
24408
+ let { api, req } = params;
24409
+ if (!api) {
24410
+ api = ENVIRONMENT.Api().GetBruceApi();
24411
+ }
24412
+ const url = BuildStatisticsUrl(params);
24413
+ const key = GetStatisticsCacheKey(params);
24414
+ const cache = api.GetCacheItem(key, req);
24415
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
24416
+ return cache.data;
24417
+ }
24418
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24419
+ try {
24420
+ const data = yield api.GET(url, Api.PrepReqParams(req));
24421
+ res(ParseStatisticsResponse(data));
24422
+ }
24423
+ catch (e) {
24424
+ rej(e);
24425
+ }
24426
+ }));
24427
+ api.SetCacheItem({ key, value: request, req });
24428
+ return request;
24429
+ });
24430
+ }
24431
+ WorkflowItem.GetStatistics = GetStatistics;
24399
24432
  function Create(params) {
24400
24433
  var _a, _b, _c, _d, _e;
24401
24434
  return __awaiter(this, void 0, void 0, function* () {
@@ -24468,6 +24501,8 @@ var WorkflowItem;
24468
24501
  appendParam(q, "itemtypeid", params === null || params === void 0 ? void 0 : params.itemTypeId);
24469
24502
  appendParam(q, "queueid", params === null || params === void 0 ? void 0 : params.queueId);
24470
24503
  appendParam(q, "scheduleid", (_a = params === null || params === void 0 ? void 0 : params.scheduleId) !== null && _a !== void 0 ? _a : params === null || params === void 0 ? void 0 : params.workflowScheduleId);
24504
+ appendParam(q, "Priority", params === null || params === void 0 ? void 0 : params.priority);
24505
+ appendParam(q, "ParentItemID", params === null || params === void 0 ? void 0 : params.parentItemId);
24471
24506
  appendParam(q, "statusid", params === null || params === void 0 ? void 0 : params.statusId);
24472
24507
  appendParam(q, "CreatedByUserID", params === null || params === void 0 ? void 0 : params.createdByUserId);
24473
24508
  appendParam(q, "DueDate", params === null || params === void 0 ? void 0 : params.dueDate);
@@ -24476,12 +24511,32 @@ var WorkflowItem;
24476
24511
  appendParam(q, "SlideID", params === null || params === void 0 ? void 0 : params.slideId);
24477
24512
  appendParam(q, "EntityID", params === null || params === void 0 ? void 0 : params.entityId);
24478
24513
  appendParam(q, "SubjectEntityID", params === null || params === void 0 ? void 0 : params.subjectEntityId);
24514
+ appendParam(q, "SubjectEntityTypeID", params === null || params === void 0 ? void 0 : params.subjectEntityTypeId);
24515
+ appendParam(q, "SubjectParentEntityTypeID", params === null || params === void 0 ? void 0 : params.subjectParentEntityTypeId);
24516
+ appendParam(q, "SubjectOntologyID", params === null || params === void 0 ? void 0 : params.subjectOntologyId);
24479
24517
  appendParam(q, "Description", params === null || params === void 0 ? void 0 : params.description);
24480
24518
  appendParam(q, "Search", params === null || params === void 0 ? void 0 : params.search);
24481
24519
  const qs = q.toString();
24482
24520
  return qs ? `workflow/itemsquery?${qs}` : "workflow/itemsquery";
24483
24521
  }
24484
24522
  WorkflowItem.BuildListUrl = BuildListUrl;
24523
+ function BuildStatisticsUrl(params) {
24524
+ const q = new URLSearchParams();
24525
+ appendParam(q, "itemtypeid", params === null || params === void 0 ? void 0 : params.itemTypeId);
24526
+ appendParam(q, "statusid", params === null || params === void 0 ? void 0 : params.statusId);
24527
+ appendParam(q, "queueid", params === null || params === void 0 ? void 0 : params.queueId);
24528
+ const expand = [];
24529
+ if (params === null || params === void 0 ? void 0 : params.expandParentEntityTypes) {
24530
+ expand.push("ParentEntityTypes");
24531
+ }
24532
+ if (params === null || params === void 0 ? void 0 : params.expandOntologies) {
24533
+ expand.push("Ontologies");
24534
+ }
24535
+ appendParam(q, "Expand", expand);
24536
+ const qs = q.toString();
24537
+ return qs ? `workflow/items/statistics?${qs}` : "workflow/items/statistics";
24538
+ }
24539
+ WorkflowItem.BuildStatisticsUrl = BuildStatisticsUrl;
24485
24540
  function ParseResponse(response) {
24486
24541
  var _a, _b, _c, _d;
24487
24542
  const parsed = parseObject$5(response);
@@ -24507,6 +24562,23 @@ var WorkflowItem;
24507
24562
  };
24508
24563
  }
24509
24564
  WorkflowItem.ParseListResponse = ParseListResponse;
24565
+ function ParseStatisticsResponse(response) {
24566
+ var _a, _b;
24567
+ const parsed = parseObject$5(response);
24568
+ 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;
24569
+ const source = (_b = parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed) !== null && _b !== void 0 ? _b : {};
24570
+ const result = {
24571
+ EntityTypes: Array.isArray(source.EntityTypes) ? source.EntityTypes : []
24572
+ };
24573
+ if (Array.isArray(source.ParentEntityTypes)) {
24574
+ result.ParentEntityTypes = source.ParentEntityTypes;
24575
+ }
24576
+ if (Array.isArray(source.Ontologies)) {
24577
+ result.Ontologies = source.Ontologies;
24578
+ }
24579
+ return result;
24580
+ }
24581
+ WorkflowItem.ParseStatisticsResponse = ParseStatisticsResponse;
24510
24582
  function GetCacheKey(id) {
24511
24583
  return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.Id}${id}`;
24512
24584
  }
@@ -24515,6 +24587,10 @@ var WorkflowItem;
24515
24587
  return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.ListId}${BuildListUrl(params)}`;
24516
24588
  }
24517
24589
  WorkflowItem.GetListCacheKey = GetListCacheKey;
24590
+ function GetStatisticsCacheKey(params) {
24591
+ return `${Api.ECacheKey.WorkflowItem}${Api.ECacheKey.ListId}${BuildStatisticsUrl(params)}`;
24592
+ }
24593
+ WorkflowItem.GetStatisticsCacheKey = GetStatisticsCacheKey;
24518
24594
  })(WorkflowItem || (WorkflowItem = {}));
24519
24595
  function appendParam(q, key, value) {
24520
24596
  if (value == null || value === "") {
@@ -25033,7 +25109,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
25033
25109
  }
25034
25110
 
25035
25111
  // This is updated with the package.json version on build.
25036
- const VERSION = "7.1.111";
25112
+ const VERSION = "7.1.113";
25037
25113
 
25038
25114
  export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, ClientFileValueMap, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, RequestLane, 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, EntityTypeSource, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportNsx, ExportUsd, Hexbin, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportTif, ImportedFile, Uploader, Markup, UIMarkup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, PluginAiTool, 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, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
25039
25115
  //# sourceMappingURL=bruce-models.es5.js.map