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.
@@ -24011,6 +24011,39 @@
24011
24011
  });
24012
24012
  }
24013
24013
  WorkflowItem.GetList = GetList;
24014
+ /**
24015
+ * Gets Workflow Item counts grouped by the Entity Types of their Subject Entities.
24016
+ * Parent Entity Type and Ontology breakdowns are returned only when expanded.
24017
+ */
24018
+ function GetStatistics(params) {
24019
+ return __awaiter(this, void 0, void 0, function* () {
24020
+ if (!params) {
24021
+ params = {};
24022
+ }
24023
+ let { api, req } = params;
24024
+ if (!api) {
24025
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
24026
+ }
24027
+ const url = BuildStatisticsUrl(params);
24028
+ const key = GetStatisticsCacheKey(params);
24029
+ const cache = api.GetCacheItem(key, req);
24030
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
24031
+ return cache.data;
24032
+ }
24033
+ const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24034
+ try {
24035
+ const data = yield api.GET(url, exports.Api.PrepReqParams(req));
24036
+ res(ParseStatisticsResponse(data));
24037
+ }
24038
+ catch (e) {
24039
+ rej(e);
24040
+ }
24041
+ }));
24042
+ api.SetCacheItem({ key, value: request, req });
24043
+ return request;
24044
+ });
24045
+ }
24046
+ WorkflowItem.GetStatistics = GetStatistics;
24014
24047
  function Create(params) {
24015
24048
  var _a, _b, _c, _d, _e;
24016
24049
  return __awaiter(this, void 0, void 0, function* () {
@@ -24083,6 +24116,8 @@
24083
24116
  appendParam(q, "itemtypeid", params === null || params === void 0 ? void 0 : params.itemTypeId);
24084
24117
  appendParam(q, "queueid", params === null || params === void 0 ? void 0 : params.queueId);
24085
24118
  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);
24119
+ appendParam(q, "Priority", params === null || params === void 0 ? void 0 : params.priority);
24120
+ appendParam(q, "ParentItemID", params === null || params === void 0 ? void 0 : params.parentItemId);
24086
24121
  appendParam(q, "statusid", params === null || params === void 0 ? void 0 : params.statusId);
24087
24122
  appendParam(q, "CreatedByUserID", params === null || params === void 0 ? void 0 : params.createdByUserId);
24088
24123
  appendParam(q, "DueDate", params === null || params === void 0 ? void 0 : params.dueDate);
@@ -24091,12 +24126,32 @@
24091
24126
  appendParam(q, "SlideID", params === null || params === void 0 ? void 0 : params.slideId);
24092
24127
  appendParam(q, "EntityID", params === null || params === void 0 ? void 0 : params.entityId);
24093
24128
  appendParam(q, "SubjectEntityID", params === null || params === void 0 ? void 0 : params.subjectEntityId);
24129
+ appendParam(q, "SubjectEntityTypeID", params === null || params === void 0 ? void 0 : params.subjectEntityTypeId);
24130
+ appendParam(q, "SubjectParentEntityTypeID", params === null || params === void 0 ? void 0 : params.subjectParentEntityTypeId);
24131
+ appendParam(q, "SubjectOntologyID", params === null || params === void 0 ? void 0 : params.subjectOntologyId);
24094
24132
  appendParam(q, "Description", params === null || params === void 0 ? void 0 : params.description);
24095
24133
  appendParam(q, "Search", params === null || params === void 0 ? void 0 : params.search);
24096
24134
  const qs = q.toString();
24097
24135
  return qs ? `workflow/itemsquery?${qs}` : "workflow/itemsquery";
24098
24136
  }
24099
24137
  WorkflowItem.BuildListUrl = BuildListUrl;
24138
+ function BuildStatisticsUrl(params) {
24139
+ const q = new URLSearchParams();
24140
+ appendParam(q, "itemtypeid", params === null || params === void 0 ? void 0 : params.itemTypeId);
24141
+ appendParam(q, "statusid", params === null || params === void 0 ? void 0 : params.statusId);
24142
+ appendParam(q, "queueid", params === null || params === void 0 ? void 0 : params.queueId);
24143
+ const expand = [];
24144
+ if (params === null || params === void 0 ? void 0 : params.expandParentEntityTypes) {
24145
+ expand.push("ParentEntityTypes");
24146
+ }
24147
+ if (params === null || params === void 0 ? void 0 : params.expandOntologies) {
24148
+ expand.push("Ontologies");
24149
+ }
24150
+ appendParam(q, "Expand", expand);
24151
+ const qs = q.toString();
24152
+ return qs ? `workflow/items/statistics?${qs}` : "workflow/items/statistics";
24153
+ }
24154
+ WorkflowItem.BuildStatisticsUrl = BuildStatisticsUrl;
24100
24155
  function ParseResponse(response) {
24101
24156
  var _a, _b, _c, _d;
24102
24157
  const parsed = parseObject$5(response);
@@ -24122,6 +24177,23 @@
24122
24177
  };
24123
24178
  }
24124
24179
  WorkflowItem.ParseListResponse = ParseListResponse;
24180
+ function ParseStatisticsResponse(response) {
24181
+ var _a, _b;
24182
+ const parsed = parseObject$5(response);
24183
+ 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;
24184
+ const source = (_b = parsedResult !== null && parsedResult !== void 0 ? parsedResult : parsed) !== null && _b !== void 0 ? _b : {};
24185
+ const result = {
24186
+ EntityTypes: Array.isArray(source.EntityTypes) ? source.EntityTypes : []
24187
+ };
24188
+ if (Array.isArray(source.ParentEntityTypes)) {
24189
+ result.ParentEntityTypes = source.ParentEntityTypes;
24190
+ }
24191
+ if (Array.isArray(source.Ontologies)) {
24192
+ result.Ontologies = source.Ontologies;
24193
+ }
24194
+ return result;
24195
+ }
24196
+ WorkflowItem.ParseStatisticsResponse = ParseStatisticsResponse;
24125
24197
  function GetCacheKey(id) {
24126
24198
  return `${exports.Api.ECacheKey.WorkflowItem}${exports.Api.ECacheKey.Id}${id}`;
24127
24199
  }
@@ -24130,6 +24202,10 @@
24130
24202
  return `${exports.Api.ECacheKey.WorkflowItem}${exports.Api.ECacheKey.ListId}${BuildListUrl(params)}`;
24131
24203
  }
24132
24204
  WorkflowItem.GetListCacheKey = GetListCacheKey;
24205
+ function GetStatisticsCacheKey(params) {
24206
+ return `${exports.Api.ECacheKey.WorkflowItem}${exports.Api.ECacheKey.ListId}${BuildStatisticsUrl(params)}`;
24207
+ }
24208
+ WorkflowItem.GetStatisticsCacheKey = GetStatisticsCacheKey;
24133
24209
  })(exports.WorkflowItem || (exports.WorkflowItem = {}));
24134
24210
  function appendParam(q, key, value) {
24135
24211
  if (value == null || value === "") {
@@ -24642,7 +24718,7 @@
24642
24718
  }
24643
24719
 
24644
24720
  // This is updated with the package.json version on build.
24645
- const VERSION = "7.1.111";
24721
+ const VERSION = "7.1.113";
24646
24722
 
24647
24723
  exports.VERSION = VERSION;
24648
24724
  exports.AbstractApi = AbstractApi;