bruce-models 7.1.26 → 7.1.28

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.
@@ -3276,14 +3276,14 @@
3276
3276
  */
3277
3277
  function Get(params) {
3278
3278
  return __awaiter(this, void 0, void 0, function* () {
3279
- let { api, entityTypeId: typeId, req: reqParams, expandLODs } = params;
3279
+ let { api, entityTypeId: typeId, req: reqParams, expandLODs, expandOntologyDiagramSettings } = params;
3280
3280
  if (!typeId) {
3281
3281
  throw ("Type ID is required.");
3282
3282
  }
3283
3283
  if (!api) {
3284
3284
  api = exports.ENVIRONMENT.Api().GetBruceApi();
3285
3285
  }
3286
- const key = GetCacheKey(typeId, expandLODs);
3286
+ const key = GetCacheKey(typeId, expandLODs, expandOntologyDiagramSettings);
3287
3287
  const cache = api.GetCacheItem(key, reqParams);
3288
3288
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
3289
3289
  return cache.data;
@@ -3291,9 +3291,10 @@
3291
3291
  const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
3292
3292
  try {
3293
3293
  const urlParams = new URLSearchParams();
3294
- if (expandLODs) {
3295
- urlParams.append("Expand", "LOD");
3296
- }
3294
+ appendEntityTypeExpandParams(urlParams, {
3295
+ expandLODs,
3296
+ expandOntologyDiagramSettings
3297
+ });
3297
3298
  const url = `entitytype/${typeId}?${urlParams.toString()}`;
3298
3299
  const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
3299
3300
  appendInternalAttrSchema(data);
@@ -3340,7 +3341,7 @@
3340
3341
  */
3341
3342
  function GetList(params) {
3342
3343
  return __awaiter(this, void 0, void 0, function* () {
3343
- let { entityTypeIds, api, req: reqParams, parentTypeId, expandSettings, search, expandLODs } = params;
3344
+ let { entityTypeIds, api, req: reqParams, parentTypeId, expandSettings, search, expandLODs, expandOntologyDiagramSettings } = params;
3344
3345
  if (!api) {
3345
3346
  api = exports.ENVIRONMENT.Api().GetBruceApi();
3346
3347
  }
@@ -3349,6 +3350,7 @@
3349
3350
  parentTypeId,
3350
3351
  expandLODs,
3351
3352
  expandSettings,
3353
+ expandOntologyDiagramSettings,
3352
3354
  search
3353
3355
  }), reqParams);
3354
3356
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
@@ -3369,15 +3371,11 @@
3369
3371
  if (parentTypeId) {
3370
3372
  urlParams.append("ParentTypeID", parentTypeId);
3371
3373
  }
3372
- if (expandSettings && expandLODs) {
3373
- urlParams.append("Expand", "true");
3374
- }
3375
- else if (expandSettings) {
3376
- urlParams.append("Expand", "Schema");
3377
- }
3378
- else if (expandLODs) {
3379
- urlParams.append("Expand", "LOD");
3380
- }
3374
+ appendEntityTypeExpandParams(urlParams, {
3375
+ expandSettings,
3376
+ expandLODs,
3377
+ expandOntologyDiagramSettings
3378
+ });
3381
3379
  if (search) {
3382
3380
  urlParams.append("Search", search);
3383
3381
  }
@@ -3389,15 +3387,11 @@
3389
3387
  if (parentTypeId) {
3390
3388
  urlParams.append("ParentTypeID", parentTypeId);
3391
3389
  }
3392
- if (expandSettings && expandLODs) {
3393
- urlParams.append("Expand", "true");
3394
- }
3395
- else if (expandSettings) {
3396
- urlParams.append("Expand", "Schema");
3397
- }
3398
- else if (expandLODs) {
3399
- urlParams.append("Expand", "LOD");
3400
- }
3390
+ appendEntityTypeExpandParams(urlParams, {
3391
+ expandSettings,
3392
+ expandLODs,
3393
+ expandOntologyDiagramSettings
3394
+ });
3401
3395
  if (search) {
3402
3396
  urlParams.append("Search", search);
3403
3397
  }
@@ -3429,6 +3423,7 @@
3429
3423
  parentTypeId,
3430
3424
  expandSettings,
3431
3425
  expandLODs,
3426
+ expandOntologyDiagramSettings,
3432
3427
  search
3433
3428
  }),
3434
3429
  value: req,
@@ -3474,6 +3469,31 @@
3474
3469
  });
3475
3470
  }
3476
3471
  EntityType.Update = Update;
3472
+ /**
3473
+ * Updates only the OntologyDiagramSettings for the specified Entity Type.
3474
+ * This calls: POST entityType/{entityType_id}/ontologyDiagramSettings
3475
+ */
3476
+ function UpdateOntologyDiagramSettings(params) {
3477
+ return __awaiter(this, void 0, void 0, function* () {
3478
+ let { api, entityTypeId, ontologyDiagramSettings, req } = params;
3479
+ if (!entityTypeId) {
3480
+ throw ("Type ID is required.");
3481
+ }
3482
+ if (ontologyDiagramSettings == null) {
3483
+ throw ("OntologyDiagramSettings is required.");
3484
+ }
3485
+ if (!api) {
3486
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
3487
+ }
3488
+ const res = yield api.POST(`entityType/${entityTypeId}/ontologyDiagramSettings`, {
3489
+ OntologyDiagramSettings: ontologyDiagramSettings
3490
+ }, exports.Api.PrepReqParams(req));
3491
+ api.Cache.RemoveByStartsWith(GetCacheKey(entityTypeId));
3492
+ api.Cache.RemoveByStartsWith(GetListCacheKey());
3493
+ return ParseUpdateOntologyDiagramSettingsResponse(res);
3494
+ });
3495
+ }
3496
+ EntityType.UpdateOntologyDiagramSettings = UpdateOntologyDiagramSettings;
3477
3497
  /**
3478
3498
  * Starts a re-index background action on a specified Entity Type.
3479
3499
  * This will ensure searchable data follows the current schema version.
@@ -3648,6 +3668,21 @@
3648
3668
  return [];
3649
3669
  }
3650
3670
  EntityType.ParseDictionaryDataSchemaDependenciesResponse = ParseDictionaryDataSchemaDependenciesResponse;
3671
+ /**
3672
+ * Normalizes response from UpdateOntologyDiagramSettings.
3673
+ * Supports direct response payloads and wrapper shapes.
3674
+ */
3675
+ function ParseUpdateOntologyDiagramSettingsResponse(response) {
3676
+ var _a, _b, _c;
3677
+ const parsed = parseObject$1(response);
3678
+ const parsedResult = (_a = parseObject$1(parsed === null || parsed === void 0 ? void 0 : parsed.Result)) !== null && _a !== void 0 ? _a : parsed === null || parsed === void 0 ? void 0 : parsed.Result;
3679
+ return {
3680
+ entityTypeId: (_b = parsed === null || parsed === void 0 ? void 0 : parsed["EntityType.ID"]) !== null && _b !== void 0 ? _b : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult["EntityType.ID"],
3681
+ ontologyDiagramSettings: (_c = parsed === null || parsed === void 0 ? void 0 : parsed.OntologyDiagramSettings) !== null && _c !== void 0 ? _c : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.OntologyDiagramSettings,
3682
+ raw: parsed
3683
+ };
3684
+ }
3685
+ EntityType.ParseUpdateOntologyDiagramSettingsResponse = ParseUpdateOntologyDiagramSettingsResponse;
3651
3686
  /**
3652
3687
  * Normalizes response from ExportOntology.
3653
3688
  * Supports both direct response payloads and wrapper shapes.
@@ -3725,11 +3760,14 @@
3725
3760
  * @param expandLODs
3726
3761
  * @returns
3727
3762
  */
3728
- function GetCacheKey(typeId, expandLODs) {
3763
+ function GetCacheKey(typeId, expandLODs, expandOntologyDiagramSettings) {
3729
3764
  let key = `${exports.Api.ECacheKey.EntityType}${exports.Api.ECacheKey.Id}${typeId}`;
3730
3765
  if (expandLODs) {
3731
3766
  key += "_LOD_" + expandLODs;
3732
3767
  }
3768
+ if (expandOntologyDiagramSettings) {
3769
+ key += "_ONTOLOGY_DIAGRAM_SETTINGS_" + expandOntologyDiagramSettings;
3770
+ }
3733
3771
  return key;
3734
3772
  }
3735
3773
  EntityType.GetCacheKey = GetCacheKey;
@@ -3747,7 +3785,7 @@
3747
3785
  if (!params) {
3748
3786
  params = {};
3749
3787
  }
3750
- let { typeIds, expandSettings, parentTypeId, expandLODs, search } = params;
3788
+ let { typeIds, expandSettings, parentTypeId, expandLODs, expandOntologyDiagramSettings, search } = params;
3751
3789
  let key = exports.Api.ECacheKey.EntityType;
3752
3790
  if (!typeIds) {
3753
3791
  typeIds = [];
@@ -3762,8 +3800,12 @@
3762
3800
  if (!expandLODs) {
3763
3801
  expandLODs = false;
3764
3802
  }
3803
+ if (!expandOntologyDiagramSettings) {
3804
+ expandOntologyDiagramSettings = false;
3805
+ }
3765
3806
  key += "_SCHEMA_" + expandSettings;
3766
3807
  key += "_LOD_" + expandLODs;
3808
+ key += "_ONTOLOGY_DIAGRAM_SETTINGS_" + expandOntologyDiagramSettings;
3767
3809
  if (search) {
3768
3810
  key += "_SEARCH_" + search;
3769
3811
  }
@@ -3771,6 +3813,17 @@
3771
3813
  }
3772
3814
  EntityType.GetListCacheKey = GetListCacheKey;
3773
3815
  })(exports.EntityType || (exports.EntityType = {}));
3816
+ function appendEntityTypeExpandParams(urlParams, params) {
3817
+ if (params.expandSettings) {
3818
+ urlParams.append("Expand", "Schema");
3819
+ }
3820
+ if (params.expandLODs) {
3821
+ urlParams.append("Expand", "LOD");
3822
+ }
3823
+ if (params.expandOntologyDiagramSettings) {
3824
+ urlParams.append("Expand", "ontologydiagramsettings");
3825
+ }
3826
+ }
3774
3827
  function parseObject$1(data) {
3775
3828
  if (data == null || data == undefined) {
3776
3829
  return null;
@@ -4121,7 +4174,7 @@
4121
4174
  */
4122
4175
  function GetListByIds(params) {
4123
4176
  return __awaiter(this, void 0, void 0, function* () {
4124
- let { api, entityIds, scenario, migrated, schemaId, req: reqParams, expandAttachments, expandLODs, expandRelations, expandLocation, expandSources, expandImports, expandComments, expandEntityType, expand: expandStr, historicFrom, historicKey, historicTo, historicPoint, maxSearchTimeSec } = params;
4177
+ let { api, entityIds, scenario, migrated, schemaId, req: reqParams, entityTypeId: typeId, expandAttachments, expandLODs, expandRelations, expandLocation, expandSources, expandImports, expandComments, expandEntityType, expand: expandStr, historicFrom, historicKey, historicTo, historicPoint, maxSearchTimeSec } = params;
4125
4178
  if (!entityIds.length) {
4126
4179
  throw ("Entity IDs are required.");
4127
4180
  }
@@ -4149,6 +4202,7 @@
4149
4202
  historicPoint: historicPoint,
4150
4203
  schemaId: schemaId,
4151
4204
  scenario: scenario,
4205
+ typeId: typeId
4152
4206
  };
4153
4207
  const crashRiskReqs = [];
4154
4208
  const reqIds = [];
@@ -4248,6 +4302,9 @@
4248
4302
  if (scenario) {
4249
4303
  reqData["Scenario"] = scenario;
4250
4304
  }
4305
+ if (typeId) {
4306
+ reqData["Type"] = typeId;
4307
+ }
4251
4308
  const urlParams = new URLSearchParams();
4252
4309
  if (schemaId) {
4253
4310
  urlParams.set("Schema", schemaId);
@@ -5083,7 +5140,7 @@
5083
5140
  * @returns
5084
5141
  */
5085
5142
  function GetCacheKey(params) {
5086
- let { entityId, scenario: scenarioId, entityTypeId, schemaId, expandLocation, expandRelations, expandImports, expandAttachments, expandLODs, expandSources, expandEntityType, expandComments, expand, historicFrom, historicKey, historicTo, historicPoint } = params;
5143
+ let { entityId, scenario: scenarioId, entityTypeId, schemaId, typeId, expandLocation, expandRelations, expandImports, expandAttachments, expandLODs, expandSources, expandEntityType, expandComments, expand, historicFrom, historicKey, historicTo, historicPoint } = params;
5087
5144
  if (!scenarioId) {
5088
5145
  scenarioId = 0;
5089
5146
  }
@@ -5106,12 +5163,16 @@
5106
5163
  if (!schemaId) {
5107
5164
  schemaId = "";
5108
5165
  }
5166
+ if (!typeId) {
5167
+ typeId = "";
5168
+ }
5109
5169
  let key = `${exports.Api.ECacheKey.Entity}${exports.Api.ECacheKey.Id}${entityId}${String(entityTypeId)}${schemaId}`;
5110
5170
  key += `${String(Boolean(expandLocation))}${String(Boolean(expandRelations))}${String(Boolean(expandSources))}${String(Boolean(expandImports))}`;
5111
5171
  key += `${String(Boolean(expandAttachments))}${String(Boolean(expandLODs))}`;
5112
5172
  key += `${exports.Api.ECacheKey.EntityHistoricData}${exports.Api.ECacheKey.Id}${historicKey}-${historicFrom}-${historicTo}-${historicPoint}`;
5113
5173
  key += `${String(Boolean(expandEntityType))}${String(Boolean(expandComments))}${expand || ""}`;
5114
5174
  key += `${exports.Api.ECacheKey.Id}${scenarioId}`;
5175
+ key += `${typeId}`;
5115
5176
  return key;
5116
5177
  }
5117
5178
  Entity.GetCacheKey = GetCacheKey;
@@ -17669,7 +17730,7 @@
17669
17730
  })(exports.ChangeSet || (exports.ChangeSet = {}));
17670
17731
 
17671
17732
  // This is updated with the package.json version on build.
17672
- const VERSION = "7.1.26";
17733
+ const VERSION = "7.1.28";
17673
17734
 
17674
17735
  exports.VERSION = VERSION;
17675
17736
  exports.AbstractApi = AbstractApi;