bruce-models 5.2.8 → 5.3.0
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 +57 -21
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +57 -21
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity.js +54 -19
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js +1 -0
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity.d.ts +4 -2
- package/dist/types/project/project-view-bookmark.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -3447,28 +3447,63 @@
|
|
|
3447
3447
|
* @returns
|
|
3448
3448
|
*/
|
|
3449
3449
|
function Update(params) {
|
|
3450
|
-
var _a, _b;
|
|
3451
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3452
|
-
let { api, entity: data, override, req: reqParams, migrated } = params;
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3450
|
+
var _a, _b, _c, _d, _e;
|
|
3451
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3452
|
+
let { api, entity: data, entities, override, req: reqParams, migrated } = params;
|
|
3453
|
+
// Bulk save.
|
|
3454
|
+
if ((entities === null || entities === void 0 ? void 0 : entities.length) && entities.length > 1) {
|
|
3455
|
+
// If the Entities don't have IDs, then they must have a Type ID.
|
|
3456
|
+
for (let i = 0; i < entities.length; i++) {
|
|
3457
|
+
const entity = entities[i];
|
|
3458
|
+
if (!((_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID) && !((_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b["EntityType.ID"])) {
|
|
3459
|
+
throw ("Entity Type ID is required for new Entity records.");
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
if (!api) {
|
|
3463
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
3464
|
+
}
|
|
3465
|
+
const reqUrl = `v3/entities`;
|
|
3466
|
+
const reqBody = {
|
|
3467
|
+
Items: entities,
|
|
3468
|
+
Override: override
|
|
3469
|
+
};
|
|
3470
|
+
const res = yield api.POST(reqUrl, reqBody, exports.Api.PrepReqParams(reqParams));
|
|
3471
|
+
entities = res.Items;
|
|
3472
|
+
for (let i = 0; i < entities.length; i++) {
|
|
3473
|
+
const entity = entities[i];
|
|
3474
|
+
const entityId = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.ID; // Should never be null.
|
|
3475
|
+
api.Cache.RemoveByContains(GetContainsKey(entityId));
|
|
3476
|
+
exports.EntityHistoricData.ClearCacheByEntityIds(api, [entityId]);
|
|
3477
|
+
}
|
|
3478
|
+
return {
|
|
3479
|
+
entities
|
|
3480
|
+
};
|
|
3461
3481
|
}
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3482
|
+
// Single save.
|
|
3483
|
+
else {
|
|
3484
|
+
if (!data && (entities === null || entities === void 0 ? void 0 : entities.length)) {
|
|
3485
|
+
data = entities[0];
|
|
3486
|
+
}
|
|
3487
|
+
if (!((_d = data === null || data === void 0 ? void 0 : data.Bruce) === null || _d === void 0 ? void 0 : _d["EntityType.ID"])) {
|
|
3488
|
+
throw ("Entity Type ID is required.");
|
|
3489
|
+
}
|
|
3490
|
+
if (!api) {
|
|
3491
|
+
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
3492
|
+
}
|
|
3493
|
+
if (!((_e = data === null || data === void 0 ? void 0 : data.Bruce) === null || _e === void 0 ? void 0 : _e.ID)) {
|
|
3494
|
+
data.Bruce = Object.assign(Object.assign({}, data.Bruce), { ID: exports.ObjectUtils.UId() });
|
|
3495
|
+
}
|
|
3496
|
+
let reqUrl = `entity/${data.Bruce.ID}/?dataoverride=${override}&BruceEntityType=${data.Bruce["EntityType.ID"]}`;
|
|
3497
|
+
if (migrated) {
|
|
3498
|
+
reqUrl += "&hasMigrated=true";
|
|
3499
|
+
}
|
|
3500
|
+
const res = yield api.POST(reqUrl, data, exports.Api.PrepReqParams(reqParams));
|
|
3501
|
+
api.Cache.RemoveByContains(GetContainsKey(data.Bruce.ID));
|
|
3502
|
+
exports.EntityHistoricData.ClearCacheByEntityIds(api, [data.Bruce.ID]);
|
|
3503
|
+
return {
|
|
3504
|
+
entity: res
|
|
3505
|
+
};
|
|
3465
3506
|
}
|
|
3466
|
-
const res = yield api.POST(reqUrl, data, exports.Api.PrepReqParams(reqParams));
|
|
3467
|
-
api.Cache.RemoveByContains(GetContainsKey(data.Bruce.ID));
|
|
3468
|
-
exports.EntityHistoricData.ClearCacheByEntityIds(api, [data.Bruce.ID]);
|
|
3469
|
-
return {
|
|
3470
|
-
entity: res
|
|
3471
|
-
};
|
|
3472
3507
|
});
|
|
3473
3508
|
}
|
|
3474
3509
|
Entity.Update = Update;
|
|
@@ -10016,6 +10051,7 @@
|
|
|
10016
10051
|
let EContentType;
|
|
10017
10052
|
(function (EContentType) {
|
|
10018
10053
|
EContentType["WEB_3D"] = "WEB_3D";
|
|
10054
|
+
EContentType["WEB_3D_SPLIT_PLUGIN"] = "WEB_3D_SPLIT_PLUGIN";
|
|
10019
10055
|
EContentType["IFRAME"] = "IFRAME";
|
|
10020
10056
|
})(EContentType = ProjectViewBookmark.EContentType || (ProjectViewBookmark.EContentType = {}));
|
|
10021
10057
|
/**
|
|
@@ -14334,7 +14370,7 @@
|
|
|
14334
14370
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
14335
14371
|
|
|
14336
14372
|
// This is updated with the package.json version on build.
|
|
14337
|
-
const VERSION = "5.
|
|
14373
|
+
const VERSION = "5.3.0";
|
|
14338
14374
|
|
|
14339
14375
|
exports.VERSION = VERSION;
|
|
14340
14376
|
exports.AbstractApi = AbstractApi;
|