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.
@@ -1032,51 +1032,11 @@
1032
1032
  if ((params === null || params === void 0 ? void 0 : params.cdn) && this.cdnBaseUrl) {
1033
1033
  return this.ConstructCdnUrl(params.url, params.urlParams);
1034
1034
  }
1035
- const tmp = new URL(this.baseUrl);
1036
- if (params === null || params === void 0 ? void 0 : params.urlParams) {
1037
- if (params.urlParams instanceof URLSearchParams) {
1038
- params.urlParams.forEach((value, key) => {
1039
- tmp.searchParams.append(key, value);
1040
- });
1041
- }
1042
- else {
1043
- for (const key in params.urlParams) {
1044
- tmp.searchParams.append(key, params.urlParams[key]);
1045
- }
1046
- }
1047
- }
1048
- // Ensure the url ends with a slash.
1049
- if (!tmp.pathname.endsWith("/")) {
1050
- tmp.pathname += "/";
1051
- }
1052
- let split;
1053
- if (params === null || params === void 0 ? void 0 : params.url) {
1054
- // Ensure we're only adding the path.
1055
- // The baseUrl could have included query params so have this extra logic.
1056
- split = params.url.split("?");
1057
- // Ensure the url does not start with a slash.
1058
- // This is because the base url already has a slash at the end.
1059
- let path = split[0];
1060
- if (path.startsWith("/")) {
1061
- path = path.substring(1);
1062
- }
1063
- tmp.pathname += path;
1064
- }
1065
- let full = tmp.toString();
1066
- // Append the query string if any exist.
1067
- if (split && split.length > 1) {
1068
- const query = split[1].split("&");
1069
- for (let q of query) {
1070
- if (full.includes("?")) {
1071
- full += "&";
1072
- }
1073
- else {
1074
- full += "?";
1075
- }
1076
- full += q;
1077
- }
1078
- }
1079
- return full;
1035
+ return exports.UrlUtils.ConstructUrl({
1036
+ existing: this.baseUrl,
1037
+ url: params === null || params === void 0 ? void 0 : params.url,
1038
+ urlParams: params === null || params === void 0 ? void 0 : params.urlParams
1039
+ });
1080
1040
  }
1081
1041
  /**
1082
1042
  * Returns a url routed through the API's CDN.
@@ -1089,51 +1049,11 @@
1089
1049
  if (!this.cdnBaseUrl) {
1090
1050
  return null;
1091
1051
  }
1092
- const tmp = new URL(this.cdnBaseUrl);
1093
- if (urlParams) {
1094
- if (urlParams instanceof URLSearchParams) {
1095
- urlParams.forEach((value, key) => {
1096
- tmp.searchParams.append(key, value);
1097
- });
1098
- }
1099
- else {
1100
- for (const key in urlParams) {
1101
- tmp.searchParams.append(key, urlParams[key]);
1102
- }
1103
- }
1104
- }
1105
- // Ensure the url ends with a slash.
1106
- if (!tmp.pathname.endsWith("/")) {
1107
- tmp.pathname += "/";
1108
- }
1109
- let split;
1110
- if (url) {
1111
- // Ensure we're only adding the path.
1112
- // The baseUrl could have included query params so have this extra logic.
1113
- split = url.split("?");
1114
- // Ensure the url does not start with a slash.
1115
- // This is because the base url already has a slash at the end.
1116
- let path = split[0];
1117
- if (path.startsWith("/")) {
1118
- path = url.substring(1);
1119
- }
1120
- tmp.pathname += path;
1121
- }
1122
- let full = tmp.toString();
1123
- // Append the query string if any exist.
1124
- if (split && split.length > 1) {
1125
- const query = split[1].split("&");
1126
- for (let q of query) {
1127
- if (full.includes("?")) {
1128
- full += "&";
1129
- }
1130
- else {
1131
- full += "?";
1132
- }
1133
- full += q;
1134
- }
1135
- }
1136
- return full;
1052
+ return exports.UrlUtils.ConstructUrl({
1053
+ existing: this.cdnBaseUrl,
1054
+ url: url,
1055
+ urlParams: urlParams
1056
+ });
1137
1057
  }
1138
1058
  /**
1139
1059
  * Warning: This will cancel the init process.
@@ -10035,15 +9955,6 @@
10035
9955
  // This is the expected default version for the DataVersion value.
10036
9956
  // This value should NOT be changed without looking at our API and seeing what the default value is.
10037
9957
  ProjectViewBookmark.DEFAULT_DATA_VERSION = 2;
10038
- /**
10039
- * Describes a bookmark file node.
10040
- */
10041
- let EBookmarkType;
10042
- (function (EBookmarkType) {
10043
- EBookmarkType["BOOKMARK"] = "bookmark";
10044
- EBookmarkType["FOLDER"] = "folder";
10045
- EBookmarkType["EXTRANODE"] = "extranode";
10046
- })(EBookmarkType = ProjectViewBookmark.EBookmarkType || (ProjectViewBookmark.EBookmarkType = {}));
10047
9958
  /**
10048
9959
  * Describes the content of a bookmark.
10049
9960
  * As part of a deal we've been commissioned to create an alternative bookmark type to embed content.
@@ -13242,6 +13153,58 @@
13242
13153
  return urlObj.toString();
13243
13154
  }
13244
13155
  UrlUtils.AddQueryParam = AddQueryParam;
13156
+ /**
13157
+ * Returns a url with the provided url appended to the provided existing url.
13158
+ * @param params
13159
+ */
13160
+ function ConstructUrl(params) {
13161
+ const tmp = new URL(params.existing);
13162
+ if (params === null || params === void 0 ? void 0 : params.urlParams) {
13163
+ if (params.urlParams instanceof URLSearchParams) {
13164
+ params.urlParams.forEach((value, key) => {
13165
+ tmp.searchParams.append(key, value);
13166
+ });
13167
+ }
13168
+ else {
13169
+ for (const key in params.urlParams) {
13170
+ tmp.searchParams.append(key, params.urlParams[key]);
13171
+ }
13172
+ }
13173
+ }
13174
+ // Ensure the url ends with a slash.
13175
+ if (!tmp.pathname.endsWith("/")) {
13176
+ tmp.pathname += "/";
13177
+ }
13178
+ let split;
13179
+ if (params === null || params === void 0 ? void 0 : params.url) {
13180
+ // Ensure we're only adding the path.
13181
+ // 'existing' could have included query params so have this extra logic.
13182
+ split = params.url.split("?");
13183
+ // Ensure the url does not start with a slash.
13184
+ // This is because the existing url already has a slash at the end.
13185
+ let path = split[0];
13186
+ if (path.startsWith("/")) {
13187
+ path = path.substring(1);
13188
+ }
13189
+ tmp.pathname += path;
13190
+ }
13191
+ let full = tmp.toString();
13192
+ // Append the query string if any exist.
13193
+ if (split && split.length > 1) {
13194
+ const query = split[1].split("&");
13195
+ for (let q of query) {
13196
+ if (full.includes("?")) {
13197
+ full += "&";
13198
+ }
13199
+ else {
13200
+ full += "?";
13201
+ }
13202
+ full += q;
13203
+ }
13204
+ }
13205
+ return full;
13206
+ }
13207
+ UrlUtils.ConstructUrl = ConstructUrl;
13245
13208
  })(exports.UrlUtils || (exports.UrlUtils = {}));
13246
13209
 
13247
13210
  (function (DataLab) {
@@ -14465,7 +14428,7 @@
14465
14428
  })(exports.DataSource || (exports.DataSource = {}));
14466
14429
 
14467
14430
  // This is updated with the package.json version on build.
14468
- const VERSION = "5.3.4";
14431
+ const VERSION = "5.3.6";
14469
14432
 
14470
14433
  exports.VERSION = VERSION;
14471
14434
  exports.AbstractApi = AbstractApi;