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.
- package/dist/bruce-models.es5.js +17 -0
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +17 -0
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +17 -0
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/project/menu-item.js.map +1 -1
- package/dist/types/entity/entity-relation.d.ts +7 -0
- package/dist/types/project/menu-item.d.ts +2 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -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;
|