bruce-models 7.1.17 → 7.1.19

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.
@@ -3876,7 +3876,15 @@
3876
3876
  });
3877
3877
  const cache = api.GetCacheItem(key, reqParams);
3878
3878
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
3879
- return cache.data;
3879
+ const cachedData = cache.data;
3880
+ if (cachedData instanceof Promise || (typeof cachedData === "object" && typeof cachedData.then === "function")) {
3881
+ return cachedData;
3882
+ }
3883
+ else {
3884
+ return Promise.resolve({
3885
+ entity: cachedData
3886
+ });
3887
+ }
3880
3888
  }
3881
3889
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
3882
3890
  try {
@@ -4155,8 +4163,10 @@
4155
4163
  const req = crashRiskReqs[i];
4156
4164
  try {
4157
4165
  const data = yield req;
4158
- if (data === null || data === void 0 ? void 0 : data.entity) {
4159
- entities.push(data.entity);
4166
+ // Handle both wrapped and direct-Entity blobs.
4167
+ const entity = (data === null || data === void 0 ? void 0 : data.entity) || ((data === null || data === void 0 ? void 0 : data.Bruce) ? data : null);
4168
+ if (entity) {
4169
+ entities.push(entity);
4160
4170
  }
4161
4171
  }
4162
4172
  catch (e) {
@@ -8289,7 +8299,10 @@
8289
8299
  */
8290
8300
  function Get(params) {
8291
8301
  return __awaiter(this, void 0, void 0, function* () {
8292
- let { api, entityTypeTriggerId, req: reqParams } = params;
8302
+ let { api, entityTypeId, entityTypeTriggerId, req: reqParams } = params;
8303
+ if (!entityTypeId) {
8304
+ throw ("Entity Type ID is required.");
8305
+ }
8293
8306
  if (entityTypeTriggerId == null || entityTypeTriggerId === "") {
8294
8307
  throw ("Entity Type Trigger ID is required.");
8295
8308
  }
@@ -8303,7 +8316,7 @@
8303
8316
  }
8304
8317
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
8305
8318
  try {
8306
- const data = yield api.GET(`entityTypeTrigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8319
+ const data = yield api.GET(`entityType/${entityTypeId}/trigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8307
8320
  res({
8308
8321
  trigger: ParseResponse(data)
8309
8322
  });
@@ -8327,14 +8340,17 @@
8327
8340
  */
8328
8341
  function Delete(params) {
8329
8342
  return __awaiter(this, void 0, void 0, function* () {
8330
- let { api, entityTypeTriggerId, req: reqParams } = params;
8343
+ let { api, entityTypeId, entityTypeTriggerId, req: reqParams } = params;
8344
+ if (!entityTypeId) {
8345
+ throw ("Entity Type ID is required.");
8346
+ }
8331
8347
  if (entityTypeTriggerId == null || entityTypeTriggerId === "") {
8332
8348
  throw ("Entity Type Trigger ID is required.");
8333
8349
  }
8334
8350
  if (!api) {
8335
8351
  api = exports.ENVIRONMENT.Api().GetBruceApi();
8336
8352
  }
8337
- yield api.DELETE(`entityTypeTrigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8353
+ yield api.DELETE(`entityType/${entityTypeId}/trigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8338
8354
  api.Cache.Remove(GetCacheKey(entityTypeTriggerId));
8339
8355
  api.Cache.RemoveByStartsWith(GetListCacheKey());
8340
8356
  });
@@ -8347,6 +8363,9 @@
8347
8363
  function GetList(params) {
8348
8364
  return __awaiter(this, void 0, void 0, function* () {
8349
8365
  let { api, entityTypeId, req: reqParams } = params;
8366
+ if (!entityTypeId) {
8367
+ throw ("Entity Type ID is required.");
8368
+ }
8350
8369
  if (!api) {
8351
8370
  api = exports.ENVIRONMENT.Api().GetBruceApi();
8352
8371
  }
@@ -8357,7 +8376,7 @@
8357
8376
  }
8358
8377
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
8359
8378
  try {
8360
- const data = yield api.GET(entityTypeId ? `entityType/${entityTypeId}/triggers` : "entityTypeTriggers", exports.Api.PrepReqParams(reqParams));
8379
+ const data = yield api.GET(`entityType/${entityTypeId}/triggers`, exports.Api.PrepReqParams(reqParams));
8361
8380
  res({
8362
8381
  triggers: ParseListResponse(data)
8363
8382
  });
@@ -17121,7 +17140,7 @@
17121
17140
  })(exports.ChangeSet || (exports.ChangeSet = {}));
17122
17141
 
17123
17142
  // This is updated with the package.json version on build.
17124
- const VERSION = "7.1.17";
17143
+ const VERSION = "7.1.19";
17125
17144
 
17126
17145
  exports.VERSION = VERSION;
17127
17146
  exports.AbstractApi = AbstractApi;