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.
- package/dist/bruce-models.es5.js +63 -100
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +63 -100
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/api/bruce-api.js +10 -90
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/project/project-view-bookmark.js +0 -9
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/util/url-utils.js +52 -0
- package/dist/lib/util/url-utils.js.map +1 -1
- package/dist/types/account/account.d.ts +3 -0
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/project/project-view-bookmark.d.ts +0 -21
- package/dist/types/util/url-utils.d.ts +10 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -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
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
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
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
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.
|
|
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
|