bruce-models 7.1.117 → 7.1.119

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.
@@ -8886,6 +8886,7 @@ var ChangeSet;
8886
8886
  EConcept["ENTITY_TYPE"] = "ET";
8887
8887
  EConcept["ENTITY_LOD"] = "EL";
8888
8888
  EConcept["ENTITY_RELATION"] = "ER";
8889
+ EConcept["ASSEMBLY"] = "A";
8889
8890
  })(EConcept = ChangeSet.EConcept || (ChangeSet.EConcept = {}));
8890
8891
  /**
8891
8892
  * Updates existing or creates new Change Set record.
@@ -8922,11 +8923,18 @@ var ChangeSet;
8922
8923
  */
8923
8924
  function Get(params) {
8924
8925
  return __awaiter(this, void 0, void 0, function* () {
8925
- let { id, expandCount, api, req: reqParams } = params;
8926
+ let { id, expandCount, expandCountByConcept, api, req: reqParams } = params;
8926
8927
  if (!api) {
8927
8928
  api = ENVIRONMENT.Api().GetBruceApi();
8928
8929
  }
8929
- const query = expandCount ? "?Expand=Count" : "";
8930
+ const expand = [];
8931
+ if (expandCount) {
8932
+ expand.push("Count");
8933
+ }
8934
+ if (expandCountByConcept) {
8935
+ expand.push("CountByConcept");
8936
+ }
8937
+ const query = expand.length ? `?Expand=${expand.join(",")}` : "";
8930
8938
  return yield api.GET(`v3/change/${id}${query}`, Api.PrepReqParams(reqParams));
8931
8939
  });
8932
8940
  }
@@ -8985,13 +8993,10 @@ var ChangeSet;
8985
8993
  ChangeSet.Reject = Reject;
8986
8994
  /**
8987
8995
  * Gets the paged list of Change Items for the specified Change Set.
8988
- * Optionally filter by Concept (E, ET, EL, ER) and/or EntityID.
8989
- * TotalCount is returned when PageIndex is 0 (the default).
8990
- * Pass -1 for both pageSize and pageIndex to get only TotalCount.
8991
8996
  */
8992
8997
  function GetItems(params) {
8993
8998
  return __awaiter(this, void 0, void 0, function* () {
8994
- let { id, api, req: reqParams, pageSize, pageIndex, concept, entityId } = params;
8999
+ let { id, api, req: reqParams, pageSize, pageIndex, concept, action, entityId } = params;
8995
9000
  if (!api) {
8996
9001
  api = ENVIRONMENT.Api().GetBruceApi();
8997
9002
  }
@@ -9005,6 +9010,9 @@ var ChangeSet;
9005
9010
  if (concept != null) {
9006
9011
  urlParams.append("Concept", concept);
9007
9012
  }
9013
+ if (action != null) {
9014
+ urlParams.append("Action", action);
9015
+ }
9008
9016
  if (entityId != null) {
9009
9017
  urlParams.append("EntityID", entityId);
9010
9018
  }
@@ -9013,6 +9021,27 @@ var ChangeSet;
9013
9021
  });
9014
9022
  }
9015
9023
  ChangeSet.GetItems = GetItems;
9024
+ /**
9025
+ * Locates the first Change Item naming an Entity, so a paged list can turn to the page holding it.
9026
+ */
9027
+ function GetItemsIndexOf(params) {
9028
+ return __awaiter(this, void 0, void 0, function* () {
9029
+ let { id, entityId, concept, action, api, req: reqParams } = params;
9030
+ if (!api) {
9031
+ api = ENVIRONMENT.Api().GetBruceApi();
9032
+ }
9033
+ const urlParams = new URLSearchParams();
9034
+ urlParams.append("IndexOf", entityId);
9035
+ if (concept != null) {
9036
+ urlParams.append("Concept", concept);
9037
+ }
9038
+ if (action != null) {
9039
+ urlParams.append("Action", action);
9040
+ }
9041
+ return api.GET(`v3/change/${id}/items?${urlParams.toString()}`, Api.PrepReqParams(reqParams));
9042
+ });
9043
+ }
9044
+ ChangeSet.GetItemsIndexOf = GetItemsIndexOf;
9016
9045
  /**
9017
9046
  * Updates existing or creates new Change Item within the specified Change Set.
9018
9047
  * To create a new item omit changeItem.ID or set it to 0.
@@ -24381,6 +24410,8 @@ var EncryptUtils;
24381
24410
 
24382
24411
  var UrlUtils;
24383
24412
  (function (UrlUtils) {
24413
+ // The "S:{expires}.{signature}/" segment the API puts in the path of URLs it signs.
24414
+ const SIGNED_SEGMENT = /\/S:(\d+)\.[A-Za-z0-9_-]+\//;
24384
24415
  /**
24385
24416
  * Returns a url-safe string that is human readable.
24386
24417
  * Eg: 'My Project View!' into 'My-Project-View'.
@@ -24410,6 +24441,52 @@ var UrlUtils;
24410
24441
  return urlObj.toString();
24411
24442
  }
24412
24443
  UrlUtils.AddQueryParam = AddQueryParam;
24444
+ /**
24445
+ * Removes every occurrence of a query parameter from a url.
24446
+ * Eg: RemoveQueryParam('http://example.com/?key=value&other=1', 'key') => 'http://example.com/?other=1'
24447
+ * @param url absolute or relative url.
24448
+ * @param key decoded name of the parameter to remove.
24449
+ * @returns
24450
+ */
24451
+ function RemoveQueryParam(url, key) {
24452
+ if (!url) {
24453
+ return url;
24454
+ }
24455
+ const hashStart = url.indexOf("#");
24456
+ const hash = hashStart === -1 ? "" : url.substring(hashStart);
24457
+ const beforeHash = hashStart === -1 ? url : url.substring(0, hashStart);
24458
+ const queryStart = beforeHash.indexOf("?");
24459
+ if (queryStart === -1) {
24460
+ return url;
24461
+ }
24462
+ // Works on the raw string so the parameters that stay keep their exact encoding, which a signed query depends on.
24463
+ const kept = beforeHash.substring(queryStart + 1).split("&").filter(pair => {
24464
+ return decodeQueryName(pair.split("=")[0]) !== key;
24465
+ });
24466
+ const query = kept.length ? "?" + kept.join("&") : "";
24467
+ return beforeHash.substring(0, queryStart) + query + hash;
24468
+ }
24469
+ UrlUtils.RemoveQueryParam = RemoveQueryParam;
24470
+ /**
24471
+ * Returns true when the url carries an API signature that has not expired, so it authorises itself.
24472
+ * @param url
24473
+ * @returns
24474
+ */
24475
+ function IsSignedUrl(url) {
24476
+ const match = url === null || url === void 0 ? void 0 : url.match(SIGNED_SEGMENT);
24477
+ return !!match && Number(match[1]) * 1000 > Date.now();
24478
+ }
24479
+ UrlUtils.IsSignedUrl = IsSignedUrl;
24480
+ /**
24481
+ * Removes the API signature from a url.
24482
+ * Eg: comparing two urls for the same file that were signed at different times, or a link leaving the app that should grant no more than the reader's own access.
24483
+ * @param url
24484
+ * @returns
24485
+ */
24486
+ function RemoveSignature(url) {
24487
+ return url ? url.replace(SIGNED_SEGMENT, "/") : url;
24488
+ }
24489
+ UrlUtils.RemoveSignature = RemoveSignature;
24413
24490
  /**
24414
24491
  * Returns a url with the provided url appended to the provided existing url.
24415
24492
  * @param params
@@ -24462,6 +24539,17 @@ var UrlUtils;
24462
24539
  return full;
24463
24540
  }
24464
24541
  UrlUtils.ConstructUrl = ConstructUrl;
24542
+ /**
24543
+ * Decodes a query parameter name the way URLSearchParams does, keeping the raw name when it is malformed.
24544
+ */
24545
+ function decodeQueryName(name) {
24546
+ try {
24547
+ return decodeURIComponent(name.replace(/\+/g, " "));
24548
+ }
24549
+ catch (_a) {
24550
+ return name;
24551
+ }
24552
+ }
24465
24553
  })(UrlUtils || (UrlUtils = {}));
24466
24554
 
24467
24555
  var WorkflowItem;
@@ -25300,7 +25388,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
25300
25388
  }
25301
25389
 
25302
25390
  // This is updated with the package.json version on build.
25303
- const VERSION = "7.1.117";
25391
+ const VERSION = "7.1.119";
25304
25392
 
25305
25393
  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, RequestLane, 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, EntityTypeSource, 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, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
25306
25394
  //# sourceMappingURL=bruce-models.es5.js.map