bruce-models 7.1.16 → 7.1.18

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.
@@ -8289,7 +8289,10 @@
8289
8289
  */
8290
8290
  function Get(params) {
8291
8291
  return __awaiter(this, void 0, void 0, function* () {
8292
- let { api, entityTypeTriggerId, req: reqParams } = params;
8292
+ let { api, entityTypeId, entityTypeTriggerId, req: reqParams } = params;
8293
+ if (!entityTypeId) {
8294
+ throw ("Entity Type ID is required.");
8295
+ }
8293
8296
  if (entityTypeTriggerId == null || entityTypeTriggerId === "") {
8294
8297
  throw ("Entity Type Trigger ID is required.");
8295
8298
  }
@@ -8303,7 +8306,7 @@
8303
8306
  }
8304
8307
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
8305
8308
  try {
8306
- const data = yield api.GET(`entityTypeTrigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8309
+ const data = yield api.GET(`entityType/${entityTypeId}/trigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8307
8310
  res({
8308
8311
  trigger: ParseResponse(data)
8309
8312
  });
@@ -8327,14 +8330,17 @@
8327
8330
  */
8328
8331
  function Delete(params) {
8329
8332
  return __awaiter(this, void 0, void 0, function* () {
8330
- let { api, entityTypeTriggerId, req: reqParams } = params;
8333
+ let { api, entityTypeId, entityTypeTriggerId, req: reqParams } = params;
8334
+ if (!entityTypeId) {
8335
+ throw ("Entity Type ID is required.");
8336
+ }
8331
8337
  if (entityTypeTriggerId == null || entityTypeTriggerId === "") {
8332
8338
  throw ("Entity Type Trigger ID is required.");
8333
8339
  }
8334
8340
  if (!api) {
8335
8341
  api = exports.ENVIRONMENT.Api().GetBruceApi();
8336
8342
  }
8337
- yield api.DELETE(`entityTypeTrigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8343
+ yield api.DELETE(`entityType/${entityTypeId}/trigger/${entityTypeTriggerId}`, exports.Api.PrepReqParams(reqParams));
8338
8344
  api.Cache.Remove(GetCacheKey(entityTypeTriggerId));
8339
8345
  api.Cache.RemoveByStartsWith(GetListCacheKey());
8340
8346
  });
@@ -8347,6 +8353,9 @@
8347
8353
  function GetList(params) {
8348
8354
  return __awaiter(this, void 0, void 0, function* () {
8349
8355
  let { api, entityTypeId, req: reqParams } = params;
8356
+ if (!entityTypeId) {
8357
+ throw ("Entity Type ID is required.");
8358
+ }
8350
8359
  if (!api) {
8351
8360
  api = exports.ENVIRONMENT.Api().GetBruceApi();
8352
8361
  }
@@ -8357,7 +8366,7 @@
8357
8366
  }
8358
8367
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
8359
8368
  try {
8360
- const data = yield api.GET(entityTypeId ? `entityType/${entityTypeId}/triggers` : "entityTypeTriggers", exports.Api.PrepReqParams(reqParams));
8369
+ const data = yield api.GET(`entityType/${entityTypeId}/triggers`, exports.Api.PrepReqParams(reqParams));
8361
8370
  res({
8362
8371
  triggers: ParseListResponse(data)
8363
8372
  });
@@ -8381,7 +8390,7 @@
8381
8390
  */
8382
8391
  function Update(params) {
8383
8392
  return __awaiter(this, void 0, void 0, function* () {
8384
- let { api, trigger: data, req: reqParams } = params;
8393
+ let { api, trigger: data, entityTypeId, req: reqParams } = params;
8385
8394
  if (!api) {
8386
8395
  api = exports.ENVIRONMENT.Api().GetBruceApi();
8387
8396
  }
@@ -8391,7 +8400,11 @@
8391
8400
  if (data.ID == null || data.ID === "") {
8392
8401
  data.ID = exports.ObjectUtils.UId();
8393
8402
  }
8394
- const res = yield api.POST(`entityTypeTrigger/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
8403
+ const typeId = entityTypeId !== null && entityTypeId !== void 0 ? entityTypeId : data["EntityType.ID"];
8404
+ if (!typeId) {
8405
+ throw ("Entity Type ID is required. Set trigger[\"EntityType.ID\"] or pass entityTypeId.");
8406
+ }
8407
+ const res = yield api.POST(`entityType/${typeId}/trigger/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
8395
8408
  api.Cache.Remove(GetCacheKey(data.ID));
8396
8409
  api.Cache.RemoveByStartsWith(GetListCacheKey());
8397
8410
  return {
@@ -17117,7 +17130,7 @@
17117
17130
  })(exports.ChangeSet || (exports.ChangeSet = {}));
17118
17131
 
17119
17132
  // This is updated with the package.json version on build.
17120
- const VERSION = "7.1.16";
17133
+ const VERSION = "7.1.18";
17121
17134
 
17122
17135
  exports.VERSION = VERSION;
17123
17136
  exports.AbstractApi = AbstractApi;