bruce-models 7.1.99 → 7.1.100

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.
@@ -1047,7 +1047,7 @@ function parseResult(data) {
1047
1047
  else if (encoding === "iso-8859-1") {
1048
1048
  encoding = "utf-8";
1049
1049
  }
1050
- if (type == "application/octet-stream" || type == "model/gltf-binary") {
1050
+ if (type == "application/octet-stream" || type == "model/gltf-binary" || type == "application/nsx") {
1051
1051
  if (encoding !== "utf-8") {
1052
1052
  console.warn("Binary data is being returned with an unexpected encoding:", encoding);
1053
1053
  }
@@ -17599,14 +17599,101 @@ var ExportNsx;
17599
17599
  */
17600
17600
  function AccountBackup(params) {
17601
17601
  return __awaiter(this, void 0, void 0, function* () {
17602
- let { api, req: reqParams } = params !== null && params !== void 0 ? params : {};
17602
+ let { api, backup, req: reqParams } = params !== null && params !== void 0 ? params : {};
17603
17603
  if (!api) {
17604
17604
  api = ENVIRONMENT.Api().GetBruceApi();
17605
17605
  }
17606
- return api.POST("export/nsx/accountBackup", {}, Api.PrepReqParams(reqParams));
17606
+ return api.POST("export/nsx/accountBackup", backup !== null && backup !== void 0 ? backup : {}, Api.PrepReqParams(reqParams));
17607
17607
  });
17608
17608
  }
17609
17609
  ExportNsx.AccountBackup = AccountBackup;
17610
+ /**
17611
+ * Returns available account backup files, including whole-account NSX backups.
17612
+ */
17613
+ function GetAccountBackupList(params) {
17614
+ return __awaiter(this, void 0, void 0, function* () {
17615
+ let { api, req: reqParams } = params !== null && params !== void 0 ? params : {};
17616
+ if (!api) {
17617
+ api = ENVIRONMENT.Api().GetBruceApi();
17618
+ }
17619
+ return api.GET("account/restoreList", Api.PrepReqParams(reqParams));
17620
+ });
17621
+ }
17622
+ ExportNsx.GetAccountBackupList = GetAccountBackupList;
17623
+ /**
17624
+ * Downloads a saved whole-account NSX backup file.
17625
+ */
17626
+ function DownloadAccountBackup(params) {
17627
+ return __awaiter(this, void 0, void 0, function* () {
17628
+ let { api, fileName, req: reqParams } = params;
17629
+ if (!fileName) {
17630
+ throw ("fileName is required.");
17631
+ }
17632
+ if (!api) {
17633
+ api = ENVIRONMENT.Api().GetBruceApi();
17634
+ }
17635
+ return api.GET(`account/backup/nsx/${encodeURIComponent(fileName)}`, Api.PrepReqParams(reqParams));
17636
+ });
17637
+ }
17638
+ ExportNsx.DownloadAccountBackup = DownloadAccountBackup;
17639
+ /**
17640
+ * Deletes a saved whole-account NSX backup file.
17641
+ */
17642
+ function DeleteAccountBackup(params) {
17643
+ return __awaiter(this, void 0, void 0, function* () {
17644
+ let { api, fileName, req: reqParams } = params;
17645
+ if (!fileName) {
17646
+ throw ("fileName is required.");
17647
+ }
17648
+ if (!api) {
17649
+ api = ENVIRONMENT.Api().GetBruceApi();
17650
+ }
17651
+ return api.DELETE(`account/backup/nsx/${encodeURIComponent(fileName)}`, Api.PrepReqParams(reqParams));
17652
+ });
17653
+ }
17654
+ ExportNsx.DeleteAccountBackup = DeleteAccountBackup;
17655
+ /**
17656
+ * Parses the completed Pending Action result from running AccountBackup.
17657
+ */
17658
+ function ParseAccountBackupResult(paResult) {
17659
+ var _a, _b, _c, _d, _e, _f, _g, _h;
17660
+ const parsed = parseObject(paResult);
17661
+ if (!parsed) {
17662
+ return {
17663
+ raw: null
17664
+ };
17665
+ }
17666
+ const resultSource = (parsed === null || parsed === void 0 ? void 0 : parsed.Result) != null ? parsed.Result : parsed;
17667
+ const rawResult = (_a = parseObject(resultSource)) !== null && _a !== void 0 ? _a : (typeof resultSource == "object" ? resultSource : null);
17668
+ const report = rawResult === null || rawResult === void 0 ? void 0 : rawResult.Report;
17669
+ return {
17670
+ accountId: (_b = rawResult === null || rawResult === void 0 ? void 0 : rawResult["Account.ID"]) !== null && _b !== void 0 ? _b : report === null || report === void 0 ? void 0 : report["Account.ID"],
17671
+ createdUtc: (_c = rawResult === null || rawResult === void 0 ? void 0 : rawResult["Created.UTC"]) !== null && _c !== void 0 ? _c : report === null || report === void 0 ? void 0 : report["Created.UTC"],
17672
+ fileName: (_d = rawResult === null || rawResult === void 0 ? void 0 : rawResult.FileName) !== null && _d !== void 0 ? _d : report === null || report === void 0 ? void 0 : report.FileName,
17673
+ storePath: (_e = rawResult === null || rawResult === void 0 ? void 0 : rawResult.StorePath) !== null && _e !== void 0 ? _e : report === null || report === void 0 ? void 0 : report.StorePath,
17674
+ sizeBytes: (_f = rawResult === null || rawResult === void 0 ? void 0 : rawResult["Size.Bytes"]) !== null && _f !== void 0 ? _f : report === null || report === void 0 ? void 0 : report["Size.Bytes"],
17675
+ downloadUrl: (_g = rawResult === null || rawResult === void 0 ? void 0 : rawResult["Download.URL"]) !== null && _g !== void 0 ? _g : report === null || report === void 0 ? void 0 : report["Download.URL"],
17676
+ message: (_h = rawResult === null || rawResult === void 0 ? void 0 : rawResult.Message) !== null && _h !== void 0 ? _h : report === null || report === void 0 ? void 0 : report.Message,
17677
+ report: report,
17678
+ stats: rawResult === null || rawResult === void 0 ? void 0 : rawResult.Stats,
17679
+ raw: rawResult
17680
+ };
17681
+ }
17682
+ ExportNsx.ParseAccountBackupResult = ParseAccountBackupResult;
17683
+ function parseObject(data) {
17684
+ if (data == null || data == undefined) {
17685
+ return null;
17686
+ }
17687
+ if (typeof data == "string") {
17688
+ try {
17689
+ return JSON.parse(data);
17690
+ }
17691
+ catch (_a) {
17692
+ return null;
17693
+ }
17694
+ }
17695
+ return data;
17696
+ }
17610
17697
  })(ExportNsx || (ExportNsx = {}));
17611
17698
 
17612
17699
  var ExportUsd;
@@ -21929,6 +22016,13 @@ var PendingAction;
21929
22016
  EStatus["Complete"] = "COMPLETE";
21930
22017
  EStatus["Failed"] = "FAILED";
21931
22018
  })(EStatus = PendingAction.EStatus || (PendingAction.EStatus = {}));
22019
+ /**
22020
+ * Available server-side Pending Action result encodings.
22021
+ */
22022
+ let EResultFormat;
22023
+ (function (EResultFormat) {
22024
+ EResultFormat["JSON"] = "JSON";
22025
+ })(EResultFormat = PendingAction.EResultFormat || (PendingAction.EResultFormat = {}));
21932
22026
  /**
21933
22027
  * Available message types.
21934
22028
  */
@@ -21946,14 +22040,20 @@ var PendingAction;
21946
22040
  */
21947
22041
  function Get(params) {
21948
22042
  return __awaiter(this, void 0, void 0, function* () {
21949
- let { api, actionId, req: reqParams } = params;
22043
+ let { api, actionId, result, req: reqParams } = params;
21950
22044
  if (!actionId) {
21951
22045
  throw ("Action ID is required.");
21952
22046
  }
21953
22047
  if (!api) {
21954
22048
  api = ENVIRONMENT.Api().GetBruceApi();
21955
22049
  }
21956
- const data = yield api.GET(`pendingAction/${actionId}`, Api.PrepReqParams(reqParams));
22050
+ let url = `pendingAction/${actionId}`;
22051
+ if (result) {
22052
+ const urlParams = new URLSearchParams();
22053
+ urlParams.append("Result", result);
22054
+ url += `?${urlParams.toString()}`;
22055
+ }
22056
+ const data = yield api.GET(url, Api.PrepReqParams(reqParams));
21957
22057
  return {
21958
22058
  action: data
21959
22059
  };
@@ -22100,7 +22200,7 @@ var PendingAction;
22100
22200
  */
22101
22201
  function OnCompletion(params) {
22102
22202
  return __awaiter(this, void 0, void 0, function* () {
22103
- let { api, actionId, req: reqParams, interval: intMs, isDisposed, onMessage } = params;
22203
+ let { api, actionId, req: reqParams, interval: intMs, isDisposed, onMessage, result } = params;
22104
22204
  if (!actionId) {
22105
22205
  throw ("Action ID is required.");
22106
22206
  }
@@ -22153,6 +22253,7 @@ var PendingAction;
22153
22253
  const { action } = yield Get({
22154
22254
  api,
22155
22255
  actionId,
22256
+ result,
22156
22257
  req: reqParams
22157
22258
  });
22158
22259
  if (action.Status !== EStatus.InProgress) {
@@ -23968,7 +24069,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
23968
24069
  }
23969
24070
 
23970
24071
  // This is updated with the package.json version on build.
23971
- const VERSION = "7.1.99";
24072
+ const VERSION = "7.1.100";
23972
24073
 
23973
24074
  export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, ClientFileValueMap, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeRelation, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportNsx, ExportUsd, Hexbin, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportTif, ImportedFile, Uploader, Markup, UIMarkup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, PluginAiTool, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowType, WorkflowItemType };
23974
24075
  //# sourceMappingURL=bruce-models.es5.js.map