bruce-models 7.1.106 → 7.1.107

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.
@@ -1250,6 +1250,7 @@
1250
1250
  * This will NOT prepend the base URL to the provided URL.
1251
1251
  * @param url
1252
1252
  * @param params
1253
+ * @param data Optional request body.
1253
1254
  * @returns
1254
1255
  */
1255
1256
  get(url, params) {
@@ -1274,7 +1275,7 @@
1274
1275
  * @param params
1275
1276
  * @returns
1276
1277
  */
1277
- delete(url, params) {
1278
+ delete(url, params, data) {
1278
1279
  return __awaiter(this, void 0, void 0, function* () {
1279
1280
  if (!params) {
1280
1281
  params = {};
@@ -1282,9 +1283,13 @@
1282
1283
  params.headers = params.headers || {};
1283
1284
  params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
1284
1285
  this.applyAuthHeader(params.headers);
1286
+ if (data != null && typeof data != "string") {
1287
+ data = JSON.stringify(data);
1288
+ }
1285
1289
  const res = yield fetch(url, {
1286
1290
  headers: params.headers,
1287
1291
  method: "DELETE",
1292
+ body: data,
1288
1293
  signal: params.abortSignal
1289
1294
  });
1290
1295
  return parseResult(res);
@@ -1897,16 +1902,17 @@
1897
1902
  * This will prepend the base url to the url.
1898
1903
  * @param url
1899
1904
  * @param params
1905
+ * @param data Optional request body.
1900
1906
  * @returns
1901
1907
  */
1902
- DELETE(url, params) {
1908
+ DELETE(url, params, data) {
1903
1909
  return __awaiter(this, void 0, void 0, function* () {
1904
1910
  return new Promise((res, rej) => {
1905
1911
  this.loadProm.then(() => {
1906
1912
  const full = this.ConstructUrl({
1907
1913
  url: url
1908
1914
  });
1909
- this.delete(full, params).then(res).catch(rej);
1915
+ this.delete(full, params, data).then(res).catch(rej);
1910
1916
  }).catch(rej);
1911
1917
  });
1912
1918
  });
@@ -2722,6 +2728,19 @@
2722
2728
  });
2723
2729
  }
2724
2730
  Account.Cleanup = Cleanup;
2731
+ /**
2732
+ * Returns file counts and sizes for each storage category in the current account.
2733
+ */
2734
+ function GetFilesSummary(params) {
2735
+ return __awaiter(this, void 0, void 0, function* () {
2736
+ let { api, req: reqParams } = params !== null && params !== void 0 ? params : {};
2737
+ if (!api) {
2738
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
2739
+ }
2740
+ return api.GET("account/filesSummary", exports.Api.PrepReqParams(reqParams));
2741
+ });
2742
+ }
2743
+ Account.GetFilesSummary = GetFilesSummary;
2725
2744
  /**
2726
2745
  * Returns cache identifier for an account by ID.
2727
2746
  * Example: {
@@ -17603,6 +17622,11 @@
17603
17622
  })(exports.ExportCsv || (exports.ExportCsv = {}));
17604
17623
 
17605
17624
  (function (ExportNsx) {
17625
+ let EAccountBackupFileType;
17626
+ (function (EAccountBackupFileType) {
17627
+ EAccountBackupFileType["DatabaseDump"] = "DatabaseDump";
17628
+ EAccountBackupFileType["NSX"] = "NSX";
17629
+ })(EAccountBackupFileType = ExportNsx.EAccountBackupFileType || (ExportNsx.EAccountBackupFileType = {}));
17606
17630
  /**
17607
17631
  * Starts a whole-account NSX backup export job.
17608
17632
  * The generated NSX file is stored in the account's configured backup file store.
@@ -17630,6 +17654,38 @@
17630
17654
  });
17631
17655
  }
17632
17656
  ExportNsx.GetAccountBackupList = GetAccountBackupList;
17657
+ /**
17658
+ * Returns account database dump and NSX backup files with storage metadata.
17659
+ */
17660
+ function GetAccountBackupFilesList(params) {
17661
+ return __awaiter(this, void 0, void 0, function* () {
17662
+ let { api, req: reqParams } = params !== null && params !== void 0 ? params : {};
17663
+ if (!api) {
17664
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17665
+ }
17666
+ return api.GET("account/backupFilesList", exports.Api.PrepReqParams(reqParams));
17667
+ });
17668
+ }
17669
+ ExportNsx.GetAccountBackupFilesList = GetAccountBackupFilesList;
17670
+ /**
17671
+ * Deletes selected account database dump and NSX backup files.
17672
+ */
17673
+ function DeleteAccountBackupFiles(params) {
17674
+ return __awaiter(this, void 0, void 0, function* () {
17675
+ let { api, fileNames, req: reqParams } = params;
17676
+ if (!(fileNames === null || fileNames === void 0 ? void 0 : fileNames.length)) {
17677
+ throw new Error("At least one backup file name is required.");
17678
+ }
17679
+ if (!api) {
17680
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17681
+ }
17682
+ const data = {
17683
+ Files: fileNames
17684
+ };
17685
+ return api.DELETE("account/backupFiles", exports.Api.PrepReqParams(reqParams), data);
17686
+ });
17687
+ }
17688
+ ExportNsx.DeleteAccountBackupFiles = DeleteAccountBackupFiles;
17633
17689
  /**
17634
17690
  * Downloads a saved whole-account NSX backup file.
17635
17691
  */
@@ -24303,7 +24359,7 @@
24303
24359
  }
24304
24360
 
24305
24361
  // This is updated with the package.json version on build.
24306
- const VERSION = "7.1.106";
24362
+ const VERSION = "7.1.107";
24307
24363
 
24308
24364
  exports.VERSION = VERSION;
24309
24365
  exports.AbstractApi = AbstractApi;