bruce-models 7.1.89 → 7.1.91

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.
@@ -4276,14 +4276,18 @@
4276
4276
  */
4277
4277
  function Delete(params) {
4278
4278
  return __awaiter(this, void 0, void 0, function* () {
4279
- let { api, assemblyId, req: reqParams } = params;
4279
+ let { api, assemblyId, deleteEmptyEntityTypes, req: reqParams } = params;
4280
4280
  if (!assemblyId) {
4281
4281
  throw ("Assembly ID is required.");
4282
4282
  }
4283
4283
  if (!api) {
4284
4284
  api = exports.ENVIRONMENT.Api().GetBruceApi();
4285
4285
  }
4286
- const res = yield api.DELETE(`v3/assembly/${assemblyId}`, exports.Api.PrepReqParams(reqParams));
4286
+ let url = `v3/assembly/${assemblyId}`;
4287
+ if (deleteEmptyEntityTypes) {
4288
+ url += "?DeleteEmptyEntityTypes=true";
4289
+ }
4290
+ const res = yield api.DELETE(url, exports.Api.PrepReqParams(reqParams));
4287
4291
  api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Assembly + exports.Api.ECacheKey.Id + assemblyId);
4288
4292
  return {
4289
4293
  action: res
@@ -4297,7 +4301,7 @@
4297
4301
  */
4298
4302
  function DeleteList(params) {
4299
4303
  return __awaiter(this, void 0, void 0, function* () {
4300
- let { api, req: reqParams, assemblyIds, lessThanSize, test } = params;
4304
+ let { api, req: reqParams, assemblyIds, lessThanSize, test, deleteEmptyEntityTypes } = params;
4301
4305
  if (!api) {
4302
4306
  api = exports.ENVIRONMENT.Api().GetBruceApi();
4303
4307
  }
@@ -4306,6 +4310,9 @@
4306
4310
  if (test) {
4307
4311
  urlParams.append("Test", "true");
4308
4312
  }
4313
+ if (deleteEmptyEntityTypes) {
4314
+ urlParams.append("DeleteEmptyEntityTypes", "true");
4315
+ }
4309
4316
  if (params.invalidRootIds) {
4310
4317
  urlParams.append("InvalidRootEntityID", "true");
4311
4318
  }
@@ -17435,6 +17442,96 @@
17435
17442
  ImportLcc.ImportEntities = ImportEntities;
17436
17443
  })(exports.ImportLcc || (exports.ImportLcc = {}));
17437
17444
 
17445
+ (function (ImportTif) {
17446
+ /**
17447
+ * A few vertical CRSs a user is likely to be choosing between. Any EPSG vertical code is
17448
+ * accepted, so this is a convenience rather than the permitted set.
17449
+ */
17450
+ let EVerticalDatum;
17451
+ (function (EVerticalDatum) {
17452
+ // Heights are already on the ellipsoid, or the source is not elevation.
17453
+ EVerticalDatum[EVerticalDatum["None"] = 0] = "None";
17454
+ EVerticalDatum[EVerticalDatum["NAVD88"] = 5703] = "NAVD88";
17455
+ EVerticalDatum[EVerticalDatum["EGM96"] = 5773] = "EGM96";
17456
+ EVerticalDatum[EVerticalDatum["EGM2008"] = 3855] = "EGM2008";
17457
+ EVerticalDatum[EVerticalDatum["NZVD2016"] = 7839] = "NZVD2016";
17458
+ })(EVerticalDatum = ImportTif.EVerticalDatum || (ImportTif.EVerticalDatum = {}));
17459
+ /**
17460
+ * Reads an analysis out of a completed Pending Action.
17461
+ * @param action the completed analyze action
17462
+ * @returns the result, or null when the action carries none
17463
+ */
17464
+ function ReadAnalysis(action) {
17465
+ if (!(action === null || action === void 0 ? void 0 : action.Result)) {
17466
+ return null;
17467
+ }
17468
+ try {
17469
+ const parsed = typeof action.Result === "string" ? JSON.parse(action.Result) : action.Result;
17470
+ // A successful action wraps its answer; older ones returned it bare.
17471
+ const result = (parsed === null || parsed === void 0 ? void 0 : parsed.success) && (parsed === null || parsed === void 0 ? void 0 : parsed.result) ? parsed.result : parsed;
17472
+ return result && typeof result === "object" ? result : null;
17473
+ }
17474
+ catch (_a) {
17475
+ return null;
17476
+ }
17477
+ }
17478
+ ImportTif.ReadAnalysis = ReadAnalysis;
17479
+ /**
17480
+ * Whether the user has to be asked what the heights are referenced to.
17481
+ * @param analysis the analysis result
17482
+ * @returns true for elevation that declares no vertical CRS
17483
+ */
17484
+ function NeedsVerticalDatum(analysis) {
17485
+ if (!analysis) {
17486
+ return false;
17487
+ }
17488
+ return (analysis.type === exports.Tileset.EType.Terrain) && (analysis.verticalDeclared !== true);
17489
+ }
17490
+ ImportTif.NeedsVerticalDatum = NeedsVerticalDatum;
17491
+ /**
17492
+ * Whether the user has to be asked which CRS the source is in.
17493
+ * @param analysis the analysis result
17494
+ * @returns true when no horizontal CRS could be resolved at all
17495
+ */
17496
+ function NeedsHorizontalCrs(analysis) {
17497
+ if (!analysis) {
17498
+ return false;
17499
+ }
17500
+ return !(analysis.epsg && analysis.epsg > 0);
17501
+ }
17502
+ ImportTif.NeedsHorizontalCrs = NeedsHorizontalCrs;
17503
+ /**
17504
+ * Starts an analysis of an uploaded raster.
17505
+ * @param params
17506
+ * @returns the Pending Action to poll
17507
+ */
17508
+ function Analyze(params) {
17509
+ return __awaiter(this, void 0, void 0, function* () {
17510
+ let { api, analyze, req: reqParams } = params;
17511
+ if (!api) {
17512
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17513
+ }
17514
+ return api.POST("import/analyze/tif", analyze, exports.Api.PrepReqParams(reqParams));
17515
+ });
17516
+ }
17517
+ ImportTif.Analyze = Analyze;
17518
+ /**
17519
+ * Imports an analysed raster: the API creates the tileset and starts generating it.
17520
+ * @param params
17521
+ * @returns the created tileset and the Pending Action to poll
17522
+ */
17523
+ function Import(params) {
17524
+ return __awaiter(this, void 0, void 0, function* () {
17525
+ let { api, fileImport, req: reqParams } = params;
17526
+ if (!api) {
17527
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17528
+ }
17529
+ return api.POST("import/tif", fileImport, exports.Api.PrepReqParams(reqParams));
17530
+ });
17531
+ }
17532
+ ImportTif.Import = Import;
17533
+ })(exports.ImportTif || (exports.ImportTif = {}));
17534
+
17438
17535
  (function (ImportedFile) {
17439
17536
  /**
17440
17537
  * Returns cache identifier for a imported file record.
@@ -22886,7 +22983,7 @@
22886
22983
  })(exports.UrlUtils || (exports.UrlUtils = {}));
22887
22984
 
22888
22985
  // This is updated with the package.json version on build.
22889
- const VERSION = "7.1.89";
22986
+ const VERSION = "7.1.91";
22890
22987
 
22891
22988
  exports.VERSION = VERSION;
22892
22989
  exports.AbstractApi = AbstractApi;