@itwin/core-frontend 5.11.0-dev.9 → 5.11.0

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 (429) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/lib/cjs/AccuDraw.d.ts +2 -0
  3. package/lib/cjs/AccuDraw.d.ts.map +1 -1
  4. package/lib/cjs/AccuDraw.js +9 -1
  5. package/lib/cjs/AccuDraw.js.map +1 -1
  6. package/lib/cjs/BingLocation.d.ts +4 -0
  7. package/lib/cjs/BingLocation.d.ts.map +1 -1
  8. package/lib/cjs/BingLocation.js +6 -1
  9. package/lib/cjs/BingLocation.js.map +1 -1
  10. package/lib/cjs/CesiumAccessClient.d.ts +52 -0
  11. package/lib/cjs/CesiumAccessClient.d.ts.map +1 -0
  12. package/lib/cjs/CesiumAccessClient.js +10 -0
  13. package/lib/cjs/CesiumAccessClient.js.map +1 -0
  14. package/lib/cjs/DisplayStyleState.js +2 -2
  15. package/lib/cjs/DisplayStyleState.js.map +1 -1
  16. package/lib/cjs/GeoProviders.d.ts +45 -0
  17. package/lib/cjs/GeoProviders.d.ts.map +1 -0
  18. package/lib/cjs/GeoProviders.js +49 -0
  19. package/lib/cjs/GeoProviders.js.map +1 -0
  20. package/lib/cjs/GraphicalEditingScope.d.ts +22 -1
  21. package/lib/cjs/GraphicalEditingScope.d.ts.map +1 -1
  22. package/lib/cjs/GraphicalEditingScope.js +27 -1
  23. package/lib/cjs/GraphicalEditingScope.js.map +1 -1
  24. package/lib/cjs/HitDetail.d.ts +1 -1
  25. package/lib/cjs/HitDetail.d.ts.map +1 -1
  26. package/lib/cjs/HitDetail.js +10 -7
  27. package/lib/cjs/HitDetail.js.map +1 -1
  28. package/lib/cjs/IModelApp.d.ts +33 -0
  29. package/lib/cjs/IModelApp.d.ts.map +1 -1
  30. package/lib/cjs/IModelApp.js +33 -0
  31. package/lib/cjs/IModelApp.js.map +1 -1
  32. package/lib/cjs/IModelConnection.d.ts +9 -9
  33. package/lib/cjs/IModelConnection.d.ts.map +1 -1
  34. package/lib/cjs/IModelConnection.js +21 -14
  35. package/lib/cjs/IModelConnection.js.map +1 -1
  36. package/lib/cjs/IpcApp.d.ts +1 -1
  37. package/lib/cjs/IpcApp.js +1 -1
  38. package/lib/cjs/IpcApp.js.map +1 -1
  39. package/lib/cjs/NativeApp.d.ts.map +1 -1
  40. package/lib/cjs/NativeApp.js +1 -3
  41. package/lib/cjs/NativeApp.js.map +1 -1
  42. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -1
  43. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  44. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +23 -5
  45. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  46. package/lib/cjs/SelectionSet.d.ts +7 -7
  47. package/lib/cjs/SelectionSet.js +3 -3
  48. package/lib/cjs/SelectionSet.js.map +1 -1
  49. package/lib/cjs/SubCategoriesCache.d.ts +15 -3
  50. package/lib/cjs/SubCategoriesCache.d.ts.map +1 -1
  51. package/lib/cjs/SubCategoriesCache.js +98 -26
  52. package/lib/cjs/SubCategoriesCache.js.map +1 -1
  53. package/lib/cjs/ViewGlobalLocation.d.ts +1 -1
  54. package/lib/cjs/ViewGlobalLocation.d.ts.map +1 -1
  55. package/lib/cjs/ViewGlobalLocation.js +3 -6
  56. package/lib/cjs/ViewGlobalLocation.js.map +1 -1
  57. package/lib/cjs/ViewState.d.ts +1 -1
  58. package/lib/cjs/ViewState.js +1 -1
  59. package/lib/cjs/ViewState.js.map +1 -1
  60. package/lib/cjs/Viewport.d.ts +5 -4
  61. package/lib/cjs/Viewport.d.ts.map +1 -1
  62. package/lib/cjs/Viewport.js +16 -4
  63. package/lib/cjs/Viewport.js.map +1 -1
  64. package/lib/cjs/core-frontend.d.ts +3 -0
  65. package/lib/cjs/core-frontend.d.ts.map +1 -1
  66. package/lib/cjs/core-frontend.js +4 -0
  67. package/lib/cjs/core-frontend.js.map +1 -1
  68. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
  69. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  70. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js +1 -1
  71. package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  72. package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts +2 -2
  73. package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  74. package/lib/cjs/internal/render/webgl/AttributeBuffers.js +2 -2
  75. package/lib/cjs/internal/render/webgl/AttributeBuffers.js.map +1 -1
  76. package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts +1 -1
  77. package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
  78. package/lib/cjs/internal/render/webgl/ClippingProgram.js +1 -1
  79. package/lib/cjs/internal/render/webgl/ClippingProgram.js.map +1 -1
  80. package/lib/cjs/internal/render/webgl/ShaderProgram.d.ts +2 -2
  81. package/lib/cjs/internal/render/webgl/ShaderProgram.d.ts.map +1 -1
  82. package/lib/cjs/internal/render/webgl/ShaderProgram.js +2 -2
  83. package/lib/cjs/internal/render/webgl/ShaderProgram.js.map +1 -1
  84. package/lib/cjs/internal/render/webgl/Technique.d.ts +3 -3
  85. package/lib/cjs/internal/render/webgl/Technique.d.ts.map +1 -1
  86. package/lib/cjs/internal/render/webgl/Technique.js +3 -3
  87. package/lib/cjs/internal/render/webgl/Technique.js.map +1 -1
  88. package/lib/cjs/internal/tile/DynamicIModelTile.d.ts +3 -3
  89. package/lib/cjs/internal/tile/DynamicIModelTile.d.ts.map +1 -1
  90. package/lib/cjs/internal/tile/DynamicIModelTile.js +26 -6
  91. package/lib/cjs/internal/tile/DynamicIModelTile.js.map +1 -1
  92. package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
  93. package/lib/cjs/internal/tile/IModelTileTree.js +4 -2
  94. package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
  95. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +1 -1
  96. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  97. package/lib/cjs/internal/tile/RealityModelTileTree.js +7 -3
  98. package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
  99. package/lib/cjs/internal/tile/RealityTileLoader.d.ts +22 -0
  100. package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
  101. package/lib/cjs/internal/tile/RealityTileLoader.js +53 -5
  102. package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
  103. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
  104. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  105. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
  106. package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  107. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -1
  108. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  109. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -1
  110. package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  111. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
  112. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
  113. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
  114. package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  115. package/lib/cjs/properties/AngleDescription.d.ts +2 -1
  116. package/lib/cjs/properties/AngleDescription.d.ts.map +1 -1
  117. package/lib/cjs/properties/AngleDescription.js +4 -1
  118. package/lib/cjs/properties/AngleDescription.js.map +1 -1
  119. package/lib/cjs/properties/FormattedQuantityDescription.d.ts +29 -1
  120. package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
  121. package/lib/cjs/properties/FormattedQuantityDescription.js +35 -0
  122. package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
  123. package/lib/cjs/properties/LengthDescription.d.ts +6 -3
  124. package/lib/cjs/properties/LengthDescription.d.ts.map +1 -1
  125. package/lib/cjs/properties/LengthDescription.js +12 -3
  126. package/lib/cjs/properties/LengthDescription.js.map +1 -1
  127. package/lib/cjs/render/Decorations.d.ts +1 -1
  128. package/lib/cjs/render/Decorations.d.ts.map +1 -1
  129. package/lib/cjs/render/Decorations.js +1 -1
  130. package/lib/cjs/render/Decorations.js.map +1 -1
  131. package/lib/cjs/render/GraphicBranch.d.ts +1 -1
  132. package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
  133. package/lib/cjs/render/GraphicBranch.js +1 -1
  134. package/lib/cjs/render/GraphicBranch.js.map +1 -1
  135. package/lib/cjs/render/RenderSystem.d.ts +2 -2
  136. package/lib/cjs/render/RenderSystem.d.ts.map +1 -1
  137. package/lib/cjs/render/RenderSystem.js +1 -1
  138. package/lib/cjs/render/RenderSystem.js.map +1 -1
  139. package/lib/cjs/render/ScreenSpaceEffectBuilder.d.ts +1 -1
  140. package/lib/cjs/render/ScreenSpaceEffectBuilder.js.map +1 -1
  141. package/lib/cjs/request/Request.d.ts +2 -2
  142. package/lib/cjs/request/Request.js.map +1 -1
  143. package/lib/cjs/tile/RealityTile.d.ts +5 -0
  144. package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
  145. package/lib/cjs/tile/RealityTile.js +4 -0
  146. package/lib/cjs/tile/RealityTile.js.map +1 -1
  147. package/lib/cjs/tile/Tile.d.ts +1 -1
  148. package/lib/cjs/tile/Tile.d.ts.map +1 -1
  149. package/lib/cjs/tile/Tile.js +1 -1
  150. package/lib/cjs/tile/Tile.js.map +1 -1
  151. package/lib/cjs/tile/TileAdmin.d.ts +23 -1
  152. package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
  153. package/lib/cjs/tile/TileAdmin.js +17 -1
  154. package/lib/cjs/tile/TileAdmin.js.map +1 -1
  155. package/lib/cjs/tile/TileTree.d.ts +1 -1
  156. package/lib/cjs/tile/TileTree.d.ts.map +1 -1
  157. package/lib/cjs/tile/TileTree.js +1 -1
  158. package/lib/cjs/tile/TileTree.js.map +1 -1
  159. package/lib/cjs/tile/TileTreeReference.d.ts +1 -1
  160. package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
  161. package/lib/cjs/tile/TileTreeReference.js +1 -1
  162. package/lib/cjs/tile/TileTreeReference.js.map +1 -1
  163. package/lib/cjs/tile/map/BingElevation.d.ts +16 -4
  164. package/lib/cjs/tile/map/BingElevation.d.ts.map +1 -1
  165. package/lib/cjs/tile/map/BingElevation.js +18 -8
  166. package/lib/cjs/tile/map/BingElevation.js.map +1 -1
  167. package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts +16 -1
  168. package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  169. package/lib/cjs/tile/map/CesiumTerrainProvider.js +58 -18
  170. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  171. package/lib/cjs/tile/map/ImageryTileTree.d.ts +2 -2
  172. package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
  173. package/lib/cjs/tile/map/ImageryTileTree.js +2 -2
  174. package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
  175. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +6 -1
  176. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  177. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  178. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts +1 -0
  179. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  180. package/lib/cjs/tile/map/MapLayerImageryFormats.js +3 -0
  181. package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
  182. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +1 -1
  183. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  184. package/lib/cjs/tile/map/MapLayerImageryProvider.js +1 -1
  185. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  186. package/lib/cjs/tile/map/MapTileTree.d.ts +1 -1
  187. package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
  188. package/lib/cjs/tile/map/MapTileTree.js +20 -9
  189. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  190. package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +7 -1
  191. package/lib/cjs/tile/map/TerrainMeshProvider.d.ts.map +1 -1
  192. package/lib/cjs/tile/map/TerrainMeshProvider.js +1 -1
  193. package/lib/cjs/tile/map/TerrainMeshProvider.js.map +1 -1
  194. package/lib/cjs/tools/AccuDrawShortcutTool.d.ts +29 -0
  195. package/lib/cjs/tools/AccuDrawShortcutTool.d.ts.map +1 -0
  196. package/lib/cjs/tools/AccuDrawShortcutTool.js +139 -0
  197. package/lib/cjs/tools/AccuDrawShortcutTool.js.map +1 -0
  198. package/lib/cjs/tools/AccuDrawTool.d.ts +13 -68
  199. package/lib/cjs/tools/AccuDrawTool.d.ts.map +1 -1
  200. package/lib/cjs/tools/AccuDrawTool.js +103 -129
  201. package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
  202. package/lib/cjs/tools/SetupCameraTools.d.ts +89 -0
  203. package/lib/cjs/tools/SetupCameraTools.d.ts.map +1 -0
  204. package/lib/cjs/tools/SetupCameraTools.js +444 -0
  205. package/lib/cjs/tools/SetupCameraTools.js.map +1 -0
  206. package/lib/cjs/tools/ToolAdmin.d.ts +5 -2
  207. package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
  208. package/lib/cjs/tools/ToolAdmin.js +30 -7
  209. package/lib/cjs/tools/ToolAdmin.js.map +1 -1
  210. package/lib/cjs/tools/ViewTool.d.ts +1 -81
  211. package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
  212. package/lib/cjs/tools/ViewTool.js +13 -410
  213. package/lib/cjs/tools/ViewTool.js.map +1 -1
  214. package/lib/esm/AccuDraw.d.ts +2 -0
  215. package/lib/esm/AccuDraw.d.ts.map +1 -1
  216. package/lib/esm/AccuDraw.js +9 -1
  217. package/lib/esm/AccuDraw.js.map +1 -1
  218. package/lib/esm/BingLocation.d.ts +4 -0
  219. package/lib/esm/BingLocation.d.ts.map +1 -1
  220. package/lib/esm/BingLocation.js +6 -1
  221. package/lib/esm/BingLocation.js.map +1 -1
  222. package/lib/esm/CesiumAccessClient.d.ts +52 -0
  223. package/lib/esm/CesiumAccessClient.d.ts.map +1 -0
  224. package/lib/esm/CesiumAccessClient.js +9 -0
  225. package/lib/esm/CesiumAccessClient.js.map +1 -0
  226. package/lib/esm/DisplayStyleState.js +2 -2
  227. package/lib/esm/DisplayStyleState.js.map +1 -1
  228. package/lib/esm/GeoProviders.d.ts +45 -0
  229. package/lib/esm/GeoProviders.d.ts.map +1 -0
  230. package/lib/esm/GeoProviders.js +45 -0
  231. package/lib/esm/GeoProviders.js.map +1 -0
  232. package/lib/esm/GraphicalEditingScope.d.ts +22 -1
  233. package/lib/esm/GraphicalEditingScope.d.ts.map +1 -1
  234. package/lib/esm/GraphicalEditingScope.js +27 -1
  235. package/lib/esm/GraphicalEditingScope.js.map +1 -1
  236. package/lib/esm/HitDetail.d.ts +1 -1
  237. package/lib/esm/HitDetail.d.ts.map +1 -1
  238. package/lib/esm/HitDetail.js +11 -8
  239. package/lib/esm/HitDetail.js.map +1 -1
  240. package/lib/esm/IModelApp.d.ts +33 -0
  241. package/lib/esm/IModelApp.d.ts.map +1 -1
  242. package/lib/esm/IModelApp.js +34 -1
  243. package/lib/esm/IModelApp.js.map +1 -1
  244. package/lib/esm/IModelConnection.d.ts +9 -9
  245. package/lib/esm/IModelConnection.d.ts.map +1 -1
  246. package/lib/esm/IModelConnection.js +21 -14
  247. package/lib/esm/IModelConnection.js.map +1 -1
  248. package/lib/esm/IpcApp.d.ts +1 -1
  249. package/lib/esm/IpcApp.js +1 -1
  250. package/lib/esm/IpcApp.js.map +1 -1
  251. package/lib/esm/NativeApp.d.ts.map +1 -1
  252. package/lib/esm/NativeApp.js +1 -3
  253. package/lib/esm/NativeApp.js.map +1 -1
  254. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -1
  255. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  256. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +24 -6
  257. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  258. package/lib/esm/SelectionSet.d.ts +7 -7
  259. package/lib/esm/SelectionSet.js +3 -3
  260. package/lib/esm/SelectionSet.js.map +1 -1
  261. package/lib/esm/SubCategoriesCache.d.ts +15 -3
  262. package/lib/esm/SubCategoriesCache.d.ts.map +1 -1
  263. package/lib/esm/SubCategoriesCache.js +99 -27
  264. package/lib/esm/SubCategoriesCache.js.map +1 -1
  265. package/lib/esm/ViewGlobalLocation.d.ts +1 -1
  266. package/lib/esm/ViewGlobalLocation.d.ts.map +1 -1
  267. package/lib/esm/ViewGlobalLocation.js +3 -6
  268. package/lib/esm/ViewGlobalLocation.js.map +1 -1
  269. package/lib/esm/ViewState.d.ts +1 -1
  270. package/lib/esm/ViewState.js +1 -1
  271. package/lib/esm/ViewState.js.map +1 -1
  272. package/lib/esm/Viewport.d.ts +5 -4
  273. package/lib/esm/Viewport.d.ts.map +1 -1
  274. package/lib/esm/Viewport.js +16 -4
  275. package/lib/esm/Viewport.js.map +1 -1
  276. package/lib/esm/core-frontend.d.ts +3 -0
  277. package/lib/esm/core-frontend.d.ts.map +1 -1
  278. package/lib/esm/core-frontend.js +6 -1
  279. package/lib/esm/core-frontend.js.map +1 -1
  280. package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
  281. package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
  282. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js +1 -1
  283. package/lib/esm/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
  284. package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts +2 -2
  285. package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
  286. package/lib/esm/internal/render/webgl/AttributeBuffers.js +2 -2
  287. package/lib/esm/internal/render/webgl/AttributeBuffers.js.map +1 -1
  288. package/lib/esm/internal/render/webgl/ClippingProgram.d.ts +1 -1
  289. package/lib/esm/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
  290. package/lib/esm/internal/render/webgl/ClippingProgram.js +1 -1
  291. package/lib/esm/internal/render/webgl/ClippingProgram.js.map +1 -1
  292. package/lib/esm/internal/render/webgl/ShaderProgram.d.ts +2 -2
  293. package/lib/esm/internal/render/webgl/ShaderProgram.d.ts.map +1 -1
  294. package/lib/esm/internal/render/webgl/ShaderProgram.js +2 -2
  295. package/lib/esm/internal/render/webgl/ShaderProgram.js.map +1 -1
  296. package/lib/esm/internal/render/webgl/Technique.d.ts +3 -3
  297. package/lib/esm/internal/render/webgl/Technique.d.ts.map +1 -1
  298. package/lib/esm/internal/render/webgl/Technique.js +3 -3
  299. package/lib/esm/internal/render/webgl/Technique.js.map +1 -1
  300. package/lib/esm/internal/tile/DynamicIModelTile.d.ts +3 -3
  301. package/lib/esm/internal/tile/DynamicIModelTile.d.ts.map +1 -1
  302. package/lib/esm/internal/tile/DynamicIModelTile.js +26 -6
  303. package/lib/esm/internal/tile/DynamicIModelTile.js.map +1 -1
  304. package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
  305. package/lib/esm/internal/tile/IModelTileTree.js +4 -2
  306. package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
  307. package/lib/esm/internal/tile/RealityModelTileTree.d.ts +1 -1
  308. package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  309. package/lib/esm/internal/tile/RealityModelTileTree.js +7 -3
  310. package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
  311. package/lib/esm/internal/tile/RealityTileLoader.d.ts +22 -0
  312. package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
  313. package/lib/esm/internal/tile/RealityTileLoader.js +54 -6
  314. package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
  315. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
  316. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  317. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
  318. package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  319. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -1
  320. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  321. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -1
  322. package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  323. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
  324. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
  325. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
  326. package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  327. package/lib/esm/properties/AngleDescription.d.ts +2 -1
  328. package/lib/esm/properties/AngleDescription.d.ts.map +1 -1
  329. package/lib/esm/properties/AngleDescription.js +4 -1
  330. package/lib/esm/properties/AngleDescription.js.map +1 -1
  331. package/lib/esm/properties/FormattedQuantityDescription.d.ts +29 -1
  332. package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
  333. package/lib/esm/properties/FormattedQuantityDescription.js +35 -1
  334. package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
  335. package/lib/esm/properties/LengthDescription.d.ts +6 -3
  336. package/lib/esm/properties/LengthDescription.d.ts.map +1 -1
  337. package/lib/esm/properties/LengthDescription.js +12 -3
  338. package/lib/esm/properties/LengthDescription.js.map +1 -1
  339. package/lib/esm/render/Decorations.d.ts +1 -1
  340. package/lib/esm/render/Decorations.d.ts.map +1 -1
  341. package/lib/esm/render/Decorations.js +1 -1
  342. package/lib/esm/render/Decorations.js.map +1 -1
  343. package/lib/esm/render/GraphicBranch.d.ts +1 -1
  344. package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
  345. package/lib/esm/render/GraphicBranch.js +1 -1
  346. package/lib/esm/render/GraphicBranch.js.map +1 -1
  347. package/lib/esm/render/RenderSystem.d.ts +2 -2
  348. package/lib/esm/render/RenderSystem.d.ts.map +1 -1
  349. package/lib/esm/render/RenderSystem.js +1 -1
  350. package/lib/esm/render/RenderSystem.js.map +1 -1
  351. package/lib/esm/render/ScreenSpaceEffectBuilder.d.ts +1 -1
  352. package/lib/esm/render/ScreenSpaceEffectBuilder.js.map +1 -1
  353. package/lib/esm/request/Request.d.ts +2 -2
  354. package/lib/esm/request/Request.js.map +1 -1
  355. package/lib/esm/tile/RealityTile.d.ts +5 -0
  356. package/lib/esm/tile/RealityTile.d.ts.map +1 -1
  357. package/lib/esm/tile/RealityTile.js +4 -0
  358. package/lib/esm/tile/RealityTile.js.map +1 -1
  359. package/lib/esm/tile/Tile.d.ts +1 -1
  360. package/lib/esm/tile/Tile.d.ts.map +1 -1
  361. package/lib/esm/tile/Tile.js +1 -1
  362. package/lib/esm/tile/Tile.js.map +1 -1
  363. package/lib/esm/tile/TileAdmin.d.ts +23 -1
  364. package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
  365. package/lib/esm/tile/TileAdmin.js +17 -1
  366. package/lib/esm/tile/TileAdmin.js.map +1 -1
  367. package/lib/esm/tile/TileTree.d.ts +1 -1
  368. package/lib/esm/tile/TileTree.d.ts.map +1 -1
  369. package/lib/esm/tile/TileTree.js +1 -1
  370. package/lib/esm/tile/TileTree.js.map +1 -1
  371. package/lib/esm/tile/TileTreeReference.d.ts +1 -1
  372. package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
  373. package/lib/esm/tile/TileTreeReference.js +1 -1
  374. package/lib/esm/tile/TileTreeReference.js.map +1 -1
  375. package/lib/esm/tile/map/BingElevation.d.ts +16 -4
  376. package/lib/esm/tile/map/BingElevation.d.ts.map +1 -1
  377. package/lib/esm/tile/map/BingElevation.js +18 -8
  378. package/lib/esm/tile/map/BingElevation.js.map +1 -1
  379. package/lib/esm/tile/map/CesiumTerrainProvider.d.ts +16 -1
  380. package/lib/esm/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  381. package/lib/esm/tile/map/CesiumTerrainProvider.js +56 -18
  382. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  383. package/lib/esm/tile/map/ImageryTileTree.d.ts +2 -2
  384. package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
  385. package/lib/esm/tile/map/ImageryTileTree.js +2 -2
  386. package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
  387. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +6 -1
  388. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  389. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  390. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts +1 -0
  391. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  392. package/lib/esm/tile/map/MapLayerImageryFormats.js +3 -0
  393. package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
  394. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +1 -1
  395. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  396. package/lib/esm/tile/map/MapLayerImageryProvider.js +1 -1
  397. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  398. package/lib/esm/tile/map/MapTileTree.d.ts +1 -1
  399. package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
  400. package/lib/esm/tile/map/MapTileTree.js +21 -10
  401. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  402. package/lib/esm/tile/map/TerrainMeshProvider.d.ts +7 -1
  403. package/lib/esm/tile/map/TerrainMeshProvider.d.ts.map +1 -1
  404. package/lib/esm/tile/map/TerrainMeshProvider.js +1 -1
  405. package/lib/esm/tile/map/TerrainMeshProvider.js.map +1 -1
  406. package/lib/esm/tools/AccuDrawShortcutTool.d.ts +29 -0
  407. package/lib/esm/tools/AccuDrawShortcutTool.d.ts.map +1 -0
  408. package/lib/esm/tools/AccuDrawShortcutTool.js +134 -0
  409. package/lib/esm/tools/AccuDrawShortcutTool.js.map +1 -0
  410. package/lib/esm/tools/AccuDrawTool.d.ts +13 -68
  411. package/lib/esm/tools/AccuDrawTool.d.ts.map +1 -1
  412. package/lib/esm/tools/AccuDrawTool.js +102 -128
  413. package/lib/esm/tools/AccuDrawTool.js.map +1 -1
  414. package/lib/esm/tools/SetupCameraTools.d.ts +89 -0
  415. package/lib/esm/tools/SetupCameraTools.d.ts.map +1 -0
  416. package/lib/esm/tools/SetupCameraTools.js +439 -0
  417. package/lib/esm/tools/SetupCameraTools.js.map +1 -0
  418. package/lib/esm/tools/ToolAdmin.d.ts +5 -2
  419. package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
  420. package/lib/esm/tools/ToolAdmin.js +30 -7
  421. package/lib/esm/tools/ToolAdmin.js.map +1 -1
  422. package/lib/esm/tools/ViewTool.d.ts +1 -81
  423. package/lib/esm/tools/ViewTool.d.ts.map +1 -1
  424. package/lib/esm/tools/ViewTool.js +14 -409
  425. package/lib/esm/tools/ViewTool.js.map +1 -1
  426. package/lib/public/locales/en/iModelJs.json +2 -1
  427. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  428. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  429. package/package.json +24 -23
package/lib/cjs/IpcApp.js CHANGED
@@ -93,7 +93,7 @@ class IpcApp {
93
93
  throw Object.assign(new core_common_1.BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);
94
94
  }
95
95
  /** @internal
96
- * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[makeIpcProxy]] for a type-safe interface.
96
+ * @deprecated in 4.8 - might be removed in next major version. Use [[makeIpcProxy]] for a type-safe interface.
97
97
  */
98
98
  static async callIpcChannel(channelName, methodName, ...args) {
99
99
  return this[Symbols_1._callIpcChannel](channelName, methodName, ...args);
@@ -1 +1 @@
1
- {"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6G;AAC7G,oDAG4B;AAC5B,uDAA4D;AAC5D,2CAA0D;AAU1D;;;GAGG;AACH,MAAa,MAAM;IACT,MAAM,CAAC,IAAI,CAAgC;IAC3C,MAAM,CAAC,gBAAgB,CAA6B;IAC5D,qEAAqE;IAE7D,MAAM,KAAK,GAAG,KAAwB,OAAO,IAAA,4BAAa,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEhF,iIAAiI;IAC1H,MAAM,KAAK,OAAO,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAExE;;;;;;;OAOG;IACI,MAAM,CAAC,WAAW,CAAC,OAAe,EAAE,OAAoB;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAC,OAAe,EAAE,QAAqB;QACjE,IAAI,CAAC,GAAG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AAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,4BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, expectDefined, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n private static _removeAppNotify: RemoveFunction | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return expectDefined(this._ipc); }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n this._removeAppNotify = IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
1
+ {"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6G;AAC7G,oDAG4B;AAC5B,uDAA4D;AAC5D,2CAA0D;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QACjB,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAW,EAAE,QAAgB,EAAE,GAAG,IAAW,EAAE,EAAE;YAC5F,MAAM,IAAI,GAAI,IAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,IAAI,OAAO,IAAI,KAAK,UAAU;gBAC5B,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,gBAAgB,EAAE,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,8DAA8D,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YAErL,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,4BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BentleyError, expectDefined, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n private static _removeAppNotify: RemoveFunction | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return expectDefined(this._ipc); }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8 - might be removed in next major version. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n this._removeAppNotify = IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeApp.d.ts","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,mBAAmB,EACrI,kBAAkB,EACwB,YAAY,EAAE,QAAQ,EACjE,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAU,aAAa,EAAuB,MAAM,UAAU,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC7B;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,GAC5C;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE5C;;;EAGE;AACF,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG;IAC3D,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,kBAAkB,C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pH,8BAA8B;IACjB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAIxD,0BAA0B;IACb,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzC,iCAAiC;IACpB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,sCAAsC;IACzB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAGxC"}
@@ -77,9 +77,7 @@ class NativeApp {
77
77
  this._removeAppNotify = NativeAppNotifyHandler.register(); // receives notifications from backend
78
78
  NativeApp.hookBrowserConnectivityEvents();
79
79
  // initialize current online state.
80
- if (window.navigator.onLine) {
81
- await this.setConnectivity(core_common_1.OverriddenBy.Browser, window.navigator.onLine ? core_common_1.InternetConnectivityStatus.Online : core_common_1.InternetConnectivityStatus.Offline);
82
- }
80
+ await this.setConnectivity(core_common_1.OverriddenBy.Browser, window.navigator.onLine ? core_common_1.InternetConnectivityStatus.Online : core_common_1.InternetConnectivityStatus.Offline);
83
81
  }
84
82
  /** @internal */
85
83
  static async shutdown() {
@@ -1 +1 @@
1
- {"version":3,"file":"NativeApp.js","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,oDAI4B;AAC5B,4EAAyE;AACzE,qCAAsE;AACtE,uDAAoD;AAyBpD,2CAA2C;AAC3C,MAAM,sBAAuB,SAAQ,4BAAmB;IACtD,IAAW,WAAW,KAAK,OAAO,iCAAmB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC/D,iCAAiC,CAAC,MAAkC;QACzE,qBAAM,CAAC,OAAO,CAAC,+CAAsB,CAAC,SAAS,EAAE,+BAA+B,CAAC,CAAC;QAClF,SAAS,CA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9B,OAAO,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,0BAA0B;IACnB,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAmB;QACnD,OAAO,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,iCAAiC;IAC1B,KAAK,CAAC,UAAU,CAAC,GAAW;QACjC,OAAO,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,SAAS;QACpB,OAAO,SAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF;AAnCD,0BAmCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BeEvent, GuidString, Logger } from \"@itwin/core-bentley\";\nimport {\n BriefcaseDownloader, BriefcaseProps, CatalogIModel, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps,\n NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications, OverriddenBy,\n RemoveFunction, RequestNewBriefcaseProps, StorageValue, SyncMode,\n} from \"@itwin/core-common\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { IpcApp, IpcAppOptions, NotificationHandler } from \"./IpcApp\";\nimport { NativeAppLogger } from \"./NativeAppLogger\";\nimport { OnDownloadProgress } from \"./BriefcaseConnection\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\n\n/** Properties for specifying the BriefcaseId for downloading. May either specify a BriefcaseId directly (preferable) or, for\n * backwards compatibility, a [SyncMode]($common). If [SyncMode.PullAndPush]($common) is supplied, a new briefcaseId will be acquired.\n * @public\n */\nexport type DownloadBriefcaseId =\n { syncMode?: SyncMode, briefcaseId?: never } |\n { briefcaseId: number, syncMode?: never };\n\n/**\n* Options to download a briefcase\n* @public\n*/\nexport type DownloadBriefcaseOptions = DownloadBriefcaseId & {\n /** the full path for the briefcase file */\n fileName?: string;\n /** Function called regularly to report progress of download. */\n progressCallback?: OnDownloadProgress;\n /** interval for calling progress function, in milliseconds */\n progressInterval?: number;\n};\n\n/** NativeApp notifications from backend */\nclass NativeAppNotifyHandler extends NotificationHandler implements NativeAppNotifications {\n public get channelName() { return nativeAppIpcStrings.notifyChannel; }\n public notifyInternetConnectivityChanged(status: InternetConnectivityStatus) {\n Logger.logInfo(FrontendLoggerCategory.NativeApp, \"Internet connectivity changed\");\n NativeApp.onInternetConnectivityChanged.raiseEvent(status);\n }\n}\n\n/**\n * Options for [[NativeApp.startup]]\n * @public\n */\nexport interface NativeAppOpts extends IpcAppOptions {\n nativeApp?: object;\n}\n\n/**\n * The frontend of a native application\n * @see [Native Applications]($docs/learning/NativeApps.md)\n * @public\n */\nexport class NativeApp {\n private static _removeAppNotify?: RemoveFunction;\n\n /** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */\n public static nativeAppIpc = IpcApp.makeIpcProxy<NativeAppFunctions>(nativeAppIpcStrings.channelName);\n public static catalogIpc = IpcApp.makeIpcProxy<CatalogIModel.IpcMethods, CatalogIModel.IpcChannel>(\"catalogIModel/ipc\");\n\n private static _storages = new Map<string, Storage>();\n private static _onOnline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Online);\n };\n private static _onOffline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Offline);\n };\n private static async setConnectivity(by: OverriddenBy, status: InternetConnectivityStatus) {\n await this.nativeAppIpc.overrideInternetConnectivity(by, status);\n }\n private static hookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.addEventListener(\"online\", this._onOnline);\n window.addEventListener(\"offline\", this._onOffline);\n }\n }\n private static unhookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.removeEventListener(\"online\", this._onOnline);\n window.removeEventListener(\"offline\", this._onOffline);\n }\n }\n /** event called when internet connectivity changes, if known */\n public static onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\n\n /** determine whether the app currently has internet connectivity, if known */\n public static async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\n return this.nativeAppIpc.checkInternetConnectivity();\n }\n /** @internal */\n public static async overrideInternetConnectivity(status: InternetConnectivityStatus): Promise<void> {\n return this.nativeAppIpc.overrideInternetConnectivity(OverriddenBy.User, status);\n }\n private static _isValid = false;\n public static get isValid(): boolean { return this._isValid; }\n\n /**\n * This is called by either ElectronApp.startup or MobileApp.startup - it should not be called directly\n * @internal\n */\n public static async startup(ipc: IpcSocketFrontend, opts?: NativeAppOpts) {\n await IpcApp.startup(ipc, opts);\n if (this._isValid)\n return;\n this._isValid = true;\n\n this._removeAppNotify = NativeAppNotifyHandler.register(); // receives notifications from backend\n NativeApp.hookBrowserConnectivityEvents();\n\n // initialize current online state.\n if (window.navigator.onLine) {\n await this.setConnectivity(OverriddenBy.Browser, window.navigator.onLine ? InternetConnectivityStatus.Online : InternetConnectivityStatus.Offline);\n }\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n NativeApp.unhookBrowserConnectivityEvents();\n await NativeAppLogger.flush();\n await IpcApp.shutdown();\n this._isValid = false;\n }\n\n public static async requestDownloadBriefcase(iTwinId: string, iModelId: string, downloadOptions: DownloadBriefcaseOptions,\n asOf?: IModelVersion): Promise<BriefcaseDownloader>;\n\n public static async requestDownloadBriefcase(\n iTwinId: string,\n iModelId: string,\n downloadOptions: DownloadBriefcaseOptions,\n asOf: IModelVersion = IModelVersion.latest()\n ): Promise<BriefcaseDownloader> {\n const shouldReportProgress = !!downloadOptions.progressCallback;\n\n let stopProgressEvents = () => { };\n if (shouldReportProgress) {\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\n downloadOptions.progressCallback?.(data);\n };\n\n stopProgressEvents = IpcApp.addListener(`nativeApp.progress-${iModelId}`, handleProgress);\n }\n\n const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :\n (downloadOptions.syncMode === SyncMode.PullOnly ? 0 : await this.nativeAppIpc.acquireNewBriefcaseId(iModelId));\n\n const fileName = downloadOptions.fileName ?? await this.getBriefcaseFileName({ briefcaseId, iModelId });\n const requestProps: RequestNewBriefcaseProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };\n\n const doDownload = async (): Promise<void> => {\n try {\n await this.nativeAppIpc.downloadBriefcase(requestProps, shouldReportProgress, downloadOptions.progressInterval);\n } finally {\n stopProgressEvents();\n }\n };\n\n const requestCancel = async (): Promise<boolean> => {\n const status = await this.nativeAppIpc.requestCancelDownloadBriefcase(fileName);\n if (status)\n stopProgressEvents();\n return status;\n };\n\n return { briefcaseId, fileName, downloadPromise: doDownload(), requestCancel };\n }\n\n /** Get the full path filename for a briefcase within the briefcase cache */\n public static async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\n return this.nativeAppIpc.getBriefcaseFileName(props);\n }\n\n /** Delete an existing briefcase\n * @param fileName the briefcase fileName\n */\n public static async deleteBriefcase(fileName: string): Promise<void> {\n await this.nativeAppIpc.deleteBriefcaseFiles(fileName);\n }\n\n /** Get a list of all briefcase files held in the local briefcase cache directory */\n public static async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\n return this.nativeAppIpc.getCachedBriefcases(iModelId);\n }\n\n /**\n * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.\n * @param name Should be a local filename without an extension.\n * @returns a Promise for the [[Storage]].\n */\n public static async openStorage(name: string): Promise<Storage> {\n let storage = this._storages.get(name);\n if (!storage) {\n storage = new Storage(await this.nativeAppIpc.storageMgrOpen(name));\n this._storages.set(storage.id, storage);\n }\n \n return storage;\n }\n\n /**\n * Close a Storage and optionally delete it.\n * @param storage normally not call directly instead use Storage.close()\n * @param deleteStorage if true, delete the storage from disk after closing it.\n */\n public static async closeStorage(storage: Storage, deleteStorage: boolean = false): Promise<void> {\n if (!this._storages.has(storage.id))\n throw new Error(`Storage [Id=${storage.id}] not open`);\n\n await this.nativeAppIpc.storageMgrClose(storage.id, deleteStorage);\n this._storages.delete(storage.id);\n }\n\n /** Get the list of existing Storages on the local disk. */\n public static async getStorageNames(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageMgrNames();\n }\n}\n\n/**\n * A local disk-based cache for key value pairs for NativeApps.\n * @note This should be used only for local caching, since its not guaranteed to exist permanently.\n * @public\n */\nexport class Storage {\n constructor(public readonly id: string) { }\n\n /** get the type of a value for a key, or undefined if not present. */\n public async getValueType(key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\n return NativeApp.nativeAppIpc.storageGetValueType(this.id, key);\n }\n\n /** Get the value for a key */\n public async getData(key: string): Promise<StorageValue> {\n return NativeApp.nativeAppIpc.storageGet(this.id, key);\n }\n\n /** Set value for a key */\n public async setData(key: string, value: StorageValue): Promise<void> {\n return NativeApp.nativeAppIpc.storageSet(this.id, key, value);\n }\n\n /**\n * Return an array of all keys in this Storage.\n * @note This can be expensive, depending on the number of keys present.\n */\n public async getKeys(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageKeys(this.id);\n }\n\n /** Remove a key and its data. */\n public async removeData(key: string): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemove(this.id, key);\n }\n\n /** Remove all keys and their data. */\n public async removeAll(): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemoveAll(this.id);\n }\n}\n"]}
1
+ {"version":3,"file":"NativeApp.js","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,oDAI4B;AAC5B,4EAAyE;AACzE,qCAAsE;AACtE,uDAAoD;AAyBpD,2CAA2C;AAC3C,MAAM,sBAAuB,SAAQ,4BAAmB;IACtD,IAAW,WAAW,KAAK,OAAO,iCAAmB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC/D,iCAAiC,CAAC,MAAkC;QACzE,qBAAM,CAAC,OAAO,CAAC,+CAAsB,CAAC,SAAS,EAAE,+BAA+B,CAAC,CAAC;QAClF,SAAS,CAAC,6BAA6B,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;CACF;AAUD;;;;GAIG;AACH,MAAa,SAAS;IACZ,MAAM,CAAC,gBAAgB,CAAkB;IAEjD,kFAAkF;IAC3E,MAAM,CAAC,YAAY,GAAG,eAAM,CAAC,YAAY,CAAqB,iCAAmB,CAAC,WAAW,CAAC,CAAC;IAC/F,MAAM,CAAC,UAAU,GAAG,eAAM,CAAC,YAAY,CAAqD,mBAAmB,CAAC,CAAC;IAEhH,MAAM,CAAC,SAAS,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,MAAM,CAAC,SAAS,GAAG,KAAK,IAAI,EAAE;QACpC,MAAM,SAAS,CAAC,eAAe,CAAC,0BAAY,CAAC,OAAO,EAAE,wCAA0B,CAAC,MAAM,CAAC,CAAC;IAC3F,CAAC,CAAC;IACM,MAAM,CAAC,UAAU,GAAG,KAAK,IAAI,EAAE;QACrC,MAAM,SAAS,CAAC,eAAe,CAAC,0BAAY,CAAC,OAAO,EAAE,wCAA0B,CAAC,OAAO,CAAC,CAAC;IAC5F,CAAC,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,EAAgB,E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MAAM,CAAC,KAAK,CAAC,eAAe;QACjC,OAAO,SAAS,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;IAClD,CAAC;;AAjKH,8BAkKC;AAED;;;;GAIG;AACH,MAAa,OAAO;IACU;IAA5B,YAA4B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAI,CAAC;IAE3C,sEAAsE;IAC/D,KAAK,CAAC,YAAY,CAAC,GAAW;QACnC,OAAO,SAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC;IAED,8BAA8B;IACvB,KAAK,CAAC,OAAO,CAAC,GAAW;QAC9B,OAAO,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,0BAA0B;IACnB,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAmB;QACnD,OAAO,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,iCAAiC;IAC1B,KAAK,CAAC,UAAU,CAAC,GAAW;QACjC,OAAO,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,SAAS;QACpB,OAAO,SAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF;AAnCD,0BAmCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { BeEvent, GuidString, Logger } from \"@itwin/core-bentley\";\nimport {\n BriefcaseDownloader, BriefcaseProps, CatalogIModel, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps,\n NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications, OverriddenBy,\n RemoveFunction, RequestNewBriefcaseProps, StorageValue, SyncMode,\n} from \"@itwin/core-common\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { IpcApp, IpcAppOptions, NotificationHandler } from \"./IpcApp\";\nimport { NativeAppLogger } from \"./NativeAppLogger\";\nimport { OnDownloadProgress } from \"./BriefcaseConnection\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\n\n/** Properties for specifying the BriefcaseId for downloading. May either specify a BriefcaseId directly (preferable) or, for\n * backwards compatibility, a [SyncMode]($common). If [SyncMode.PullAndPush]($common) is supplied, a new briefcaseId will be acquired.\n * @public\n */\nexport type DownloadBriefcaseId =\n { syncMode?: SyncMode, briefcaseId?: never } |\n { briefcaseId: number, syncMode?: never };\n\n/**\n* Options to download a briefcase\n* @public\n*/\nexport type DownloadBriefcaseOptions = DownloadBriefcaseId & {\n /** the full path for the briefcase file */\n fileName?: string;\n /** Function called regularly to report progress of download. */\n progressCallback?: OnDownloadProgress;\n /** interval for calling progress function, in milliseconds */\n progressInterval?: number;\n};\n\n/** NativeApp notifications from backend */\nclass NativeAppNotifyHandler extends NotificationHandler implements NativeAppNotifications {\n public get channelName() { return nativeAppIpcStrings.notifyChannel; }\n public notifyInternetConnectivityChanged(status: InternetConnectivityStatus) {\n Logger.logInfo(FrontendLoggerCategory.NativeApp, \"Internet connectivity changed\");\n NativeApp.onInternetConnectivityChanged.raiseEvent(status);\n }\n}\n\n/**\n * Options for [[NativeApp.startup]]\n * @public\n */\nexport interface NativeAppOpts extends IpcAppOptions {\n nativeApp?: object;\n}\n\n/**\n * The frontend of a native application\n * @see [Native Applications]($docs/learning/NativeApps.md)\n * @public\n */\nexport class NativeApp {\n private static _removeAppNotify?: RemoveFunction;\n\n /** A Proxy to call one of the [NativeAppFunctions]($common) functions via IPC. */\n public static nativeAppIpc = IpcApp.makeIpcProxy<NativeAppFunctions>(nativeAppIpcStrings.channelName);\n public static catalogIpc = IpcApp.makeIpcProxy<CatalogIModel.IpcMethods, CatalogIModel.IpcChannel>(\"catalogIModel/ipc\");\n\n private static _storages = new Map<string, Storage>();\n private static _onOnline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Online);\n };\n private static _onOffline = async () => {\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Offline);\n };\n private static async setConnectivity(by: OverriddenBy, status: InternetConnectivityStatus) {\n await this.nativeAppIpc.overrideInternetConnectivity(by, status);\n }\n private static hookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.addEventListener(\"online\", this._onOnline);\n window.addEventListener(\"offline\", this._onOffline);\n }\n }\n private static unhookBrowserConnectivityEvents() {\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\n window.removeEventListener(\"online\", this._onOnline);\n window.removeEventListener(\"offline\", this._onOffline);\n }\n }\n /** event called when internet connectivity changes, if known */\n public static onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\n\n /** determine whether the app currently has internet connectivity, if known */\n public static async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\n return this.nativeAppIpc.checkInternetConnectivity();\n }\n /** @internal */\n public static async overrideInternetConnectivity(status: InternetConnectivityStatus): Promise<void> {\n return this.nativeAppIpc.overrideInternetConnectivity(OverriddenBy.User, status);\n }\n private static _isValid = false;\n public static get isValid(): boolean { return this._isValid; }\n\n /**\n * This is called by either ElectronApp.startup or MobileApp.startup - it should not be called directly\n * @internal\n */\n public static async startup(ipc: IpcSocketFrontend, opts?: NativeAppOpts) {\n await IpcApp.startup(ipc, opts);\n if (this._isValid)\n return;\n this._isValid = true;\n\n this._removeAppNotify = NativeAppNotifyHandler.register(); // receives notifications from backend\n NativeApp.hookBrowserConnectivityEvents();\n\n // initialize current online state.\n await this.setConnectivity(OverriddenBy.Browser, window.navigator.onLine ? InternetConnectivityStatus.Online : InternetConnectivityStatus.Offline);\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n NativeApp.unhookBrowserConnectivityEvents();\n await NativeAppLogger.flush();\n await IpcApp.shutdown();\n this._isValid = false;\n }\n\n public static async requestDownloadBriefcase(iTwinId: string, iModelId: string, downloadOptions: DownloadBriefcaseOptions,\n asOf?: IModelVersion): Promise<BriefcaseDownloader>;\n\n public static async requestDownloadBriefcase(\n iTwinId: string,\n iModelId: string,\n downloadOptions: DownloadBriefcaseOptions,\n asOf: IModelVersion = IModelVersion.latest()\n ): Promise<BriefcaseDownloader> {\n const shouldReportProgress = !!downloadOptions.progressCallback;\n\n let stopProgressEvents = () => { };\n if (shouldReportProgress) {\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\n downloadOptions.progressCallback?.(data);\n };\n\n stopProgressEvents = IpcApp.addListener(`nativeApp.progress-${iModelId}`, handleProgress);\n }\n\n const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :\n (downloadOptions.syncMode === SyncMode.PullOnly ? 0 : await this.nativeAppIpc.acquireNewBriefcaseId(iModelId));\n\n const fileName = downloadOptions.fileName ?? await this.getBriefcaseFileName({ briefcaseId, iModelId });\n const requestProps: RequestNewBriefcaseProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };\n\n const doDownload = async (): Promise<void> => {\n try {\n await this.nativeAppIpc.downloadBriefcase(requestProps, shouldReportProgress, downloadOptions.progressInterval);\n } finally {\n stopProgressEvents();\n }\n };\n\n const requestCancel = async (): Promise<boolean> => {\n const status = await this.nativeAppIpc.requestCancelDownloadBriefcase(fileName);\n if (status)\n stopProgressEvents();\n return status;\n };\n\n return { briefcaseId, fileName, downloadPromise: doDownload(), requestCancel };\n }\n\n /** Get the full path filename for a briefcase within the briefcase cache */\n public static async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\n return this.nativeAppIpc.getBriefcaseFileName(props);\n }\n\n /** Delete an existing briefcase\n * @param fileName the briefcase fileName\n */\n public static async deleteBriefcase(fileName: string): Promise<void> {\n await this.nativeAppIpc.deleteBriefcaseFiles(fileName);\n }\n\n /** Get a list of all briefcase files held in the local briefcase cache directory */\n public static async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\n return this.nativeAppIpc.getCachedBriefcases(iModelId);\n }\n\n /**\n * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.\n * @param name Should be a local filename without an extension.\n * @returns a Promise for the [[Storage]].\n */\n public static async openStorage(name: string): Promise<Storage> {\n let storage = this._storages.get(name);\n if (!storage) {\n storage = new Storage(await this.nativeAppIpc.storageMgrOpen(name));\n this._storages.set(storage.id, storage);\n }\n\n return storage;\n }\n\n /**\n * Close a Storage and optionally delete it.\n * @param storage normally not call directly instead use Storage.close()\n * @param deleteStorage if true, delete the storage from disk after closing it.\n */\n public static async closeStorage(storage: Storage, deleteStorage: boolean = false): Promise<void> {\n if (!this._storages.has(storage.id))\n throw new Error(`Storage [Id=${storage.id}] not open`);\n\n await this.nativeAppIpc.storageMgrClose(storage.id, deleteStorage);\n this._storages.delete(storage.id);\n }\n\n /** Get the list of existing Storages on the local disk. */\n public static async getStorageNames(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageMgrNames();\n }\n}\n\n/**\n * A local disk-based cache for key value pairs for NativeApps.\n * @note This should be used only for local caching, since its not guaranteed to exist permanently.\n * @public\n */\nexport class Storage {\n constructor(public readonly id: string) { }\n\n /** get the type of a value for a key, or undefined if not present. */\n public async getValueType(key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\n return NativeApp.nativeAppIpc.storageGetValueType(this.id, key);\n }\n\n /** Get the value for a key */\n public async getData(key: string): Promise<StorageValue> {\n return NativeApp.nativeAppIpc.storageGet(this.id, key);\n }\n\n /** Set value for a key */\n public async setData(key: string, value: StorageValue): Promise<void> {\n return NativeApp.nativeAppIpc.storageSet(this.id, key, value);\n }\n\n /**\n * Return an array of all keys in this Storage.\n * @note This can be expensive, depending on the number of keys present.\n */\n public async getKeys(): Promise<string[]> {\n return NativeApp.nativeAppIpc.storageKeys(this.id);\n }\n\n /** Remove a key and its data. */\n public async removeData(key: string): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemove(this.id, key);\n }\n\n /** Remove all keys and their data. */\n public async removeAll(): Promise<void> {\n return NativeApp.nativeAppIpc.storageRemoveAll(this.id);\n }\n}\n"]}
@@ -2,7 +2,7 @@ import { GuidString } from "@itwin/core-bentley";
2
2
  import { RealityData, RealityDataSourceKey, RealityDataSourceProps } from "@itwin/core-common";
3
3
  import { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from "./RealityDataSource";
4
4
  /** This class provides access to the reality data provider services.
5
- * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.
5
+ * It encapsulates access to a reality data whether it be from local access, http or ProjectWise Context Share.
6
6
  * The key provided at the creation determines if this is ProjectWise Context Share reference.
7
7
  * If not then it is considered local (ex: C:\temp\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)
8
8
  * There is a one to one relationship between a reality data and the instances of present class.
@@ -1 +1 @@
1
- {"version":3,"file":"RealityDataSourceCesiumIonAssetImpl.d.ts","sourceRoot":"","sources":["../../src/RealityDataSourceCesiumIonAssetImpl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAyB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAe,WAAW,EAAuB,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjI,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;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C,WAAW,CAAC;IAO/D;;OAEG;IACU,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAO7C,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI1D;;;;OAIG;IACU,4BAA4B,IAAI,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAK3F;;;;;OAKG;IACU,uBAAuB,IAAI,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;CAIlF"}
@@ -13,7 +13,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
13
13
  const core_common_1 = require("@itwin/core-common");
14
14
  const internal_1 = require("./tile/internal");
15
15
  /** This class provides access to the reality data provider services.
16
- * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.
16
+ * It encapsulates access to a reality data whether it be from local access, http or ProjectWise Context Share.
17
17
  * The key provided at the creation determines if this is ProjectWise Context Share reference.
18
18
  * If not then it is considered local (ex: C:\temp\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)
19
19
  * There is a one to one relationship between a reality data and the instances of present class.
@@ -104,10 +104,28 @@ class RealityDataSourceCesiumIonAssetImpl {
104
104
  // The following is only if the reality data is not stored on PW Context Share.
105
105
  const cesiumAsset = internal_1.CesiumIonAssetProvider.parseCesiumUrl(url);
106
106
  if (cesiumAsset) {
107
- const tokenAndUrl = await (0, internal_1.getCesiumAccessTokenAndEndpointUrl)(`${cesiumAsset.id}`, cesiumAsset.key);
108
- if (tokenAndUrl.url && tokenAndUrl.token) {
109
- url = tokenAndUrl.url;
110
- this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;
107
+ let resolvedToken;
108
+ let resolvedUrl;
109
+ if (cesiumAsset.key) {
110
+ // Legacy key-bearing URL (e.g. persisted saved view) - authenticate directly with the embedded Ion key.
111
+ // Such URLs are intentionally exempt from the cesiumAccess-over-cesiumIonKey precedence rule and are not
112
+ // routed through a registered CesiumAccessClient; see [[CesiumAccessClient]].
113
+ const tokenAndUrl = await (0, internal_1.getCesiumAccessTokenAndEndpointUrl)(`${cesiumAsset.id}`, cesiumAsset.key);
114
+ resolvedToken = tokenAndUrl.token;
115
+ resolvedUrl = tokenAndUrl.url;
116
+ }
117
+ else {
118
+ // delegate to the registered CesiumAccessClient
119
+ const client = (0, internal_1.getCesiumAccessClient)();
120
+ const endpoint = await client.getAssetEndpoint(`${cesiumAsset.id}`, iTwinId);
121
+ if (endpoint) {
122
+ resolvedToken = endpoint.accessToken;
123
+ resolvedUrl = endpoint.url;
124
+ }
125
+ }
126
+ if (resolvedUrl && resolvedToken) {
127
+ url = resolvedUrl;
128
+ this._requestAuthorization = `Bearer ${resolvedToken}`;
111
129
  }
112
130
  }
113
131
  // The following is only if the reality data is not stored on PW Context Share.
@@ -1 +1 @@
1
- {"version":3,"file":"RealityDataSourceCesiumIonAssetImpl.js","sourceRoot":"","sources":["../../src/RealityDataSourceCesiumIonAssetImpl.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+CAA4C;AAC5C,sDAAwE;AACxE,oDAAiI;AACjI,8CAA0I;AAG1I;;;;;;EAME;AACF,MAAa,mCAAmC;IAC9B,GAAG,CAAuB;IAC1C,2EAA2E;IACnE,WAAW,CAAqB;IACxC,sIAAsI;IAC9H,QAAQ,GAAW,EAAE,CAAC;IAC9B,6DAA6D;IACrD,qBAAqB,CAAU;IAEvC;;OAEG;IACH,YAAsB,KAA6B;QACjD,IAAA,qBAAM,EAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,SAA+B,EAAE,OAA+B;QAChG,IAAI,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,cAAc;YAC3D,OAAO,SAAS,CAAC;QACnB,MAA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Ac,CAAC,IAAY;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrC,MAAM,OAAO,GAAG,EAAE,aAAa,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE9D,OAAO,IAAA,iBAAO,EAAC,OAAO,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,IAAY;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrC,MAAM,OAAO,GAAG,EAAE,aAAa,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE9D,OAAO,IAAA,iBAAO,EAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;IAEM,kBAAkB,CAAC,GAAW;QACnC,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,4BAA4B;QACvC,sEAAsE;QACtE,MAAM,eAAe,GAA0C,SAAS,CAAC;QACzE,OAAO,eAAe,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,uBAAuB;QAClC,IAAI,aAA+C,CAAC;QACpD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAvJD,kFAuJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\nimport { request } from \"./request/Request\";\nimport { assert, BentleyStatus, GuidString } from \"@itwin/core-bentley\";\nimport { IModelError, RealityData, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\nimport { CesiumIonAssetProvider, getCesiumAccessTokenAndEndpointUrl, getCesiumAssetUrl, getCesiumOSMBuildingsUrl } from \"./tile/internal\";\nimport { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from \"./RealityDataSource\";\n\n/** This class provides access to the reality data provider services.\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\n * There is a one to one relationship between a reality data and the instances of present class.\n* @internal\n*/\nexport class RealityDataSourceCesiumIonAssetImpl implements RealityDataSource {\n public readonly key: RealityDataSourceKey;\n /** The URL that supplies the 3d tiles for displaying the reality model. */\n private _tilesetUrl: string | undefined;\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\n private _baseUrl: string = \"\";\n /** Request authorization for non PW ContextShare requests.*/\n private _requestAuthorization?: string;\n\n /** Construct a new reality data source.\n * @param props JSON representation of the reality data source\n */\n protected constructor(props: RealityDataSourceProps) {\n assert(props.sourceKey.provider === RealityDataProvider.CesiumIonAsset);\n this.key = props.sourceKey;\n }\n\n /**\n * Create an instance of this class from a source key and iTwin context/\n */\n public static async createFromKey(sourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n if (sourceKey.provider !== RealityDataProvider.CesiumIonAsset)\n return undefined;\n const rdSource = new RealityDataSourceCesiumIonAssetImpl({ sourceKey });\n let tilesetUrl: string | undefined;\n try {\n tilesetUrl = await rdSource.getServiceUrl(iTwinId);\n } catch { }\n\n return (tilesetUrl !== undefined) ? rdSource : undefined;\n }\n\n public get isContextShare(): boolean {\n return false;\n }\n\n /**\n * Returns Reality Data if available\n */\n public get realityData(): RealityData | undefined {\n return undefined;\n }\n public get realityDataId(): string | undefined {\n return undefined;\n }\n /**\n * Returns Reality Data type if available\n */\n public get realityDataType(): string | undefined {\n return undefined;\n }\n\n // This is to set the root url from the provided root document path.\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\n // otherwise the full path to root document is given.\n // The base URL contains the base URL from which tile relative path are constructed.\n // The tile's path root will need to be reinserted for child tiles to return a 200\n private setBaseUrl(url: string): void {\n const urlParts = url.split(\"/\");\n urlParts.pop();\n if (urlParts.length === 0)\n this._baseUrl = \"\";\n else\n this._baseUrl = `${urlParts.join(\"/\")}/`;\n }\n\n /**\n * This method returns the URL to access the actual 3d tiles from the service provider.\n * @returns string containing the URL to reality data.\n */\n public async getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined> {\n // If url was not resolved - resolve it\n this._tilesetUrl = this.key.id;\n if (this.key.id === CesiumIonAssetProvider.osmBuildingId) {\n this._tilesetUrl = getCesiumOSMBuildingsUrl();\n } else {\n const parsedId = CesiumIonAssetProvider.parseCesiumUrl(this.key.id);\n if (parsedId) {\n this._tilesetUrl = getCesiumAssetUrl(parsedId.id, parsedId.key);\n }\n }\n\n return this._tilesetUrl;\n }\n\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\n let url = await this.getServiceUrl(iTwinId);\n if (!url)\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\n\n // The following is only if the reality data is not stored on PW Context Share.\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(url);\n if (cesiumAsset) {\n const tokenAndUrl = await getCesiumAccessTokenAndEndpointUrl(`${cesiumAsset.id}`, cesiumAsset.key);\n if (tokenAndUrl.url && tokenAndUrl.token) {\n url = tokenAndUrl.url;\n this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;\n }\n }\n\n // The following is only if the reality data is not stored on PW Context Share.\n this.setBaseUrl(url);\n const headers = { authorization: this._requestAuthorization };\n\n return request(url, \"json\", { headers });\n }\n\n /**\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileContent(name: string): Promise<ArrayBuffer> {\n const tileUrl = this._baseUrl + name;\n const headers = { authorization: this._requestAuthorization };\n\n return request(tileUrl, \"arraybuffer\", { headers });\n }\n\n /**\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileJson(name: string): Promise<any> {\n const tileUrl = this._baseUrl + name;\n const headers = { authorization: this._requestAuthorization };\n\n return request(tileUrl, \"json\", { headers });\n }\n\n public getTileContentType(url: string): \"tile\" | \"tileset\" {\n return url.endsWith(\"json\") ? \"tileset\" : \"tile\";\n }\n\n /**\n * Gets spatial location and extents of this reality data source\n * @returns spatial location and extents\n * @internal\n */\n public async getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined> {\n // Cesium Ion asset we currenlty support are unbound (cover all earth)\n const spatialLocation: SpatialLocationAndExtents | undefined = undefined;\n return spatialLocation;\n }\n /**\n * Gets information to identify the product and engine that create this reality data\n * Will return undefined if cannot be resolved\n * @returns information to identify the product and engine that create this reality data\n * @alpha\n */\n public async getPublisherProductInfo(): Promise<PublisherProductInfo | undefined> {\n let publisherInfo: PublisherProductInfo | undefined;\n return publisherInfo;\n }\n}\n\n"]}
1
+ {"version":3,"file":"RealityDataSourceCesiumIonAssetImpl.js","sourceRoot":"","sources":["../../src/RealityDataSourceCesiumIonAssetImpl.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+CAA4C;AAC5C,sDAAwE;AACxE,oDAAiI;AACjI,8CAAiK;AAGjK;;;;;;EAME;AACF,MAAa,mCAAmC;IAC9B,GAAG,CAAuB;IAC1C,2EAA2E;IACnE,WAAW,CAAqB;IACxC,sIAAsI;IAC9H,QAAQ,GAAW,EAAE,CAAC;IAC9B,6DAA6D;IACrD,qBAAqB,CAAU;IAEvC;;OAEG;IACH,YAAsB,KAA6B;QACjD,IAAA,qBAAM,EAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;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AAC,GAAW;QACnC,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,4BAA4B;QACvC,sEAAsE;QACtE,MAAM,eAAe,GAA0C,SAAS,CAAC;QACzE,OAAO,eAAe,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,uBAAuB;QAClC,IAAI,aAA+C,CAAC;QACpD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAxKD,kFAwKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\nimport { request } from \"./request/Request\";\nimport { assert, BentleyStatus, GuidString } from \"@itwin/core-bentley\";\nimport { IModelError, RealityData, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\nimport { CesiumIonAssetProvider, getCesiumAccessClient, getCesiumAccessTokenAndEndpointUrl, getCesiumAssetUrl, getCesiumOSMBuildingsUrl } from \"./tile/internal\";\nimport { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from \"./RealityDataSource\";\n\n/** This class provides access to the reality data provider services.\n * It encapsulates access to a reality data whether it be from local access, http or ProjectWise Context Share.\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\n * There is a one to one relationship between a reality data and the instances of present class.\n* @internal\n*/\nexport class RealityDataSourceCesiumIonAssetImpl implements RealityDataSource {\n public readonly key: RealityDataSourceKey;\n /** The URL that supplies the 3d tiles for displaying the reality model. */\n private _tilesetUrl: string | undefined;\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\n private _baseUrl: string = \"\";\n /** Request authorization for non PW ContextShare requests.*/\n private _requestAuthorization?: string;\n\n /** Construct a new reality data source.\n * @param props JSON representation of the reality data source\n */\n protected constructor(props: RealityDataSourceProps) {\n assert(props.sourceKey.provider === RealityDataProvider.CesiumIonAsset);\n this.key = props.sourceKey;\n }\n\n /**\n * Create an instance of this class from a source key and iTwin context/\n */\n public static async createFromKey(sourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n if (sourceKey.provider !== RealityDataProvider.CesiumIonAsset)\n return undefined;\n const rdSource = new RealityDataSourceCesiumIonAssetImpl({ sourceKey });\n let tilesetUrl: string | undefined;\n try {\n tilesetUrl = await rdSource.getServiceUrl(iTwinId);\n } catch { }\n\n return (tilesetUrl !== undefined) ? rdSource : undefined;\n }\n\n public get isContextShare(): boolean {\n return false;\n }\n\n /**\n * Returns Reality Data if available\n */\n public get realityData(): RealityData | undefined {\n return undefined;\n }\n public get realityDataId(): string | undefined {\n return undefined;\n }\n /**\n * Returns Reality Data type if available\n */\n public get realityDataType(): string | undefined {\n return undefined;\n }\n\n // This is to set the root url from the provided root document path.\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\n // otherwise the full path to root document is given.\n // The base URL contains the base URL from which tile relative path are constructed.\n // The tile's path root will need to be reinserted for child tiles to return a 200\n private setBaseUrl(url: string): void {\n const urlParts = url.split(\"/\");\n urlParts.pop();\n if (urlParts.length === 0)\n this._baseUrl = \"\";\n else\n this._baseUrl = `${urlParts.join(\"/\")}/`;\n }\n\n /**\n * This method returns the URL to access the actual 3d tiles from the service provider.\n * @returns string containing the URL to reality data.\n */\n public async getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined> {\n // If url was not resolved - resolve it\n this._tilesetUrl = this.key.id;\n if (this.key.id === CesiumIonAssetProvider.osmBuildingId) {\n this._tilesetUrl = getCesiumOSMBuildingsUrl();\n } else {\n const parsedId = CesiumIonAssetProvider.parseCesiumUrl(this.key.id);\n if (parsedId) {\n this._tilesetUrl = getCesiumAssetUrl(parsedId.id, parsedId.key);\n }\n }\n\n return this._tilesetUrl;\n }\n\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\n let url = await this.getServiceUrl(iTwinId);\n if (!url)\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\n\n // The following is only if the reality data is not stored on PW Context Share.\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(url);\n if (cesiumAsset) {\n let resolvedToken: string | undefined;\n let resolvedUrl: string | undefined;\n if (cesiumAsset.key) {\n // Legacy key-bearing URL (e.g. persisted saved view) - authenticate directly with the embedded Ion key.\n // Such URLs are intentionally exempt from the cesiumAccess-over-cesiumIonKey precedence rule and are not\n // routed through a registered CesiumAccessClient; see [[CesiumAccessClient]].\n const tokenAndUrl = await getCesiumAccessTokenAndEndpointUrl(`${cesiumAsset.id}`, cesiumAsset.key);\n resolvedToken = tokenAndUrl.token;\n resolvedUrl = tokenAndUrl.url;\n } else {\n // delegate to the registered CesiumAccessClient\n const client = getCesiumAccessClient();\n const endpoint = await client.getAssetEndpoint(`${cesiumAsset.id}`, iTwinId);\n if (endpoint) {\n resolvedToken = endpoint.accessToken;\n resolvedUrl = endpoint.url;\n }\n }\n if (resolvedUrl && resolvedToken) {\n url = resolvedUrl;\n this._requestAuthorization = `Bearer ${resolvedToken}`;\n }\n }\n\n // The following is only if the reality data is not stored on PW Context Share.\n this.setBaseUrl(url);\n const headers = { authorization: this._requestAuthorization };\n\n return request(url, \"json\", { headers });\n }\n\n /**\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileContent(name: string): Promise<ArrayBuffer> {\n const tileUrl = this._baseUrl + name;\n const headers = { authorization: this._requestAuthorization };\n\n return request(tileUrl, \"arraybuffer\", { headers });\n }\n\n /**\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileJson(name: string): Promise<any> {\n const tileUrl = this._baseUrl + name;\n const headers = { authorization: this._requestAuthorization };\n\n return request(tileUrl, \"json\", { headers });\n }\n\n public getTileContentType(url: string): \"tile\" | \"tileset\" {\n return url.endsWith(\"json\") ? \"tileset\" : \"tile\";\n }\n\n /**\n * Gets spatial location and extents of this reality data source\n * @returns spatial location and extents\n * @internal\n */\n public async getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined> {\n // Cesium Ion asset we currenlty support are unbound (cover all earth)\n const spatialLocation: SpatialLocationAndExtents | undefined = undefined;\n return spatialLocation;\n }\n /**\n * Gets information to identify the product and engine that create this reality data\n * Will return undefined if cannot be resolved\n * @returns information to identify the product and engine that create this reality data\n * @alpha\n */\n public async getPublisherProductInfo(): Promise<PublisherProductInfo | undefined> {\n let publisherInfo: PublisherProductInfo | undefined;\n return publisherInfo;\n }\n}\n\n"]}
@@ -25,7 +25,7 @@ export interface SelectAddEvent {
25
25
  type: SelectionSetEventType.Add;
26
26
  /**
27
27
  * The Ids of the elements added to the set.
28
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.
28
+ * @deprecated in 5.0 - might be removed in next major version. Use the [[additions]] attribute instead.
29
29
  */
30
30
  added: Id64Arg;
31
31
  /** A collection of geometric element, model and subcategory ids that have been added to selection set. */
@@ -42,7 +42,7 @@ export interface SelectRemoveEvent {
42
42
  type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;
43
43
  /**
44
44
  * The element Ids removed from the set.
45
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.
45
+ * @deprecated in 5.0 - might be removed in next major version. Use the [[removals]] attribute instead.
46
46
  */
47
47
  removed: Id64Arg;
48
48
  /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */
@@ -58,14 +58,14 @@ export interface SelectReplaceEvent {
58
58
  type: SelectionSetEventType.Replace;
59
59
  /**
60
60
  * The element Ids added to the set.
61
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.
61
+ * @deprecated in 5.0 - might be removed in next major version. Use the [[additions]] attribute instead.
62
62
  */
63
63
  added: Id64Arg;
64
64
  /** A collection of geometric element, model and subcategory ids that have been added to selection set. */
65
65
  additions: SelectableIds;
66
66
  /**
67
67
  * The element Ids removed from the set.
68
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.
68
+ * @deprecated in 5.0 - might be removed in next major version. Use the [[removals]] attribute instead.
69
69
  */
70
70
  removed: Id64Arg;
71
71
  /** A collection of geometric element, model and subcategory ids that have been removed from selection set. */
@@ -163,7 +163,7 @@ export declare class HiliteSet {
163
163
  /** Toggle the hilited state of one or more elements.
164
164
  * @param arg the ID(s) of the elements whose state is to be toggled.
165
165
  * @param onOff True to add the elements to the hilited set, false to remove them.
166
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[add]], [[remove]], [[replace]] instead.
166
+ * @deprecated in 5.0 - might be removed in next major version. Use [[add]], [[remove]], [[replace]] instead.
167
167
  */
168
168
  setHilite(arg: Id64Arg, onOff: boolean): void;
169
169
  }
@@ -203,12 +203,12 @@ export declare class SelectionSet {
203
203
  get isActive(): boolean;
204
204
  /** Return true if elemId is in this `SelectionSet`.
205
205
  * @see [[isSelected]]
206
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
206
+ * @deprecated in 5.0 - might be removed in next major version. Use `SelectionSet.elements.has(elemId)` instead.
207
207
  */
208
208
  has(elemId?: string): boolean;
209
209
  /** Query whether an Id is in the selection set.
210
210
  * @see [[has]]
211
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
211
+ * @deprecated in 5.0 - might be removed in next major version. Use `SelectionSet.elements.has(elemId)` instead.
212
212
  */
213
213
  isSelected(elemId?: Id64String): boolean;
214
214
  /** Clear current selection set.
@@ -205,7 +205,7 @@ class HiliteSet {
205
205
  /** Toggle the hilited state of one or more elements.
206
206
  * @param arg the ID(s) of the elements whose state is to be toggled.
207
207
  * @param onOff True to add the elements to the hilited set, false to remove them.
208
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[add]], [[remove]], [[replace]] instead.
208
+ * @deprecated in 5.0 - might be removed in next major version. Use [[add]], [[remove]], [[replace]] instead.
209
209
  */
210
210
  setHilite(arg, onOff) {
211
211
  if (onOff) {
@@ -274,14 +274,14 @@ class SelectionSet {
274
274
  }
275
275
  /** Return true if elemId is in this `SelectionSet`.
276
276
  * @see [[isSelected]]
277
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
277
+ * @deprecated in 5.0 - might be removed in next major version. Use `SelectionSet.elements.has(elemId)` instead.
278
278
  */
279
279
  has(elemId) {
280
280
  return !!elemId && this.elements.has(elemId);
281
281
  }
282
282
  /** Query whether an Id is in the selection set.
283
283
  * @see [[has]]
284
- * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
284
+ * @deprecated in 5.0 - might be removed in next major version. Use `SelectionSet.elements.has(elemId)` instead.
285
285
  */
286
286
  isSelected(elemId) {
287
287
  return !!elemId && this.elements.has(elemId);