bruce-models 5.2.3 → 5.2.5

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.
@@ -1247,6 +1247,51 @@
1247
1247
  });
1248
1248
  });
1249
1249
  }
1250
+ /**
1251
+ * Version check that returns true if the version is at least the provided version.
1252
+ * @param version
1253
+ */
1254
+ IsVersionAtLeast(version) {
1255
+ if (!this.version) {
1256
+ return false;
1257
+ }
1258
+ // Debug.
1259
+ if (typeof this.version == "string" && this.version.toLowerCase().includes("debug")) {
1260
+ return true;
1261
+ }
1262
+ // Bad data.
1263
+ if (!this.version.includes(".")) {
1264
+ return false;
1265
+ }
1266
+ /**
1267
+ * Compares two arrays of version parts.
1268
+ * Returns -1 if `a` is less than `b`, 1 if `a` is greater than `b`, or 0 if they are equal.
1269
+ * @param a
1270
+ * @param b
1271
+ */
1272
+ function compareVersions(a, b) {
1273
+ for (let i = 0; i < a.length; i++) {
1274
+ if (a[i] < b[i]) {
1275
+ return -1;
1276
+ }
1277
+ else if (a[i] > b[i]) {
1278
+ return 1;
1279
+ }
1280
+ }
1281
+ return 0;
1282
+ }
1283
+ /**
1284
+ * Splits a version string into an array of version parts.
1285
+ * Example format: "1.0.4836".
1286
+ * @param version
1287
+ */
1288
+ function splitVersion(version) {
1289
+ return version.split(".").map(part => parseInt(part));
1290
+ }
1291
+ const curSplit = splitVersion(this.version);
1292
+ const reqSplit = splitVersion(version);
1293
+ return compareVersions(curSplit, reqSplit) >= 0;
1294
+ }
1250
1295
  }
1251
1296
  BruceApi.Api = Api$$1;
1252
1297
  })(exports.BruceApi || (exports.BruceApi = {}));
@@ -11015,6 +11060,27 @@
11015
11060
  });
11016
11061
  }
11017
11062
  Account.Create = Create;
11063
+ /**
11064
+ * Call to start a cleanup job. Do not start multiple cleanups at once.
11065
+ * @param params
11066
+ * @returns
11067
+ */
11068
+ function Cleanup(params) {
11069
+ return __awaiter(this, void 0, void 0, function* () {
11070
+ let { api, cleanTilesets, cleanPlugins, cleanLODs, cleanClientFiles } = params;
11071
+ if (!api) {
11072
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
11073
+ }
11074
+ const data = yield api.POST("cleanup", {
11075
+ "CleanTilesets": cleanTilesets,
11076
+ "CleanPlugins": cleanPlugins,
11077
+ "CleanLODs": cleanLODs,
11078
+ "CleanClientFiles": cleanClientFiles
11079
+ });
11080
+ return data;
11081
+ });
11082
+ }
11083
+ Account.Cleanup = Cleanup;
11018
11084
  /**
11019
11085
  * Returns cache identifier for an account by ID.
11020
11086
  * Example: {
@@ -14254,7 +14320,7 @@
14254
14320
  })(exports.DataSource || (exports.DataSource = {}));
14255
14321
 
14256
14322
  // This is updated with the package.json version on build.
14257
- const VERSION = "5.2.3";
14323
+ const VERSION = "5.2.5";
14258
14324
 
14259
14325
  exports.VERSION = VERSION;
14260
14326
  exports.AbstractApi = AbstractApi;