bruce-models 4.5.9 → 4.6.1
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.
- package/dist/bruce-models.es5.js +47 -13
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +47 -13
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/bruce-api.js +46 -12
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -1055,9 +1055,6 @@ var BruceApi;
|
|
|
1055
1055
|
* @param params
|
|
1056
1056
|
*/
|
|
1057
1057
|
ConstructUrl(params) {
|
|
1058
|
-
if (!(params === null || params === void 0 ? void 0 : params.url)) {
|
|
1059
|
-
return null;
|
|
1060
|
-
}
|
|
1061
1058
|
if ((params === null || params === void 0 ? void 0 : params.cdn) && this.cdnBaseUrl) {
|
|
1062
1059
|
return this.ConstructCdnUrl(params.url, params.urlParams);
|
|
1063
1060
|
}
|
|
@@ -1078,15 +1075,34 @@ var BruceApi;
|
|
|
1078
1075
|
if (!tmp.pathname.endsWith("/")) {
|
|
1079
1076
|
tmp.pathname += "/";
|
|
1080
1077
|
}
|
|
1078
|
+
let split;
|
|
1081
1079
|
if (params === null || params === void 0 ? void 0 : params.url) {
|
|
1080
|
+
// Ensure we're only adding the path.
|
|
1081
|
+
// The baseUrl could have included query params so have this extra logic.
|
|
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
|
-
|
|
1085
|
+
let path = split[0];
|
|
1086
|
+
if (path.startsWith("/")) {
|
|
1087
|
+
path = path.substring(1);
|
|
1088
|
+
}
|
|
1089
|
+
tmp.pathname += path;
|
|
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 += "?";
|
|
1101
|
+
}
|
|
1102
|
+
full += q;
|
|
1086
1103
|
}
|
|
1087
|
-
tmp.pathname += params.url;
|
|
1088
1104
|
}
|
|
1089
|
-
return
|
|
1105
|
+
return full;
|
|
1090
1106
|
}
|
|
1091
1107
|
/**
|
|
1092
1108
|
* Returns a url routed through the API's CDN.
|
|
@@ -1117,12 +1133,24 @@ var BruceApi;
|
|
|
1117
1133
|
tmp.pathname += "/";
|
|
1118
1134
|
}
|
|
1119
1135
|
if (url) {
|
|
1136
|
+
// Ensure we're only adding the path.
|
|
1137
|
+
// The baseUrl could have included query params so have this extra logic.
|
|
1138
|
+
let split = url.split("?");
|
|
1120
1139
|
// Ensure the url does not start with a slash.
|
|
1121
1140
|
// This is because the base url already has a slash at the end.
|
|
1122
|
-
|
|
1123
|
-
|
|
1141
|
+
let path = split[0];
|
|
1142
|
+
if (path.startsWith("/")) {
|
|
1143
|
+
path = url.substring(1);
|
|
1144
|
+
}
|
|
1145
|
+
tmp.pathname += path;
|
|
1146
|
+
// Append the query string if any exist.
|
|
1147
|
+
if (split.length > 1) {
|
|
1148
|
+
const query = split[1].split("&");
|
|
1149
|
+
for (let q of query) {
|
|
1150
|
+
const parts = q.split("=");
|
|
1151
|
+
tmp.searchParams.append(parts[0], parts[1]);
|
|
1152
|
+
}
|
|
1124
1153
|
}
|
|
1125
|
-
tmp.pathname += url;
|
|
1126
1154
|
}
|
|
1127
1155
|
return tmp.toString();
|
|
1128
1156
|
}
|
|
@@ -1134,8 +1162,14 @@ var BruceApi;
|
|
|
1134
1162
|
*/
|
|
1135
1163
|
SetBaseUrl(url) {
|
|
1136
1164
|
this.baseUrl = url;
|
|
1137
|
-
|
|
1138
|
-
|
|
1165
|
+
// If we're setting a valid URL then we'll ensure it ends with a slash.
|
|
1166
|
+
if (this.baseUrl && (this.baseUrl.startsWith("http://") || this.baseUrl.startsWith("https://"))) {
|
|
1167
|
+
// Parsing into URL object to avoid adding a "/" after query params.
|
|
1168
|
+
const full = new URL(this.baseUrl);
|
|
1169
|
+
if (!full.pathname.endsWith("/")) {
|
|
1170
|
+
full.pathname += "/";
|
|
1171
|
+
}
|
|
1172
|
+
this.baseUrl = full.toString();
|
|
1139
1173
|
}
|
|
1140
1174
|
this.loadCancelled = true;
|
|
1141
1175
|
}
|
|
@@ -13734,7 +13768,7 @@ var DataSource;
|
|
|
13734
13768
|
})(DataSource || (DataSource = {}));
|
|
13735
13769
|
|
|
13736
13770
|
// This is updated with the package.json version on build.
|
|
13737
|
-
const VERSION = "4.
|
|
13771
|
+
const VERSION = "4.6.1";
|
|
13738
13772
|
|
|
13739
13773
|
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 };
|
|
13740
13774
|
//# sourceMappingURL=bruce-models.es5.js.map
|