bruce-models 6.5.0 → 6.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.
@@ -2927,10 +2927,14 @@
2927
2927
  if (!data.Name) {
2928
2928
  data.Name = data.ID;
2929
2929
  }
2930
+ // Will not append if we're not updating schema (not specified).
2930
2931
  appendInternalAttrSchema(data);
2931
2932
  const res = yield api.POST(`entitytype/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
2932
2933
  api.Cache.RemoveByStartsWith(GetCacheKey(data.ID));
2933
2934
  api.Cache.RemoveByStartsWith(GetListCacheKey());
2935
+ // Useful to append afterwards as newly created Entity Types may have it missing.
2936
+ // This makes our UI apps not have to check for default attribute existence.
2937
+ appendInternalAttrSchema(res);
2934
2938
  return {
2935
2939
  entityType: res
2936
2940
  };
@@ -3075,6 +3079,16 @@
3075
3079
  bruce.Structure = [];
3076
3080
  }
3077
3081
  // Append any missing internal attributes.
3082
+ if (!bruce.Structure.find(x => x.Key == "ID")) {
3083
+ bruce.Structure.push({
3084
+ Key: "ID",
3085
+ Name: "ID",
3086
+ Description: "Unique identifier for the Entity.",
3087
+ Type: exports.EntityAttribute.EType.String,
3088
+ IsIndexed: true,
3089
+ IsImportant: true
3090
+ });
3091
+ }
3078
3092
  if (!bruce.Structure.find(x => x.Key == "Location")) {
3079
3093
  bruce.Structure.push({
3080
3094
  Key: "Location",
@@ -12423,6 +12437,7 @@
12423
12437
  if ((_c = (_b = session === null || session === void 0 ? void 0 : session.User) === null || _b === void 0 ? void 0 : _b.AccessPermissions) === null || _c === void 0 ? void 0 : _c.length) {
12424
12438
  for (let i = 0; i < session.User.AccessPermissions.length; i++) {
12425
12439
  const perms = session.User.AccessPermissions[i];
12440
+ let accIdChecked = false;
12426
12441
  // Newer API versions always specify accountId in the collections.
12427
12442
  // If it's set we can do a super account check early.
12428
12443
  if (perms["ClientAccount.ID"] != null) {
@@ -12430,13 +12445,14 @@
12430
12445
  if (pAccountId != exports.Api.SUPER_ACCOUNT_ID) {
12431
12446
  continue;
12432
12447
  }
12448
+ accIdChecked = true;
12433
12449
  }
12434
12450
  if ((_d = perms === null || perms === void 0 ? void 0 : perms.UserGroups) === null || _d === void 0 ? void 0 : _d.length) {
12435
12451
  for (let j = 0; j < perms.UserGroups.length; j++) {
12436
12452
  const group = perms.UserGroups[j];
12437
12453
  if (typeof group != "string") {
12438
12454
  const gAccountId = String(group["ClientAccount.ID"]).toLowerCase();
12439
- if (gAccountId != exports.Api.SUPER_ACCOUNT_ID) {
12455
+ if (gAccountId != exports.Api.SUPER_ACCOUNT_ID && !accIdChecked) {
12440
12456
  continue;
12441
12457
  }
12442
12458
  const features = group.Features;
@@ -15833,7 +15849,7 @@
15833
15849
  })(exports.Tracking || (exports.Tracking = {}));
15834
15850
 
15835
15851
  // This is updated with the package.json version on build.
15836
- const VERSION = "6.5.0";
15852
+ const VERSION = "6.5.2";
15837
15853
 
15838
15854
  exports.VERSION = VERSION;
15839
15855
  exports.AbstractApi = AbstractApi;