bruce-models 3.9.6 → 3.9.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.
@@ -3276,7 +3276,7 @@
3276
3276
  */
3277
3277
  function GetListByIds(params) {
3278
3278
  return __awaiter(this, void 0, void 0, function* () {
3279
- let { api, entityIds, req: reqParams, expandRelations, expandLocation, historicFrom, historicKey, historicTo, historicPoint } = params;
3279
+ let { api, entityIds, schemaId, req: reqParams, expandRelations, expandLocation, historicFrom, historicKey, historicTo, historicPoint } = params;
3280
3280
  if (!entityIds.length) {
3281
3281
  throw ("Entity IDs are required.");
3282
3282
  }
@@ -3322,9 +3322,14 @@
3322
3322
  if (historicPoint) {
3323
3323
  reqData["historicPoint"] = historicPoint;
3324
3324
  }
3325
+ const urlParams = new URLSearchParams();
3326
+ if (schemaId) {
3327
+ urlParams.set("schema", schemaId);
3328
+ }
3329
+ const url = `entities?${urlParams.toString()}`;
3325
3330
  const reqs = [];
3326
3331
  if (reqIds.length > 0) {
3327
- const req = api.POST("entities", reqData, exports.Api.PrepReqParams(reqParams));
3332
+ const req = api.POST(url, reqData, exports.Api.PrepReqParams(reqParams));
3328
3333
  for (let i = 0; i < reqIds.length; i++) {
3329
3334
  const entityId = reqIds[i];
3330
3335
  const key = GetCacheKey({
@@ -3335,7 +3340,8 @@
3335
3340
  historicFrom: historicFrom,
3336
3341
  historicKey: historicKey,
3337
3342
  historicTo: historicTo,
3338
- historicPoint: historicPoint
3343
+ historicPoint: historicPoint,
3344
+ schemaId: schemaId
3339
3345
  });
3340
3346
  const prom = new Promise((res) => __awaiter(this, void 0, void 0, function* () {
3341
3347
  try {
@@ -3620,7 +3626,7 @@
3620
3626
  function GetList(params) {
3621
3627
  var _a;
3622
3628
  return __awaiter(this, void 0, void 0, function* () {
3623
- let { api, filter, req: reqParams, viaCdn, viaCdnCacheToken, analysis, expandRelations, historicFrom, historicKey, historicTo, historicPoint } = params;
3629
+ let { api, filter, schemaId, req: reqParams, viaCdn, viaCdnCacheToken, analysis, expandRelations, historicFrom, historicKey, historicTo, historicPoint } = params;
3624
3630
  if (!api) {
3625
3631
  api = exports.ENVIRONMENT.Api().GetBruceApi();
3626
3632
  }
@@ -3713,6 +3719,9 @@
3713
3719
  if (historicPoint) {
3714
3720
  urlParams.set("historicPoint", historicPoint);
3715
3721
  }
3722
+ if (schemaId) {
3723
+ urlParams.set("schema", schemaId);
3724
+ }
3716
3725
  const urlStr = url.toString() + "?" + urlParams.toString();
3717
3726
  const data = yield api.get(urlStr, exports.Api.PrepReqParams(reqParams));
3718
3727
  if (!analysis) {
@@ -3726,6 +3735,9 @@
3726
3735
  if (expandRelations) {
3727
3736
  urlParams.append("$expand", "relation");
3728
3737
  }
3738
+ if (schemaId) {
3739
+ urlParams.set("schema", schemaId);
3740
+ }
3729
3741
  const urlStr = url.toString() + "?" + urlParams.toString();
3730
3742
  const data = yield api.post(urlStr, body, exports.Api.PrepReqParams(reqParams));
3731
3743
  if (!analysis) {
@@ -3742,7 +3754,8 @@
3742
3754
  entityTypeId: filter.entityTypeId,
3743
3755
  historicFrom: historicFrom,
3744
3756
  historicKey: historicKey,
3745
- historicTo: historicTo
3757
+ historicTo: historicTo,
3758
+ schemaId: schemaId
3746
3759
  }),
3747
3760
  value: {
3748
3761
  entity: entity
@@ -7725,6 +7738,26 @@
7725
7738
  });
7726
7739
  }
7727
7740
  Tileset.DeleteFile = DeleteFile;
7741
+ /**
7742
+ * Deletes all files from a tileset.
7743
+ * @param params
7744
+ */
7745
+ function DeleteAllFiles(params) {
7746
+ return __awaiter(this, void 0, void 0, function* () {
7747
+ let { api, tilesetId, req } = params;
7748
+ if (!tilesetId) {
7749
+ throw ("Tileset ID is required.");
7750
+ }
7751
+ if (!api) {
7752
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
7753
+ }
7754
+ req = exports.Api.PrepReqParams(req);
7755
+ yield api.DELETE(`ui.tileset/${tilesetId}/files`, req);
7756
+ const cacheKey = `${exports.Api.ECacheKey.Tileset}${exports.Api.ECacheKey.Id}${tilesetId}`;
7757
+ api.Cache.RemoveByStartsWith(cacheKey);
7758
+ });
7759
+ }
7760
+ Tileset.DeleteAllFiles = DeleteAllFiles;
7728
7761
  /**
7729
7762
  * Uploads a file to a tileset.
7730
7763
  * Src files are used to generate tilesets.
@@ -11258,7 +11291,7 @@
11258
11291
  })(exports.DataSource || (exports.DataSource = {}));
11259
11292
 
11260
11293
  // This is updated with the package.json version on build.
11261
- const VERSION = "3.9.6";
11294
+ const VERSION = "3.9.8";
11262
11295
 
11263
11296
  exports.VERSION = VERSION;
11264
11297
  exports.AbstractApi = AbstractApi;