bruce-models 2.0.4 → 2.0.5
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 +19 -7
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +19 -7
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/entity/entity.js +5 -5
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/server/pending-action.js +14 -2
- package/dist/lib/server/pending-action.js.map +1 -1
- package/dist/types/entity/entity.d.ts +4 -1
- package/dist/types/server/pending-action.d.ts +8 -1
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -1808,24 +1808,24 @@ var PathUtils;
|
|
|
1808
1808
|
*/
|
|
1809
1809
|
var Entity;
|
|
1810
1810
|
(function (Entity) {
|
|
1811
|
-
function GetCacheKey(entityId) {
|
|
1812
|
-
return `${Api.ECacheKey.Entity}${Api.ECacheKey.Id}${entityId}`;
|
|
1811
|
+
function GetCacheKey(entityId, expandLocation) {
|
|
1812
|
+
return `${Api.ECacheKey.Entity}${Api.ECacheKey.Id}${entityId}${String(Boolean(expandLocation))}`;
|
|
1813
1813
|
}
|
|
1814
1814
|
Entity.GetCacheKey = GetCacheKey;
|
|
1815
1815
|
function Get(params) {
|
|
1816
1816
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1817
|
-
const { api, entityId, req: reqParams } = params;
|
|
1817
|
+
const { api, entityId, req: reqParams, expandLocation } = params;
|
|
1818
1818
|
if (!entityId) {
|
|
1819
1819
|
throw ("Entity ID is required.");
|
|
1820
1820
|
}
|
|
1821
|
-
const key = GetCacheKey(entityId);
|
|
1821
|
+
const key = GetCacheKey(entityId, expandLocation);
|
|
1822
1822
|
const cacheData = api.GetCacheItem(key, reqParams);
|
|
1823
1823
|
if (cacheData) {
|
|
1824
1824
|
return cacheData;
|
|
1825
1825
|
}
|
|
1826
1826
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
1827
1827
|
try {
|
|
1828
|
-
const data = yield api.GET(`entity/${entityId}`, Api.PrepReqParams(reqParams));
|
|
1828
|
+
const data = yield api.GET(`entity/${entityId}${expandLocation ? "?$expand=location" : ""}`, Api.PrepReqParams(reqParams));
|
|
1829
1829
|
res({
|
|
1830
1830
|
entity: data
|
|
1831
1831
|
});
|
|
@@ -6451,6 +6451,13 @@ var PendingAction;
|
|
|
6451
6451
|
EStatus["Complete"] = "COMPLETE";
|
|
6452
6452
|
EStatus["Failed"] = "FAILED";
|
|
6453
6453
|
})(EStatus = PendingAction.EStatus || (PendingAction.EStatus = {}));
|
|
6454
|
+
let EMessageType;
|
|
6455
|
+
(function (EMessageType) {
|
|
6456
|
+
EMessageType["Warn"] = "WARNING";
|
|
6457
|
+
EMessageType["Error"] = "ERROR";
|
|
6458
|
+
EMessageType["Status"] = "STATUS";
|
|
6459
|
+
EMessageType["Info"] = "INFO";
|
|
6460
|
+
})(EMessageType = PendingAction.EMessageType || (PendingAction.EMessageType = {}));
|
|
6454
6461
|
function Get(params) {
|
|
6455
6462
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6456
6463
|
const { api, actionId, req: reqParams } = params;
|
|
@@ -6476,7 +6483,7 @@ var PendingAction;
|
|
|
6476
6483
|
PendingAction.GetRelevantList = GetRelevantList;
|
|
6477
6484
|
function GetMessages(params) {
|
|
6478
6485
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6479
|
-
let { api, actionId, order, startIndex, amount, req: reqParams } = params;
|
|
6486
|
+
let { api, actionId, order, startIndex, amount, req: reqParams, types } = params;
|
|
6480
6487
|
if (amount == null) {
|
|
6481
6488
|
amount = 500;
|
|
6482
6489
|
}
|
|
@@ -6486,7 +6493,12 @@ var PendingAction;
|
|
|
6486
6493
|
if (order == null) {
|
|
6487
6494
|
order = Api.ESortOrder.Asc;
|
|
6488
6495
|
}
|
|
6489
|
-
|
|
6496
|
+
let args = `?SortOrder=${order == Api.ESortOrder.Desc ? "DESC" : "ASC"}&PageSize=${amount}&PageIndex=${startIndex}`;
|
|
6497
|
+
if (types === null || types === void 0 ? void 0 : types.length) {
|
|
6498
|
+
for (let i = 0; i < types.length; i++) {
|
|
6499
|
+
args += `&Type=${types[i]}`;
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6490
6502
|
const data = yield api.GET(`pendingAction/${actionId}/progressMessages` + args, Api.PrepReqParams(reqParams));
|
|
6491
6503
|
return {
|
|
6492
6504
|
messages: data.Items
|