bruce-models 4.6.0 → 4.6.2

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.
@@ -1075,10 +1075,11 @@ var BruceApi;
1075
1075
  if (!tmp.pathname.endsWith("/")) {
1076
1076
  tmp.pathname += "/";
1077
1077
  }
1078
+ let split;
1078
1079
  if (params === null || params === void 0 ? void 0 : params.url) {
1079
1080
  // Ensure we're only adding the path.
1080
1081
  // The baseUrl could have included query params so have this extra logic.
1081
- const split = params.url.split("?");
1082
+ split = params.url.split("?");
1082
1083
  // Ensure the url does not start with a slash.
1083
1084
  // This is because the base url already has a slash at the end.
1084
1085
  let path = split[0];
@@ -1086,16 +1087,22 @@ var BruceApi;
1086
1087
  path = path.substring(1);
1087
1088
  }
1088
1089
  tmp.pathname += path;
1089
- // Append the query string if any exist.
1090
- if (split.length > 1) {
1091
- const query = split[1].split("&");
1092
- for (let q of query) {
1093
- const parts = q.split("=");
1094
- tmp.searchParams.append(parts[0], parts[1]);
1090
+ }
1091
+ let full = tmp.toString();
1092
+ // Append the query string if any exist.
1093
+ if (split && split.length > 1) {
1094
+ const query = split[1].split("&");
1095
+ for (let q of query) {
1096
+ if (full.includes("?")) {
1097
+ full += "&";
1098
+ }
1099
+ else {
1100
+ full += "?";
1095
1101
  }
1102
+ full += q;
1096
1103
  }
1097
1104
  }
1098
- return tmp.toString();
1105
+ return full;
1099
1106
  }
1100
1107
  /**
1101
1108
  * Returns a url routed through the API's CDN.
@@ -1125,10 +1132,11 @@ var BruceApi;
1125
1132
  if (!tmp.pathname.endsWith("/")) {
1126
1133
  tmp.pathname += "/";
1127
1134
  }
1135
+ let split;
1128
1136
  if (url) {
1129
1137
  // Ensure we're only adding the path.
1130
1138
  // The baseUrl could have included query params so have this extra logic.
1131
- let split = url.split("?");
1139
+ split = url.split("?");
1132
1140
  // Ensure the url does not start with a slash.
1133
1141
  // This is because the base url already has a slash at the end.
1134
1142
  let path = split[0];
@@ -1136,16 +1144,22 @@ var BruceApi;
1136
1144
  path = url.substring(1);
1137
1145
  }
1138
1146
  tmp.pathname += path;
1139
- // Append the query string if any exist.
1140
- if (split.length > 1) {
1141
- const query = split[1].split("&");
1142
- for (let q of query) {
1143
- const parts = q.split("=");
1144
- tmp.searchParams.append(parts[0], parts[1]);
1147
+ }
1148
+ let full = tmp.toString();
1149
+ // Append the query string if any exist.
1150
+ if (split && split.length > 1) {
1151
+ const query = split[1].split("&");
1152
+ for (let q of query) {
1153
+ if (full.includes("?")) {
1154
+ full += "&";
1155
+ }
1156
+ else {
1157
+ full += "?";
1145
1158
  }
1159
+ full += q;
1146
1160
  }
1147
1161
  }
1148
- return tmp.toString();
1162
+ return full;
1149
1163
  }
1150
1164
  /**
1151
1165
  * Warning: This will cancel the init process.
@@ -3822,10 +3836,13 @@ var Entity;
3822
3836
  urlParams.set("schema", schemaId);
3823
3837
  }
3824
3838
  urlParams.set("hasMigrated", String(Boolean(migrated)));
3839
+ let url = analysis ? "entities/summary" : "entities";
3840
+ // Adding url params here because this will avoid making them encoded.
3841
+ // Our API isn't decoding them properly so $expand is not being recognized.
3842
+ url += "?" + urlParams.toString();
3825
3843
  const urlStr = api.ConstructUrl({
3826
3844
  cdn: !analysis && viaCdn,
3827
- url: analysis ? "entities/summary" : "entities",
3828
- urlParams: urlParams
3845
+ url: url
3829
3846
  });
3830
3847
  const data = yield api.get(urlStr, Api.PrepReqParams(reqParams));
3831
3848
  if (!analysis) {
@@ -3845,10 +3862,13 @@ var Entity;
3845
3862
  urlParams.set("schema", schemaId);
3846
3863
  }
3847
3864
  urlParams.set("hasMigrated", String(Boolean(migrated)));
3865
+ let url = analysis ? "entities/summary" : "entities";
3866
+ // Adding url params here because this will avoid making them encoded.
3867
+ // Our API isn't decoding them properly so $expand is not being recognized.
3868
+ url += "?" + urlParams.toString();
3848
3869
  const urlStr = api.ConstructUrl({
3849
3870
  cdn: false,
3850
- url: analysis ? "entities/summary" : "entities",
3851
- urlParams: urlParams
3871
+ url: url
3852
3872
  });
3853
3873
  const data = yield api.post(urlStr, body, Api.PrepReqParams(reqParams));
3854
3874
  if (!analysis) {
@@ -13761,7 +13781,7 @@ var DataSource;
13761
13781
  })(DataSource || (DataSource = {}));
13762
13782
 
13763
13783
  // This is updated with the package.json version on build.
13764
- const VERSION = "4.6.0";
13784
+ const VERSION = "4.6.2";
13765
13785
 
13766
13786
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, 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, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
13767
13787
  //# sourceMappingURL=bruce-models.es5.js.map