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.
@@ -3771,6 +3771,23 @@ var EntityRelation;
3771
3771
  });
3772
3772
  }
3773
3773
  EntityRelation.Create = Create;
3774
+ function Delete(params) {
3775
+ return __awaiter(this, void 0, void 0, function* () {
3776
+ const { api, principalEntityId, relatedEntityId, relationTypeId, req: reqParams } = params;
3777
+ if (!principalEntityId || !relatedEntityId || !relationTypeId) {
3778
+ throw new Error("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
3779
+ }
3780
+ const url = `entity/${principalEntityId}/relation/${relationTypeId}/delete`;
3781
+ yield api.POST(url, {
3782
+ "Related.Entity.ID": [relatedEntityId]
3783
+ }, Api.PrepReqParams(reqParams));
3784
+ // Remove related cache entries
3785
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.Relation + Api.ECacheKey.Id + principalEntityId);
3786
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.Relation + Api.ECacheKey.Id + relatedEntityId);
3787
+ api.Cache.RemoveByStartsWith(Api.ECacheKey.Relation + Api.ECacheKey.RelationType + Api.ECacheKey.Id + relationTypeId);
3788
+ });
3789
+ }
3790
+ EntityRelation.Delete = Delete;
3774
3791
  function Update(params) {
3775
3792
  return __awaiter(this, void 0, void 0, function* () {
3776
3793
  const { api, relation: data, req: reqParams } = params;