bruce-models 6.9.3 → 6.9.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.
- package/dist/bruce-models.es5.js +131 -17
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +131 -17
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity.js +115 -6
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/mcp/navigator-chat.js +3 -0
- package/dist/lib/mcp/navigator-chat.js.map +1 -1
- package/dist/lib/mcp/navigator-mcp-websocket.js +12 -10
- package/dist/lib/mcp/navigator-mcp-websocket.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity.d.ts +12 -0
- package/dist/types/mcp/navigator-chat.d.ts +1 -0
- package/dist/types/mcp/navigator-mcp-websocket.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -3637,7 +3637,7 @@
|
|
|
3637
3637
|
*/
|
|
3638
3638
|
function Get(params) {
|
|
3639
3639
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3640
|
-
let { api, entityId, scenario, migrated, schemaId, req: reqParams, expandLocation, expandRelations, expandAttachments, expandLODs, entityTypeId, historicFrom, historicKey, historicTo, historicPoint } = params;
|
|
3640
|
+
let { api, entityId, scenario, migrated, schemaId, req: reqParams, expandLocation, expandRelations, expandAttachments, expandLODs, expandComments, expandEntityType, expand: expandStr, entityTypeId, historicFrom, historicKey, historicTo, historicPoint } = params;
|
|
3641
3641
|
if (!entityId) {
|
|
3642
3642
|
throw ("Entity ID is required.");
|
|
3643
3643
|
}
|
|
@@ -3655,6 +3655,9 @@
|
|
|
3655
3655
|
expandRelations,
|
|
3656
3656
|
expandAttachments,
|
|
3657
3657
|
expandLODs,
|
|
3658
|
+
expandComments,
|
|
3659
|
+
expandEntityType,
|
|
3660
|
+
expand: expandStr,
|
|
3658
3661
|
historicFrom,
|
|
3659
3662
|
historicKey,
|
|
3660
3663
|
historicTo,
|
|
@@ -3685,6 +3688,24 @@
|
|
|
3685
3688
|
}
|
|
3686
3689
|
expand += "attachment";
|
|
3687
3690
|
}
|
|
3691
|
+
if (expandEntityType) {
|
|
3692
|
+
if (expand) {
|
|
3693
|
+
expand += ",";
|
|
3694
|
+
}
|
|
3695
|
+
expand += "EntityType";
|
|
3696
|
+
}
|
|
3697
|
+
if (expandComments) {
|
|
3698
|
+
if (expand) {
|
|
3699
|
+
expand += ",";
|
|
3700
|
+
}
|
|
3701
|
+
expand += "comment";
|
|
3702
|
+
}
|
|
3703
|
+
if (expandStr) {
|
|
3704
|
+
if (expand) {
|
|
3705
|
+
expand += ",";
|
|
3706
|
+
}
|
|
3707
|
+
expand += expandStr;
|
|
3708
|
+
}
|
|
3688
3709
|
if (expand) {
|
|
3689
3710
|
urlParams.append("Expand", expand);
|
|
3690
3711
|
}
|
|
@@ -3738,7 +3759,7 @@
|
|
|
3738
3759
|
*/
|
|
3739
3760
|
function GetListByIds(params) {
|
|
3740
3761
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3741
|
-
let { api, entityIds, scenario, migrated, schemaId, req: reqParams, expandAttachments, expandLODs, expandRelations, expandLocation, historicFrom, historicKey, historicTo, historicPoint,
|
|
3762
|
+
let { api, entityIds, scenario, migrated, schemaId, req: reqParams, expandAttachments, expandLODs, expandRelations, expandLocation, expandSources, expandImports, expandComments, expandEntityType, expand: expandStr, historicFrom, historicKey, historicTo, historicPoint, maxSearchTimeSec } = params;
|
|
3742
3763
|
if (!entityIds.length) {
|
|
3743
3764
|
throw ("Entity IDs are required.");
|
|
3744
3765
|
}
|
|
@@ -3756,13 +3777,16 @@
|
|
|
3756
3777
|
expandSources,
|
|
3757
3778
|
expandAttachments,
|
|
3758
3779
|
expandLODs,
|
|
3780
|
+
expandComments,
|
|
3781
|
+
expandEntityType,
|
|
3782
|
+
expand: expandStr,
|
|
3759
3783
|
entityTypeId: null,
|
|
3760
3784
|
historicFrom: historicFrom,
|
|
3761
3785
|
historicKey: historicKey,
|
|
3762
3786
|
historicTo: historicTo,
|
|
3763
3787
|
historicPoint: historicPoint,
|
|
3764
3788
|
schemaId: schemaId,
|
|
3765
|
-
scenario: scenario
|
|
3789
|
+
scenario: scenario,
|
|
3766
3790
|
};
|
|
3767
3791
|
const crashRiskReqs = [];
|
|
3768
3792
|
const reqIds = [];
|
|
@@ -3812,6 +3836,30 @@
|
|
|
3812
3836
|
reqData["Expand"] = "attachment";
|
|
3813
3837
|
}
|
|
3814
3838
|
}
|
|
3839
|
+
if (expandEntityType) {
|
|
3840
|
+
if (reqData["Expand"]) {
|
|
3841
|
+
reqData["Expand"] += ",EntityType";
|
|
3842
|
+
}
|
|
3843
|
+
else {
|
|
3844
|
+
reqData["Expand"] = "EntityType";
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3847
|
+
if (expandComments) {
|
|
3848
|
+
if (reqData["Expand"]) {
|
|
3849
|
+
reqData["Expand"] += ",comment";
|
|
3850
|
+
}
|
|
3851
|
+
else {
|
|
3852
|
+
reqData["Expand"] = "comment";
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3855
|
+
if (expandStr) {
|
|
3856
|
+
if (reqData["Expand"]) {
|
|
3857
|
+
reqData["Expand"] += `,${expandStr}`;
|
|
3858
|
+
}
|
|
3859
|
+
else {
|
|
3860
|
+
reqData["Expand"] = expandStr;
|
|
3861
|
+
}
|
|
3862
|
+
}
|
|
3815
3863
|
if (expandLODs) {
|
|
3816
3864
|
reqData["LODType"] = "*";
|
|
3817
3865
|
}
|
|
@@ -4281,7 +4329,7 @@
|
|
|
4281
4329
|
function GetList(params) {
|
|
4282
4330
|
var _a;
|
|
4283
4331
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4284
|
-
let { api, filter, scenario, migrated, schemaId, req: reqParams, viaCdn, viaCdnCacheToken, analysis, expandRelations, expandImports, historicFrom, historicKey, historicTo, historicPoint,
|
|
4332
|
+
let { api, filter, scenario, migrated, schemaId, req: reqParams, viaCdn, viaCdnCacheToken, analysis, expandRelations, expandImports, expandLocation, expandSources, expandComments, expandEntityType, expand: expandStr, historicFrom, historicKey, historicTo, historicPoint, maxSearchTimeSec } = params;
|
|
4285
4333
|
if (!api) {
|
|
4286
4334
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
4287
4335
|
}
|
|
@@ -4332,7 +4380,7 @@
|
|
|
4332
4380
|
ExpandSources: expandSources,
|
|
4333
4381
|
Scenario: scenario
|
|
4334
4382
|
};
|
|
4335
|
-
if (expandLocation || expandRelations || expandImports) {
|
|
4383
|
+
if (expandLocation || expandRelations || expandImports || expandEntityType || expandComments || expandStr) {
|
|
4336
4384
|
let expand = "";
|
|
4337
4385
|
if (expandLocation) {
|
|
4338
4386
|
expand += "location";
|
|
@@ -4349,6 +4397,24 @@
|
|
|
4349
4397
|
}
|
|
4350
4398
|
expand += "import";
|
|
4351
4399
|
}
|
|
4400
|
+
if (expandEntityType) {
|
|
4401
|
+
if (expand) {
|
|
4402
|
+
expand += ",";
|
|
4403
|
+
}
|
|
4404
|
+
expand += "EntityType";
|
|
4405
|
+
}
|
|
4406
|
+
if (expandComments) {
|
|
4407
|
+
if (expand) {
|
|
4408
|
+
expand += ",";
|
|
4409
|
+
}
|
|
4410
|
+
expand += "comment";
|
|
4411
|
+
}
|
|
4412
|
+
if (expandStr) {
|
|
4413
|
+
if (expand) {
|
|
4414
|
+
expand += ",";
|
|
4415
|
+
}
|
|
4416
|
+
expand += expandStr;
|
|
4417
|
+
}
|
|
4352
4418
|
if (expand) {
|
|
4353
4419
|
body["Expand"] = expand;
|
|
4354
4420
|
}
|
|
@@ -4409,6 +4475,24 @@
|
|
|
4409
4475
|
}
|
|
4410
4476
|
expand += "Source";
|
|
4411
4477
|
}
|
|
4478
|
+
if (expandEntityType) {
|
|
4479
|
+
if (expand.length) {
|
|
4480
|
+
expand += ",";
|
|
4481
|
+
}
|
|
4482
|
+
expand += "EntityType";
|
|
4483
|
+
}
|
|
4484
|
+
if (expandComments) {
|
|
4485
|
+
if (expand.length) {
|
|
4486
|
+
expand += ",";
|
|
4487
|
+
}
|
|
4488
|
+
expand += "Comment";
|
|
4489
|
+
}
|
|
4490
|
+
if (expandStr) {
|
|
4491
|
+
if (expand.length) {
|
|
4492
|
+
expand += ",";
|
|
4493
|
+
}
|
|
4494
|
+
expand += expandStr;
|
|
4495
|
+
}
|
|
4412
4496
|
if (expand.length) {
|
|
4413
4497
|
urlParams.append("Expand", expand);
|
|
4414
4498
|
}
|
|
@@ -4472,6 +4556,30 @@
|
|
|
4472
4556
|
}
|
|
4473
4557
|
expand += "Import";
|
|
4474
4558
|
}
|
|
4559
|
+
if (expandSources) {
|
|
4560
|
+
if (expand.length) {
|
|
4561
|
+
expand += ",";
|
|
4562
|
+
}
|
|
4563
|
+
expand += "Source";
|
|
4564
|
+
}
|
|
4565
|
+
if (expandEntityType) {
|
|
4566
|
+
if (expand.length) {
|
|
4567
|
+
expand += ",";
|
|
4568
|
+
}
|
|
4569
|
+
expand += "EntityType";
|
|
4570
|
+
}
|
|
4571
|
+
if (expandComments) {
|
|
4572
|
+
if (expand.length) {
|
|
4573
|
+
expand += ",";
|
|
4574
|
+
}
|
|
4575
|
+
expand += "Comment";
|
|
4576
|
+
}
|
|
4577
|
+
if (expandStr) {
|
|
4578
|
+
if (expand.length) {
|
|
4579
|
+
expand += ",";
|
|
4580
|
+
}
|
|
4581
|
+
expand += expandStr;
|
|
4582
|
+
}
|
|
4475
4583
|
if (expand.length) {
|
|
4476
4584
|
urlParams.append("Expand", expand);
|
|
4477
4585
|
}
|
|
@@ -4610,7 +4718,7 @@
|
|
|
4610
4718
|
* @returns
|
|
4611
4719
|
*/
|
|
4612
4720
|
function GetCacheKey(params) {
|
|
4613
|
-
let { entityId, scenario: scenarioId, entityTypeId, schemaId, expandLocation, expandRelations, expandImports, expandAttachments, expandLODs, expandSources, historicFrom, historicKey, historicTo, historicPoint } = params;
|
|
4721
|
+
let { entityId, scenario: scenarioId, entityTypeId, schemaId, expandLocation, expandRelations, expandImports, expandAttachments, expandLODs, expandSources, expandEntityType, expandComments, expand, historicFrom, historicKey, historicTo, historicPoint } = params;
|
|
4614
4722
|
if (!scenarioId) {
|
|
4615
4723
|
scenarioId = 0;
|
|
4616
4724
|
}
|
|
@@ -4637,6 +4745,7 @@
|
|
|
4637
4745
|
key += `${String(Boolean(expandLocation))}${String(Boolean(expandRelations))}${String(Boolean(expandSources))}${String(Boolean(expandImports))}`;
|
|
4638
4746
|
key += `${String(Boolean(expandAttachments))}${String(Boolean(expandLODs))}`;
|
|
4639
4747
|
key += `${exports.Api.ECacheKey.EntityHistoricData}${exports.Api.ECacheKey.Id}${historicKey}-${historicFrom}-${historicTo}-${historicPoint}`;
|
|
4748
|
+
key += `${String(Boolean(expandEntityType))}${String(Boolean(expandComments))}${expand || ""}`;
|
|
4640
4749
|
key += `${exports.Api.ECacheKey.Id}${scenarioId}`;
|
|
4641
4750
|
return key;
|
|
4642
4751
|
}
|
|
@@ -16316,6 +16425,9 @@
|
|
|
16316
16425
|
if (auth === null || auth === void 0 ? void 0 : auth.fingerprint) {
|
|
16317
16426
|
headers["X-Fingerprint"] = auth.fingerprint;
|
|
16318
16427
|
}
|
|
16428
|
+
if (auth === null || auth === void 0 ? void 0 : auth.apiBaseUrl) {
|
|
16429
|
+
headers["X-Api-Base-Url"] = auth.apiBaseUrl;
|
|
16430
|
+
}
|
|
16319
16431
|
const response = yield fetchImpl(this.buildUrl(path), Object.assign(Object.assign({}, init), { headers }));
|
|
16320
16432
|
if (!response.ok) {
|
|
16321
16433
|
const message = yield this.safeReadResponseText(response);
|
|
@@ -16378,7 +16490,7 @@
|
|
|
16378
16490
|
}
|
|
16379
16491
|
}
|
|
16380
16492
|
connect(auth) {
|
|
16381
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
16493
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
16382
16494
|
if (auth) {
|
|
16383
16495
|
this.currentAuth = auth;
|
|
16384
16496
|
}
|
|
@@ -16386,14 +16498,10 @@
|
|
|
16386
16498
|
(_c = (_b = this.logger()).debug) === null || _c === void 0 ? void 0 : _c.call(_b, "[NavigatorMcpWS] Connection already active or in-flight; skipping connect.");
|
|
16387
16499
|
return;
|
|
16388
16500
|
}
|
|
16389
|
-
if (!((_d = this.currentAuth) === null || _d === void 0 ? void 0 : _d.accountId)) {
|
|
16390
|
-
(_f = (_e = this.logger()).debug) === null || _f === void 0 ? void 0 : _f.call(_e, "[NavigatorMcpWS] Missing accountId; connection not started.");
|
|
16391
|
-
return;
|
|
16392
|
-
}
|
|
16393
16501
|
try {
|
|
16394
16502
|
this.isConnecting = true;
|
|
16395
16503
|
const url = this.buildUrl();
|
|
16396
|
-
(
|
|
16504
|
+
(_e = (_d = this.logger()).log) === null || _e === void 0 ? void 0 : _e.call(_d, "[NavigatorMcpWS] Connecting to", url);
|
|
16397
16505
|
this.ws = new WebSocket(url);
|
|
16398
16506
|
this.ws.onopen = (event) => {
|
|
16399
16507
|
var _a, _b, _c, _d;
|
|
@@ -16420,7 +16528,7 @@
|
|
|
16420
16528
|
};
|
|
16421
16529
|
}
|
|
16422
16530
|
catch (error) {
|
|
16423
|
-
(
|
|
16531
|
+
(_g = (_f = this.logger()).error) === null || _g === void 0 ? void 0 : _g.call(_f, "[NavigatorMcpWS] Failed to establish connection", error);
|
|
16424
16532
|
this.isConnecting = false;
|
|
16425
16533
|
}
|
|
16426
16534
|
}
|
|
@@ -16454,12 +16562,14 @@
|
|
|
16454
16562
|
return this.appendAuthParams(url);
|
|
16455
16563
|
}
|
|
16456
16564
|
appendAuthParams(url) {
|
|
16457
|
-
|
|
16458
|
-
if (!((_a = this.currentAuth) === null || _a === void 0 ? void 0 : _a.accountId)) {
|
|
16565
|
+
if (!this.currentAuth) {
|
|
16459
16566
|
return url;
|
|
16460
16567
|
}
|
|
16461
16568
|
const urlInstance = new URL(url);
|
|
16462
|
-
|
|
16569
|
+
// Add accountId if provided
|
|
16570
|
+
if (this.currentAuth.accountId) {
|
|
16571
|
+
urlInstance.searchParams.set("accountId", this.currentAuth.accountId);
|
|
16572
|
+
}
|
|
16463
16573
|
// Only add sessionId if it's provided (support anonymous access)
|
|
16464
16574
|
if (this.currentAuth.sessionId) {
|
|
16465
16575
|
urlInstance.searchParams.set("sessionId", this.currentAuth.sessionId);
|
|
@@ -16468,6 +16578,10 @@
|
|
|
16468
16578
|
if (this.currentAuth.fingerprint) {
|
|
16469
16579
|
urlInstance.searchParams.set("fingerprint", this.currentAuth.fingerprint);
|
|
16470
16580
|
}
|
|
16581
|
+
// Add apiBaseUrl if provided (for anonymous access)
|
|
16582
|
+
if (this.currentAuth.apiBaseUrl) {
|
|
16583
|
+
urlInstance.searchParams.set("apiBaseUrl", this.currentAuth.apiBaseUrl);
|
|
16584
|
+
}
|
|
16471
16585
|
// Preserve the hash (unlikely to be used, but consistent with URL semantics)
|
|
16472
16586
|
return urlInstance.toString();
|
|
16473
16587
|
}
|
|
@@ -16524,7 +16638,7 @@
|
|
|
16524
16638
|
}
|
|
16525
16639
|
|
|
16526
16640
|
// This is updated with the package.json version on build.
|
|
16527
|
-
const VERSION = "6.9.
|
|
16641
|
+
const VERSION = "6.9.5";
|
|
16528
16642
|
|
|
16529
16643
|
exports.VERSION = VERSION;
|
|
16530
16644
|
exports.AbstractApi = AbstractApi;
|