bruce-models 0.5.0 → 0.5.2
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 +26 -2
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +26 -2
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +2 -2
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/entity/entity.js +24 -0
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/types/entity/entity-relation.d.ts +1 -1
- package/dist/types/entity/entity.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -1231,6 +1231,30 @@ var Entity;
|
|
|
1231
1231
|
});
|
|
1232
1232
|
}
|
|
1233
1233
|
Entity.Delete = Delete;
|
|
1234
|
+
function DeleteList(api, entityIds) {
|
|
1235
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1236
|
+
var i, entityId;
|
|
1237
|
+
return __generator(this, function (_a) {
|
|
1238
|
+
switch (_a.label) {
|
|
1239
|
+
case 0:
|
|
1240
|
+
if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
|
|
1241
|
+
throw ("Entity IDs are required.");
|
|
1242
|
+
}
|
|
1243
|
+
return [4 /*yield*/, api.POST("deleteEntities", {
|
|
1244
|
+
Items: entityIds
|
|
1245
|
+
}, Api.PrepReqParams())];
|
|
1246
|
+
case 1:
|
|
1247
|
+
_a.sent();
|
|
1248
|
+
for (i = 0; i < entityIds.length; i++) {
|
|
1249
|
+
entityId = entityIds[i];
|
|
1250
|
+
api.Cache.Remove(GetCacheKey(entityId));
|
|
1251
|
+
}
|
|
1252
|
+
return [2 /*return*/];
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
Entity.DeleteList = DeleteList;
|
|
1234
1258
|
function Update(api, data, override) {
|
|
1235
1259
|
var _a, _b;
|
|
1236
1260
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2696,14 +2720,14 @@ var EntityRelation;
|
|
|
2696
2720
|
url = "entity/" + data["Principal.Entity.ID"] + "/relation/" + data["Relation.Type.ID"] + "/add";
|
|
2697
2721
|
return [4 /*yield*/, api.POST(url, reqData, Api.PrepReqParams())];
|
|
2698
2722
|
case 1:
|
|
2699
|
-
|
|
2723
|
+
_a.sent();
|
|
2700
2724
|
api.Cache.RemoveByStartsWith(Api.ECacheKey.Relation + Api.ECacheKey.Id + data["Principal.Entity.ID"]);
|
|
2701
2725
|
api.Cache.RemoveByStartsWith(Api.ECacheKey.Relation + Api.ECacheKey.Id + data["Related.Entity.ID"]);
|
|
2702
2726
|
api.Cache.RemoveByStartsWith(Api.ECacheKey.Relation + Api.ECacheKey.RelationType + Api.ECacheKey.Id + data["Relation.Type.ID"]);
|
|
2703
2727
|
if (data["Data.Entity.ID"]) {
|
|
2704
2728
|
api.Cache.RemoveByStartsWith(Api.ECacheKey.Relation + Api.ECacheKey.Entity + Api.ECacheKey.Id + data["Data.Entity.ID"]);
|
|
2705
2729
|
}
|
|
2706
|
-
return [2 /*return
|
|
2730
|
+
return [2 /*return*/];
|
|
2707
2731
|
}
|
|
2708
2732
|
});
|
|
2709
2733
|
});
|