@itwin/rpcinterface-full-stack-tests 4.4.0-dev.28 → 4.4.0-dev.29

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.
@@ -1 +1 @@
1
- {"version":3,"file":"_bea9.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\7\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.1.6\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"_bea9.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\486\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.1.6\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
@@ -143095,6 +143095,62 @@ async function fetchWithRetry(fetchFunc, remainingRetries) {
143095
143095
  }
143096
143096
 
143097
143097
 
143098
+ /***/ }),
143099
+
143100
+ /***/ "../../core/frontend/lib/esm/request/utils.js":
143101
+ /*!****************************************************!*\
143102
+ !*** ../../core/frontend/lib/esm/request/utils.js ***!
143103
+ \****************************************************/
143104
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
143105
+
143106
+ "use strict";
143107
+ __webpack_require__.r(__webpack_exports__);
143108
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
143109
+ /* harmony export */ "headersIncludeAuthMethod": () => (/* binding */ headersIncludeAuthMethod),
143110
+ /* harmony export */ "setBasicAuthorization": () => (/* binding */ setBasicAuthorization)
143111
+ /* harmony export */ });
143112
+ /* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
143113
+ /*---------------------------------------------------------------------------------------------
143114
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
143115
+ * See LICENSE.md in the project root for license terms and full copyright notice.
143116
+ *--------------------------------------------------------------------------------------------*/
143117
+
143118
+ /**
143119
+ * Check whether or not one of the requested authentication method is listed in the HTTP 'WWW-Authenticate' response header
143120
+ * @param headers Headers object
143121
+ * @param query List of authentication method to lookup (case-insensitive)
143122
+ * @note For CORS requests, the 'Access-Control-Expose-Headers' header from the server must make the 'WWW-Authenticate' available to the browser, otherwise this won't work.
143123
+ * @internal
143124
+ */
143125
+ function headersIncludeAuthMethod(headers, query) {
143126
+ const wwwAuthenticate = headers.get("WWW-authenticate");
143127
+ const lowerCaseQuery = query.map(((value) => value.toLowerCase())); // not case-sensitive
143128
+ if (wwwAuthenticate !== null) {
143129
+ const authMethods = wwwAuthenticate.split(",").map(((value) => value.toLowerCase().trim()));
143130
+ for (const queryValue of lowerCaseQuery) {
143131
+ if (authMethods.includes(queryValue))
143132
+ return true;
143133
+ }
143134
+ }
143135
+ return false;
143136
+ }
143137
+ /** @internal */
143138
+ function setBasicAuthorization(headers, userOrCreds, password) {
143139
+ let username;
143140
+ let pwd;
143141
+ if (typeof userOrCreds === "string") {
143142
+ username = userOrCreds;
143143
+ pwd = password;
143144
+ }
143145
+ else {
143146
+ username = userOrCreds.user;
143147
+ pwd = userOrCreds.password;
143148
+ }
143149
+ if (username !== undefined && pwd !== undefined)
143150
+ headers.set("Authorization", `Basic ${_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.Base64EncodedString.encode(`${username}:${pwd}`)}`);
143151
+ }
143152
+
143153
+
143098
143154
  /***/ }),
143099
143155
 
143100
143156
  /***/ "../../core/frontend/lib/esm/tile/B3dmReader.js":
@@ -155146,6 +155202,7 @@ __webpack_require__.r(__webpack_exports__);
155146
155202
  /* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
155147
155203
  /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
155148
155204
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
155205
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
155149
155206
  /*---------------------------------------------------------------------------------------------
155150
155207
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
155151
155208
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -155153,6 +155210,7 @@ __webpack_require__.r(__webpack_exports__);
155153
155210
 
155154
155211
 
155155
155212
 
155213
+
155156
155214
  /** @packageDocumentation
155157
155215
  * @module Tiles
155158
155216
  */
@@ -155375,6 +155433,10 @@ class ArcGisUtilities {
155375
155433
  }
155376
155434
  }
155377
155435
  let response = await fetch(tmpUrl.toString(), { method: "GET" });
155436
+ if (response.status === 401 && !requireToken && (0,_request_utils__WEBPACK_IMPORTED_MODULE_3__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])) {
155437
+ // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)
155438
+ response = await fetch(url, { method: "GET", credentials: "include" });
155439
+ }
155378
155440
  // Append security token when corresponding error code is returned by ArcGIS service
155379
155441
  let errorCode = await ArcGisUtilities.checkForResponseErrorCode(response);
155380
155442
  if (!accessTokenRequired
@@ -156236,6 +156298,7 @@ __webpack_require__.r(__webpack_exports__);
156236
156298
  /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../internal */ "../../core/frontend/lib/esm/tile/internal.js");
156237
156299
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
156238
156300
  /* harmony import */ var _NotificationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../NotificationManager */ "../../core/frontend/lib/esm/NotificationManager.js");
156301
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
156239
156302
  /*---------------------------------------------------------------------------------------------
156240
156303
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
156241
156304
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -156246,6 +156309,7 @@ __webpack_require__.r(__webpack_exports__);
156246
156309
 
156247
156310
 
156248
156311
 
156312
+
156249
156313
  /** Base class for ArcGIS map-layer imagery providers.
156250
156314
  *
156251
156315
  * The initial purpose of this class is to offer shared methods
@@ -156325,50 +156389,71 @@ class ArcGISImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_0__.MapLa
156325
156389
  password: this._settings.password
156326
156390
  });
156327
156391
  }
156328
- let response = await fetch(urlObj.toString(), options);
156329
- if ((this._lastAccessToken && response.status === 400)
156330
- || response.headers.get("content-type")?.toLowerCase().includes("htm")) {
156331
- // For some reasons when we make a request with the fetch() api and there is a token error
156332
- // we receive a status 400 instead of proper json response. (i.e doing the same request in the browser gives a different response)
156333
- // For some other request, we also seen error message in html.
156334
- // When it occurs, we fall back to root service request so we get a proper JSON response with error code.
156335
- const tmpUrl = new URL(this._settings.url);
156336
- if (this._lastAccessToken && this._accessTokenRequired)
156337
- tmpUrl.searchParams.append("token", this._lastAccessToken.token);
156338
- tmpUrl.searchParams.append("f", "json");
156339
- response = await fetch(tmpUrl.toString(), options);
156340
- }
156341
- errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
156342
- if (errorCode !== undefined &&
156343
- (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken)) {
156344
- if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken) {
156345
- // **** Legacy token ONLY ***
156346
- // Token might have expired, make a second attempt by forcing new token.
156347
- if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)
156348
- this._accessClient.invalidateToken(this._lastAccessToken);
156349
- const urlObj2 = new URL(url);
156350
- if (this._accessClient) {
156351
- try {
156352
- this._lastAccessToken = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, { mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });
156392
+ // We want to complete the first request before letting other requests go;
156393
+ // this done to avoid flooding server with requests missing credentials
156394
+ if (!this._firstRequestPromise)
156395
+ this._firstRequestPromise = new Promise((resolve) => this.onFirstRequestCompleted.addOnce(() => resolve()));
156396
+ else
156397
+ await this._firstRequestPromise;
156398
+ let response;
156399
+ try {
156400
+ response = await fetch(urlObj.toString(), { ...options, credentials: this._includeUserCredentials ? "include" : undefined });
156401
+ if (response.status === 401 && !this._lastAccessToken && (0,_request_utils__WEBPACK_IMPORTED_MODULE_3__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])) {
156402
+ // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)
156403
+ response = await fetch(url, { ...options, credentials: "include" });
156404
+ if (response.status === 200) {
156405
+ this._includeUserCredentials = true; // avoid going through 401 challenges over and over
156406
+ }
156407
+ }
156408
+ if ((this._lastAccessToken && response.status === 400)
156409
+ || response.headers.get("content-type")?.toLowerCase().includes("htm")) {
156410
+ // For some reasons when we make a request with the fetch() api and there is a token error
156411
+ // we receive a status 400 instead of proper json response. (i.e doing the same request in the browser gives a different response)
156412
+ // For some other request, we also seen error message in html.
156413
+ // When it occurs, we fall back to root service request so we get a proper JSON response with error code.
156414
+ const tmpUrl = new URL(this._settings.url);
156415
+ if (this._lastAccessToken && this._accessTokenRequired)
156416
+ tmpUrl.searchParams.append("token", this._lastAccessToken.token);
156417
+ tmpUrl.searchParams.append("f", "json");
156418
+ response = await fetch(tmpUrl.toString(), options);
156419
+ }
156420
+ errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
156421
+ if (errorCode !== undefined &&
156422
+ (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken)) {
156423
+ if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken) {
156424
+ // **** Legacy token ONLY ***
156425
+ // Token might have expired, make a second attempt by forcing new token.
156426
+ if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)
156427
+ this._accessClient.invalidateToken(this._lastAccessToken);
156428
+ const urlObj2 = new URL(url);
156429
+ if (this._accessClient) {
156430
+ try {
156431
+ this._lastAccessToken = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, { mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });
156432
+ }
156433
+ catch {
156434
+ }
156353
156435
  }
156354
- catch {
156436
+ // Make a second attempt with refreshed token
156437
+ response = await fetch(urlObj2.toString(), options);
156438
+ errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
156439
+ }
156440
+ if (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken) {
156441
+ // Looks like the initially generated token has expired.
156442
+ if (this.status === _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.Valid) {
156443
+ // Only report new status change to avoid spamming the UI
156444
+ this.setStatus(_internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.RequireAuth);
156445
+ this.onStatusChanged.raiseEvent(this);
156446
+ const msg = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Messages.FetchTooltipTokenError", { layerName: this._settings.name });
156447
+ _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.notifications.outputMessage(new _NotificationManager__WEBPACK_IMPORTED_MODULE_2__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_2__.OutputMessagePriority.Warning, msg));
156355
156448
  }
156356
156449
  }
156357
- // Make a second attempt with refreshed token
156358
- response = await fetch(urlObj2.toString(), options);
156359
- errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
156360
- }
156361
- if (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken) {
156362
- // Looks like the initially generated token has expired.
156363
- if (this.status === _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.Valid) {
156364
- // Only report new status change to avoid spamming the UI
156365
- this.setStatus(_internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.RequireAuth);
156366
- this.onStatusChanged.raiseEvent(this);
156367
- const msg = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Messages.FetchTooltipTokenError", { layerName: this._settings.name });
156368
- _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.notifications.outputMessage(new _NotificationManager__WEBPACK_IMPORTED_MODULE_2__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_2__.OutputMessagePriority.Warning, msg));
156369
- }
156370
156450
  }
156371
156451
  }
156452
+ finally {
156453
+ this.onFirstRequestCompleted.raiseEvent();
156454
+ }
156455
+ if (response === undefined)
156456
+ throw new Error("fetch call failed");
156372
156457
  return response;
156373
156458
  }
156374
156459
  }
@@ -158806,6 +158891,7 @@ __webpack_require__.r(__webpack_exports__);
158806
158891
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
158807
158892
  /* harmony import */ var _NotificationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../NotificationManager */ "../../core/frontend/lib/esm/NotificationManager.js");
158808
158893
  /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
158894
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
158809
158895
  /*---------------------------------------------------------------------------------------------
158810
158896
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
158811
158897
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -158819,6 +158905,7 @@ __webpack_require__.r(__webpack_exports__);
158819
158905
 
158820
158906
 
158821
158907
 
158908
+
158822
158909
  /** @internal */
158823
158910
  const tileImageSize = 256, untiledImageSize = 256;
158824
158911
  const earthRadius = 6378137;
@@ -158865,6 +158952,10 @@ class MapLayerImageryProvider {
158865
158952
  this._geographicTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.GeographicTilingScheme();
158866
158953
  /** @internal */
158867
158954
  this._status = MapLayerImageryProviderStatus.Valid;
158955
+ /** @internal */
158956
+ this._includeUserCredentials = false;
158957
+ /** @internal */
158958
+ this.onFirstRequestCompleted = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
158868
158959
  /**
158869
158960
  * This value is used internally for various computations, this should not get overriden.
158870
158961
  * @internal
@@ -158984,17 +159075,48 @@ class MapLayerImageryProvider {
158984
159075
  /** @internal */
158985
159076
  setRequestAuthorization(headers) {
158986
159077
  if (this._settings.userName && this._settings.password) {
158987
- headers.set("Authorization", `Basic ${_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Base64EncodedString.encode(`${this._settings.userName}:${this._settings.password}`)}`);
159078
+ (0,_request_utils__WEBPACK_IMPORTED_MODULE_6__.setBasicAuthorization)(headers, this._settings.userName, this._settings.password);
158988
159079
  }
158989
159080
  }
158990
159081
  /** @internal */
158991
159082
  async makeTileRequest(url) {
158992
- let headers;
158993
- if (this._settings.userName && this._settings.password) {
158994
- headers = new Headers();
158995
- this.setRequestAuthorization(headers);
159083
+ // We want to complete the first request before letting other requests go;
159084
+ // this done to avoid flooding server with requests missing credentials
159085
+ if (!this._firstRequestPromise)
159086
+ this._firstRequestPromise = new Promise((resolve) => this.onFirstRequestCompleted.addOnce(() => resolve()));
159087
+ else
159088
+ await this._firstRequestPromise;
159089
+ let response;
159090
+ try {
159091
+ let headers;
159092
+ let hasCreds = false;
159093
+ if (this._settings.userName && this._settings.password) {
159094
+ hasCreds = true;
159095
+ headers = new Headers();
159096
+ this.setRequestAuthorization(headers);
159097
+ }
159098
+ response = await fetch(url, {
159099
+ method: "GET",
159100
+ headers,
159101
+ credentials: this._includeUserCredentials ? "include" : undefined,
159102
+ });
159103
+ if (response.status === 401
159104
+ && (0,_request_utils__WEBPACK_IMPORTED_MODULE_6__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])
159105
+ && !this._includeUserCredentials
159106
+ && !hasCreds) {
159107
+ // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)
159108
+ response = await fetch(url, { method: "GET", credentials: "include" });
159109
+ if (response.status === 200) {
159110
+ this._includeUserCredentials = true; // avoid going through 401 challenges over and over
159111
+ }
159112
+ }
158996
159113
  }
158997
- return fetch(url, { method: "GET", headers });
159114
+ finally {
159115
+ this.onFirstRequestCompleted.raiseEvent();
159116
+ }
159117
+ if (response === undefined)
159118
+ throw new Error("fetch call failed");
159119
+ return response;
158998
159120
  }
158999
159121
  /** Returns a map layer tile at the specified settings. */
159000
159122
  async loadTile(row, column, zoomLevel) {
@@ -159027,7 +159149,11 @@ class MapLayerImageryProvider {
159027
159149
  const headers = new Headers();
159028
159150
  this.setRequestAuthorization(headers);
159029
159151
  try {
159030
- const response = await fetch(url, { method: "GET", headers });
159152
+ const response = await fetch(url, {
159153
+ method: "GET",
159154
+ headers,
159155
+ credentials: this._includeUserCredentials ? "include" : undefined,
159156
+ });
159031
159157
  const text = await response.text();
159032
159158
  if (undefined !== text) {
159033
159159
  strings.push(text);
@@ -162197,10 +162323,9 @@ __webpack_require__.r(__webpack_exports__);
162197
162323
  /* harmony export */ "WmsCapabilities": () => (/* binding */ WmsCapabilities),
162198
162324
  /* harmony export */ "WmsCapability": () => (/* binding */ WmsCapability)
162199
162325
  /* harmony export */ });
162200
- /* harmony import */ var _request_Request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../request/Request */ "../../core/frontend/lib/esm/request/Request.js");
162201
- /* harmony import */ var wms_capabilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! wms-capabilities */ "../../common/temp/node_modules/.pnpm/wms-capabilities@0.4.0/node_modules/wms-capabilities/dist/wms-capabilities.min.js");
162202
- /* harmony import */ var wms_capabilities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(wms_capabilities__WEBPACK_IMPORTED_MODULE_1__);
162203
- /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
162326
+ /* harmony import */ var wms_capabilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! wms-capabilities */ "../../common/temp/node_modules/.pnpm/wms-capabilities@0.4.0/node_modules/wms-capabilities/dist/wms-capabilities.min.js");
162327
+ /* harmony import */ var wms_capabilities__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(wms_capabilities__WEBPACK_IMPORTED_MODULE_0__);
162328
+ /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
162204
162329
  /*---------------------------------------------------------------------------------------------
162205
162330
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
162206
162331
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -162210,22 +162335,8 @@ __webpack_require__.r(__webpack_exports__);
162210
162335
  */
162211
162336
 
162212
162337
 
162213
-
162214
- /**
162215
- * fetch XML from HTTP request
162216
- * @param url server URL to address the request
162217
- * @internal
162218
- */
162219
- async function getXml(url, credentials) {
162220
- const options = {
162221
- timeout: 20000,
162222
- retryCount: 2,
162223
- auth: credentials,
162224
- };
162225
- return (0,_request_Request__WEBPACK_IMPORTED_MODULE_0__.request)(url, "text", options);
162226
- }
162227
162338
  function rangeFromJSONArray(json) {
162228
- return (Array.isArray(json) && json.length === 4) ? _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.fromDegrees(json[0], json[1], json[2], json[3]) : undefined;
162339
+ return (Array.isArray(json) && json.length === 4) ? _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.fromDegrees(json[0], json[1], json[2], json[3]) : undefined;
162229
162340
  }
162230
162341
  function rangeFromJSON(json) {
162231
162342
  if (undefined !== json.LatLonBoundingBox)
@@ -162386,7 +162497,7 @@ class WmsCapabilities {
162386
162497
  if (cached !== undefined)
162387
162498
  return cached;
162388
162499
  }
162389
- const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_2__.WmsUtilities.getBaseUrl(url));
162500
+ const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.getBaseUrl(url));
162390
162501
  tmpUrl.searchParams.append("request", "GetCapabilities");
162391
162502
  tmpUrl.searchParams.append("service", "WMS");
162392
162503
  if (queryParams) {
@@ -162395,10 +162506,10 @@ class WmsCapabilities {
162395
162506
  tmpUrl.searchParams.append(paramKey, queryParams[paramKey]);
162396
162507
  });
162397
162508
  }
162398
- const xmlCapabilities = await getXml(tmpUrl.toString(), credentials);
162509
+ const xmlCapabilities = await _internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.fetchXml(tmpUrl.toString(), credentials);
162399
162510
  if (!xmlCapabilities)
162400
162511
  return undefined;
162401
- const capabilities = new WmsCapabilities(new (wms_capabilities__WEBPACK_IMPORTED_MODULE_1___default())().parse(xmlCapabilities));
162512
+ const capabilities = new WmsCapabilities(new (wms_capabilities__WEBPACK_IMPORTED_MODULE_0___default())().parse(xmlCapabilities));
162402
162513
  if (!credentials) {
162403
162514
  // Avoid caching protected data
162404
162515
  WmsCapabilities._capabilitiesCache.set(url, capabilities);
@@ -162429,10 +162540,14 @@ __webpack_require__.r(__webpack_exports__);
162429
162540
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
162430
162541
  /* harmony export */ "WmsUtilities": () => (/* binding */ WmsUtilities)
162431
162542
  /* harmony export */ });
162543
+ /* harmony import */ var _request_Request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../request/Request */ "../../core/frontend/lib/esm/request/Request.js");
162544
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
162432
162545
  /*---------------------------------------------------------------------------------------------
162433
162546
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
162434
162547
  * See LICENSE.md in the project root for license terms and full copyright notice.
162435
162548
  *--------------------------------------------------------------------------------------------*/
162549
+
162550
+
162436
162551
  /** @packageDocumentation
162437
162552
  * @module Tiles
162438
162553
  */
@@ -162442,6 +162557,26 @@ class WmsUtilities {
162442
162557
  const lastIndex = url.lastIndexOf("?");
162443
162558
  return lastIndex > 0 ? url.slice(0, lastIndex) : url;
162444
162559
  }
162560
+ /**
162561
+ * fetch XML from HTTP request
162562
+ * @param url server URL to address the request
162563
+ * @internal
162564
+ */
162565
+ static async fetchXml(url, credentials) {
162566
+ let headers;
162567
+ if (credentials && credentials.user && credentials.password) {
162568
+ headers = new Headers();
162569
+ (0,_request_utils__WEBPACK_IMPORTED_MODULE_1__.setBasicAuthorization)(headers, credentials);
162570
+ }
162571
+ let response = await fetch(url, { method: "GET", headers });
162572
+ if (!credentials && response.status === 401 && (0,_request_utils__WEBPACK_IMPORTED_MODULE_1__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])) {
162573
+ // We got a http 401 challenge, lets try SSO (i.e. Windows Authentication)
162574
+ response = await fetch(url, { method: "GET", credentials: "include" });
162575
+ }
162576
+ if (response.status !== 200)
162577
+ throw new _request_Request__WEBPACK_IMPORTED_MODULE_0__.HttpResponseError(response.status, await response.text());
162578
+ return response.text();
162579
+ }
162445
162580
  }
162446
162581
 
162447
162582
 
@@ -162461,8 +162596,7 @@ __webpack_require__.r(__webpack_exports__);
162461
162596
  /* harmony export */ "WmtsConstants": () => (/* binding */ WmtsConstants)
162462
162597
  /* harmony export */ });
162463
162598
  /* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
162464
- /* harmony import */ var _request_Request__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../request/Request */ "../../core/frontend/lib/esm/request/Request.js");
162465
- /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
162599
+ /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
162466
162600
  /*---------------------------------------------------------------------------------------------
162467
162601
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
162468
162602
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -162472,7 +162606,6 @@ __webpack_require__.r(__webpack_exports__);
162472
162606
  */
162473
162607
 
162474
162608
 
162475
- // WmsUtilities needed for getBaseUrl
162476
162609
  var OwsConstants;
162477
162610
  (function (OwsConstants) {
162478
162611
  OwsConstants["ABSTRACT_XMLTAG"] = "ows:Abstract";
@@ -162526,19 +162659,6 @@ var WmtsConstants;
162526
162659
  WmtsConstants[WmtsConstants["GOOGLEMAPS_LEVEL0_SCALE_DENOM"] = 559082264.0287178] = "GOOGLEMAPS_LEVEL0_SCALE_DENOM";
162527
162660
  WmtsConstants["GOOGLEMAPS_COMPATIBLE_WELLKNOWNNAME"] = "googlemapscompatible";
162528
162661
  })(WmtsConstants || (WmtsConstants = {}));
162529
- /**
162530
- * fetch XML from HTTP request
162531
- * @param url server URL to address the request
162532
- * @internal
162533
- */
162534
- async function getXml(url, credentials) {
162535
- const options = {
162536
- timeout: 20000,
162537
- retryCount: 2,
162538
- auth: credentials,
162539
- };
162540
- return (0,_request_Request__WEBPACK_IMPORTED_MODULE_1__.request)(url, "text", options);
162541
- }
162542
162662
  /**
162543
162663
  * Utility function to extract an element' text content
162544
162664
  * @return An element's text content, default to provided defaultTest value if no text is available.
@@ -162836,14 +162956,14 @@ var WmtsCapability;
162836
162956
  upperCornerArray = getElementTextContent(bbox[0], OwsConstants.UPPERCORNER_XMLTAG)?.split(" ").map((x) => +x);
162837
162957
  }
162838
162958
  if (lowerCornerArray?.length === 2 && upperCornerArray?.length === 2)
162839
- this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.fromDegrees(lowerCornerArray[0], lowerCornerArray[1], upperCornerArray[0], upperCornerArray[1]);
162959
+ this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.fromDegrees(lowerCornerArray[0], lowerCornerArray[1], upperCornerArray[0], upperCornerArray[1]);
162840
162960
  // If we could not initialized WSG84 bounding box, attempt to initialized it from Bounding Box
162841
162961
  if (!this.wsg84BoundingBox && (this.boundingBox?.crs?.includes("EPSG:4326") || this.boundingBox?.crs?.includes("CRS:84"))) {
162842
162962
  const range = this.boundingBox.range;
162843
162963
  if (range)
162844
- this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.fromDegrees(range.low.x, range.low.y, range.high.x, range.high.y);
162964
+ this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.fromDegrees(range.low.x, range.low.y, range.high.x, range.high.y);
162845
162965
  else
162846
- this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.createMaximum();
162966
+ this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.createMaximum();
162847
162967
  }
162848
162968
  // Style
162849
162969
  const style = elem.getElementsByTagName("Style");
@@ -162894,7 +163014,7 @@ class WmtsCapabilities {
162894
163014
  if (cached !== undefined)
162895
163015
  return cached;
162896
163016
  }
162897
- const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_2__.WmsUtilities.getBaseUrl(url));
163017
+ const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.getBaseUrl(url));
162898
163018
  tmpUrl.searchParams.append("request", "GetCapabilities");
162899
163019
  tmpUrl.searchParams.append("service", "WMTS");
162900
163020
  if (queryParams) {
@@ -162903,7 +163023,7 @@ class WmtsCapabilities {
162903
163023
  tmpUrl.searchParams.append(paramKey, queryParams[paramKey]);
162904
163024
  });
162905
163025
  }
162906
- const xmlCapabilities = await getXml(tmpUrl.toString(), credentials);
163026
+ const xmlCapabilities = await _internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.fetchXml(tmpUrl.toString(), credentials);
162907
163027
  if (!xmlCapabilities)
162908
163028
  return undefined;
162909
163029
  const capabilities = WmtsCapabilities.createFromXml(xmlCapabilities);
@@ -288467,7 +288587,7 @@ class TestContext {
288467
288587
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
288468
288588
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
288469
288589
  await core_frontend_1.NoRenderApp.startup({
288470
- applicationVersion: "4.4.0-dev.28",
288590
+ applicationVersion: "4.4.0-dev.29",
288471
288591
  applicationId: this.settings.gprid,
288472
288592
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
288473
288593
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -307300,7 +307420,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
307300
307420
  /***/ ((module) => {
307301
307421
 
307302
307422
  "use strict";
307303
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.28","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.4.0-dev.28","@itwin/core-bentley":"workspace:^4.4.0-dev.28","@itwin/core-common":"workspace:^4.4.0-dev.28","@itwin/core-geometry":"workspace:^4.4.0-dev.28","@itwin/core-orbitgt":"workspace:^4.4.0-dev.28","@itwin/core-quantity":"workspace:^4.4.0-dev.28"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
307423
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.29","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.4.0-dev.29","@itwin/core-bentley":"workspace:^4.4.0-dev.29","@itwin/core-common":"workspace:^4.4.0-dev.29","@itwin/core-geometry":"workspace:^4.4.0-dev.29","@itwin/core-orbitgt":"workspace:^4.4.0-dev.29","@itwin/core-quantity":"workspace:^4.4.0-dev.29"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
307304
307424
 
307305
307425
  /***/ }),
307306
307426