bruce-models 7.1.22 → 7.1.24

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.
@@ -3602,6 +3602,25 @@ var EntityType;
3602
3602
  });
3603
3603
  }
3604
3604
  EntityType.ExportOntology = ExportOntology;
3605
+ /**
3606
+ * Starts the background action that suggests Entity Type relations.
3607
+ * This calls: POST entityType/relations/findSuggested
3608
+ */
3609
+ function FindSuggestedRelations(params) {
3610
+ var _a;
3611
+ return __awaiter(this, void 0, void 0, function* () {
3612
+ let { api, suggestedRelationsRequest, req } = params;
3613
+ if (!((_a = suggestedRelationsRequest === null || suggestedRelationsRequest === void 0 ? void 0 : suggestedRelationsRequest["EntityType.ID"]) === null || _a === void 0 ? void 0 : _a.length)) {
3614
+ throw ("EntityType.ID is required.");
3615
+ }
3616
+ if (!api) {
3617
+ api = ENVIRONMENT.Api().GetBruceApi();
3618
+ }
3619
+ const res = yield api.POST("entityType/relations/findSuggested", suggestedRelationsRequest, req ? Api.PrepReqParams(req) : undefined);
3620
+ return ParseFindSuggestedRelationsResponse(res);
3621
+ });
3622
+ }
3623
+ EntityType.FindSuggestedRelations = FindSuggestedRelations;
3605
3624
  /**
3606
3625
  * Gets source dependency records for an Entity Type.
3607
3626
  * This calls: GET entityType/{entityType_id}/sourceDependencies
@@ -3698,6 +3717,46 @@ var EntityType;
3698
3717
  };
3699
3718
  }
3700
3719
  EntityType.ParseExportOntologyResponse = ParseExportOntologyResponse;
3720
+ /**
3721
+ * Normalizes response from FindSuggestedRelations.
3722
+ * Supports both direct response payloads and wrapper shapes.
3723
+ */
3724
+ function ParseFindSuggestedRelationsResponse(response) {
3725
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
3726
+ const parsed = parseObject$1(response);
3727
+ 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;
3728
+ const pendingActionId = (_g = (_f = (_e = (_c = (_b = parsed === null || parsed === void 0 ? void 0 : parsed.PendingActionID) !== null && _b !== void 0 ? _b : parsed === null || parsed === void 0 ? void 0 : parsed["PendingAction.ID"]) !== null && _c !== void 0 ? _c : (_d = parsed === null || parsed === void 0 ? void 0 : parsed.PendingAction) === null || _d === void 0 ? void 0 : _d.ID) !== null && _e !== void 0 ? _e : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.PendingActionID) !== null && _f !== void 0 ? _f : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult["PendingAction.ID"]) !== null && _g !== void 0 ? _g : (_h = parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.PendingAction) === null || _h === void 0 ? void 0 : _h.ID;
3729
+ return {
3730
+ pendingActionId,
3731
+ warnings: (_j = parsed === null || parsed === void 0 ? void 0 : parsed.Warnings) !== null && _j !== void 0 ? _j : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Warnings,
3732
+ errors: (_k = parsed === null || parsed === void 0 ? void 0 : parsed.Errors) !== null && _k !== void 0 ? _k : parsedResult === null || parsedResult === void 0 ? void 0 : parsedResult.Errors,
3733
+ raw: parsed
3734
+ };
3735
+ }
3736
+ EntityType.ParseFindSuggestedRelationsResponse = ParseFindSuggestedRelationsResponse;
3737
+ /**
3738
+ * Parses pending-action result payload produced by FindSuggestedRelations.
3739
+ */
3740
+ function ParseFindSuggestedRelationsResult(paResult) {
3741
+ var _a, _b, _c;
3742
+ const parsed = parseObject$1(paResult);
3743
+ if (!parsed) {
3744
+ return {
3745
+ raw: null
3746
+ };
3747
+ }
3748
+ const rawResult = (_b = (_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) !== null && _b !== void 0 ? _b : parsed;
3749
+ return {
3750
+ inputEntityTypeIds: rawResult === null || rawResult === void 0 ? void 0 : rawResult["Input.EntityType.ID"],
3751
+ discoveredEntityTypeIds: rawResult === null || rawResult === void 0 ? void 0 : rawResult["Discovered.EntityType.ID"],
3752
+ items: Array.isArray(rawResult === null || rawResult === void 0 ? void 0 : rawResult.Items) ? rawResult.Items : [],
3753
+ count: (_c = rawResult === null || rawResult === void 0 ? void 0 : rawResult.Count) !== null && _c !== void 0 ? _c : (Array.isArray(rawResult === null || rawResult === void 0 ? void 0 : rawResult.Items) ? rawResult.Items.length : undefined),
3754
+ warnings: rawResult === null || rawResult === void 0 ? void 0 : rawResult.Warnings,
3755
+ errors: rawResult === null || rawResult === void 0 ? void 0 : rawResult.Errors,
3756
+ raw: rawResult
3757
+ };
3758
+ }
3759
+ EntityType.ParseFindSuggestedRelationsResult = ParseFindSuggestedRelationsResult;
3701
3760
  /**
3702
3761
  * Returns cache identifier for an entity type.
3703
3762
  * Example: {
@@ -17689,23 +17748,35 @@ var ChangeSet;
17689
17748
  /**
17690
17749
  * Valid values for the Change Set Status.
17691
17750
  */
17692
- let BruceChangeStatus;
17693
- (function (BruceChangeStatus) {
17694
- BruceChangeStatus["UNCOMMITTED"] = "Uncommitted";
17695
- BruceChangeStatus["COMMITTED"] = "Committed";
17696
- BruceChangeStatus["CANCELLED"] = "Cancelled";
17697
- })(BruceChangeStatus = ChangeSet.BruceChangeStatus || (ChangeSet.BruceChangeStatus = {}));
17751
+ let EStatus;
17752
+ (function (EStatus) {
17753
+ EStatus["UNCOMMITTED"] = "Uncommitted";
17754
+ EStatus["COMMITTED"] = "Committed";
17755
+ EStatus["CANCELLED"] = "Cancelled";
17756
+ EStatus["ERROR"] = "Error";
17757
+ })(EStatus = ChangeSet.EStatus || (ChangeSet.EStatus = {}));
17698
17758
  /**
17699
- * Updates existing or crates new Change Set record.
17759
+ * Single-character action values stored on Entity Change and Entity Type Change records.
17760
+ */
17761
+ let EAction;
17762
+ (function (EAction) {
17763
+ EAction["CREATE"] = "C";
17764
+ EAction["UPDATE"] = "U";
17765
+ EAction["DELETE"] = "D";
17766
+ })(EAction = ChangeSet.EAction || (ChangeSet.EAction = {}));
17767
+ /**
17768
+ * Updates existing or creates new Change Set record.
17769
+ * To create a new record pass a changeSet without an ID (or with ID set to 0/null).
17700
17770
  */
17701
17771
  function Update(params) {
17772
+ var _a;
17702
17773
  return __awaiter(this, void 0, void 0, function* () {
17703
17774
  let { changeSet: data, api, req: reqParams } = params;
17704
17775
  if (!api) {
17705
17776
  api = ENVIRONMENT.Api().GetBruceApi();
17706
17777
  }
17707
- const url = `change` + (data.ID == null ? "" : "/" + data.ID);
17708
- return api.POST(url, data, Api.PrepReqParams(reqParams));
17778
+ const id = (_a = data.ID) !== null && _a !== void 0 ? _a : 0;
17779
+ return api.POST(`change/${id}`, data, Api.PrepReqParams(reqParams));
17709
17780
  });
17710
17781
  }
17711
17782
  ChangeSet.Update = Update;
@@ -17724,6 +17795,7 @@ var ChangeSet;
17724
17795
  ChangeSet.Delete = Delete;
17725
17796
  /**
17726
17797
  * Gets the Change Set record by its ID.
17798
+ * The response includes PendingAction data when a pending action exists for the change set.
17727
17799
  */
17728
17800
  function Get(params) {
17729
17801
  return __awaiter(this, void 0, void 0, function* () {
@@ -17731,43 +17803,197 @@ var ChangeSet;
17731
17803
  if (!api) {
17732
17804
  api = ENVIRONMENT.Api().GetBruceApi();
17733
17805
  }
17734
- reqParams = Api.PrepReqParams(reqParams);
17735
17806
  return yield api.GET(`change/${id}`, Api.PrepReqParams(reqParams));
17736
17807
  });
17737
17808
  }
17738
17809
  ChangeSet.Get = Get;
17739
17810
  /**
17740
17811
  * Gets the list of all the Change Set records.
17812
+ * TotalCount is returned when PageIndex is 0 (the default).
17741
17813
  */
17742
17814
  function GetList(params) {
17743
17815
  return __awaiter(this, void 0, void 0, function* () {
17744
- let { api, req: reqParams } = params;
17816
+ let { api, req: reqParams, pageSize, pageIndex } = params;
17745
17817
  if (!api) {
17746
17818
  api = ENVIRONMENT.Api().GetBruceApi();
17747
17819
  }
17748
- reqParams = Api.PrepReqParams(reqParams);
17749
- return api.GET("changes", Api.PrepReqParams(reqParams));
17820
+ const urlParams = new URLSearchParams();
17821
+ if (pageSize != null) {
17822
+ urlParams.append("PageSize", String(pageSize));
17823
+ }
17824
+ if (pageIndex != null) {
17825
+ urlParams.append("PageIndex", String(pageIndex));
17826
+ }
17827
+ const query = urlParams.toString();
17828
+ return api.GET(query ? `changes?${query}` : "changes", Api.PrepReqParams(reqParams));
17750
17829
  });
17751
17830
  }
17752
17831
  ChangeSet.GetList = GetList;
17753
17832
  /**
17754
- * Gets the Change Set record by its ID.
17833
+ * Gets the content of the specified Change Set including Entity Type and Entity change records.
17834
+ * Supports pagination, mapping mode, and filtering by entity action and Entity IDs.
17755
17835
  */
17756
- function GetChangeSetContent(params) {
17836
+ function GetContent(params) {
17837
+ return __awaiter(this, void 0, void 0, function* () {
17838
+ let { id, api, req: reqParams, pageSize, pageIndex, select, entityStatus, entityId } = params;
17839
+ if (!api) {
17840
+ api = ENVIRONMENT.Api().GetBruceApi();
17841
+ }
17842
+ const urlParams = new URLSearchParams();
17843
+ if (pageSize != null) {
17844
+ urlParams.append("PageSize", String(pageSize));
17845
+ }
17846
+ if (pageIndex != null) {
17847
+ urlParams.append("PageIndex", String(pageIndex));
17848
+ }
17849
+ if (select != null) {
17850
+ urlParams.append("Select", select);
17851
+ }
17852
+ if (entityStatus != null) {
17853
+ const statuses = Array.isArray(entityStatus) ? entityStatus : [entityStatus];
17854
+ for (const s of statuses) {
17855
+ urlParams.append("EntityStatus", s);
17856
+ }
17857
+ }
17858
+ if (entityId != null) {
17859
+ const ids = Array.isArray(entityId) ? entityId : [entityId];
17860
+ for (const eid of ids) {
17861
+ urlParams.append("EntityID", eid);
17862
+ }
17863
+ }
17864
+ const query = urlParams.toString();
17865
+ return api.GET(query ? `change/${id}/content?${query}` : `change/${id}/content`, Api.PrepReqParams(reqParams));
17866
+ });
17867
+ }
17868
+ ChangeSet.GetContent = GetContent;
17869
+ /**
17870
+ * Starts job to commit changes proposed in the change set.
17871
+ * Returns the PA ID to monitor.
17872
+ */
17873
+ function Commit(params) {
17757
17874
  return __awaiter(this, void 0, void 0, function* () {
17758
17875
  let { id, api, req: reqParams } = params;
17759
17876
  if (!api) {
17760
17877
  api = ENVIRONMENT.Api().GetBruceApi();
17761
17878
  }
17762
- reqParams = Api.PrepReqParams(reqParams);
17763
- return api.GET(`change/${id}/content`, Api.PrepReqParams(reqParams));
17879
+ return api.POST(`change/${id}/commit`, null, Api.PrepReqParams(reqParams));
17880
+ });
17881
+ }
17882
+ ChangeSet.Commit = Commit;
17883
+ /**
17884
+ * Gets the details of one Entity Change record by its ID.
17885
+ */
17886
+ function GetEntityChange(params) {
17887
+ return __awaiter(this, void 0, void 0, function* () {
17888
+ let { id, api, req: reqParams } = params;
17889
+ if (!api) {
17890
+ api = ENVIRONMENT.Api().GetBruceApi();
17891
+ }
17892
+ return api.GET(`entity/change/${id}`, Api.PrepReqParams(reqParams));
17893
+ });
17894
+ }
17895
+ ChangeSet.GetEntityChange = GetEntityChange;
17896
+ /**
17897
+ * Gets the list of Entity Change records for the specified Change Set.
17898
+ * Supports pagination and filtering by action and Entity ID.
17899
+ */
17900
+ function GetEntityChangeList(params) {
17901
+ return __awaiter(this, void 0, void 0, function* () {
17902
+ let { changeId, api, req: reqParams, pageSize, pageIndex, status, entityId } = params;
17903
+ if (!api) {
17904
+ api = ENVIRONMENT.Api().GetBruceApi();
17905
+ }
17906
+ const urlParams = new URLSearchParams();
17907
+ if (pageSize != null) {
17908
+ urlParams.append("PageSize", String(pageSize));
17909
+ }
17910
+ if (pageIndex != null) {
17911
+ urlParams.append("PageIndex", String(pageIndex));
17912
+ }
17913
+ if (status != null) {
17914
+ const statuses = Array.isArray(status) ? status : [status];
17915
+ for (const s of statuses) {
17916
+ urlParams.append("Status", s);
17917
+ }
17918
+ }
17919
+ if (entityId != null) {
17920
+ const ids = Array.isArray(entityId) ? entityId : [entityId];
17921
+ for (const eid of ids) {
17922
+ urlParams.append("EntityID", eid);
17923
+ }
17924
+ }
17925
+ const query = urlParams.toString();
17926
+ return api.GET(query
17927
+ ? `entity/changes/by_change_id/${changeId}?${query}`
17928
+ : `entity/changes/by_change_id/${changeId}`, Api.PrepReqParams(reqParams));
17929
+ });
17930
+ }
17931
+ ChangeSet.GetEntityChangeList = GetEntityChangeList;
17932
+ /**
17933
+ * Gets a mapping of Entity.ID to Action ("C", "U", "D") for all Entity Change records.
17934
+ * Equivalent to GetEntityChangeList with Select=MAPPING.
17935
+ */
17936
+ function GetEntityChangeListMapping(params) {
17937
+ return __awaiter(this, void 0, void 0, function* () {
17938
+ let { changeId, api, req: reqParams, pageSize, pageIndex, status, entityId } = params;
17939
+ if (!api) {
17940
+ api = ENVIRONMENT.Api().GetBruceApi();
17941
+ }
17942
+ const urlParams = new URLSearchParams();
17943
+ urlParams.append("Select", "MAPPING");
17944
+ if (pageSize != null) {
17945
+ urlParams.append("PageSize", String(pageSize));
17946
+ }
17947
+ if (pageIndex != null) {
17948
+ urlParams.append("PageIndex", String(pageIndex));
17949
+ }
17950
+ if (status != null) {
17951
+ const statuses = Array.isArray(status) ? status : [status];
17952
+ for (const s of statuses) {
17953
+ urlParams.append("Status", s);
17954
+ }
17955
+ }
17956
+ if (entityId != null) {
17957
+ const ids = Array.isArray(entityId) ? entityId : [entityId];
17958
+ for (const eid of ids) {
17959
+ urlParams.append("EntityID", eid);
17960
+ }
17961
+ }
17962
+ return api.GET(`entity/changes/by_change_id/${changeId}?${urlParams.toString()}`, Api.PrepReqParams(reqParams));
17963
+ });
17964
+ }
17965
+ ChangeSet.GetEntityChangeListMapping = GetEntityChangeListMapping;
17966
+ /**
17967
+ * Updates existing or creates new Entity Change record within the specified Change Set.
17968
+ * To create a new record, omit entityChange.ID or set it to 0.
17969
+ */
17970
+ function UpdateEntityChange(params) {
17971
+ return __awaiter(this, void 0, void 0, function* () {
17972
+ let { changeId, entityChange: data, api, req: reqParams } = params;
17973
+ if (!api) {
17974
+ api = ENVIRONMENT.Api().GetBruceApi();
17975
+ }
17976
+ return yield api.POST(`entity/change/by_change_id/${changeId || 0}/${data.ID || 0}`, data, Api.PrepReqParams(reqParams));
17977
+ });
17978
+ }
17979
+ ChangeSet.UpdateEntityChange = UpdateEntityChange;
17980
+ /**
17981
+ * Deletes the specified Entity Change record.
17982
+ */
17983
+ function DeleteEntityChange(params) {
17984
+ return __awaiter(this, void 0, void 0, function* () {
17985
+ let { id, api, req: reqParams } = params;
17986
+ if (!api) {
17987
+ api = ENVIRONMENT.Api().GetBruceApi();
17988
+ }
17989
+ yield api.DELETE(`entity/change/${id}`, Api.PrepReqParams(reqParams));
17764
17990
  });
17765
17991
  }
17766
- ChangeSet.GetChangeSetContent = GetChangeSetContent;
17992
+ ChangeSet.DeleteEntityChange = DeleteEntityChange;
17767
17993
  })(ChangeSet || (ChangeSet = {}));
17768
17994
 
17769
17995
  // This is updated with the package.json version on build.
17770
- const VERSION = "7.1.22";
17996
+ const VERSION = "7.1.24";
17771
17997
 
17772
17998
  export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityTypeTrigger, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, DataFeed, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking, NavigatorChatClient, NavigatorMcpWebSocketClient, ChangeSet };
17773
17999
  //# sourceMappingURL=bruce-models.es5.js.map