@itwin/ecschema-rpcinterface-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":""}
@@ -138006,6 +138006,62 @@ async function fetchWithRetry(fetchFunc, remainingRetries) {
138006
138006
  }
138007
138007
 
138008
138008
 
138009
+ /***/ }),
138010
+
138011
+ /***/ "../../core/frontend/lib/esm/request/utils.js":
138012
+ /*!****************************************************!*\
138013
+ !*** ../../core/frontend/lib/esm/request/utils.js ***!
138014
+ \****************************************************/
138015
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
138016
+
138017
+ "use strict";
138018
+ __webpack_require__.r(__webpack_exports__);
138019
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
138020
+ /* harmony export */ "headersIncludeAuthMethod": () => (/* binding */ headersIncludeAuthMethod),
138021
+ /* harmony export */ "setBasicAuthorization": () => (/* binding */ setBasicAuthorization)
138022
+ /* harmony export */ });
138023
+ /* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
138024
+ /*---------------------------------------------------------------------------------------------
138025
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
138026
+ * See LICENSE.md in the project root for license terms and full copyright notice.
138027
+ *--------------------------------------------------------------------------------------------*/
138028
+
138029
+ /**
138030
+ * Check whether or not one of the requested authentication method is listed in the HTTP 'WWW-Authenticate' response header
138031
+ * @param headers Headers object
138032
+ * @param query List of authentication method to lookup (case-insensitive)
138033
+ * @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.
138034
+ * @internal
138035
+ */
138036
+ function headersIncludeAuthMethod(headers, query) {
138037
+ const wwwAuthenticate = headers.get("WWW-authenticate");
138038
+ const lowerCaseQuery = query.map(((value) => value.toLowerCase())); // not case-sensitive
138039
+ if (wwwAuthenticate !== null) {
138040
+ const authMethods = wwwAuthenticate.split(",").map(((value) => value.toLowerCase().trim()));
138041
+ for (const queryValue of lowerCaseQuery) {
138042
+ if (authMethods.includes(queryValue))
138043
+ return true;
138044
+ }
138045
+ }
138046
+ return false;
138047
+ }
138048
+ /** @internal */
138049
+ function setBasicAuthorization(headers, userOrCreds, password) {
138050
+ let username;
138051
+ let pwd;
138052
+ if (typeof userOrCreds === "string") {
138053
+ username = userOrCreds;
138054
+ pwd = password;
138055
+ }
138056
+ else {
138057
+ username = userOrCreds.user;
138058
+ pwd = userOrCreds.password;
138059
+ }
138060
+ if (username !== undefined && pwd !== undefined)
138061
+ headers.set("Authorization", `Basic ${_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.Base64EncodedString.encode(`${username}:${pwd}`)}`);
138062
+ }
138063
+
138064
+
138009
138065
  /***/ }),
138010
138066
 
138011
138067
  /***/ "../../core/frontend/lib/esm/tile/B3dmReader.js":
@@ -150057,6 +150113,7 @@ __webpack_require__.r(__webpack_exports__);
150057
150113
  /* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
150058
150114
  /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
150059
150115
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
150116
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
150060
150117
  /*---------------------------------------------------------------------------------------------
150061
150118
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
150062
150119
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -150064,6 +150121,7 @@ __webpack_require__.r(__webpack_exports__);
150064
150121
 
150065
150122
 
150066
150123
 
150124
+
150067
150125
  /** @packageDocumentation
150068
150126
  * @module Tiles
150069
150127
  */
@@ -150286,6 +150344,10 @@ class ArcGisUtilities {
150286
150344
  }
150287
150345
  }
150288
150346
  let response = await fetch(tmpUrl.toString(), { method: "GET" });
150347
+ if (response.status === 401 && !requireToken && (0,_request_utils__WEBPACK_IMPORTED_MODULE_3__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])) {
150348
+ // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)
150349
+ response = await fetch(url, { method: "GET", credentials: "include" });
150350
+ }
150289
150351
  // Append security token when corresponding error code is returned by ArcGIS service
150290
150352
  let errorCode = await ArcGisUtilities.checkForResponseErrorCode(response);
150291
150353
  if (!accessTokenRequired
@@ -151147,6 +151209,7 @@ __webpack_require__.r(__webpack_exports__);
151147
151209
  /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../internal */ "../../core/frontend/lib/esm/tile/internal.js");
151148
151210
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
151149
151211
  /* harmony import */ var _NotificationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../NotificationManager */ "../../core/frontend/lib/esm/NotificationManager.js");
151212
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
151150
151213
  /*---------------------------------------------------------------------------------------------
151151
151214
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
151152
151215
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -151157,6 +151220,7 @@ __webpack_require__.r(__webpack_exports__);
151157
151220
 
151158
151221
 
151159
151222
 
151223
+
151160
151224
  /** Base class for ArcGIS map-layer imagery providers.
151161
151225
  *
151162
151226
  * The initial purpose of this class is to offer shared methods
@@ -151236,50 +151300,71 @@ class ArcGISImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_0__.MapLa
151236
151300
  password: this._settings.password
151237
151301
  });
151238
151302
  }
151239
- let response = await fetch(urlObj.toString(), options);
151240
- if ((this._lastAccessToken && response.status === 400)
151241
- || response.headers.get("content-type")?.toLowerCase().includes("htm")) {
151242
- // For some reasons when we make a request with the fetch() api and there is a token error
151243
- // we receive a status 400 instead of proper json response. (i.e doing the same request in the browser gives a different response)
151244
- // For some other request, we also seen error message in html.
151245
- // When it occurs, we fall back to root service request so we get a proper JSON response with error code.
151246
- const tmpUrl = new URL(this._settings.url);
151247
- if (this._lastAccessToken && this._accessTokenRequired)
151248
- tmpUrl.searchParams.append("token", this._lastAccessToken.token);
151249
- tmpUrl.searchParams.append("f", "json");
151250
- response = await fetch(tmpUrl.toString(), options);
151251
- }
151252
- errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
151253
- if (errorCode !== undefined &&
151254
- (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken)) {
151255
- if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken) {
151256
- // **** Legacy token ONLY ***
151257
- // Token might have expired, make a second attempt by forcing new token.
151258
- if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)
151259
- this._accessClient.invalidateToken(this._lastAccessToken);
151260
- const urlObj2 = new URL(url);
151261
- if (this._accessClient) {
151262
- try {
151263
- this._lastAccessToken = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, { mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });
151303
+ // We want to complete the first request before letting other requests go;
151304
+ // this done to avoid flooding server with requests missing credentials
151305
+ if (!this._firstRequestPromise)
151306
+ this._firstRequestPromise = new Promise((resolve) => this.onFirstRequestCompleted.addOnce(() => resolve()));
151307
+ else
151308
+ await this._firstRequestPromise;
151309
+ let response;
151310
+ try {
151311
+ response = await fetch(urlObj.toString(), { ...options, credentials: this._includeUserCredentials ? "include" : undefined });
151312
+ if (response.status === 401 && !this._lastAccessToken && (0,_request_utils__WEBPACK_IMPORTED_MODULE_3__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])) {
151313
+ // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)
151314
+ response = await fetch(url, { ...options, credentials: "include" });
151315
+ if (response.status === 200) {
151316
+ this._includeUserCredentials = true; // avoid going through 401 challenges over and over
151317
+ }
151318
+ }
151319
+ if ((this._lastAccessToken && response.status === 400)
151320
+ || response.headers.get("content-type")?.toLowerCase().includes("htm")) {
151321
+ // For some reasons when we make a request with the fetch() api and there is a token error
151322
+ // we receive a status 400 instead of proper json response. (i.e doing the same request in the browser gives a different response)
151323
+ // For some other request, we also seen error message in html.
151324
+ // When it occurs, we fall back to root service request so we get a proper JSON response with error code.
151325
+ const tmpUrl = new URL(this._settings.url);
151326
+ if (this._lastAccessToken && this._accessTokenRequired)
151327
+ tmpUrl.searchParams.append("token", this._lastAccessToken.token);
151328
+ tmpUrl.searchParams.append("f", "json");
151329
+ response = await fetch(tmpUrl.toString(), options);
151330
+ }
151331
+ errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
151332
+ if (errorCode !== undefined &&
151333
+ (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken)) {
151334
+ if (this._settings.userName && this._settings.userName.length > 0 && this._lastAccessToken) {
151335
+ // **** Legacy token ONLY ***
151336
+ // Token might have expired, make a second attempt by forcing new token.
151337
+ if (this._accessClient?.invalidateToken !== undefined && this._lastAccessToken !== undefined)
151338
+ this._accessClient.invalidateToken(this._lastAccessToken);
151339
+ const urlObj2 = new URL(url);
151340
+ if (this._accessClient) {
151341
+ try {
151342
+ this._lastAccessToken = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, { mapLayerUrl: urlObj, userName: this._settings.userName, password: this._settings.password });
151343
+ }
151344
+ catch {
151345
+ }
151264
151346
  }
151265
- catch {
151347
+ // Make a second attempt with refreshed token
151348
+ response = await fetch(urlObj2.toString(), options);
151349
+ errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
151350
+ }
151351
+ if (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken) {
151352
+ // Looks like the initially generated token has expired.
151353
+ if (this.status === _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.Valid) {
151354
+ // Only report new status change to avoid spamming the UI
151355
+ this.setStatus(_internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.RequireAuth);
151356
+ this.onStatusChanged.raiseEvent(this);
151357
+ const msg = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Messages.FetchTooltipTokenError", { layerName: this._settings.name });
151358
+ _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.notifications.outputMessage(new _NotificationManager__WEBPACK_IMPORTED_MODULE_2__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_2__.OutputMessagePriority.Warning, msg));
151266
151359
  }
151267
151360
  }
151268
- // Make a second attempt with refreshed token
151269
- response = await fetch(urlObj2.toString(), options);
151270
- errorCode = await _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.checkForResponseErrorCode(response);
151271
- }
151272
- if (errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.TokenRequired || errorCode === _internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisErrorCode.InvalidToken) {
151273
- // Looks like the initially generated token has expired.
151274
- if (this.status === _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.Valid) {
151275
- // Only report new status change to avoid spamming the UI
151276
- this.setStatus(_internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerImageryProviderStatus.RequireAuth);
151277
- this.onStatusChanged.raiseEvent(this);
151278
- const msg = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Messages.FetchTooltipTokenError", { layerName: this._settings.name });
151279
- _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.notifications.outputMessage(new _NotificationManager__WEBPACK_IMPORTED_MODULE_2__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_2__.OutputMessagePriority.Warning, msg));
151280
- }
151281
151361
  }
151282
151362
  }
151363
+ finally {
151364
+ this.onFirstRequestCompleted.raiseEvent();
151365
+ }
151366
+ if (response === undefined)
151367
+ throw new Error("fetch call failed");
151283
151368
  return response;
151284
151369
  }
151285
151370
  }
@@ -153717,6 +153802,7 @@ __webpack_require__.r(__webpack_exports__);
153717
153802
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
153718
153803
  /* harmony import */ var _NotificationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../NotificationManager */ "../../core/frontend/lib/esm/NotificationManager.js");
153719
153804
  /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
153805
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
153720
153806
  /*---------------------------------------------------------------------------------------------
153721
153807
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
153722
153808
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -153730,6 +153816,7 @@ __webpack_require__.r(__webpack_exports__);
153730
153816
 
153731
153817
 
153732
153818
 
153819
+
153733
153820
  /** @internal */
153734
153821
  const tileImageSize = 256, untiledImageSize = 256;
153735
153822
  const earthRadius = 6378137;
@@ -153776,6 +153863,10 @@ class MapLayerImageryProvider {
153776
153863
  this._geographicTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.GeographicTilingScheme();
153777
153864
  /** @internal */
153778
153865
  this._status = MapLayerImageryProviderStatus.Valid;
153866
+ /** @internal */
153867
+ this._includeUserCredentials = false;
153868
+ /** @internal */
153869
+ this.onFirstRequestCompleted = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
153779
153870
  /**
153780
153871
  * This value is used internally for various computations, this should not get overriden.
153781
153872
  * @internal
@@ -153895,17 +153986,48 @@ class MapLayerImageryProvider {
153895
153986
  /** @internal */
153896
153987
  setRequestAuthorization(headers) {
153897
153988
  if (this._settings.userName && this._settings.password) {
153898
- headers.set("Authorization", `Basic ${_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Base64EncodedString.encode(`${this._settings.userName}:${this._settings.password}`)}`);
153989
+ (0,_request_utils__WEBPACK_IMPORTED_MODULE_6__.setBasicAuthorization)(headers, this._settings.userName, this._settings.password);
153899
153990
  }
153900
153991
  }
153901
153992
  /** @internal */
153902
153993
  async makeTileRequest(url) {
153903
- let headers;
153904
- if (this._settings.userName && this._settings.password) {
153905
- headers = new Headers();
153906
- this.setRequestAuthorization(headers);
153994
+ // We want to complete the first request before letting other requests go;
153995
+ // this done to avoid flooding server with requests missing credentials
153996
+ if (!this._firstRequestPromise)
153997
+ this._firstRequestPromise = new Promise((resolve) => this.onFirstRequestCompleted.addOnce(() => resolve()));
153998
+ else
153999
+ await this._firstRequestPromise;
154000
+ let response;
154001
+ try {
154002
+ let headers;
154003
+ let hasCreds = false;
154004
+ if (this._settings.userName && this._settings.password) {
154005
+ hasCreds = true;
154006
+ headers = new Headers();
154007
+ this.setRequestAuthorization(headers);
154008
+ }
154009
+ response = await fetch(url, {
154010
+ method: "GET",
154011
+ headers,
154012
+ credentials: this._includeUserCredentials ? "include" : undefined,
154013
+ });
154014
+ if (response.status === 401
154015
+ && (0,_request_utils__WEBPACK_IMPORTED_MODULE_6__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])
154016
+ && !this._includeUserCredentials
154017
+ && !hasCreds) {
154018
+ // We got a http 401 challenge, lets try again with SSO enabled (i.e. Windows Authentication)
154019
+ response = await fetch(url, { method: "GET", credentials: "include" });
154020
+ if (response.status === 200) {
154021
+ this._includeUserCredentials = true; // avoid going through 401 challenges over and over
154022
+ }
154023
+ }
153907
154024
  }
153908
- return fetch(url, { method: "GET", headers });
154025
+ finally {
154026
+ this.onFirstRequestCompleted.raiseEvent();
154027
+ }
154028
+ if (response === undefined)
154029
+ throw new Error("fetch call failed");
154030
+ return response;
153909
154031
  }
153910
154032
  /** Returns a map layer tile at the specified settings. */
153911
154033
  async loadTile(row, column, zoomLevel) {
@@ -153938,7 +154060,11 @@ class MapLayerImageryProvider {
153938
154060
  const headers = new Headers();
153939
154061
  this.setRequestAuthorization(headers);
153940
154062
  try {
153941
- const response = await fetch(url, { method: "GET", headers });
154063
+ const response = await fetch(url, {
154064
+ method: "GET",
154065
+ headers,
154066
+ credentials: this._includeUserCredentials ? "include" : undefined,
154067
+ });
153942
154068
  const text = await response.text();
153943
154069
  if (undefined !== text) {
153944
154070
  strings.push(text);
@@ -157108,10 +157234,9 @@ __webpack_require__.r(__webpack_exports__);
157108
157234
  /* harmony export */ "WmsCapabilities": () => (/* binding */ WmsCapabilities),
157109
157235
  /* harmony export */ "WmsCapability": () => (/* binding */ WmsCapability)
157110
157236
  /* harmony export */ });
157111
- /* harmony import */ var _request_Request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../request/Request */ "../../core/frontend/lib/esm/request/Request.js");
157112
- /* 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");
157113
- /* harmony import */ var wms_capabilities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(wms_capabilities__WEBPACK_IMPORTED_MODULE_1__);
157114
- /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
157237
+ /* 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");
157238
+ /* harmony import */ var wms_capabilities__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(wms_capabilities__WEBPACK_IMPORTED_MODULE_0__);
157239
+ /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
157115
157240
  /*---------------------------------------------------------------------------------------------
157116
157241
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
157117
157242
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -157121,22 +157246,8 @@ __webpack_require__.r(__webpack_exports__);
157121
157246
  */
157122
157247
 
157123
157248
 
157124
-
157125
- /**
157126
- * fetch XML from HTTP request
157127
- * @param url server URL to address the request
157128
- * @internal
157129
- */
157130
- async function getXml(url, credentials) {
157131
- const options = {
157132
- timeout: 20000,
157133
- retryCount: 2,
157134
- auth: credentials,
157135
- };
157136
- return (0,_request_Request__WEBPACK_IMPORTED_MODULE_0__.request)(url, "text", options);
157137
- }
157138
157249
  function rangeFromJSONArray(json) {
157139
- return (Array.isArray(json) && json.length === 4) ? _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.fromDegrees(json[0], json[1], json[2], json[3]) : undefined;
157250
+ return (Array.isArray(json) && json.length === 4) ? _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.fromDegrees(json[0], json[1], json[2], json[3]) : undefined;
157140
157251
  }
157141
157252
  function rangeFromJSON(json) {
157142
157253
  if (undefined !== json.LatLonBoundingBox)
@@ -157297,7 +157408,7 @@ class WmsCapabilities {
157297
157408
  if (cached !== undefined)
157298
157409
  return cached;
157299
157410
  }
157300
- const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_2__.WmsUtilities.getBaseUrl(url));
157411
+ const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.getBaseUrl(url));
157301
157412
  tmpUrl.searchParams.append("request", "GetCapabilities");
157302
157413
  tmpUrl.searchParams.append("service", "WMS");
157303
157414
  if (queryParams) {
@@ -157306,10 +157417,10 @@ class WmsCapabilities {
157306
157417
  tmpUrl.searchParams.append(paramKey, queryParams[paramKey]);
157307
157418
  });
157308
157419
  }
157309
- const xmlCapabilities = await getXml(tmpUrl.toString(), credentials);
157420
+ const xmlCapabilities = await _internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.fetchXml(tmpUrl.toString(), credentials);
157310
157421
  if (!xmlCapabilities)
157311
157422
  return undefined;
157312
- const capabilities = new WmsCapabilities(new (wms_capabilities__WEBPACK_IMPORTED_MODULE_1___default())().parse(xmlCapabilities));
157423
+ const capabilities = new WmsCapabilities(new (wms_capabilities__WEBPACK_IMPORTED_MODULE_0___default())().parse(xmlCapabilities));
157313
157424
  if (!credentials) {
157314
157425
  // Avoid caching protected data
157315
157426
  WmsCapabilities._capabilitiesCache.set(url, capabilities);
@@ -157340,10 +157451,14 @@ __webpack_require__.r(__webpack_exports__);
157340
157451
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
157341
157452
  /* harmony export */ "WmsUtilities": () => (/* binding */ WmsUtilities)
157342
157453
  /* harmony export */ });
157454
+ /* harmony import */ var _request_Request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../request/Request */ "../../core/frontend/lib/esm/request/Request.js");
157455
+ /* harmony import */ var _request_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../request/utils */ "../../core/frontend/lib/esm/request/utils.js");
157343
157456
  /*---------------------------------------------------------------------------------------------
157344
157457
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
157345
157458
  * See LICENSE.md in the project root for license terms and full copyright notice.
157346
157459
  *--------------------------------------------------------------------------------------------*/
157460
+
157461
+
157347
157462
  /** @packageDocumentation
157348
157463
  * @module Tiles
157349
157464
  */
@@ -157353,6 +157468,26 @@ class WmsUtilities {
157353
157468
  const lastIndex = url.lastIndexOf("?");
157354
157469
  return lastIndex > 0 ? url.slice(0, lastIndex) : url;
157355
157470
  }
157471
+ /**
157472
+ * fetch XML from HTTP request
157473
+ * @param url server URL to address the request
157474
+ * @internal
157475
+ */
157476
+ static async fetchXml(url, credentials) {
157477
+ let headers;
157478
+ if (credentials && credentials.user && credentials.password) {
157479
+ headers = new Headers();
157480
+ (0,_request_utils__WEBPACK_IMPORTED_MODULE_1__.setBasicAuthorization)(headers, credentials);
157481
+ }
157482
+ let response = await fetch(url, { method: "GET", headers });
157483
+ if (!credentials && response.status === 401 && (0,_request_utils__WEBPACK_IMPORTED_MODULE_1__.headersIncludeAuthMethod)(response.headers, ["ntlm", "negotiate"])) {
157484
+ // We got a http 401 challenge, lets try SSO (i.e. Windows Authentication)
157485
+ response = await fetch(url, { method: "GET", credentials: "include" });
157486
+ }
157487
+ if (response.status !== 200)
157488
+ throw new _request_Request__WEBPACK_IMPORTED_MODULE_0__.HttpResponseError(response.status, await response.text());
157489
+ return response.text();
157490
+ }
157356
157491
  }
157357
157492
 
157358
157493
 
@@ -157372,8 +157507,7 @@ __webpack_require__.r(__webpack_exports__);
157372
157507
  /* harmony export */ "WmtsConstants": () => (/* binding */ WmtsConstants)
157373
157508
  /* harmony export */ });
157374
157509
  /* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
157375
- /* harmony import */ var _request_Request__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../request/Request */ "../../core/frontend/lib/esm/request/Request.js");
157376
- /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
157510
+ /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal */ "../../core/frontend/lib/esm/tile/internal.js");
157377
157511
  /*---------------------------------------------------------------------------------------------
157378
157512
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
157379
157513
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -157383,7 +157517,6 @@ __webpack_require__.r(__webpack_exports__);
157383
157517
  */
157384
157518
 
157385
157519
 
157386
- // WmsUtilities needed for getBaseUrl
157387
157520
  var OwsConstants;
157388
157521
  (function (OwsConstants) {
157389
157522
  OwsConstants["ABSTRACT_XMLTAG"] = "ows:Abstract";
@@ -157437,19 +157570,6 @@ var WmtsConstants;
157437
157570
  WmtsConstants[WmtsConstants["GOOGLEMAPS_LEVEL0_SCALE_DENOM"] = 559082264.0287178] = "GOOGLEMAPS_LEVEL0_SCALE_DENOM";
157438
157571
  WmtsConstants["GOOGLEMAPS_COMPATIBLE_WELLKNOWNNAME"] = "googlemapscompatible";
157439
157572
  })(WmtsConstants || (WmtsConstants = {}));
157440
- /**
157441
- * fetch XML from HTTP request
157442
- * @param url server URL to address the request
157443
- * @internal
157444
- */
157445
- async function getXml(url, credentials) {
157446
- const options = {
157447
- timeout: 20000,
157448
- retryCount: 2,
157449
- auth: credentials,
157450
- };
157451
- return (0,_request_Request__WEBPACK_IMPORTED_MODULE_1__.request)(url, "text", options);
157452
- }
157453
157573
  /**
157454
157574
  * Utility function to extract an element' text content
157455
157575
  * @return An element's text content, default to provided defaultTest value if no text is available.
@@ -157747,14 +157867,14 @@ var WmtsCapability;
157747
157867
  upperCornerArray = getElementTextContent(bbox[0], OwsConstants.UPPERCORNER_XMLTAG)?.split(" ").map((x) => +x);
157748
157868
  }
157749
157869
  if (lowerCornerArray?.length === 2 && upperCornerArray?.length === 2)
157750
- this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.fromDegrees(lowerCornerArray[0], lowerCornerArray[1], upperCornerArray[0], upperCornerArray[1]);
157870
+ this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.fromDegrees(lowerCornerArray[0], lowerCornerArray[1], upperCornerArray[0], upperCornerArray[1]);
157751
157871
  // If we could not initialized WSG84 bounding box, attempt to initialized it from Bounding Box
157752
157872
  if (!this.wsg84BoundingBox && (this.boundingBox?.crs?.includes("EPSG:4326") || this.boundingBox?.crs?.includes("CRS:84"))) {
157753
157873
  const range = this.boundingBox.range;
157754
157874
  if (range)
157755
- this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.fromDegrees(range.low.x, range.low.y, range.high.x, range.high.y);
157875
+ this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.fromDegrees(range.low.x, range.low.y, range.high.x, range.high.y);
157756
157876
  else
157757
- this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_2__.MapCartoRectangle.createMaximum();
157877
+ this.wsg84BoundingBox = _internal__WEBPACK_IMPORTED_MODULE_1__.MapCartoRectangle.createMaximum();
157758
157878
  }
157759
157879
  // Style
157760
157880
  const style = elem.getElementsByTagName("Style");
@@ -157805,7 +157925,7 @@ class WmtsCapabilities {
157805
157925
  if (cached !== undefined)
157806
157926
  return cached;
157807
157927
  }
157808
- const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_2__.WmsUtilities.getBaseUrl(url));
157928
+ const tmpUrl = new URL(_internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.getBaseUrl(url));
157809
157929
  tmpUrl.searchParams.append("request", "GetCapabilities");
157810
157930
  tmpUrl.searchParams.append("service", "WMTS");
157811
157931
  if (queryParams) {
@@ -157814,7 +157934,7 @@ class WmtsCapabilities {
157814
157934
  tmpUrl.searchParams.append(paramKey, queryParams[paramKey]);
157815
157935
  });
157816
157936
  }
157817
- const xmlCapabilities = await getXml(tmpUrl.toString(), credentials);
157937
+ const xmlCapabilities = await _internal__WEBPACK_IMPORTED_MODULE_1__.WmsUtilities.fetchXml(tmpUrl.toString(), credentials);
157818
157938
  if (!xmlCapabilities)
157819
157939
  return undefined;
157820
157940
  const capabilities = WmtsCapabilities.createFromXml(xmlCapabilities);
@@ -292507,7 +292627,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
292507
292627
  /***/ ((module) => {
292508
292628
 
292509
292629
  "use strict";
292510
- 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"}}');
292630
+ 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"}}');
292511
292631
 
292512
292632
  /***/ })
292513
292633