bruce-models 7.1.116 → 7.1.118

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.
@@ -17443,6 +17443,7 @@ var EntityTypeTrigger;
17443
17443
  (function (EType) {
17444
17444
  EType["DataLabQuery"] = "DataLabQuery";
17445
17445
  EType["WorkflowTicket"] = "WorkflowTicket";
17446
+ EType["CreateEntity"] = "CreateEntity";
17446
17447
  })(EType = EntityTypeTrigger.EType || (EntityTypeTrigger.EType = {}));
17447
17448
  /**
17448
17449
  * Builds the Settings payload for a WorkflowTicket trigger.
@@ -24380,6 +24381,8 @@ var EncryptUtils;
24380
24381
 
24381
24382
  var UrlUtils;
24382
24383
  (function (UrlUtils) {
24384
+ // The "S:{expires}.{signature}/" segment the API puts in the path of URLs it signs.
24385
+ const SIGNED_SEGMENT = /\/S:(\d+)\.[A-Za-z0-9_-]+\//;
24383
24386
  /**
24384
24387
  * Returns a url-safe string that is human readable.
24385
24388
  * Eg: 'My Project View!' into 'My-Project-View'.
@@ -24409,6 +24412,52 @@ var UrlUtils;
24409
24412
  return urlObj.toString();
24410
24413
  }
24411
24414
  UrlUtils.AddQueryParam = AddQueryParam;
24415
+ /**
24416
+ * Removes every occurrence of a query parameter from a url.
24417
+ * Eg: RemoveQueryParam('http://example.com/?key=value&other=1', 'key') => 'http://example.com/?other=1'
24418
+ * @param url absolute or relative url.
24419
+ * @param key decoded name of the parameter to remove.
24420
+ * @returns
24421
+ */
24422
+ function RemoveQueryParam(url, key) {
24423
+ if (!url) {
24424
+ return url;
24425
+ }
24426
+ const hashStart = url.indexOf("#");
24427
+ const hash = hashStart === -1 ? "" : url.substring(hashStart);
24428
+ const beforeHash = hashStart === -1 ? url : url.substring(0, hashStart);
24429
+ const queryStart = beforeHash.indexOf("?");
24430
+ if (queryStart === -1) {
24431
+ return url;
24432
+ }
24433
+ // Works on the raw string so the parameters that stay keep their exact encoding, which a signed query depends on.
24434
+ const kept = beforeHash.substring(queryStart + 1).split("&").filter(pair => {
24435
+ return decodeQueryName(pair.split("=")[0]) !== key;
24436
+ });
24437
+ const query = kept.length ? "?" + kept.join("&") : "";
24438
+ return beforeHash.substring(0, queryStart) + query + hash;
24439
+ }
24440
+ UrlUtils.RemoveQueryParam = RemoveQueryParam;
24441
+ /**
24442
+ * Returns true when the url carries an API signature that has not expired, so it authorises itself.
24443
+ * @param url
24444
+ * @returns
24445
+ */
24446
+ function IsSignedUrl(url) {
24447
+ const match = url === null || url === void 0 ? void 0 : url.match(SIGNED_SEGMENT);
24448
+ return !!match && Number(match[1]) * 1000 > Date.now();
24449
+ }
24450
+ UrlUtils.IsSignedUrl = IsSignedUrl;
24451
+ /**
24452
+ * Removes the API signature from a url.
24453
+ * 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.
24454
+ * @param url
24455
+ * @returns
24456
+ */
24457
+ function RemoveSignature(url) {
24458
+ return url ? url.replace(SIGNED_SEGMENT, "/") : url;
24459
+ }
24460
+ UrlUtils.RemoveSignature = RemoveSignature;
24412
24461
  /**
24413
24462
  * Returns a url with the provided url appended to the provided existing url.
24414
24463
  * @param params
@@ -24461,6 +24510,17 @@ var UrlUtils;
24461
24510
  return full;
24462
24511
  }
24463
24512
  UrlUtils.ConstructUrl = ConstructUrl;
24513
+ /**
24514
+ * Decodes a query parameter name the way URLSearchParams does, keeping the raw name when it is malformed.
24515
+ */
24516
+ function decodeQueryName(name) {
24517
+ try {
24518
+ return decodeURIComponent(name.replace(/\+/g, " "));
24519
+ }
24520
+ catch (_a) {
24521
+ return name;
24522
+ }
24523
+ }
24464
24524
  })(UrlUtils || (UrlUtils = {}));
24465
24525
 
24466
24526
  var WorkflowItem;
@@ -25299,7 +25359,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
25299
25359
  }
25300
25360
 
25301
25361
  // This is updated with the package.json version on build.
25302
- const VERSION = "7.1.116";
25362
+ const VERSION = "7.1.118";
25303
25363
 
25304
25364
  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 };
25305
25365
  //# sourceMappingURL=bruce-models.es5.js.map