bruce-models 7.1.99 → 7.1.101
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.
- package/dist/bruce-models.es5.js +146 -15
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +146 -15
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-concept.js +4 -0
- package/dist/lib/account/account-concept.js.map +1 -1
- package/dist/lib/api/abstract-api.js +1 -1
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/export/export-nsx.js +89 -2
- package/dist/lib/export/export-nsx.js.map +1 -1
- package/dist/lib/project/menu-item.js.map +1 -1
- package/dist/lib/server/pending-action.js +17 -3
- package/dist/lib/server/pending-action.js.map +1 -1
- package/dist/lib/server/record-change-feed.js +34 -8
- package/dist/lib/server/record-change-feed.js.map +1 -1
- package/dist/types/account/account-concept.d.ts +5 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/export/export-nsx.d.ts +88 -0
- package/dist/types/project/menu-item.d.ts +3 -0
- package/dist/types/server/pending-action.d.ts +14 -6
- package/dist/types/server/record-change-feed.d.ts +14 -3
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -364,6 +364,10 @@ var AccountConcept;
|
|
|
364
364
|
EConcept["UI_SLIDE"] = "pvs";
|
|
365
365
|
EConcept["UI_SLIDE_GROUP"] = "sg";
|
|
366
366
|
EConcept["UI_TABLE_VIEW"] = "tv";
|
|
367
|
+
EConcept["WORKFLOW_ITEM"] = "wi";
|
|
368
|
+
EConcept["WORKFLOW_ITEM_STATUS"] = "wis";
|
|
369
|
+
EConcept["WORKFLOW_ITEM_TYPE"] = "wit";
|
|
370
|
+
EConcept["WORKFLOW_QUEUE"] = "wq";
|
|
367
371
|
})(EConcept = AccountConcept.EConcept || (AccountConcept.EConcept = {}));
|
|
368
372
|
let EAction;
|
|
369
373
|
(function (EAction) {
|
|
@@ -584,14 +588,17 @@ var RecordChangeFeed;
|
|
|
584
588
|
};
|
|
585
589
|
};
|
|
586
590
|
/**
|
|
587
|
-
* Returns true if the given
|
|
591
|
+
* Returns true if the given internal ID falls within the reported range string.
|
|
592
|
+
*
|
|
593
|
+
* Every concept whose records carry a numeric identity reports them this way, as runs rather than
|
|
594
|
+
* as one ID per record, so that a change touching thousands of rows is still a short message.
|
|
588
595
|
*
|
|
589
596
|
* @example
|
|
590
|
-
*
|
|
591
|
-
*
|
|
597
|
+
* isInternalIdInRangeString("100-200,305,400-450", 150) // true
|
|
598
|
+
* isInternalIdInRangeString("100-200,305,400-450", 301) // false
|
|
592
599
|
*/
|
|
593
|
-
RecordChangeFeed.
|
|
594
|
-
if (!rangeString || !Number.isInteger(
|
|
600
|
+
RecordChangeFeed.isInternalIdInRangeString = (rangeString, internalId) => {
|
|
601
|
+
if (!rangeString || !Number.isInteger(internalId)) {
|
|
595
602
|
return false;
|
|
596
603
|
}
|
|
597
604
|
for (const part of rangeString.split(",")) {
|
|
@@ -607,12 +614,20 @@ var RecordChangeFeed;
|
|
|
607
614
|
}
|
|
608
615
|
const min = Math.min(start, end);
|
|
609
616
|
const max = Math.max(start, end);
|
|
610
|
-
if (
|
|
617
|
+
if (internalId >= min && internalId <= max) {
|
|
611
618
|
return true;
|
|
612
619
|
}
|
|
613
620
|
}
|
|
614
621
|
return false;
|
|
615
622
|
};
|
|
623
|
+
/**
|
|
624
|
+
* Returns true if the given Entity internal ID falls within the reported range string.
|
|
625
|
+
*
|
|
626
|
+
* The Entity-named form of {@link isInternalIdInRangeString}, kept because it is what the Entity
|
|
627
|
+
* callers already read as. Ranges are not an Entity idea: a Workflow Item reports its own IDs the
|
|
628
|
+
* same way.
|
|
629
|
+
*/
|
|
630
|
+
RecordChangeFeed.isEntityInternalIdInRangeString = (rangeString, entityInternalId) => RecordChangeFeed.isInternalIdInRangeString(rangeString, entityInternalId);
|
|
616
631
|
/**
|
|
617
632
|
* Returns true if the given record ID appears in a comma-separated list string.
|
|
618
633
|
*
|
|
@@ -820,8 +835,23 @@ var RecordChangeFeed;
|
|
|
820
835
|
}
|
|
821
836
|
const isEntityConcept = event.concept === ENTITY_CONCEPT;
|
|
822
837
|
if (!isEntityConcept && params.recordId !== undefined) {
|
|
823
|
-
const
|
|
824
|
-
|
|
838
|
+
const data = typeof event.data === "string" ? event.data : "";
|
|
839
|
+
const numericId = Number(params.recordId);
|
|
840
|
+
const isNumericIdentity = Number.isInteger(numericId)
|
|
841
|
+
&& String(params.recordId).trim() === String(numericId);
|
|
842
|
+
/*
|
|
843
|
+
* A NUMERIC identity is reported as runs, so it is matched against the runs: a Workflow
|
|
844
|
+
* Item asking about ID 7 has to see itself in "5-9" and not only in a list that spells
|
|
845
|
+
* out every ID. Matching runs still finds a plain numeric ID, since one ID is a run of
|
|
846
|
+
* one, so this is what every numeric concept wants.
|
|
847
|
+
*
|
|
848
|
+
* A STRING identity (a Bookmark, a Project View) has no runs to fall inside and arrives
|
|
849
|
+
* as a plain list, which is matched as one.
|
|
850
|
+
*/
|
|
851
|
+
const matched = isNumericIdentity
|
|
852
|
+
? RecordChangeFeed.isInternalIdInRangeString(data, numericId)
|
|
853
|
+
: RecordChangeFeed.isRecordIdInListString(data, params.recordId);
|
|
854
|
+
if (!matched) {
|
|
825
855
|
return false;
|
|
826
856
|
}
|
|
827
857
|
}
|
|
@@ -1047,7 +1077,7 @@ function parseResult(data) {
|
|
|
1047
1077
|
else if (encoding === "iso-8859-1") {
|
|
1048
1078
|
encoding = "utf-8";
|
|
1049
1079
|
}
|
|
1050
|
-
if (type == "application/octet-stream" || type == "model/gltf-binary") {
|
|
1080
|
+
if (type == "application/octet-stream" || type == "model/gltf-binary" || type == "application/nsx") {
|
|
1051
1081
|
if (encoding !== "utf-8") {
|
|
1052
1082
|
console.warn("Binary data is being returned with an unexpected encoding:", encoding);
|
|
1053
1083
|
}
|
|
@@ -17599,14 +17629,101 @@ var ExportNsx;
|
|
|
17599
17629
|
*/
|
|
17600
17630
|
function AccountBackup(params) {
|
|
17601
17631
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17602
|
-
let { api, req: reqParams } = params !== null && params !== void 0 ? params : {};
|
|
17632
|
+
let { api, backup, req: reqParams } = params !== null && params !== void 0 ? params : {};
|
|
17603
17633
|
if (!api) {
|
|
17604
17634
|
api = ENVIRONMENT.Api().GetBruceApi();
|
|
17605
17635
|
}
|
|
17606
|
-
return api.POST("export/nsx/accountBackup", {}, Api.PrepReqParams(reqParams));
|
|
17636
|
+
return api.POST("export/nsx/accountBackup", backup !== null && backup !== void 0 ? backup : {}, Api.PrepReqParams(reqParams));
|
|
17607
17637
|
});
|
|
17608
17638
|
}
|
|
17609
17639
|
ExportNsx.AccountBackup = AccountBackup;
|
|
17640
|
+
/**
|
|
17641
|
+
* Returns available account backup files, including whole-account NSX backups.
|
|
17642
|
+
*/
|
|
17643
|
+
function GetAccountBackupList(params) {
|
|
17644
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17645
|
+
let { api, req: reqParams } = params !== null && params !== void 0 ? params : {};
|
|
17646
|
+
if (!api) {
|
|
17647
|
+
api = ENVIRONMENT.Api().GetBruceApi();
|
|
17648
|
+
}
|
|
17649
|
+
return api.GET("account/restoreList", Api.PrepReqParams(reqParams));
|
|
17650
|
+
});
|
|
17651
|
+
}
|
|
17652
|
+
ExportNsx.GetAccountBackupList = GetAccountBackupList;
|
|
17653
|
+
/**
|
|
17654
|
+
* Downloads a saved whole-account NSX backup file.
|
|
17655
|
+
*/
|
|
17656
|
+
function DownloadAccountBackup(params) {
|
|
17657
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17658
|
+
let { api, fileName, req: reqParams } = params;
|
|
17659
|
+
if (!fileName) {
|
|
17660
|
+
throw ("fileName is required.");
|
|
17661
|
+
}
|
|
17662
|
+
if (!api) {
|
|
17663
|
+
api = ENVIRONMENT.Api().GetBruceApi();
|
|
17664
|
+
}
|
|
17665
|
+
return api.GET(`account/backup/nsx/${encodeURIComponent(fileName)}`, Api.PrepReqParams(reqParams));
|
|
17666
|
+
});
|
|
17667
|
+
}
|
|
17668
|
+
ExportNsx.DownloadAccountBackup = DownloadAccountBackup;
|
|
17669
|
+
/**
|
|
17670
|
+
* Deletes a saved whole-account NSX backup file.
|
|
17671
|
+
*/
|
|
17672
|
+
function DeleteAccountBackup(params) {
|
|
17673
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17674
|
+
let { api, fileName, req: reqParams } = params;
|
|
17675
|
+
if (!fileName) {
|
|
17676
|
+
throw ("fileName is required.");
|
|
17677
|
+
}
|
|
17678
|
+
if (!api) {
|
|
17679
|
+
api = ENVIRONMENT.Api().GetBruceApi();
|
|
17680
|
+
}
|
|
17681
|
+
return api.DELETE(`account/backup/nsx/${encodeURIComponent(fileName)}`, Api.PrepReqParams(reqParams));
|
|
17682
|
+
});
|
|
17683
|
+
}
|
|
17684
|
+
ExportNsx.DeleteAccountBackup = DeleteAccountBackup;
|
|
17685
|
+
/**
|
|
17686
|
+
* Parses the completed Pending Action result from running AccountBackup.
|
|
17687
|
+
*/
|
|
17688
|
+
function ParseAccountBackupResult(paResult) {
|
|
17689
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
17690
|
+
const parsed = parseObject(paResult);
|
|
17691
|
+
if (!parsed) {
|
|
17692
|
+
return {
|
|
17693
|
+
raw: null
|
|
17694
|
+
};
|
|
17695
|
+
}
|
|
17696
|
+
const resultSource = (parsed === null || parsed === void 0 ? void 0 : parsed.Result) != null ? parsed.Result : parsed;
|
|
17697
|
+
const rawResult = (_a = parseObject(resultSource)) !== null && _a !== void 0 ? _a : (typeof resultSource == "object" ? resultSource : null);
|
|
17698
|
+
const report = rawResult === null || rawResult === void 0 ? void 0 : rawResult.Report;
|
|
17699
|
+
return {
|
|
17700
|
+
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"],
|
|
17701
|
+
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"],
|
|
17702
|
+
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,
|
|
17703
|
+
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,
|
|
17704
|
+
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"],
|
|
17705
|
+
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"],
|
|
17706
|
+
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,
|
|
17707
|
+
report: report,
|
|
17708
|
+
stats: rawResult === null || rawResult === void 0 ? void 0 : rawResult.Stats,
|
|
17709
|
+
raw: rawResult
|
|
17710
|
+
};
|
|
17711
|
+
}
|
|
17712
|
+
ExportNsx.ParseAccountBackupResult = ParseAccountBackupResult;
|
|
17713
|
+
function parseObject(data) {
|
|
17714
|
+
if (data == null || data == undefined) {
|
|
17715
|
+
return null;
|
|
17716
|
+
}
|
|
17717
|
+
if (typeof data == "string") {
|
|
17718
|
+
try {
|
|
17719
|
+
return JSON.parse(data);
|
|
17720
|
+
}
|
|
17721
|
+
catch (_a) {
|
|
17722
|
+
return null;
|
|
17723
|
+
}
|
|
17724
|
+
}
|
|
17725
|
+
return data;
|
|
17726
|
+
}
|
|
17610
17727
|
})(ExportNsx || (ExportNsx = {}));
|
|
17611
17728
|
|
|
17612
17729
|
var ExportUsd;
|
|
@@ -21929,6 +22046,13 @@ var PendingAction;
|
|
|
21929
22046
|
EStatus["Complete"] = "COMPLETE";
|
|
21930
22047
|
EStatus["Failed"] = "FAILED";
|
|
21931
22048
|
})(EStatus = PendingAction.EStatus || (PendingAction.EStatus = {}));
|
|
22049
|
+
/**
|
|
22050
|
+
* Available server-side Pending Action result encodings.
|
|
22051
|
+
*/
|
|
22052
|
+
let EResultFormat;
|
|
22053
|
+
(function (EResultFormat) {
|
|
22054
|
+
EResultFormat["JSON"] = "JSON";
|
|
22055
|
+
})(EResultFormat = PendingAction.EResultFormat || (PendingAction.EResultFormat = {}));
|
|
21932
22056
|
/**
|
|
21933
22057
|
* Available message types.
|
|
21934
22058
|
*/
|
|
@@ -21946,14 +22070,20 @@ var PendingAction;
|
|
|
21946
22070
|
*/
|
|
21947
22071
|
function Get(params) {
|
|
21948
22072
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21949
|
-
let { api, actionId, req: reqParams } = params;
|
|
22073
|
+
let { api, actionId, result, req: reqParams } = params;
|
|
21950
22074
|
if (!actionId) {
|
|
21951
22075
|
throw ("Action ID is required.");
|
|
21952
22076
|
}
|
|
21953
22077
|
if (!api) {
|
|
21954
22078
|
api = ENVIRONMENT.Api().GetBruceApi();
|
|
21955
22079
|
}
|
|
21956
|
-
|
|
22080
|
+
let url = `pendingAction/${actionId}`;
|
|
22081
|
+
if (result) {
|
|
22082
|
+
const urlParams = new URLSearchParams();
|
|
22083
|
+
urlParams.append("Result", result);
|
|
22084
|
+
url += `?${urlParams.toString()}`;
|
|
22085
|
+
}
|
|
22086
|
+
const data = yield api.GET(url, Api.PrepReqParams(reqParams));
|
|
21957
22087
|
return {
|
|
21958
22088
|
action: data
|
|
21959
22089
|
};
|
|
@@ -22100,7 +22230,7 @@ var PendingAction;
|
|
|
22100
22230
|
*/
|
|
22101
22231
|
function OnCompletion(params) {
|
|
22102
22232
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22103
|
-
let { api, actionId, req: reqParams, interval: intMs, isDisposed, onMessage } = params;
|
|
22233
|
+
let { api, actionId, req: reqParams, interval: intMs, isDisposed, onMessage, result } = params;
|
|
22104
22234
|
if (!actionId) {
|
|
22105
22235
|
throw ("Action ID is required.");
|
|
22106
22236
|
}
|
|
@@ -22153,6 +22283,7 @@ var PendingAction;
|
|
|
22153
22283
|
const { action } = yield Get({
|
|
22154
22284
|
api,
|
|
22155
22285
|
actionId,
|
|
22286
|
+
result,
|
|
22156
22287
|
req: reqParams
|
|
22157
22288
|
});
|
|
22158
22289
|
if (action.Status !== EStatus.InProgress) {
|
|
@@ -23968,7 +24099,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
|
|
|
23968
24099
|
}
|
|
23969
24100
|
|
|
23970
24101
|
// This is updated with the package.json version on build.
|
|
23971
|
-
const VERSION = "7.1.
|
|
24102
|
+
const VERSION = "7.1.101";
|
|
23972
24103
|
|
|
23973
24104
|
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
24105
|
//# sourceMappingURL=bruce-models.es5.js.map
|