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.
@@ -1779,24 +1779,24 @@
1779
1779
  })(exports.PathUtils || (exports.PathUtils = {}));
1780
1780
 
1781
1781
  (function (Entity) {
1782
- function GetCacheKey(entityId) {
1783
- return `${exports.Api.ECacheKey.Entity}${exports.Api.ECacheKey.Id}${entityId}`;
1782
+ function GetCacheKey(entityId, expandLocation) {
1783
+ return `${exports.Api.ECacheKey.Entity}${exports.Api.ECacheKey.Id}${entityId}${String(Boolean(expandLocation))}`;
1784
1784
  }
1785
1785
  Entity.GetCacheKey = GetCacheKey;
1786
1786
  function Get(params) {
1787
1787
  return __awaiter(this, void 0, void 0, function* () {
1788
- const { api, entityId, req: reqParams } = params;
1788
+ const { api, entityId, req: reqParams, expandLocation } = params;
1789
1789
  if (!entityId) {
1790
1790
  throw ("Entity ID is required.");
1791
1791
  }
1792
- const key = GetCacheKey(entityId);
1792
+ const key = GetCacheKey(entityId, expandLocation);
1793
1793
  const cacheData = api.GetCacheItem(key, reqParams);
1794
1794
  if (cacheData) {
1795
1795
  return cacheData;
1796
1796
  }
1797
1797
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
1798
1798
  try {
1799
- const data = yield api.GET(`entity/${entityId}`, exports.Api.PrepReqParams(reqParams));
1799
+ const data = yield api.GET(`entity/${entityId}${expandLocation ? "?$expand=location" : ""}`, exports.Api.PrepReqParams(reqParams));
1800
1800
  res({
1801
1801
  entity: data
1802
1802
  });
@@ -6275,6 +6275,13 @@
6275
6275
  EStatus["Complete"] = "COMPLETE";
6276
6276
  EStatus["Failed"] = "FAILED";
6277
6277
  })(EStatus = PendingAction.EStatus || (PendingAction.EStatus = {}));
6278
+ let EMessageType;
6279
+ (function (EMessageType) {
6280
+ EMessageType["Warn"] = "WARNING";
6281
+ EMessageType["Error"] = "ERROR";
6282
+ EMessageType["Status"] = "STATUS";
6283
+ EMessageType["Info"] = "INFO";
6284
+ })(EMessageType = PendingAction.EMessageType || (PendingAction.EMessageType = {}));
6278
6285
  function Get(params) {
6279
6286
  return __awaiter(this, void 0, void 0, function* () {
6280
6287
  const { api, actionId, req: reqParams } = params;
@@ -6300,7 +6307,7 @@
6300
6307
  PendingAction.GetRelevantList = GetRelevantList;
6301
6308
  function GetMessages(params) {
6302
6309
  return __awaiter(this, void 0, void 0, function* () {
6303
- let { api, actionId, order, startIndex, amount, req: reqParams } = params;
6310
+ let { api, actionId, order, startIndex, amount, req: reqParams, types } = params;
6304
6311
  if (amount == null) {
6305
6312
  amount = 500;
6306
6313
  }
@@ -6310,7 +6317,12 @@
6310
6317
  if (order == null) {
6311
6318
  order = exports.Api.ESortOrder.Asc;
6312
6319
  }
6313
- const args = `?SortOrder=${order == exports.Api.ESortOrder.Desc ? "DESC" : "ASC"}&PageSize=${amount}&PageIndex=${startIndex}`;
6320
+ let args = `?SortOrder=${order == exports.Api.ESortOrder.Desc ? "DESC" : "ASC"}&PageSize=${amount}&PageIndex=${startIndex}`;
6321
+ if (types === null || types === void 0 ? void 0 : types.length) {
6322
+ for (let i = 0; i < types.length; i++) {
6323
+ args += `&Type=${types[i]}`;
6324
+ }
6325
+ }
6314
6326
  const data = yield api.GET(`pendingAction/${actionId}/progressMessages` + args, exports.Api.PrepReqParams(reqParams));
6315
6327
  return {
6316
6328
  messages: data.Items