bruce-models 7.1.112 → 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.
- package/dist/bruce-models.es5.js +75 -1
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +75 -1
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/workflow/workflow-item.js +74 -0
- package/dist/lib/workflow/workflow-item.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/workflow/workflow-item.d.ts +45 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -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* () {
|
|
@@ -24093,12 +24126,32 @@
|
|
|
24093
24126
|
appendParam(q, "SlideID", params === null || params === void 0 ? void 0 : params.slideId);
|
|
24094
24127
|
appendParam(q, "EntityID", params === null || params === void 0 ? void 0 : params.entityId);
|
|
24095
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);
|
|
24096
24132
|
appendParam(q, "Description", params === null || params === void 0 ? void 0 : params.description);
|
|
24097
24133
|
appendParam(q, "Search", params === null || params === void 0 ? void 0 : params.search);
|
|
24098
24134
|
const qs = q.toString();
|
|
24099
24135
|
return qs ? `workflow/itemsquery?${qs}` : "workflow/itemsquery";
|
|
24100
24136
|
}
|
|
24101
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;
|
|
24102
24155
|
function ParseResponse(response) {
|
|
24103
24156
|
var _a, _b, _c, _d;
|
|
24104
24157
|
const parsed = parseObject$5(response);
|
|
@@ -24124,6 +24177,23 @@
|
|
|
24124
24177
|
};
|
|
24125
24178
|
}
|
|
24126
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;
|
|
24127
24197
|
function GetCacheKey(id) {
|
|
24128
24198
|
return `${exports.Api.ECacheKey.WorkflowItem}${exports.Api.ECacheKey.Id}${id}`;
|
|
24129
24199
|
}
|
|
@@ -24132,6 +24202,10 @@
|
|
|
24132
24202
|
return `${exports.Api.ECacheKey.WorkflowItem}${exports.Api.ECacheKey.ListId}${BuildListUrl(params)}`;
|
|
24133
24203
|
}
|
|
24134
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;
|
|
24135
24209
|
})(exports.WorkflowItem || (exports.WorkflowItem = {}));
|
|
24136
24210
|
function appendParam(q, key, value) {
|
|
24137
24211
|
if (value == null || value === "") {
|
|
@@ -24644,7 +24718,7 @@
|
|
|
24644
24718
|
}
|
|
24645
24719
|
|
|
24646
24720
|
// This is updated with the package.json version on build.
|
|
24647
|
-
const VERSION = "7.1.
|
|
24721
|
+
const VERSION = "7.1.113";
|
|
24648
24722
|
|
|
24649
24723
|
exports.VERSION = VERSION;
|
|
24650
24724
|
exports.AbstractApi = AbstractApi;
|