bruce-models 5.3.4 → 5.3.6

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.
@@ -1041,51 +1041,11 @@ var BruceApi;
1041
1041
  if ((params === null || params === void 0 ? void 0 : params.cdn) && this.cdnBaseUrl) {
1042
1042
  return this.ConstructCdnUrl(params.url, params.urlParams);
1043
1043
  }
1044
- const tmp = new URL(this.baseUrl);
1045
- if (params === null || params === void 0 ? void 0 : params.urlParams) {
1046
- if (params.urlParams instanceof URLSearchParams) {
1047
- params.urlParams.forEach((value, key) => {
1048
- tmp.searchParams.append(key, value);
1049
- });
1050
- }
1051
- else {
1052
- for (const key in params.urlParams) {
1053
- tmp.searchParams.append(key, params.urlParams[key]);
1054
- }
1055
- }
1056
- }
1057
- // Ensure the url ends with a slash.
1058
- if (!tmp.pathname.endsWith("/")) {
1059
- tmp.pathname += "/";
1060
- }
1061
- let split;
1062
- if (params === null || params === void 0 ? void 0 : params.url) {
1063
- // Ensure we're only adding the path.
1064
- // The baseUrl could have included query params so have this extra logic.
1065
- split = params.url.split("?");
1066
- // Ensure the url does not start with a slash.
1067
- // This is because the base url already has a slash at the end.
1068
- let path = split[0];
1069
- if (path.startsWith("/")) {
1070
- path = path.substring(1);
1071
- }
1072
- tmp.pathname += path;
1073
- }
1074
- let full = tmp.toString();
1075
- // Append the query string if any exist.
1076
- if (split && split.length > 1) {
1077
- const query = split[1].split("&");
1078
- for (let q of query) {
1079
- if (full.includes("?")) {
1080
- full += "&";
1081
- }
1082
- else {
1083
- full += "?";
1084
- }
1085
- full += q;
1086
- }
1087
- }
1088
- return full;
1044
+ return UrlUtils.ConstructUrl({
1045
+ existing: this.baseUrl,
1046
+ url: params === null || params === void 0 ? void 0 : params.url,
1047
+ urlParams: params === null || params === void 0 ? void 0 : params.urlParams
1048
+ });
1089
1049
  }
1090
1050
  /**
1091
1051
  * Returns a url routed through the API's CDN.
@@ -1098,51 +1058,11 @@ var BruceApi;
1098
1058
  if (!this.cdnBaseUrl) {
1099
1059
  return null;
1100
1060
  }
1101
- const tmp = new URL(this.cdnBaseUrl);
1102
- if (urlParams) {
1103
- if (urlParams instanceof URLSearchParams) {
1104
- urlParams.forEach((value, key) => {
1105
- tmp.searchParams.append(key, value);
1106
- });
1107
- }
1108
- else {
1109
- for (const key in urlParams) {
1110
- tmp.searchParams.append(key, urlParams[key]);
1111
- }
1112
- }
1113
- }
1114
- // Ensure the url ends with a slash.
1115
- if (!tmp.pathname.endsWith("/")) {
1116
- tmp.pathname += "/";
1117
- }
1118
- let split;
1119
- if (url) {
1120
- // Ensure we're only adding the path.
1121
- // The baseUrl could have included query params so have this extra logic.
1122
- split = url.split("?");
1123
- // Ensure the url does not start with a slash.
1124
- // This is because the base url already has a slash at the end.
1125
- let path = split[0];
1126
- if (path.startsWith("/")) {
1127
- path = url.substring(1);
1128
- }
1129
- tmp.pathname += path;
1130
- }
1131
- let full = tmp.toString();
1132
- // Append the query string if any exist.
1133
- if (split && split.length > 1) {
1134
- const query = split[1].split("&");
1135
- for (let q of query) {
1136
- if (full.includes("?")) {
1137
- full += "&";
1138
- }
1139
- else {
1140
- full += "?";
1141
- }
1142
- full += q;
1143
- }
1144
- }
1145
- return full;
1061
+ return UrlUtils.ConstructUrl({
1062
+ existing: this.cdnBaseUrl,
1063
+ url: url,
1064
+ urlParams: urlParams
1065
+ });
1146
1066
  }
1147
1067
  /**
1148
1068
  * Warning: This will cancel the init process.
@@ -10224,15 +10144,6 @@ var ProjectViewBookmark;
10224
10144
  // This is the expected default version for the DataVersion value.
10225
10145
  // This value should NOT be changed without looking at our API and seeing what the default value is.
10226
10146
  ProjectViewBookmark.DEFAULT_DATA_VERSION = 2;
10227
- /**
10228
- * Describes a bookmark file node.
10229
- */
10230
- let EBookmarkType;
10231
- (function (EBookmarkType) {
10232
- EBookmarkType["BOOKMARK"] = "bookmark";
10233
- EBookmarkType["FOLDER"] = "folder";
10234
- EBookmarkType["EXTRANODE"] = "extranode";
10235
- })(EBookmarkType = ProjectViewBookmark.EBookmarkType || (ProjectViewBookmark.EBookmarkType = {}));
10236
10147
  /**
10237
10148
  * Describes the content of a bookmark.
10238
10149
  * As part of a deal we've been commissioned to create an alternative bookmark type to embed content.
@@ -13495,6 +13406,58 @@ var UrlUtils;
13495
13406
  return urlObj.toString();
13496
13407
  }
13497
13408
  UrlUtils.AddQueryParam = AddQueryParam;
13409
+ /**
13410
+ * Returns a url with the provided url appended to the provided existing url.
13411
+ * @param params
13412
+ */
13413
+ function ConstructUrl(params) {
13414
+ const tmp = new URL(params.existing);
13415
+ if (params === null || params === void 0 ? void 0 : params.urlParams) {
13416
+ if (params.urlParams instanceof URLSearchParams) {
13417
+ params.urlParams.forEach((value, key) => {
13418
+ tmp.searchParams.append(key, value);
13419
+ });
13420
+ }
13421
+ else {
13422
+ for (const key in params.urlParams) {
13423
+ tmp.searchParams.append(key, params.urlParams[key]);
13424
+ }
13425
+ }
13426
+ }
13427
+ // Ensure the url ends with a slash.
13428
+ if (!tmp.pathname.endsWith("/")) {
13429
+ tmp.pathname += "/";
13430
+ }
13431
+ let split;
13432
+ if (params === null || params === void 0 ? void 0 : params.url) {
13433
+ // Ensure we're only adding the path.
13434
+ // 'existing' could have included query params so have this extra logic.
13435
+ split = params.url.split("?");
13436
+ // Ensure the url does not start with a slash.
13437
+ // This is because the existing url already has a slash at the end.
13438
+ let path = split[0];
13439
+ if (path.startsWith("/")) {
13440
+ path = path.substring(1);
13441
+ }
13442
+ tmp.pathname += path;
13443
+ }
13444
+ let full = tmp.toString();
13445
+ // Append the query string if any exist.
13446
+ if (split && split.length > 1) {
13447
+ const query = split[1].split("&");
13448
+ for (let q of query) {
13449
+ if (full.includes("?")) {
13450
+ full += "&";
13451
+ }
13452
+ else {
13453
+ full += "?";
13454
+ }
13455
+ full += q;
13456
+ }
13457
+ }
13458
+ return full;
13459
+ }
13460
+ UrlUtils.ConstructUrl = ConstructUrl;
13498
13461
  })(UrlUtils || (UrlUtils = {}));
13499
13462
 
13500
13463
  /**
@@ -14746,7 +14709,7 @@ var DataSource;
14746
14709
  })(DataSource || (DataSource = {}));
14747
14710
 
14748
14711
  // This is updated with the package.json version on build.
14749
- const VERSION = "5.3.4";
14712
+ const VERSION = "5.3.6";
14750
14713
 
14751
14714
  export { VERSION, 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, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
14752
14715
  //# sourceMappingURL=bruce-models.es5.js.map