bruce-models 4.4.6 → 4.4.8

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.
@@ -2923,21 +2923,42 @@
2923
2923
  }
2924
2924
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
2925
2925
  try {
2926
- const urlParams = new URLSearchParams();
2927
- if (parentTypeId) {
2928
- urlParams.append("parentEntityTypeID", parentTypeId);
2929
- }
2926
+ // If we have an array of typeIds then we'll request in batches to avoid overflowing the URL.
2927
+ const BATCH_SIZE = 20;
2928
+ const reqs = [];
2930
2929
  if (entityTypeIds) {
2931
- for (const id of entityTypeIds) {
2932
- urlParams.append("typeId", id);
2930
+ for (let i = 0; i < entityTypeIds.length; i += BATCH_SIZE) {
2931
+ const batch = entityTypeIds.slice(i, i + BATCH_SIZE);
2932
+ const urlParams = new URLSearchParams();
2933
+ for (const id of batch) {
2934
+ urlParams.append("typeId", id);
2935
+ }
2936
+ if (parentTypeId) {
2937
+ urlParams.append("parentEntityTypeID", parentTypeId);
2938
+ }
2939
+ reqs.push(api.GET("entitytypes?" + urlParams.toString(), exports.Api.PrepReqParams(reqParams)));
2940
+ }
2941
+ }
2942
+ else {
2943
+ const urlParams = new URLSearchParams();
2944
+ if (parentTypeId) {
2945
+ urlParams.append("parentEntityTypeID", parentTypeId);
2933
2946
  }
2947
+ reqs.push(api.GET("entitytypes?" + urlParams.toString(), exports.Api.PrepReqParams(reqParams)));
2934
2948
  }
2935
- const data = yield api.GET("entitytypes?" + urlParams.toString(), exports.Api.PrepReqParams(reqParams));
2936
- for (const item of data.Items) {
2937
- appendInternalAttrSchema(item);
2949
+ const data = yield Promise.all(reqs);
2950
+ // Populate array, while checking for already added types.
2951
+ const types = [];
2952
+ for (const item of data) {
2953
+ for (const type of item.Items) {
2954
+ appendInternalAttrSchema(type);
2955
+ if (!types.find(x => x.ID == type.ID)) {
2956
+ types.push(type);
2957
+ }
2958
+ }
2938
2959
  }
2939
2960
  res({
2940
- entityTypes: data.Items
2961
+ entityTypes: types
2941
2962
  });
2942
2963
  }
2943
2964
  catch (e) {
@@ -9881,6 +9902,15 @@
9881
9902
  // This is the expected default version for the DataVersion value.
9882
9903
  // This value should NOT be changed without looking at our API and seeing what the default value is.
9883
9904
  ProjectViewBookmark.DEFAULT_DATA_VERSION = 2;
9905
+ /**
9906
+ * Describes the content of a bookmark.
9907
+ * As part of a deal we've been commissioned to create an alternative bookmark type to embed content.
9908
+ */
9909
+ let EContentType;
9910
+ (function (EContentType) {
9911
+ EContentType["WEB_3D"] = "WEB_3D";
9912
+ EContentType["IFRAME"] = "IFRAME";
9913
+ })(EContentType = ProjectViewBookmark.EContentType || (ProjectViewBookmark.EContentType = {}));
9884
9914
  /**
9885
9915
  * Gets a bookmark record.
9886
9916
  * @param params
@@ -12398,7 +12428,7 @@
12398
12428
  */
12399
12429
  function Run(params) {
12400
12430
  return __awaiter(this, void 0, void 0, function* () {
12401
- let { api, query, key, skip, load, req: reqParams, migrated } = params;
12431
+ let { api, query, key, skip, load, req: reqParams, migrated, analysis } = params;
12402
12432
  if (!api) {
12403
12433
  api = exports.ENVIRONMENT.Api().GetBruceApi();
12404
12434
  }
@@ -12411,12 +12441,20 @@
12411
12441
  if (!load) {
12412
12442
  load = 50;
12413
12443
  }
12414
- const req = api.POST(`entities/datalab/getMatchingEntities/${key}?skip=${skip}&load=${load}?hasMigrated=${Boolean(migrated)}`, query, exports.Api.PrepReqParams(reqParams));
12444
+ let url = null;
12445
+ if (analysis) {
12446
+ url = "entities/datalab/getMatchesCount/PrimarySelection";
12447
+ }
12448
+ else {
12449
+ url = `entities/datalab/getMatchingEntities/${key}?skip=${skip}&load=${load}&hasMigrated=${Boolean(migrated)}`;
12450
+ }
12451
+ const req = api.POST(url, query, exports.Api.PrepReqParams(reqParams));
12415
12452
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
12416
12453
  try {
12417
12454
  const data = yield req;
12418
12455
  res({
12419
- entities: data.Items
12456
+ entities: data.Items,
12457
+ totalCount: data.MatchesCount
12420
12458
  });
12421
12459
  }
12422
12460
  catch (e) {
@@ -13349,7 +13387,7 @@
13349
13387
  })(exports.DataSource || (exports.DataSource = {}));
13350
13388
 
13351
13389
  // This is updated with the package.json version on build.
13352
- const VERSION = "4.4.6";
13390
+ const VERSION = "4.4.8";
13353
13391
 
13354
13392
  exports.VERSION = VERSION;
13355
13393
  exports.AbstractApi = AbstractApi;