@itwin/core-frontend 5.15.1 → 5.16.0-dev.10

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.
Files changed (172) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts +5 -2
  3. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
  4. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +6 -0
  5. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  6. package/lib/cjs/core-frontend.d.ts +1 -1
  7. package/lib/cjs/core-frontend.d.ts.map +1 -1
  8. package/lib/cjs/core-frontend.js +3 -2
  9. package/lib/cjs/core-frontend.js.map +1 -1
  10. package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.d.ts +2 -0
  11. package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.d.ts.map +1 -1
  12. package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.js +13 -4
  13. package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.js.map +1 -1
  14. package/lib/cjs/internal/cross-package.d.ts +1 -1
  15. package/lib/cjs/internal/cross-package.d.ts.map +1 -1
  16. package/lib/cjs/internal/cross-package.js +4 -1
  17. package/lib/cjs/internal/cross-package.js.map +1 -1
  18. package/lib/cjs/internal/tile/RealityTileLoader.d.ts +1 -1
  19. package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
  20. package/lib/cjs/internal/tile/RealityTileLoader.js +5 -3
  21. package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
  22. package/lib/cjs/internal/tile/map/ArcGisUtilities.d.ts +15 -2
  23. package/lib/cjs/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
  24. package/lib/cjs/internal/tile/map/ArcGisUtilities.js +54 -29
  25. package/lib/cjs/internal/tile/map/ArcGisUtilities.js.map +1 -1
  26. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts +14 -0
  27. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
  28. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js +91 -45
  29. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
  30. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  31. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +5 -4
  32. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  33. package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
  34. package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +8 -2
  35. package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  36. package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
  37. package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +8 -2
  38. package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
  39. package/lib/cjs/internal/tile/map/MapLayerFetch.d.ts +57 -0
  40. package/lib/cjs/internal/tile/map/MapLayerFetch.d.ts.map +1 -0
  41. package/lib/cjs/internal/tile/map/MapLayerFetch.js +95 -0
  42. package/lib/cjs/internal/tile/map/MapLayerFetch.js.map +1 -0
  43. package/lib/cjs/internal/tile/map/UrlUtils.js +1 -1
  44. package/lib/cjs/internal/tile/map/UrlUtils.js.map +1 -1
  45. package/lib/cjs/internal/tile/map/WmsCapabilities.d.ts +2 -5
  46. package/lib/cjs/internal/tile/map/WmsCapabilities.d.ts.map +1 -1
  47. package/lib/cjs/internal/tile/map/WmsCapabilities.js +16 -9
  48. package/lib/cjs/internal/tile/map/WmsCapabilities.js.map +1 -1
  49. package/lib/cjs/internal/tile/map/WmsUtilities.d.ts +29 -1
  50. package/lib/cjs/internal/tile/map/WmsUtilities.d.ts.map +1 -1
  51. package/lib/cjs/internal/tile/map/WmsUtilities.js +43 -11
  52. package/lib/cjs/internal/tile/map/WmsUtilities.js.map +1 -1
  53. package/lib/cjs/internal/tile/map/WmtsCapabilities.d.ts +2 -5
  54. package/lib/cjs/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
  55. package/lib/cjs/internal/tile/map/WmtsCapabilities.js +16 -9
  56. package/lib/cjs/internal/tile/map/WmtsCapabilities.js.map +1 -1
  57. package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
  58. package/lib/cjs/tile/GltfReader.js +3 -1
  59. package/lib/cjs/tile/GltfReader.js.map +1 -1
  60. package/lib/cjs/tile/internal.d.ts +2 -0
  61. package/lib/cjs/tile/internal.d.ts.map +1 -1
  62. package/lib/cjs/tile/internal.js +2 -0
  63. package/lib/cjs/tile/internal.js.map +1 -1
  64. package/lib/cjs/tile/map/MapLayerFetchHandler.d.ts +94 -0
  65. package/lib/cjs/tile/map/MapLayerFetchHandler.d.ts.map +1 -0
  66. package/lib/cjs/tile/map/MapLayerFetchHandler.js +10 -0
  67. package/lib/cjs/tile/map/MapLayerFetchHandler.js.map +1 -0
  68. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +27 -1
  69. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  70. package/lib/cjs/tile/map/MapLayerFormatRegistry.js +42 -1
  71. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  72. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  73. package/lib/cjs/tile/map/MapLayerImageryFormats.js +20 -4
  74. package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
  75. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +28 -16
  76. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  77. package/lib/cjs/tile/map/MapLayerImageryProvider.js +134 -66
  78. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  79. package/lib/cjs/tile/map/MapLayerSources.d.ts +19 -4
  80. package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
  81. package/lib/cjs/tile/map/MapLayerSources.js +28 -11
  82. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  83. package/lib/cjs/tools/ToolAdmin.d.ts +11 -4
  84. package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
  85. package/lib/cjs/tools/ToolAdmin.js +28 -3
  86. package/lib/cjs/tools/ToolAdmin.js.map +1 -1
  87. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts +5 -2
  88. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
  89. package/lib/esm/RealityDataSourceTilesetUrlImpl.js +6 -0
  90. package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  91. package/lib/esm/core-frontend.d.ts +1 -1
  92. package/lib/esm/core-frontend.d.ts.map +1 -1
  93. package/lib/esm/core-frontend.js +1 -1
  94. package/lib/esm/core-frontend.js.map +1 -1
  95. package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.d.ts +2 -0
  96. package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.d.ts.map +1 -1
  97. package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.js +13 -4
  98. package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.js.map +1 -1
  99. package/lib/esm/internal/cross-package.d.ts +1 -1
  100. package/lib/esm/internal/cross-package.d.ts.map +1 -1
  101. package/lib/esm/internal/cross-package.js +1 -1
  102. package/lib/esm/internal/cross-package.js.map +1 -1
  103. package/lib/esm/internal/tile/RealityTileLoader.d.ts +1 -1
  104. package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
  105. package/lib/esm/internal/tile/RealityTileLoader.js +5 -3
  106. package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
  107. package/lib/esm/internal/tile/map/ArcGisUtilities.d.ts +15 -2
  108. package/lib/esm/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
  109. package/lib/esm/internal/tile/map/ArcGisUtilities.js +55 -30
  110. package/lib/esm/internal/tile/map/ArcGisUtilities.js.map +1 -1
  111. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts +14 -0
  112. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
  113. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js +92 -46
  114. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
  115. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  116. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +5 -4
  117. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  118. package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
  119. package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +9 -3
  120. package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  121. package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
  122. package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +9 -3
  123. package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
  124. package/lib/esm/internal/tile/map/MapLayerFetch.d.ts +57 -0
  125. package/lib/esm/internal/tile/map/MapLayerFetch.d.ts.map +1 -0
  126. package/lib/esm/internal/tile/map/MapLayerFetch.js +91 -0
  127. package/lib/esm/internal/tile/map/MapLayerFetch.js.map +1 -0
  128. package/lib/esm/internal/tile/map/UrlUtils.js +1 -1
  129. package/lib/esm/internal/tile/map/UrlUtils.js.map +1 -1
  130. package/lib/esm/internal/tile/map/WmsCapabilities.d.ts +2 -5
  131. package/lib/esm/internal/tile/map/WmsCapabilities.d.ts.map +1 -1
  132. package/lib/esm/internal/tile/map/WmsCapabilities.js +16 -9
  133. package/lib/esm/internal/tile/map/WmsCapabilities.js.map +1 -1
  134. package/lib/esm/internal/tile/map/WmsUtilities.d.ts +29 -1
  135. package/lib/esm/internal/tile/map/WmsUtilities.d.ts.map +1 -1
  136. package/lib/esm/internal/tile/map/WmsUtilities.js +44 -12
  137. package/lib/esm/internal/tile/map/WmsUtilities.js.map +1 -1
  138. package/lib/esm/internal/tile/map/WmtsCapabilities.d.ts +2 -5
  139. package/lib/esm/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
  140. package/lib/esm/internal/tile/map/WmtsCapabilities.js +16 -9
  141. package/lib/esm/internal/tile/map/WmtsCapabilities.js.map +1 -1
  142. package/lib/esm/tile/GltfReader.d.ts.map +1 -1
  143. package/lib/esm/tile/GltfReader.js +3 -1
  144. package/lib/esm/tile/GltfReader.js.map +1 -1
  145. package/lib/esm/tile/internal.d.ts +2 -0
  146. package/lib/esm/tile/internal.d.ts.map +1 -1
  147. package/lib/esm/tile/internal.js +2 -0
  148. package/lib/esm/tile/internal.js.map +1 -1
  149. package/lib/esm/tile/map/MapLayerFetchHandler.d.ts +94 -0
  150. package/lib/esm/tile/map/MapLayerFetchHandler.d.ts.map +1 -0
  151. package/lib/esm/tile/map/MapLayerFetchHandler.js +9 -0
  152. package/lib/esm/tile/map/MapLayerFetchHandler.js.map +1 -0
  153. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +27 -1
  154. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  155. package/lib/esm/tile/map/MapLayerFormatRegistry.js +40 -0
  156. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  157. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  158. package/lib/esm/tile/map/MapLayerImageryFormats.js +21 -5
  159. package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
  160. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +28 -16
  161. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  162. package/lib/esm/tile/map/MapLayerImageryProvider.js +136 -68
  163. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  164. package/lib/esm/tile/map/MapLayerSources.d.ts +19 -4
  165. package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
  166. package/lib/esm/tile/map/MapLayerSources.js +28 -11
  167. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  168. package/lib/esm/tools/ToolAdmin.d.ts +11 -4
  169. package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
  170. package/lib/esm/tools/ToolAdmin.js +30 -5
  171. package/lib/esm/tools/ToolAdmin.js.map +1 -1
  172. package/package.json +21 -21
@@ -42,9 +42,11 @@ export * from "../internal/tile/ImdlGraphicsCreator";
42
42
  export * from "../internal/tile/ImdlParser";
43
43
  export * from "../internal/tile/map/ArcGISTileMap";
44
44
  export * from "./map/MapLayerAuthentication";
45
+ export * from "./map/MapLayerFetchHandler";
45
46
  export * from "./map/MapFeatureInfo";
46
47
  export * from "./map/MapLayerFormatRegistry";
47
48
  export * from "../internal/tile/map/ArcGisUtilities";
49
+ export * from "../internal/tile/map/MapLayerFetch";
48
50
  export * from "../internal/tile/map/WmsUtilities";
49
51
  export * from "../internal/tile/map/WmsCapabilities";
50
52
  export * from "../internal/tile/map/WmtsCapabilities";
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tile/internal.ts"],"names":[],"mappings":"AAIA;;GAEG;AAYH,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cA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C,CAAC;AACtD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC"}
@@ -71,9 +71,11 @@ __exportStar(require("../internal/tile/ImdlGraphicsCreator"), exports);
71
71
  __exportStar(require("../internal/tile/ImdlParser"), exports);
72
72
  __exportStar(require("../internal/tile/map/ArcGISTileMap"), exports);
73
73
  __exportStar(require("./map/MapLayerAuthentication"), exports);
74
+ __exportStar(require("./map/MapLayerFetchHandler"), exports);
74
75
  __exportStar(require("./map/MapFeatureInfo"), exports);
75
76
  __exportStar(require("./map/MapLayerFormatRegistry"), exports);
76
77
  __exportStar(require("../internal/tile/map/ArcGisUtilities"), exports);
78
+ __exportStar(require("../internal/tile/map/MapLayerFetch"), exports);
77
79
  __exportStar(require("../internal/tile/map/WmsUtilities"), exports);
78
80
  __exportStar(require("../internal/tile/map/WmsCapabilities"), exports);
79
81
  __exportStar(require("../internal/tile/map/WmtsCapabilities"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tile/internal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;AAEH;;;;;;;;GAQG;AAEH,qEAAmD;AACnD,0DAAwC;AACxC,+CAA6B;AAC7B,yDAAuC;AACvC,yCAAuB;AACvB,+DAA6C;AAC7C,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,uEAAqD;AACrD,qEAAmD;AACnD,oEAAkD;AAClD,mDAAiC;AACjC,6CAA2B;AAC3B,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC;AAChC,sDAAoC;AACpC,iFAA+D;AAC/D,wEAAsD;AACtD,0DAAwC;AACxC,0DAAwC;AACxC,8CAA4B;AAC5B,gDAA8B;AAC9B,gDAA8B;AAC9B,uDAAqC;AACrC,6EAA2D;AAC3D,wDAAsC;AACtC,oDAAkC;AAClC,6CAA2B;AAC3B,+DAA6C;AAC7C,+CAA6B;AAC7B,8DAA4C;AAC5C,8DAA4C;AAC5C,+CAA6B;AAC7B,+DAA6C;AAC7C,uEAAqD;AACrD,8DAA4C;AAC5C,qEAAmD;AACnD,+DAA6C;AAC7C,uDAAqC;AACrC,+DAA6C;AAC7C,uEAAqD;AACrD,oEAAkD;AAClD,uEAAqD;AACrD,wEAAsD;AACtD,yFAAuE;AACvE,gEAA8C;AAC9C,gEAA8C;AAC9C,oFAAkE;AAClE,iGAA+E;AAC/E,wGAAsF;AACtF,8FAA4E;AAC5E,gGAA8E;AAC9E,gGAA8E;AAC9E,iGAA+E;AAC/E,sGAAoF;AACpF,4FAA0E;AAC1E,mGAAiF;AACjF,+FAA6E;AAC7E,mGAAiF;AACjF,oGAAkF;AAClF,+DAA6C;AAC7C,kEAAgD;AAChD,oDAAkC;AAClC,4DAA0C;AAC1C,wDAAsC;AACtC,8DAA4C;AAC5C,iEAA+C;AAC/C,gDAA8B;AAC9B,qEAAmD;AACnD,qEAAmD;AACnD,sDAAoC;AACpC,wDAAsC;AACtC,2EAAyD;AACzD,8DAA4C;AAC5C,wEAAsD;AACtD,0DAAwC;AACxC,8DAA4C;AAC5C,qEAAmD;AACnD,kEAAgD;AAChD,mEAAiD;AACjD,sEAAoD;AACpD,mEAAiD;AACjD,wDAAsC;AACtC,wDAAsC;AACtC,iEAA+C;AAC/C,uEAAqD;AACrD,wEAAsD;AACtD,+EAA6D;AAC7D,wEAAsD;AACtD,qEAAmD;AACnD,sEAAoD;AACpD,0EAAwD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\n/* The order of exports below is based on dependencies between the types in each file.\r\n * For example, IModelTileTree derives from TileTree, so TileTree must be exported first.\r\n * No file inside core-frontend should import from *any* file in /tile/ *except* for this one.\r\n * e.g.:\r\n * import { TileTree } from \"./tile/TileTree\"; // NO...\r\n * import { TileTree } from \"./tile/internal\"; // YES!\r\n * Failure to follow either of these two guidelines is very likely to produce difficult-to-debug run-time errors due\r\n * to circular dependencies.\r\n */\r\n\r\nexport * from \"../internal/tile/ViewFlagOverrides\";\r\nexport * from \"./map/MapCartoRectangle\";\r\nexport * from \"./map/QuadId\";\r\nexport * from \"./DisclosedTileTreeSet\";\r\nexport * from \"./Tile\";\r\nexport * from \"../internal/tile/LRUTileList\";\r\nexport * from \"./RealityTile\";\r\nexport * from \"./TileParams\";\r\nexport * from \"./TileContent\";\r\nexport * from \"./TileDrawArgs\";\r\nexport * from \"../internal/tile/RealityTileDrawArgs\";\r\nexport * from \"../internal/tile/GraphicsCollector\";\r\nexport * from \"../internal/tile/BatchedTileIdMap\";\r\nexport * from \"./TileTreeParams\";\r\nexport * from \"./TileTree\";\r\nexport * from \"./RealityTileTree\";\r\nexport * from \"./TileTreeSupplier\";\r\nexport * from \"./TileTreeOwner\";\r\nexport * from \"./TileTreeReference\";\r\nexport * from \"../internal/tile/LayerTileTreeReferenceHandler\";\r\nexport * from \"../internal/tile/LayerTileTreeHandler\";\r\nexport * from \"./TileGeometryCollector\";\r\nexport * from \"./TiledGraphicsProvider\";\r\nexport * from \"./TileAdmin\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TileRequest\";\r\nexport * from \"./TileRequestChannel\";\r\nexport * from \"../internal/tile/IModelTileRequestChannels\";\r\nexport * from \"./TileRequestChannels\";\r\nexport * from \"./TileUsageMarker\";\r\nexport * from \"./TileUser\";\r\nexport * from \"../internal/tile/TileUserSet\";\r\nexport * from \"./GltfReader\";\r\nexport * from \"../internal/tile/I3dmReader\";\r\nexport * from \"../internal/tile/B3dmReader\";\r\nexport * from \"./ImdlReader\";\r\nexport * from \"../internal/tile/ImdlDecoder\";\r\nexport * from \"../internal/tile/ImdlGraphicsCreator\";\r\nexport * from \"../internal/tile/ImdlParser\";\r\nexport * from \"../internal/tile/map/ArcGISTileMap\";\r\nexport * from \"./map/MapLayerAuthentication\";\r\nexport * from \"./map/MapFeatureInfo\";\r\nexport * from \"./map/MapLayerFormatRegistry\";\r\nexport * from \"../internal/tile/map/ArcGisUtilities\";\r\nexport * from \"../internal/tile/map/WmsUtilities\";\r\nexport * from \"../internal/tile/map/WmsCapabilities\";\r\nexport * from \"../internal/tile/map/WmtsCapabilities\";\r\nexport * from \"../internal/tile/map/ImageryProviders/CoordinatesUtils\";\r\nexport * from \"../internal/tile/map/UrlUtils\";\r\nexport * from \"./map/MapLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/WebMercator\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureSymbologyRenderer\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureAttributeDrivenSymbology\";\r\nexport * from \"../internal/tile/map/ImageryProviders/ArcGISImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureGeometryRenderer\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureGraphicsRenderer\";\r\nexport * from \"../internal/tile/map/ImageryProviders/ArcGisGeometryReaderJSON\";\r\nexport * from \"../internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/BingImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/TileUrlImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider\";\r\nexport * from \"./map/MapLayerImageryFormats\";\r\nexport * from \"./map/MapLayerTileTreeReference\";\r\nexport * from \"./map/MapTileTree\";\r\nexport * from \"./map/TerrainMeshProvider\";\r\nexport * from \"./map/TerrainProvider\";\r\nexport * from \"./map/CesiumTerrainProvider\";\r\nexport * from \"./map/EllipsoidTerrainProvider\";\r\nexport * from \"./map/MapTile\";\r\nexport * from \"../internal/tile/RealityTileLoader\";\r\nexport * from \"../internal/tile/map/MapTileLoader\";\r\nexport * from \"./map/BingElevation\";\r\nexport * from \"./map/MapTilingScheme\";\r\nexport * from \"../internal/tile/map/MapTileAvailability\";\r\nexport * from \"../internal/tile/PntsReader\";\r\nexport * from \"../internal/tile/RealityModelTileTree\";\r\nexport * from \"./RenderGraphicTileTree\";\r\nexport * from \"../internal/tile/IModelTile\";\r\nexport * from \"../internal/tile/DynamicIModelTile\";\r\nexport * from \"../internal/tile/IModelTileTree\";\r\nexport * from \"../internal/tile/PrimaryTileTree\";\r\nexport * from \"../internal/tile/ClassifierTileTree\";\r\nexport * from \"../internal/tile/OrbitGtTileTree\";\r\nexport * from \"./map/ImageryTileTree\";\r\nexport * from \"./map/MapLayerSources\";\r\nexport * from \"./map/MapTiledGraphicsProvider\";\r\nexport * from \"../internal/tile/CesiumAssetProvider\";\r\nexport * from \"../internal/tile/ContextShareProvider\";\r\nexport * from \"../internal/tile/ThreeDTileFormatInterpreter\";\r\nexport * from \"../internal/tile/OPCFormatInterpreter\";\r\nexport * from \"../internal/tile/FetchCloudStorage\";\r\nexport * from \"../internal/tile/MeshoptCompression\";\r\nexport * from \"../internal/render/webgl/MapLayerParams\";"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tile/internal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;AAEH;;;;;;;;GAQG;AAEH,qEAAmD;AACnD,0DAAwC;AACxC,+CAA6B;AAC7B,yDAAuC;AACvC,yCAAuB;AACvB,+DAA6C;AAC7C,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,uEAAqD;AACrD,qEAAmD;AACnD,oEAAkD;AAClD,mDAAiC;AACjC,6CAA2B;AAC3B,oDAAkC;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------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\n/* The order of exports below is based on dependencies between the types in each file.\r\n * For example, IModelTileTree derives from TileTree, so TileTree must be exported first.\r\n * No file inside core-frontend should import from *any* file in /tile/ *except* for this one.\r\n * e.g.:\r\n * import { TileTree } from \"./tile/TileTree\"; // NO...\r\n * import { TileTree } from \"./tile/internal\"; // YES!\r\n * Failure to follow either of these two guidelines is very likely to produce difficult-to-debug run-time errors due\r\n * to circular dependencies.\r\n */\r\n\r\nexport * from \"../internal/tile/ViewFlagOverrides\";\r\nexport * from \"./map/MapCartoRectangle\";\r\nexport * from \"./map/QuadId\";\r\nexport * from \"./DisclosedTileTreeSet\";\r\nexport * from \"./Tile\";\r\nexport * from \"../internal/tile/LRUTileList\";\r\nexport * from \"./RealityTile\";\r\nexport * from \"./TileParams\";\r\nexport * from \"./TileContent\";\r\nexport * from \"./TileDrawArgs\";\r\nexport * from \"../internal/tile/RealityTileDrawArgs\";\r\nexport * from \"../internal/tile/GraphicsCollector\";\r\nexport * from \"../internal/tile/BatchedTileIdMap\";\r\nexport * from \"./TileTreeParams\";\r\nexport * from \"./TileTree\";\r\nexport * from \"./RealityTileTree\";\r\nexport * from \"./TileTreeSupplier\";\r\nexport * from \"./TileTreeOwner\";\r\nexport * from \"./TileTreeReference\";\r\nexport * from \"../internal/tile/LayerTileTreeReferenceHandler\";\r\nexport * from \"../internal/tile/LayerTileTreeHandler\";\r\nexport * from \"./TileGeometryCollector\";\r\nexport * from \"./TiledGraphicsProvider\";\r\nexport * from \"./TileAdmin\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TileRequest\";\r\nexport * from \"./TileRequestChannel\";\r\nexport * from \"../internal/tile/IModelTileRequestChannels\";\r\nexport * from \"./TileRequestChannels\";\r\nexport * from \"./TileUsageMarker\";\r\nexport * from \"./TileUser\";\r\nexport * from \"../internal/tile/TileUserSet\";\r\nexport * from \"./GltfReader\";\r\nexport * from \"../internal/tile/I3dmReader\";\r\nexport * from \"../internal/tile/B3dmReader\";\r\nexport * from \"./ImdlReader\";\r\nexport * from \"../internal/tile/ImdlDecoder\";\r\nexport * from \"../internal/tile/ImdlGraphicsCreator\";\r\nexport * from \"../internal/tile/ImdlParser\";\r\nexport * from \"../internal/tile/map/ArcGISTileMap\";\r\nexport * from \"./map/MapLayerAuthentication\";\r\nexport * from \"./map/MapLayerFetchHandler\";\r\nexport * from \"./map/MapFeatureInfo\";\r\nexport * from \"./map/MapLayerFormatRegistry\";\r\nexport * from \"../internal/tile/map/ArcGisUtilities\";\r\nexport * from \"../internal/tile/map/MapLayerFetch\";\r\nexport * from \"../internal/tile/map/WmsUtilities\";\r\nexport * from \"../internal/tile/map/WmsCapabilities\";\r\nexport * from \"../internal/tile/map/WmtsCapabilities\";\r\nexport * from \"../internal/tile/map/ImageryProviders/CoordinatesUtils\";\r\nexport * from \"../internal/tile/map/UrlUtils\";\r\nexport * from \"./map/MapLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/WebMercator\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureSymbologyRenderer\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureAttributeDrivenSymbology\";\r\nexport * from \"../internal/tile/map/ImageryProviders/ArcGISImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureGeometryRenderer\";\r\nexport * from \"../internal/tile/map/ImageryProviders/FeatureGraphicsRenderer\";\r\nexport * from \"../internal/tile/map/ImageryProviders/ArcGisGeometryReaderJSON\";\r\nexport * from \"../internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/BingImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/TileUrlImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider\";\r\nexport * from \"../internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider\";\r\nexport * from \"./map/MapLayerImageryFormats\";\r\nexport * from \"./map/MapLayerTileTreeReference\";\r\nexport * from \"./map/MapTileTree\";\r\nexport * from \"./map/TerrainMeshProvider\";\r\nexport * from \"./map/TerrainProvider\";\r\nexport * from \"./map/CesiumTerrainProvider\";\r\nexport * from \"./map/EllipsoidTerrainProvider\";\r\nexport * from \"./map/MapTile\";\r\nexport * from \"../internal/tile/RealityTileLoader\";\r\nexport * from \"../internal/tile/map/MapTileLoader\";\r\nexport * from \"./map/BingElevation\";\r\nexport * from \"./map/MapTilingScheme\";\r\nexport * from \"../internal/tile/map/MapTileAvailability\";\r\nexport * from \"../internal/tile/PntsReader\";\r\nexport * from \"../internal/tile/RealityModelTileTree\";\r\nexport * from \"./RenderGraphicTileTree\";\r\nexport * from \"../internal/tile/IModelTile\";\r\nexport * from \"../internal/tile/DynamicIModelTile\";\r\nexport * from \"../internal/tile/IModelTileTree\";\r\nexport * from \"../internal/tile/PrimaryTileTree\";\r\nexport * from \"../internal/tile/ClassifierTileTree\";\r\nexport * from \"../internal/tile/OrbitGtTileTree\";\r\nexport * from \"./map/ImageryTileTree\";\r\nexport * from \"./map/MapLayerSources\";\r\nexport * from \"./map/MapTiledGraphicsProvider\";\r\nexport * from \"../internal/tile/CesiumAssetProvider\";\r\nexport * from \"../internal/tile/ContextShareProvider\";\r\nexport * from \"../internal/tile/ThreeDTileFormatInterpreter\";\r\nexport * from \"../internal/tile/OPCFormatInterpreter\";\r\nexport * from \"../internal/tile/FetchCloudStorage\";\r\nexport * from \"../internal/tile/MeshoptCompression\";\r\nexport * from \"../internal/render/webgl/MapLayerParams\";"]}
@@ -0,0 +1,94 @@
1
+ /** @packageDocumentation
2
+ * @module MapLayers
3
+ */
4
+ import type { MapLayerProviderProperties } from "@itwin/core-common";
5
+ /** Describes an outgoing map-layer request submitted to the [[MapLayerFetchHandler]]s registered via
6
+ * [[MapLayerFormatRegistry.addMapLayerFetchHandler]]. Treat it as an immutable value: to change what is sent,
7
+ * pass a copy with different [[searchParams]] or [[headers]] to [[MapLayerFetchRequest]], e.g.
8
+ * `fetchRequest({ ...request, headers })`. Each handler receives its own copy of the request, and only what it
9
+ * passes to `fetchRequest` reaches the wire — a change made in place on a request the handler then declines has
10
+ * no effect. The target (origin and path) is fixed by us and cannot be changed, so a handler can never
11
+ * (accidentally or otherwise) reroute a request.
12
+ * @beta
13
+ */
14
+ export interface MapLayerRequest {
15
+ /** The request URL as the provider built it (possibly relative to the document), including its query parameters.
16
+ * Informational: a handler that changes [[searchParams]] does not need to — and cannot — update it; we recompute
17
+ * it for the next handler.
18
+ */
19
+ readonly url: string;
20
+ /** The URL of the map-layer source this request is made for, as configured on the layer's settings.
21
+ * Unlike [[url]], it is stable across every request kind (tiles, tooltips, capabilities, service metadata),
22
+ * making it the key to use when a handler manages distinct values (e.g. credentials) for several layers.
23
+ */
24
+ readonly layerUrl: string;
25
+ /** The provider-specific properties of the layer's settings ([ImageMapLayerSettings.properties]($common)), if any;
26
+ * lets a handler identify a layer when [[layerUrl]] is not enough. Undefined for source-validation requests.
27
+ */
28
+ readonly layerProperties?: MapLayerProviderProperties;
29
+ /** The id of the map-layer format the request is made for (e.g. "WMS", "ArcGIS"), letting a handler
30
+ * restrict itself to the formats it manages.
31
+ */
32
+ readonly formatId: string;
33
+ /** The complete query-parameter set of the outgoing request — including parameters embedded in the layer's URL
34
+ * and those appended by the provider (e.g. custom query parameters, protocol parameters). To send different
35
+ * parameters, pass a copy: `const searchParams = new URLSearchParams(request.searchParams); searchParams.set("token", ...)`.
36
+ * Overriding parameters the provider relies on may break the request.
37
+ */
38
+ readonly searchParams: URLSearchParams;
39
+ /** The request headers we supply (e.g. settings-derived basic auth). To send different headers,
40
+ * pass a copy: `const headers = new Headers(request.headers); headers.set("Authorization", ...)`.
41
+ */
42
+ readonly headers: Headers;
43
+ }
44
+ /** Sends a [[MapLayerRequest]] onward: the request is first offered to the [[MapLayerFetchHandler]]s registered
45
+ * after the calling one, which may modify it further or decline; once the pipeline is exhausted we issue it with
46
+ * the site's standard behavior (origin-trust checks, timeouts) and resolve with the response.
47
+ * The request sent is the one passed: its [[MapLayerRequest.searchParams]] and [[MapLayerRequest.headers]] go on
48
+ * the wire, while the target (origin and path) is always that of the request the handler received. May be
49
+ * called one or more times by a handler (e.g. to retry with a refreshed token).
50
+ *
51
+ * Every send is a credentialed request, because only the handler knows whether a value it injected is a secret:
52
+ * redirects are refused while [[MapLayerFormatRegistry.restrictCredentialsToTrustedOrigins]] is enabled (so
53
+ * injected values cannot silently reach an unlisted origin through a redirect), and an NTLM/Negotiate 401
54
+ * challenge is never answered with browser credentials (SSO). A handler that does not manage a request must
55
+ * therefore not send it but decline it (return `undefined`), so the request keeps its default behavior in
56
+ * full — e.g. layers served by Windows-Authentication-protected services are not degraded by a handler
57
+ * serving another format. We keep protecting the credentials we supply ourselves (settings-derived basic
58
+ * auth, browser SSO identity) on every send.
59
+ * @beta
60
+ */
61
+ export type MapLayerFetchRequest = (request: MapLayerRequest) => Promise<Response>;
62
+ /** Wraps every map-layer network request issued through [[MapLayerImageryProvider]] — tiles, tooltips,
63
+ * capabilities, service metadata, and source validation.
64
+ * Registered via [[MapLayerFormatRegistry.addMapLayerFetchHandler]]. Handlers form a pipeline we own, run in
65
+ * registration order: the first registered is the outermost. Requests a format issues outside the provider's
66
+ * request path (e.g. through its own session or token service client) are not routed; that format's
67
+ * documentation states which.
68
+ *
69
+ * A handler may:
70
+ * - decline a request it does not manage (e.g. a format it does not serve) by returning `undefined` without
71
+ * calling `fetchRequest`: each handler receives its own copy of the request, so the next handler sees it exactly
72
+ * as the declining one received it, and if every handler declines we issue it ourselves with the default
73
+ * behavior in full;
74
+ * - pass a copy of the request with different query parameters or headers to `fetchRequest`; the request is
75
+ * offered to the remaining handlers, then issued as a credentialed send;
76
+ * - call `fetchRequest` one or more times (e.g. refresh an expired token and retry transparently);
77
+ * - return its own `Response` without calling `fetchRequest` (short-circuit);
78
+ * - throw [[MapLayerAuthenticationFailedError]] to report an unrecoverable authentication failure,
79
+ * transitioning the layer to [[MapLayerImageryProviderStatus.RequireAuth]].
80
+ *
81
+ * A handler that has called `fetchRequest` must return a response (its own or the one received) or throw; it must
82
+ * not decline. This is not enforced: declining after sending makes the enclosing handler's `fetchRequest` issue
83
+ * the request again.
84
+ *
85
+ * Invoked on the hot path of tile loading; handlers should be fast, cache their tokens internally, and
86
+ * coalesce concurrent refreshes (many tile requests observe an expired token at the same time).
87
+ * While a handler is registered, URL-keyed capability/service-metadata caches are bypassed so that
88
+ * customized responses are never shared across differing request contexts. Note that a single logical
89
+ * operation may invoke the pipeline more than once (e.g. the ArcGIS providers issue fallback and
90
+ * token-retry requests); each network request passes through it individually.
91
+ * @beta
92
+ */
93
+ export type MapLayerFetchHandler = (request: MapLayerRequest, fetchRequest: MapLayerFetchRequest) => Promise<Response | undefined>;
94
+ //# sourceMappingURL=MapLayerFetchHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapLayerFetchHandler.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFetchHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,0BAA0B,CAAC;IACtD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;IACvC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,KAAK,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module MapLayers
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=MapLayerFetchHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapLayerFetchHandler.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFetchHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport type { MapLayerProviderProperties } from \"@itwin/core-common\";\r\n\r\n/** Describes an outgoing map-layer request submitted to the [[MapLayerFetchHandler]]s registered via\r\n * [[MapLayerFormatRegistry.addMapLayerFetchHandler]]. Treat it as an immutable value: to change what is sent,\r\n * pass a copy with different [[searchParams]] or [[headers]] to [[MapLayerFetchRequest]], e.g.\r\n * `fetchRequest({ ...request, headers })`. Each handler receives its own copy of the request, and only what it\r\n * passes to `fetchRequest` reaches the wire — a change made in place on a request the handler then declines has\r\n * no effect. The target (origin and path) is fixed by us and cannot be changed, so a handler can never\r\n * (accidentally or otherwise) reroute a request.\r\n * @beta\r\n */\r\nexport interface MapLayerRequest {\r\n /** The request URL as the provider built it (possibly relative to the document), including its query parameters.\r\n * Informational: a handler that changes [[searchParams]] does not need to — and cannot — update it; we recompute\r\n * it for the next handler.\r\n */\r\n readonly url: string;\r\n /** The URL of the map-layer source this request is made for, as configured on the layer's settings.\r\n * Unlike [[url]], it is stable across every request kind (tiles, tooltips, capabilities, service metadata),\r\n * making it the key to use when a handler manages distinct values (e.g. credentials) for several layers.\r\n */\r\n readonly layerUrl: string;\r\n /** The provider-specific properties of the layer's settings ([ImageMapLayerSettings.properties]($common)), if any;\r\n * lets a handler identify a layer when [[layerUrl]] is not enough. Undefined for source-validation requests.\r\n */\r\n readonly layerProperties?: MapLayerProviderProperties;\r\n /** The id of the map-layer format the request is made for (e.g. \"WMS\", \"ArcGIS\"), letting a handler\r\n * restrict itself to the formats it manages.\r\n */\r\n readonly formatId: string;\r\n /** The complete query-parameter set of the outgoing request — including parameters embedded in the layer's URL\r\n * and those appended by the provider (e.g. custom query parameters, protocol parameters). To send different\r\n * parameters, pass a copy: `const searchParams = new URLSearchParams(request.searchParams); searchParams.set(\"token\", ...)`.\r\n * Overriding parameters the provider relies on may break the request.\r\n */\r\n readonly searchParams: URLSearchParams;\r\n /** The request headers we supply (e.g. settings-derived basic auth). To send different headers,\r\n * pass a copy: `const headers = new Headers(request.headers); headers.set(\"Authorization\", ...)`.\r\n */\r\n readonly headers: Headers;\r\n}\r\n\r\n/** Sends a [[MapLayerRequest]] onward: the request is first offered to the [[MapLayerFetchHandler]]s registered\r\n * after the calling one, which may modify it further or decline; once the pipeline is exhausted we issue it with\r\n * the site's standard behavior (origin-trust checks, timeouts) and resolve with the response.\r\n * The request sent is the one passed: its [[MapLayerRequest.searchParams]] and [[MapLayerRequest.headers]] go on\r\n * the wire, while the target (origin and path) is always that of the request the handler received. May be\r\n * called one or more times by a handler (e.g. to retry with a refreshed token).\r\n *\r\n * Every send is a credentialed request, because only the handler knows whether a value it injected is a secret:\r\n * redirects are refused while [[MapLayerFormatRegistry.restrictCredentialsToTrustedOrigins]] is enabled (so\r\n * injected values cannot silently reach an unlisted origin through a redirect), and an NTLM/Negotiate 401\r\n * challenge is never answered with browser credentials (SSO). A handler that does not manage a request must\r\n * therefore not send it but decline it (return `undefined`), so the request keeps its default behavior in\r\n * full — e.g. layers served by Windows-Authentication-protected services are not degraded by a handler\r\n * serving another format. We keep protecting the credentials we supply ourselves (settings-derived basic\r\n * auth, browser SSO identity) on every send.\r\n * @beta\r\n */\r\nexport type MapLayerFetchRequest = (request: MapLayerRequest) => Promise<Response>;\r\n\r\n/** Wraps every map-layer network request issued through [[MapLayerImageryProvider]] — tiles, tooltips,\r\n * capabilities, service metadata, and source validation.\r\n * Registered via [[MapLayerFormatRegistry.addMapLayerFetchHandler]]. Handlers form a pipeline we own, run in\r\n * registration order: the first registered is the outermost. Requests a format issues outside the provider's\r\n * request path (e.g. through its own session or token service client) are not routed; that format's\r\n * documentation states which.\r\n *\r\n * A handler may:\r\n * - decline a request it does not manage (e.g. a format it does not serve) by returning `undefined` without\r\n * calling `fetchRequest`: each handler receives its own copy of the request, so the next handler sees it exactly\r\n * as the declining one received it, and if every handler declines we issue it ourselves with the default\r\n * behavior in full;\r\n * - pass a copy of the request with different query parameters or headers to `fetchRequest`; the request is\r\n * offered to the remaining handlers, then issued as a credentialed send;\r\n * - call `fetchRequest` one or more times (e.g. refresh an expired token and retry transparently);\r\n * - return its own `Response` without calling `fetchRequest` (short-circuit);\r\n * - throw [[MapLayerAuthenticationFailedError]] to report an unrecoverable authentication failure,\r\n * transitioning the layer to [[MapLayerImageryProviderStatus.RequireAuth]].\r\n *\r\n * A handler that has called `fetchRequest` must return a response (its own or the one received) or throw; it must\r\n * not decline. This is not enforced: declining after sending makes the enclosing handler's `fetchRequest` issue\r\n * the request again.\r\n *\r\n * Invoked on the hot path of tile loading; handlers should be fast, cache their tokens internally, and\r\n * coalesce concurrent refreshes (many tile requests observe an expired token at the same time).\r\n * While a handler is registered, URL-keyed capability/service-metadata caches are bypassed so that\r\n * customized responses are never shared across differing request contexts. Note that a single logical\r\n * operation may invoke the pipeline more than once (e.g. the ArcGIS providers issue fallback and\r\n * token-retry requests); each network request passes through it individually.\r\n * @beta\r\n */\r\nexport type MapLayerFetchHandler = (request: MapLayerRequest, fetchRequest: MapLayerFetchRequest) => Promise<Response | undefined>;\r\n"]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from "@itwin/core-common";
5
5
  import { IModelConnection } from "../../IModelConnection";
6
- import { ImageryMapLayerTreeReference, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference } from "../internal";
6
+ import { ImageryMapLayerTreeReference, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerFetchHandler, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference } from "../internal";
7
7
  /**
8
8
  * Class representing a map-layer format.
9
9
  * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].
@@ -74,6 +74,19 @@ export declare class MapLayerUntrustedOriginError extends Error {
74
74
  readonly url: string;
75
75
  constructor(url: string);
76
76
  }
77
+ /** Error reporting an unrecoverable authentication failure for a map-layer request.
78
+ * Thrown by a [[MapLayerFetchHandler]] when it recognizes an authentication failure it cannot fix
79
+ * silently (e.g. a `401` that survives a token refresh, or a protocol-specific error embedded in a
80
+ * `200` body); callers convert it to [[MapLayerImageryProviderStatus.RequireAuth]] (tile requests and
81
+ * provider initialization) or [[MapLayerSourceStatus.RequireAuth]] (source validation), letting the
82
+ * application prompt for re-authentication.
83
+ * @beta
84
+ */
85
+ export declare class MapLayerAuthenticationFailedError extends Error {
86
+ /** The URL of the request that failed to authenticate. */
87
+ readonly url: string;
88
+ constructor(url: string);
89
+ }
77
90
  /** @public */
78
91
  export interface MapLayerSourceValidation {
79
92
  status: MapLayerSourceStatus;
@@ -132,6 +145,19 @@ export declare class MapLayerFormatRegistry {
132
145
  * @beta
133
146
  */
134
147
  restrictCredentialsToTrustedOrigins: boolean;
148
+ private readonly _fetchHandlers;
149
+ /** Appends a [[MapLayerFetchHandler]] to the pipeline wrapping every map-layer network request issued through
150
+ * [[MapLayerImageryProvider]] — tiles, tooltips, capabilities, service metadata, and source validation.
151
+ * Handlers run in registration order (the first registered is the outermost), each deciding whether to
152
+ * manage a request or decline it to the next one; several layers of an application can therefore register
153
+ * their own handler without coordinating. Returns the function that removes the handler.
154
+ * @beta
155
+ */
156
+ addMapLayerFetchHandler(handler: MapLayerFetchHandler): () => void;
157
+ /** The registered [[MapLayerFetchHandler]]s, in pipeline order.
158
+ * @internal
159
+ */
160
+ get mapLayerFetchHandlers(): ReadonlyArray<MapLayerFetchHandler>;
135
161
  constructor(opts?: MapLayerOptions);
136
162
  /** Origins (e.g. "https://tiles.example.com") to which map layer providers may send credentials —
137
163
  * both the basic-auth credentials stored in the layer settings and browser credentials for
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerFormatRegistry.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAkC,oBAAoB,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,EAAgB,MAAM,aAAa,CAAC;AAGrP;;;;;;;;GAQG;AACH,qBAAa,cAAc;IACzB,OAAc,QAAQ,EAAE,MAAM,CAAC;IAE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AM,GAAG,oBAAoB,GAAG,SAAS;IAO1E,IAAW,aAAa,IAAI,eAAe,CAE1C;IAED,gBAAgB;IACT,yBAAyB,CAAC,aAAa,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,4BAA4B,GAAG,SAAS;IAU9J;;;OAGG;IACI,qBAAqB,CAAC,aAAa,EAAE,qBAAqB,GAAG,uBAAuB,GAAG,SAAS;IAWvG,WAAW;IACE,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAE3E,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;CA+B3J"}
@@ -7,7 +7,7 @@
7
7
  * @module MapLayers
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.MapLayerFormatRegistry = exports.MapLayerUntrustedOriginError = exports.MapLayerFormat = void 0;
10
+ exports.MapLayerFormatRegistry = exports.MapLayerAuthenticationFailedError = exports.MapLayerUntrustedOriginError = exports.MapLayerFormat = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const IModelApp_1 = require("../../IModelApp");
13
13
  const internal_1 = require("../internal");
@@ -79,6 +79,23 @@ class MapLayerUntrustedOriginError extends Error {
79
79
  }
80
80
  }
81
81
  exports.MapLayerUntrustedOriginError = MapLayerUntrustedOriginError;
82
+ /** Error reporting an unrecoverable authentication failure for a map-layer request.
83
+ * Thrown by a [[MapLayerFetchHandler]] when it recognizes an authentication failure it cannot fix
84
+ * silently (e.g. a `401` that survives a token refresh, or a protocol-specific error embedded in a
85
+ * `200` body); callers convert it to [[MapLayerImageryProviderStatus.RequireAuth]] (tile requests and
86
+ * provider initialization) or [[MapLayerSourceStatus.RequireAuth]] (source validation), letting the
87
+ * application prompt for re-authentication.
88
+ * @beta
89
+ */
90
+ class MapLayerAuthenticationFailedError extends Error {
91
+ /** The URL of the request that failed to authenticate. */
92
+ url;
93
+ constructor(url) {
94
+ super("Authentication failed for map-layer request");
95
+ this.url = url;
96
+ }
97
+ }
98
+ exports.MapLayerAuthenticationFailedError = MapLayerAuthenticationFailedError;
82
99
  /**
83
100
  * A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].
84
101
  * @public
@@ -98,6 +115,30 @@ class MapLayerFormatRegistry {
98
115
  * @beta
99
116
  */
100
117
  restrictCredentialsToTrustedOrigins = false;
118
+ _fetchHandlers = [];
119
+ /** Appends a [[MapLayerFetchHandler]] to the pipeline wrapping every map-layer network request issued through
120
+ * [[MapLayerImageryProvider]] — tiles, tooltips, capabilities, service metadata, and source validation.
121
+ * Handlers run in registration order (the first registered is the outermost), each deciding whether to
122
+ * manage a request or decline it to the next one; several layers of an application can therefore register
123
+ * their own handler without coordinating. Returns the function that removes the handler.
124
+ * @beta
125
+ */
126
+ addMapLayerFetchHandler(handler) {
127
+ // One wrapper per registration, so registering the same function twice yields independent removers.
128
+ const registration = async (request, fetchRequest) => handler(request, fetchRequest);
129
+ this._fetchHandlers.push(registration);
130
+ return () => {
131
+ const index = this._fetchHandlers.indexOf(registration);
132
+ if (index >= 0)
133
+ this._fetchHandlers.splice(index, 1);
134
+ };
135
+ }
136
+ /** The registered [[MapLayerFetchHandler]]s, in pipeline order.
137
+ * @internal
138
+ */
139
+ get mapLayerFetchHandlers() {
140
+ return this._fetchHandlers;
141
+ }
101
142
  constructor(opts) {
102
143
  this._configOptions = opts ?? {};
103
144
  internal_1.internalMapLayerImageryFormats.forEach((format) => this.register(format));
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GA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K,SAAS,EAAE,CAAC;oBACzB,IAAI,GAAG,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC;oBAC7B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBAC3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBAC7B,CAAC;YAEH,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAChE,MAAM,GAAG,KAAK,EAAE,IAAI,CAAC;YACrB,IAAI,GAAG,cAAc,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;YAClB,OAAO,EAAE,MAAM,EAAE,+BAAoB,CAAC,aAAa,EAAE,CAAC;QAExD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAnND,wDAmNC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert, expectDefined, Logger } from \"@itwin/core-bentley\";\r\nimport { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { ImageryMapLayerTreeReference, internalMapLayerImageryFormats, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference, tryGetOrigin } from \"../internal\";\r\nconst loggerCategory = \"MapLayerFormatRegistry\";\r\n\r\n/**\r\n * Class representing a map-layer format.\r\n * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].\r\n * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.\r\n * The MapLayerFormat object can later be used to validate a source, or create a provider.\r\n *\r\n * Subclasses should override formatId, [[MapLayerFormat.createImageryProvider]], and [[MapLayerFormat.createMapLayerTree]].\r\n * @public\r\n */\r\nexport class MapLayerFormat {\r\n public static formatId: string;\r\n\r\n /** Register the current format in the [[MapLayerFormatRegistry]]. */\r\n public static register() { IModelApp.mapLayerFormatRegistry.register(this); }\r\n\r\n /**\r\n * Allow a source of a specific format to be validated before being attached as a map-layer.\r\n * @param _url The URL of the source.\r\n * @param _userName The username to access the source if needed.\r\n * @param _password The password to access the source if needed.\r\n * @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).\r\n * @returns Validation Status. If successful, a list of available sub-layers may also be returned.\r\n */\r\n public static async validateSource(_url: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _accesKey?: MapLayerKey): Promise<MapLayerSourceValidation> { return { status: MapLayerSourceStatus.Valid }; }\r\n\r\n /** Allow a source object to be validated before being attached as a map-layer.\r\n * @beta\r\n */\r\n public static async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\r\n return this.validateSource(args.source.url, args.source.userName, args.source.password, args.ignoreCache);\r\n }\r\n\r\n /**\r\n * Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.\r\n * @param _settings The map layer settings to be applied to the imagery provider.\r\n * @returns Returns the new imagery provider.\r\n * @beta\r\n */\r\n public static createImageryProvider(_settings: MapLayerSettings): MapLayerImageryProvider | undefined { assert(false); }\r\n\r\n /**\r\n * Creates a MapLayerTileTreeReference for this map layer format.\r\n * @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.\r\n * @param _layerIndex The index of the associated map layer.\r\n * @param _iModel The iModel containing the MapLayerTileTreeReference.\r\n * @returns Returns the new tile tree reference.\r\n * @beta\r\n */\r\n public static createMapLayerTree(_layerSettings: MapLayerSettings, _layerIndex: number, _iModel: IModelConnection): MapLayerTileTreeReference | undefined {\r\n assert(false);\r\n return undefined;\r\n }\r\n\r\n}\r\n\r\n/** Options for validating sources\r\n * @beta\r\n */\r\nexport interface ValidateSourceArgs {\r\n source: MapLayerSource;\r\n /** Disable cache lookup during validate process */\r\n ignoreCache?: boolean;\r\n}\r\n\r\n/**\r\n * The type of a map layer format.\r\n * @public\r\n */\r\nexport type MapLayerFormatType = typeof MapLayerFormat;\r\n\r\n/** Error thrown when an NTLM or Negotiate http 401 challenge could not be answered because the request\r\n * URL's origin is not listed in [[MapLayerFormatRegistry.trustedCredentialsOrigins]]\r\n * (see [[MapLayerFormatRegistry.restrictCredentialsToTrustedOrigins]]).\r\n * Thrown by the static map-layer utilities (e.g. capabilities / service-metadata fetches) that have no\r\n * provider instance on which to report the blocked origin; callers convert it to\r\n * [[MapLayerImageryProviderStatus.UntrustedOrigin]] (provider initialization) or\r\n * [[MapLayerSourceStatus.UntrustedOrigin]] (source validation).\r\n * @internal\r\n */\r\nexport class MapLayerUntrustedOriginError extends Error {\r\n /** The URL of the request whose authentication challenge was left unanswered. */\r\n public readonly url: string;\r\n\r\n constructor(url: string) {\r\n super(`Authentication blocked: origin of '${url}' is not listed in MapLayerFormatRegistry.trustedCredentialsOrigins`);\r\n this.url = url;\r\n }\r\n}\r\n\r\n/** @public */\r\nexport interface MapLayerSourceValidation {\r\n status: MapLayerSourceStatus;\r\n subLayers?: MapSubLayerProps[];\r\n\r\n /** @beta */\r\n authInfo?: MapLayerAuthenticationInfo;\r\n\r\n /** The origin of the URL that triggered an `UntrustedOrigin` validation failure, if known. Applications\r\n * can use this to whitelist the correct origin in [[MapLayerFormatRegistry.trustedCredentialsOrigins]].\r\n * @beta\r\n */\r\n blockedOrigin?: string;\r\n}\r\n\r\n/**\r\n * Options supplied at startup via [[IModelAppOptions.mapLayerOptions]] to specify access keys for various map layer formats.\r\n * 'BingMaps' must have it's key value set to 'key'\r\n * 'MapboxImagery' must have it's key value set to 'access_token'\r\n * Some format-specific options, including `BingMaps`, are retained for compatibility.\r\n *\r\n * @public\r\n */\r\nexport interface MapLayerOptions {\r\n /** Access key for Azure Maps in the format `{ key: \"subscription-key\", value: \"your-azure-maps-key\" }`. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n AzureMaps?: MapLayerKey;\r\n /** Access key for Mapbox in the format `{ key: \"access_token\", value: \"your-mapbox-key\" }`. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n MapboxImagery?: MapLayerKey;\r\n /** Access key for Bing Maps in the format `{ key: \"key\", value: \"your-bing-maps-key\" }`.\r\n * @deprecated in 5.11.0 - will not be removed until after 2027-07-03. All Bing Maps APIs are deprecated. Supply custom providers via\r\n * [[IModelAppOptions.geospatialProviders]].\r\n * For basemap imagery, use `@itwin/map-layers-formats`.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n BingMaps?: MapLayerKey;\r\n /** Access keys for additional map layer formats. */\r\n [format: string]: MapLayerKey | undefined;\r\n}\r\n\r\n/** @internal */\r\nexport interface MapLayerFormatEntry {\r\n type: MapLayerFormatType;\r\n accessClient?: MapLayerAccessClient;\r\n}\r\n\r\n/**\r\n * A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].\r\n * @public\r\n */\r\nexport class MapLayerFormatRegistry {\r\n private _configOptions: MapLayerOptions;\r\n private _trustedCredentialsOrigins: string[] = [];\r\n\r\n /** Opt-in enforcement of origin restrictions on map-layer credentials.\r\n * When enabled, map layer providers:\r\n * - attach the basic-auth credentials stored in the layer settings only to requests targeting the origin\r\n * of the layer's settings URL or an origin listed in [[trustedCredentialsOrigins]];\r\n * - retry a request with browser credentials included (i.e. SSO / Windows Authentication) after an NTLM\r\n * or Negotiate http 401 challenge only for origins explicitly listed in [[trustedCredentialsOrigins]]\r\n * (the settings-URL origin is NOT implicitly trusted for SSO, since map-layer URLs may originate from\r\n * untrusted user input while SSO shares the user's ambient identity).\r\n * Default is false, preserving the legacy behavior of sending credentials to any request URL.\r\n * @beta\r\n */\r\n public restrictCredentialsToTrustedOrigins = false;\r\n\r\n constructor(opts?: MapLayerOptions) {\r\n this._configOptions = opts ?? {};\r\n internalMapLayerImageryFormats.forEach((format) => this.register(format));\r\n }\r\n\r\n /** Origins (e.g. \"https://tiles.example.com\") to which map layer providers may send credentials —\r\n * both the basic-auth credentials stored in the layer settings and browser credentials for\r\n * SSO (i.e. Windows Authentication) retries after an NTLM or Negotiate http 401 challenge.\r\n * Only enforced when [[restrictCredentialsToTrustedOrigins]] is enabled.\r\n * For basic-auth, the origin of each map layer's settings URL is always implicitly trusted; for SSO,\r\n * origins must be explicitly listed here.\r\n * Entries are normalized to their origin (scheme + host + port); only `http:` and `https:` URLs are accepted,\r\n * and any other entry is ignored and logged. Opaque schemes such as `file:`, `data:`, `about:` and custom\r\n * Electron protocols are rejected because they all share the same serialized origin, so trusting one would\r\n * trust every other.\r\n * @beta\r\n */\r\n public get trustedCredentialsOrigins(): ReadonlyArray<string> {\r\n return this._trustedCredentialsOrigins;\r\n }\r\n\r\n public set trustedCredentialsOrigins(origins: ReadonlyArray<string>) {\r\n const normalized: string[] = [];\r\n for (const entry of origins) {\r\n const origin = tryGetOrigin(entry);\r\n if (origin !== undefined)\r\n normalized.push(origin);\r\n else\r\n Logger.logWarning(loggerCategory, `trustedCredentialsOrigins: ignoring '${entry}'; entries must be http or https URLs.`);\r\n }\r\n this._trustedCredentialsOrigins = normalized;\r\n }\r\n\r\n /** Returns true if a request to the given URL may be retried with browser credentials included\r\n * (i.e. SSO / Windows Authentication) after an NTLM or Negotiate http 401 challenge.\r\n * Always true unless [[restrictCredentialsToTrustedOrigins]] is enabled (opt-in).\r\n * When enabled, the URL's origin must be explicitly listed in [[trustedCredentialsOrigins]];\r\n * unlike basic-auth, the settings-URL origin is NOT implicitly trusted because SSO shares the user's\r\n * ambient identity, and map-layer URLs may originate from untrusted user input.\r\n * @internal\r\n */\r\n public isSsoAllowed(url: string): boolean {\r\n if (!this.restrictCredentialsToTrustedOrigins)\r\n return true;\r\n\r\n const origin = tryGetOrigin(url);\r\n\r\n // Entries are normalized to their origin by the [[trustedCredentialsOrigins]] setter.\r\n return origin !== undefined && this._trustedCredentialsOrigins.includes(origin);\r\n }\r\n\r\n /** Returns true if the basic-auth credentials belonging to a map-layer source or settings URL may be\r\n * attached to a request to the given URL. Always true unless [[restrictCredentialsToTrustedOrigins]]\r\n * is enabled (opt-in). When enabled, the origin of `settingsUrl` is implicitly trusted (the credentials\r\n * belong to that server); any other origin must be listed in [[trustedCredentialsOrigins]].\r\n * @internal\r\n */\r\n public isCredentialsSharingAllowed(url: string, settingsUrl: string): boolean {\r\n if (!this.restrictCredentialsToTrustedOrigins)\r\n return true;\r\n\r\n const origin = tryGetOrigin(url);\r\n if (origin === undefined)\r\n return false;\r\n\r\n if (origin === tryGetOrigin(settingsUrl))\r\n return true;\r\n\r\n // Entries are normalized to their origin by the [[trustedCredentialsOrigins]] setter.\r\n return this._trustedCredentialsOrigins.includes(origin);\r\n }\r\n\r\n /** Origins for which a \"credentials sent to untrusted origin\" warning was already logged;\r\n * used to log the discovery warning only once per origin.\r\n */\r\n private readonly _untrustedUseLogged = new Set<string>();\r\n\r\n /** Logs a warning (once per origin) when credentials are sent to an origin that would be blocked\r\n * if [[restrictCredentialsToTrustedOrigins]] were enabled.\r\n * Helps applications discover the origins they need to whitelist before opting in to the restriction.\r\n * If `settingsUrl` is supplied, requests sharing its origin are not logged, since that origin is\r\n * implicitly trusted for basic-auth.\r\n * @internal\r\n */\r\n public logUntrustedOriginUse(url: string, settingsUrl?: string): void {\r\n if (this.restrictCredentialsToTrustedOrigins)\r\n return; // restriction active; nothing to preview\r\n\r\n const origin = tryGetOrigin(url) ?? url;\r\n\r\n if (settingsUrl !== undefined && origin === tryGetOrigin(settingsUrl))\r\n return; // implicitly trusted for basic-auth\r\n\r\n if (this._untrustedUseLogged.has(origin) || this._trustedCredentialsOrigins.includes(origin))\r\n return;\r\n\r\n this._untrustedUseLogged.add(origin);\r\n Logger.logWarning(loggerCategory, `Credentials sent to origin '${origin}' which is not in MapLayerFormatRegistry.trustedCredentialsOrigins; `\r\n + \"this request would be blocked if restrictCredentialsToTrustedOrigins were enabled.\");\r\n }\r\n\r\n private _formats = new Map<string, MapLayerFormatEntry>();\r\n\r\n public isRegistered(formatId: string) { return this._formats.get(formatId) !== undefined; }\r\n\r\n public register(formatClass: MapLayerFormatType) {\r\n if (formatClass.formatId.length === 0)\r\n return; // must be an abstract class, ignore it\r\n\r\n this._formats.set(formatClass.formatId, { type: formatClass });\r\n }\r\n\r\n /** @beta */\r\n public setAccessClient(formatId: string, accessClient: MapLayerAccessClient): boolean {\r\n const entry = this._formats.get(formatId);\r\n if (entry !== undefined) {\r\n entry.accessClient = accessClient;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /** @beta */\r\n public getAccessClient(formatId: string): MapLayerAccessClient | undefined {\r\n if (formatId.length === 0)\r\n return undefined;\r\n\r\n return this._formats.get(formatId)?.accessClient;\r\n }\r\n\r\n public get configOptions(): MapLayerOptions {\r\n return this._configOptions;\r\n }\r\n\r\n /** @internal */\r\n public createImageryMapLayerTree(layerSettings: ImageMapLayerSettings, layerIndex: number, iModel: IModelConnection): ImageryMapLayerTreeReference | undefined {\r\n const entry = this._formats.get(layerSettings.formatId);\r\n const format = entry?.type;\r\n if (format === undefined) {\r\n Logger.logError(loggerCategory, `Could not find format '${layerSettings.formatId}' in registry`);\r\n return undefined;\r\n }\r\n return format.createMapLayerTree(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n /**\r\n * Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.\r\n * @internal\r\n */\r\n public createImageryProvider(layerSettings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\r\n const entry = this._formats.get(layerSettings.formatId);\r\n const format = entry?.type;\r\n if (this._configOptions[layerSettings.formatId] !== undefined) {\r\n const keyValuePair = expectDefined(this._configOptions[layerSettings.formatId]);\r\n const key: MapLayerKey = { key: keyValuePair.key, value: keyValuePair.value };\r\n layerSettings = layerSettings.clone({ accessKey: key });\r\n }\r\n return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);\r\n }\r\n\r\n /** @beta*/\r\n public async validateSource(opts: ValidateSourceArgs): Promise<MapLayerSourceValidation>;\r\n\r\n public async validateSource(formatId: string, url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation>;\r\n\r\n /** @internal*/\r\n public async validateSource(formatIdOrArgs: string|ValidateSourceArgs, url?: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\r\n let format: typeof MapLayerFormat | undefined;\r\n let args: ValidateSourceArgs | undefined;\r\n\r\n if (typeof formatIdOrArgs == \"string\" && url !== undefined) {\r\n const formatId = formatIdOrArgs;\r\n const entry = this._formats.get(formatId);\r\n format = entry?.type;\r\n if (format !== undefined) {\r\n const source = MapLayerSource.fromJSON({name: \"\", formatId, url});\r\n if (source !== undefined) {\r\n args = {source, ignoreCache};\r\n source.userName = userName;\r\n source.password = password;\r\n }\r\n\r\n }\r\n } else if (typeof formatIdOrArgs !== \"string\") {\r\n const entry = this._formats.get(formatIdOrArgs.source.formatId);\r\n format = entry?.type;\r\n args = formatIdOrArgs;\r\n }\r\n\r\n if (!args || !format)\r\n return { status: MapLayerSourceStatus.InvalidFormat };\r\n\r\n return format.validate(args);\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AAEpE,+CAA4C;AAE5C,0CAA2Q;AAC3Q,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAa,cAAc;IAClB,MAAM,CAAC,QAAQ,CAAS;IAE/B,qEAAqE;IAC9D,MAAM,C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A9OD,wDA8OC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert, expectDefined, Logger } from \"@itwin/core-bentley\";\r\nimport { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { ImageryMapLayerTreeReference, internalMapLayerImageryFormats, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerFetchHandler, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference, tryGetOrigin } from \"../internal\";\r\nconst loggerCategory = \"MapLayerFormatRegistry\";\r\n\r\n/**\r\n * Class representing a map-layer format.\r\n * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].\r\n * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.\r\n * The MapLayerFormat object can later be used to validate a source, or create a provider.\r\n *\r\n * Subclasses should override formatId, [[MapLayerFormat.createImageryProvider]], and [[MapLayerFormat.createMapLayerTree]].\r\n * @public\r\n */\r\nexport class MapLayerFormat {\r\n public static formatId: string;\r\n\r\n /** Register the current format in the [[MapLayerFormatRegistry]]. */\r\n public static register() { IModelApp.mapLayerFormatRegistry.register(this); }\r\n\r\n /**\r\n * Allow a source of a specific format to be validated before being attached as a map-layer.\r\n * @param _url The URL of the source.\r\n * @param _userName The username to access the source if needed.\r\n * @param _password The password to access the source if needed.\r\n * @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).\r\n * @returns Validation Status. If successful, a list of available sub-layers may also be returned.\r\n */\r\n public static async validateSource(_url: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _accesKey?: MapLayerKey): Promise<MapLayerSourceValidation> { return { status: MapLayerSourceStatus.Valid }; }\r\n\r\n /** Allow a source object to be validated before being attached as a map-layer.\r\n * @beta\r\n */\r\n public static async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\r\n return this.validateSource(args.source.url, args.source.userName, args.source.password, args.ignoreCache);\r\n }\r\n\r\n /**\r\n * Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.\r\n * @param _settings The map layer settings to be applied to the imagery provider.\r\n * @returns Returns the new imagery provider.\r\n * @beta\r\n */\r\n public static createImageryProvider(_settings: MapLayerSettings): MapLayerImageryProvider | undefined { assert(false); }\r\n\r\n /**\r\n * Creates a MapLayerTileTreeReference for this map layer format.\r\n * @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.\r\n * @param _layerIndex The index of the associated map layer.\r\n * @param _iModel The iModel containing the MapLayerTileTreeReference.\r\n * @returns Returns the new tile tree reference.\r\n * @beta\r\n */\r\n public static createMapLayerTree(_layerSettings: MapLayerSettings, _layerIndex: number, _iModel: IModelConnection): MapLayerTileTreeReference | undefined {\r\n assert(false);\r\n return undefined;\r\n }\r\n\r\n}\r\n\r\n/** Options for validating sources\r\n * @beta\r\n */\r\nexport interface ValidateSourceArgs {\r\n source: MapLayerSource;\r\n /** Disable cache lookup during validate process */\r\n ignoreCache?: boolean;\r\n}\r\n\r\n/**\r\n * The type of a map layer format.\r\n * @public\r\n */\r\nexport type MapLayerFormatType = typeof MapLayerFormat;\r\n\r\n/** Error thrown when an NTLM or Negotiate http 401 challenge could not be answered because the request\r\n * URL's origin is not listed in [[MapLayerFormatRegistry.trustedCredentialsOrigins]]\r\n * (see [[MapLayerFormatRegistry.restrictCredentialsToTrustedOrigins]]).\r\n * Thrown by the static map-layer utilities (e.g. capabilities / service-metadata fetches) that have no\r\n * provider instance on which to report the blocked origin; callers convert it to\r\n * [[MapLayerImageryProviderStatus.UntrustedOrigin]] (provider initialization) or\r\n * [[MapLayerSourceStatus.UntrustedOrigin]] (source validation).\r\n * @internal\r\n */\r\nexport class MapLayerUntrustedOriginError extends Error {\r\n /** The URL of the request whose authentication challenge was left unanswered. */\r\n public readonly url: string;\r\n\r\n constructor(url: string) {\r\n super(`Authentication blocked: origin of '${url}' is not listed in MapLayerFormatRegistry.trustedCredentialsOrigins`);\r\n this.url = url;\r\n }\r\n}\r\n\r\n/** Error reporting an unrecoverable authentication failure for a map-layer request.\r\n * Thrown by a [[MapLayerFetchHandler]] when it recognizes an authentication failure it cannot fix\r\n * silently (e.g. a `401` that survives a token refresh, or a protocol-specific error embedded in a\r\n * `200` body); callers convert it to [[MapLayerImageryProviderStatus.RequireAuth]] (tile requests and\r\n * provider initialization) or [[MapLayerSourceStatus.RequireAuth]] (source validation), letting the\r\n * application prompt for re-authentication.\r\n * @beta\r\n */\r\nexport class MapLayerAuthenticationFailedError extends Error {\r\n /** The URL of the request that failed to authenticate. */\r\n public readonly url: string;\r\n\r\n constructor(url: string) {\r\n super(\"Authentication failed for map-layer request\");\r\n this.url = url;\r\n }\r\n}\r\n\r\n/** @public */\r\nexport interface MapLayerSourceValidation {\r\n status: MapLayerSourceStatus;\r\n subLayers?: MapSubLayerProps[];\r\n\r\n /** @beta */\r\n authInfo?: MapLayerAuthenticationInfo;\r\n\r\n /** The origin of the URL that triggered an `UntrustedOrigin` validation failure, if known. Applications\r\n * can use this to whitelist the correct origin in [[MapLayerFormatRegistry.trustedCredentialsOrigins]].\r\n * @beta\r\n */\r\n blockedOrigin?: string;\r\n}\r\n\r\n/**\r\n * Options supplied at startup via [[IModelAppOptions.mapLayerOptions]] to specify access keys for various map layer formats.\r\n * 'BingMaps' must have it's key value set to 'key'\r\n * 'MapboxImagery' must have it's key value set to 'access_token'\r\n * Some format-specific options, including `BingMaps`, are retained for compatibility.\r\n *\r\n * @public\r\n */\r\nexport interface MapLayerOptions {\r\n /** Access key for Azure Maps in the format `{ key: \"subscription-key\", value: \"your-azure-maps-key\" }`. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n AzureMaps?: MapLayerKey;\r\n /** Access key for Mapbox in the format `{ key: \"access_token\", value: \"your-mapbox-key\" }`. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n MapboxImagery?: MapLayerKey;\r\n /** Access key for Bing Maps in the format `{ key: \"key\", value: \"your-bing-maps-key\" }`.\r\n * @deprecated in 5.11.0 - will not be removed until after 2027-07-03. All Bing Maps APIs are deprecated. Supply custom providers via\r\n * [[IModelAppOptions.geospatialProviders]].\r\n * For basemap imagery, use `@itwin/map-layers-formats`.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n BingMaps?: MapLayerKey;\r\n /** Access keys for additional map layer formats. */\r\n [format: string]: MapLayerKey | undefined;\r\n}\r\n\r\n/** @internal */\r\nexport interface MapLayerFormatEntry {\r\n type: MapLayerFormatType;\r\n accessClient?: MapLayerAccessClient;\r\n}\r\n\r\n/**\r\n * A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].\r\n * @public\r\n */\r\nexport class MapLayerFormatRegistry {\r\n private _configOptions: MapLayerOptions;\r\n private _trustedCredentialsOrigins: string[] = [];\r\n\r\n /** Opt-in enforcement of origin restrictions on map-layer credentials.\r\n * When enabled, map layer providers:\r\n * - attach the basic-auth credentials stored in the layer settings only to requests targeting the origin\r\n * of the layer's settings URL or an origin listed in [[trustedCredentialsOrigins]];\r\n * - retry a request with browser credentials included (i.e. SSO / Windows Authentication) after an NTLM\r\n * or Negotiate http 401 challenge only for origins explicitly listed in [[trustedCredentialsOrigins]]\r\n * (the settings-URL origin is NOT implicitly trusted for SSO, since map-layer URLs may originate from\r\n * untrusted user input while SSO shares the user's ambient identity).\r\n * Default is false, preserving the legacy behavior of sending credentials to any request URL.\r\n * @beta\r\n */\r\n public restrictCredentialsToTrustedOrigins = false;\r\n\r\n private readonly _fetchHandlers: MapLayerFetchHandler[] = [];\r\n\r\n /** Appends a [[MapLayerFetchHandler]] to the pipeline wrapping every map-layer network request issued through\r\n * [[MapLayerImageryProvider]] — tiles, tooltips, capabilities, service metadata, and source validation.\r\n * Handlers run in registration order (the first registered is the outermost), each deciding whether to\r\n * manage a request or decline it to the next one; several layers of an application can therefore register\r\n * their own handler without coordinating. Returns the function that removes the handler.\r\n * @beta\r\n */\r\n public addMapLayerFetchHandler(handler: MapLayerFetchHandler): () => void {\r\n // One wrapper per registration, so registering the same function twice yields independent removers.\r\n const registration: MapLayerFetchHandler = async (request, fetchRequest) => handler(request, fetchRequest);\r\n this._fetchHandlers.push(registration);\r\n return () => {\r\n const index = this._fetchHandlers.indexOf(registration);\r\n if (index >= 0)\r\n this._fetchHandlers.splice(index, 1);\r\n };\r\n }\r\n\r\n /** The registered [[MapLayerFetchHandler]]s, in pipeline order.\r\n * @internal\r\n */\r\n public get mapLayerFetchHandlers(): ReadonlyArray<MapLayerFetchHandler> {\r\n return this._fetchHandlers;\r\n }\r\n\r\n constructor(opts?: MapLayerOptions) {\r\n this._configOptions = opts ?? {};\r\n internalMapLayerImageryFormats.forEach((format) => this.register(format));\r\n }\r\n\r\n /** Origins (e.g. \"https://tiles.example.com\") to which map layer providers may send credentials —\r\n * both the basic-auth credentials stored in the layer settings and browser credentials for\r\n * SSO (i.e. Windows Authentication) retries after an NTLM or Negotiate http 401 challenge.\r\n * Only enforced when [[restrictCredentialsToTrustedOrigins]] is enabled.\r\n * For basic-auth, the origin of each map layer's settings URL is always implicitly trusted; for SSO,\r\n * origins must be explicitly listed here.\r\n * Entries are normalized to their origin (scheme + host + port); only `http:` and `https:` URLs are accepted,\r\n * and any other entry is ignored and logged. Opaque schemes such as `file:`, `data:`, `about:` and custom\r\n * Electron protocols are rejected because they all share the same serialized origin, so trusting one would\r\n * trust every other.\r\n * @beta\r\n */\r\n public get trustedCredentialsOrigins(): ReadonlyArray<string> {\r\n return this._trustedCredentialsOrigins;\r\n }\r\n\r\n public set trustedCredentialsOrigins(origins: ReadonlyArray<string>) {\r\n const normalized: string[] = [];\r\n for (const entry of origins) {\r\n const origin = tryGetOrigin(entry);\r\n if (origin !== undefined)\r\n normalized.push(origin);\r\n else\r\n Logger.logWarning(loggerCategory, `trustedCredentialsOrigins: ignoring '${entry}'; entries must be http or https URLs.`);\r\n }\r\n this._trustedCredentialsOrigins = normalized;\r\n }\r\n\r\n /** Returns true if a request to the given URL may be retried with browser credentials included\r\n * (i.e. SSO / Windows Authentication) after an NTLM or Negotiate http 401 challenge.\r\n * Always true unless [[restrictCredentialsToTrustedOrigins]] is enabled (opt-in).\r\n * When enabled, the URL's origin must be explicitly listed in [[trustedCredentialsOrigins]];\r\n * unlike basic-auth, the settings-URL origin is NOT implicitly trusted because SSO shares the user's\r\n * ambient identity, and map-layer URLs may originate from untrusted user input.\r\n * @internal\r\n */\r\n public isSsoAllowed(url: string): boolean {\r\n if (!this.restrictCredentialsToTrustedOrigins)\r\n return true;\r\n\r\n const origin = tryGetOrigin(url);\r\n\r\n // Entries are normalized to their origin by the [[trustedCredentialsOrigins]] setter.\r\n return origin !== undefined && this._trustedCredentialsOrigins.includes(origin);\r\n }\r\n\r\n /** Returns true if the basic-auth credentials belonging to a map-layer source or settings URL may be\r\n * attached to a request to the given URL. Always true unless [[restrictCredentialsToTrustedOrigins]]\r\n * is enabled (opt-in). When enabled, the origin of `settingsUrl` is implicitly trusted (the credentials\r\n * belong to that server); any other origin must be listed in [[trustedCredentialsOrigins]].\r\n * @internal\r\n */\r\n public isCredentialsSharingAllowed(url: string, settingsUrl: string): boolean {\r\n if (!this.restrictCredentialsToTrustedOrigins)\r\n return true;\r\n\r\n const origin = tryGetOrigin(url);\r\n if (origin === undefined)\r\n return false;\r\n\r\n if (origin === tryGetOrigin(settingsUrl))\r\n return true;\r\n\r\n // Entries are normalized to their origin by the [[trustedCredentialsOrigins]] setter.\r\n return this._trustedCredentialsOrigins.includes(origin);\r\n }\r\n\r\n /** Origins for which a \"credentials sent to untrusted origin\" warning was already logged;\r\n * used to log the discovery warning only once per origin.\r\n */\r\n private readonly _untrustedUseLogged = new Set<string>();\r\n\r\n /** Logs a warning (once per origin) when credentials are sent to an origin that would be blocked\r\n * if [[restrictCredentialsToTrustedOrigins]] were enabled.\r\n * Helps applications discover the origins they need to whitelist before opting in to the restriction.\r\n * If `settingsUrl` is supplied, requests sharing its origin are not logged, since that origin is\r\n * implicitly trusted for basic-auth.\r\n * @internal\r\n */\r\n public logUntrustedOriginUse(url: string, settingsUrl?: string): void {\r\n if (this.restrictCredentialsToTrustedOrigins)\r\n return; // restriction active; nothing to preview\r\n\r\n const origin = tryGetOrigin(url) ?? url;\r\n\r\n if (settingsUrl !== undefined && origin === tryGetOrigin(settingsUrl))\r\n return; // implicitly trusted for basic-auth\r\n\r\n if (this._untrustedUseLogged.has(origin) || this._trustedCredentialsOrigins.includes(origin))\r\n return;\r\n\r\n this._untrustedUseLogged.add(origin);\r\n Logger.logWarning(loggerCategory, `Credentials sent to origin '${origin}' which is not in MapLayerFormatRegistry.trustedCredentialsOrigins; `\r\n + \"this request would be blocked if restrictCredentialsToTrustedOrigins were enabled.\");\r\n }\r\n\r\n private _formats = new Map<string, MapLayerFormatEntry>();\r\n\r\n public isRegistered(formatId: string) { return this._formats.get(formatId) !== undefined; }\r\n\r\n public register(formatClass: MapLayerFormatType) {\r\n if (formatClass.formatId.length === 0)\r\n return; // must be an abstract class, ignore it\r\n\r\n this._formats.set(formatClass.formatId, { type: formatClass });\r\n }\r\n\r\n /** @beta */\r\n public setAccessClient(formatId: string, accessClient: MapLayerAccessClient): boolean {\r\n const entry = this._formats.get(formatId);\r\n if (entry !== undefined) {\r\n entry.accessClient = accessClient;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /** @beta */\r\n public getAccessClient(formatId: string): MapLayerAccessClient | undefined {\r\n if (formatId.length === 0)\r\n return undefined;\r\n\r\n return this._formats.get(formatId)?.accessClient;\r\n }\r\n\r\n public get configOptions(): MapLayerOptions {\r\n return this._configOptions;\r\n }\r\n\r\n /** @internal */\r\n public createImageryMapLayerTree(layerSettings: ImageMapLayerSettings, layerIndex: number, iModel: IModelConnection): ImageryMapLayerTreeReference | undefined {\r\n const entry = this._formats.get(layerSettings.formatId);\r\n const format = entry?.type;\r\n if (format === undefined) {\r\n Logger.logError(loggerCategory, `Could not find format '${layerSettings.formatId}' in registry`);\r\n return undefined;\r\n }\r\n return format.createMapLayerTree(layerSettings, layerIndex, iModel);\r\n }\r\n\r\n /**\r\n * Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.\r\n * @internal\r\n */\r\n public createImageryProvider(layerSettings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\r\n const entry = this._formats.get(layerSettings.formatId);\r\n const format = entry?.type;\r\n if (this._configOptions[layerSettings.formatId] !== undefined) {\r\n const keyValuePair = expectDefined(this._configOptions[layerSettings.formatId]);\r\n const key: MapLayerKey = { key: keyValuePair.key, value: keyValuePair.value };\r\n layerSettings = layerSettings.clone({ accessKey: key });\r\n }\r\n return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);\r\n }\r\n\r\n /** @beta*/\r\n public async validateSource(opts: ValidateSourceArgs): Promise<MapLayerSourceValidation>;\r\n\r\n public async validateSource(formatId: string, url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation>;\r\n\r\n /** @internal*/\r\n public async validateSource(formatIdOrArgs: string|ValidateSourceArgs, url?: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\r\n let format: typeof MapLayerFormat | undefined;\r\n let args: ValidateSourceArgs | undefined;\r\n\r\n if (typeof formatIdOrArgs == \"string\" && url !== undefined) {\r\n const formatId = formatIdOrArgs;\r\n const entry = this._formats.get(formatId);\r\n format = entry?.type;\r\n if (format !== undefined) {\r\n const source = MapLayerSource.fromJSON({name: \"\", formatId, url});\r\n if (source !== undefined) {\r\n args = {source, ignoreCache};\r\n source.userName = userName;\r\n source.password = password;\r\n }\r\n\r\n }\r\n } else if (typeof formatIdOrArgs !== \"string\") {\r\n const entry = this._formats.get(formatIdOrArgs.source.formatId);\r\n format = entry?.type;\r\n args = formatIdOrArgs;\r\n }\r\n\r\n if (!args || !format)\r\n return { status: MapLayerSourceStatus.InvalidFormat };\r\n\r\n return format.validate(args);\r\n }\r\n}\r\n\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerImageryFormats.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryFormats.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAML,cAAc,EACd,uBAAuB,EAIvB,yBAAyB,EAS1B,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,cAAc;IACvD,gBAAgB;WACO,kBAAkB,CAAC,aAAa,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,yBAAyB,GAAG,SAAS;CAGrK;AA8LD,2KAA2K;AAC3K,cAAM,sBAAuB,SAAQ,qBAAqB;IACxD,OAAuB,QAAQ,SAAc;WACtB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB,GAAG,SAAS;CAInH;AAaD,gBAAgB;AAEhB,eAAO,MAAM,8BAA8B,mCAA4I,CAAC"}
1
+ {"version":3,"file":"MapLayerImageryFormats.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerImageryFormats.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAOL,cAAc,EACd,uBAAuB,EAIvB,yBAAyB,EAS1B,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,cAAc;IACvD,gBAAgB;WACO,kBAAkB,CAAC,aAAa,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,yBAAyB,GAAG,SAAS;CAGrK;AA4MD,2KAA2K;AAC3K,cAAM,sBAAuB,SAAQ,qBAAqB;IACxD,OAAuB,QAAQ,SAAc;WACtB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB,GAAG,SAAS;CAInH;AAaD,gBAAgB;AAEhB,eAAO,MAAM,8BAA8B,mCAA4I,CAAC"}
@@ -33,7 +33,12 @@ class WmsMapLayerFormat extends ImageryMapLayerFormat {
33
33
  try {
34
34
  let subLayers;
35
35
  const maxVisibleSubLayers = 50;
36
- const capabilities = await internal_1.WmsCapabilities.create(url, (userName && password ? { user: userName, password } : undefined), ignoreCache, source.collectQueryParams());
36
+ const capabilities = await internal_1.WmsCapabilities.create(url, {
37
+ credentials: (userName && password ? { user: userName, password } : undefined),
38
+ ignoreCache,
39
+ queryParams: source.collectQueryParams(),
40
+ formatId: source.formatId,
41
+ });
37
42
  if (capabilities !== undefined) {
38
43
  subLayers = capabilities.getSubLayers(false);
39
44
  const rootsSubLayer = subLayers?.find((sublayer) => sublayer.parent === undefined);
@@ -83,7 +88,10 @@ class WmsMapLayerFormat extends ImageryMapLayerFormat {
83
88
  return { status: internal_1.MapLayerSourceStatus.UntrustedOrigin, blockedOrigin };
84
89
  }
85
90
  let status = internal_1.MapLayerSourceStatus.InvalidUrl;
86
- if (err?.status === 401) {
91
+ if (err instanceof internal_1.MapLayerAuthenticationFailedError) {
92
+ status = internal_1.MapLayerSourceStatus.RequireAuth;
93
+ }
94
+ else if (err?.status === 401) {
87
95
  status = ((userName && password) ? internal_1.MapLayerSourceStatus.InvalidCredentials : internal_1.MapLayerSourceStatus.RequireAuth);
88
96
  }
89
97
  return { status };
@@ -108,7 +116,12 @@ class WmtsMapLayerFormat extends ImageryMapLayerFormat {
108
116
  const { url, userName, password } = source;
109
117
  try {
110
118
  const subLayers = [];
111
- const capabilities = await internal_1.WmtsCapabilities.create(url, (userName && password ? { user: userName, password } : undefined), ignoreCache, source.collectQueryParams());
119
+ const capabilities = await internal_1.WmtsCapabilities.create(url, {
120
+ credentials: (userName && password ? { user: userName, password } : undefined),
121
+ ignoreCache,
122
+ queryParams: source.collectQueryParams(),
123
+ formatId: source.formatId,
124
+ });
112
125
  if (!capabilities)
113
126
  return { status: internal_1.MapLayerSourceStatus.InvalidUrl };
114
127
  // Only returns layer that can be published in the Google maps or WGS84 aligned tile trees.
@@ -156,7 +169,10 @@ class WmtsMapLayerFormat extends ImageryMapLayerFormat {
156
169
  return { status: internal_1.MapLayerSourceStatus.UntrustedOrigin, blockedOrigin };
157
170
  }
158
171
  let status = internal_1.MapLayerSourceStatus.InvalidUrl;
159
- if (err?.status === 401) {
172
+ if (err instanceof internal_1.MapLayerAuthenticationFailedError) {
173
+ status = internal_1.MapLayerSourceStatus.RequireAuth;
174
+ }
175
+ else if (err?.status === 401) {
160
176
  status = ((userName && password) ? internal_1.MapLayerSourceStatus.InvalidCredentials : internal_1.MapLayerSourceStatus.RequireAuth);
161
177
  }
162
178
  return { status };