bruce-models 2.0.2 → 2.0.4

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.
@@ -3684,6 +3684,23 @@
3684
3684
  });
3685
3685
  }
3686
3686
  EntityRelation.Create = Create;
3687
+ function Delete(params) {
3688
+ return __awaiter(this, void 0, void 0, function* () {
3689
+ const { api, principalEntityId, relatedEntityId, relationTypeId, req: reqParams } = params;
3690
+ if (!principalEntityId || !relatedEntityId || !relationTypeId) {
3691
+ throw new Error("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
3692
+ }
3693
+ const url = `entity/${principalEntityId}/relation/${relationTypeId}/delete`;
3694
+ yield api.POST(url, {
3695
+ "Related.Entity.ID": [relatedEntityId]
3696
+ }, exports.Api.PrepReqParams(reqParams));
3697
+ // Remove related cache entries
3698
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + principalEntityId);
3699
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + relatedEntityId);
3700
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.RelationType + exports.Api.ECacheKey.Id + relationTypeId);
3701
+ });
3702
+ }
3703
+ EntityRelation.Delete = Delete;
3687
3704
  function Update(params) {
3688
3705
  return __awaiter(this, void 0, void 0, function* () {
3689
3706
  const { api, relation: data, req: reqParams } = params;