@itwin/core-common 3.6.0-dev.8 → 4.0.0-dev.2

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 (355) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/LICENSE.md +1 -1
  3. package/lib/cjs/AuthorizationClient.d.ts +9 -3
  4. package/lib/cjs/AuthorizationClient.d.ts.map +1 -1
  5. package/lib/cjs/AuthorizationClient.js.map +1 -1
  6. package/lib/cjs/BackendTypes.d.ts +3 -3
  7. package/lib/cjs/BackendTypes.d.ts.map +1 -1
  8. package/lib/cjs/BackendTypes.js.map +1 -1
  9. package/lib/cjs/BackgroundMapSettings.d.ts +2 -2
  10. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  11. package/lib/cjs/CloudStorage.d.ts +5 -5
  12. package/lib/cjs/CloudStorage.js +3 -3
  13. package/lib/cjs/CloudStorage.js.map +1 -1
  14. package/lib/cjs/CloudStorageTileCache.d.ts +1 -1
  15. package/lib/cjs/CloudStorageTileCache.js +1 -1
  16. package/lib/cjs/CloudStorageTileCache.js.map +1 -1
  17. package/lib/cjs/Code.d.ts +31 -10
  18. package/lib/cjs/Code.d.ts.map +1 -1
  19. package/lib/cjs/Code.js +17 -29
  20. package/lib/cjs/Code.js.map +1 -1
  21. package/lib/cjs/ContextRealityModel.d.ts +30 -3
  22. package/lib/cjs/ContextRealityModel.d.ts.map +1 -1
  23. package/lib/cjs/ContextRealityModel.js +23 -8
  24. package/lib/cjs/ContextRealityModel.js.map +1 -1
  25. package/lib/cjs/DisplayStyleSettings.d.ts +4 -0
  26. package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
  27. package/lib/cjs/DisplayStyleSettings.js +5 -1
  28. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  29. package/lib/cjs/ElementMesh.js +2 -2
  30. package/lib/cjs/ElementMesh.js.map +1 -1
  31. package/lib/cjs/ElementProps.d.ts +5 -1
  32. package/lib/cjs/ElementProps.d.ts.map +1 -1
  33. package/lib/cjs/ElementProps.js.map +1 -1
  34. package/lib/cjs/EntityProps.d.ts +2 -1
  35. package/lib/cjs/EntityProps.d.ts.map +1 -1
  36. package/lib/cjs/EntityProps.js +1 -0
  37. package/lib/cjs/EntityProps.js.map +1 -1
  38. package/lib/cjs/FeatureSymbology.d.ts +3 -3
  39. package/lib/cjs/FeatureSymbology.js +3 -3
  40. package/lib/cjs/FeatureSymbology.js.map +1 -1
  41. package/lib/cjs/IModel.d.ts +1 -1
  42. package/lib/cjs/IModel.js.map +1 -1
  43. package/lib/cjs/IModelError.d.ts +10 -4
  44. package/lib/cjs/IModelError.d.ts.map +1 -1
  45. package/lib/cjs/IModelError.js +3 -4
  46. package/lib/cjs/IModelError.js.map +1 -1
  47. package/lib/cjs/Localization.d.ts +1 -1
  48. package/lib/cjs/Localization.d.ts.map +1 -1
  49. package/lib/cjs/Localization.js +8 -1
  50. package/lib/cjs/Localization.js.map +1 -1
  51. package/lib/cjs/MaterialProps.d.ts +42 -7
  52. package/lib/cjs/MaterialProps.d.ts.map +1 -1
  53. package/lib/cjs/MaterialProps.js +13 -1
  54. package/lib/cjs/MaterialProps.js.map +1 -1
  55. package/lib/cjs/RealityModelDisplaySettings.d.ts +65 -0
  56. package/lib/cjs/RealityModelDisplaySettings.d.ts.map +1 -1
  57. package/lib/cjs/RealityModelDisplaySettings.js +30 -2
  58. package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
  59. package/lib/cjs/RenderMaterial.d.ts +1 -1
  60. package/lib/cjs/RenderMaterial.d.ts.map +1 -1
  61. package/lib/cjs/RenderMaterial.js +1 -1
  62. package/lib/cjs/RenderMaterial.js.map +1 -1
  63. package/lib/cjs/RenderTexture.d.ts +1 -1
  64. package/lib/cjs/RenderTexture.js +1 -1
  65. package/lib/cjs/RenderTexture.js.map +1 -1
  66. package/lib/cjs/RpcInterface.d.ts.map +1 -1
  67. package/lib/cjs/RpcInterface.js.map +1 -1
  68. package/lib/cjs/RpcManager.d.ts.map +1 -1
  69. package/lib/cjs/RpcManager.js.map +1 -1
  70. package/lib/cjs/TerrainSettings.d.ts +1 -1
  71. package/lib/cjs/TerrainSettings.js.map +1 -1
  72. package/lib/cjs/TextureMapping.d.ts +5 -3
  73. package/lib/cjs/TextureMapping.d.ts.map +1 -1
  74. package/lib/cjs/TextureMapping.js.map +1 -1
  75. package/lib/cjs/ViewFlags.d.ts +2 -6
  76. package/lib/cjs/ViewFlags.d.ts.map +1 -1
  77. package/lib/cjs/ViewFlags.js.map +1 -1
  78. package/lib/cjs/ViewProps.d.ts +2 -2
  79. package/lib/cjs/ViewProps.d.ts.map +1 -1
  80. package/lib/cjs/ViewProps.js.map +1 -1
  81. package/lib/cjs/core-common.d.ts +0 -1
  82. package/lib/cjs/core-common.d.ts.map +1 -1
  83. package/lib/cjs/core-common.js +0 -1
  84. package/lib/cjs/core-common.js.map +1 -1
  85. package/lib/cjs/geometry/BoundingSphere.d.ts +15 -2
  86. package/lib/cjs/geometry/BoundingSphere.d.ts.map +1 -1
  87. package/lib/cjs/geometry/BoundingSphere.js +18 -4
  88. package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
  89. package/lib/cjs/geometry/FrustumPlanes.d.ts +59 -10
  90. package/lib/cjs/geometry/FrustumPlanes.d.ts.map +1 -1
  91. package/lib/cjs/geometry/FrustumPlanes.js +94 -33
  92. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  93. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  94. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -1
  95. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  96. package/lib/cjs/rpc/IModelReadRpcInterface.js +12 -12
  97. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  98. package/lib/cjs/rpc/IModelTileRpcInterface.d.ts +2 -2
  99. package/lib/cjs/rpc/IModelTileRpcInterface.js +4 -4
  100. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  101. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  102. package/lib/cjs/rpc/TestRpcManager.d.ts.map +1 -1
  103. package/lib/cjs/rpc/TestRpcManager.js +1 -0
  104. package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
  105. package/lib/cjs/rpc/WipRpcInterface.js.map +1 -1
  106. package/lib/cjs/rpc/core/RpcConfiguration.d.ts.map +1 -1
  107. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  108. package/lib/cjs/rpc/core/RpcConstants.d.ts +6 -1
  109. package/lib/cjs/rpc/core/RpcConstants.d.ts.map +1 -1
  110. package/lib/cjs/rpc/core/RpcConstants.js +7 -1
  111. package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
  112. package/lib/cjs/rpc/core/RpcControl.d.ts.map +1 -1
  113. package/lib/cjs/rpc/core/RpcControl.js +1 -0
  114. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  115. package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
  116. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  117. package/lib/cjs/rpc/core/RpcOperation.d.ts.map +1 -1
  118. package/lib/cjs/rpc/core/RpcOperation.js +1 -0
  119. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  120. package/lib/cjs/rpc/core/RpcPendingQueue.d.ts.map +1 -1
  121. package/lib/cjs/rpc/core/RpcPendingQueue.js +1 -0
  122. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  123. package/lib/cjs/rpc/core/RpcProtocol.d.ts.map +1 -1
  124. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  125. package/lib/cjs/rpc/core/RpcPush.d.ts.map +1 -1
  126. package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
  127. package/lib/cjs/rpc/core/RpcRegistry.d.ts.map +1 -1
  128. package/lib/cjs/rpc/core/RpcRegistry.js +1 -0
  129. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  130. package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
  131. package/lib/cjs/rpc/core/RpcRequest.js +1 -0
  132. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  133. package/lib/cjs/rpc/core/RpcRequestContext.d.ts.map +1 -1
  134. package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
  135. package/lib/cjs/rpc/core/RpcRoutingToken.d.ts.map +1 -1
  136. package/lib/cjs/rpc/core/RpcRoutingToken.js +1 -0
  137. package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
  138. package/lib/cjs/rpc/core/RpcSessionInvocation.d.ts.map +1 -1
  139. package/lib/cjs/rpc/core/RpcSessionInvocation.js +1 -0
  140. package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
  141. package/lib/cjs/rpc/web/BentleyCloudRpcManager.d.ts.map +1 -1
  142. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  143. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
  144. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -0
  145. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  146. package/lib/cjs/rpc/web/OpenAPI.d.ts +1 -0
  147. package/lib/cjs/rpc/web/OpenAPI.d.ts.map +1 -1
  148. package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
  149. package/lib/cjs/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
  150. package/lib/cjs/rpc/web/WebAppRpcLogging.js +1 -0
  151. package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
  152. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +2 -0
  153. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  154. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  155. package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  156. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  157. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
  158. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +1 -0
  159. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  160. package/lib/cjs/tile/B3dmTileIO.js +5 -5
  161. package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
  162. package/lib/cjs/tile/CompositeTileIO.js +2 -2
  163. package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
  164. package/lib/cjs/tile/GltfTileIO.js +5 -5
  165. package/lib/cjs/tile/GltfTileIO.js.map +1 -1
  166. package/lib/cjs/tile/I3dmTileIO.js +6 -6
  167. package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
  168. package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
  169. package/lib/cjs/tile/IModelTileIO.js +12 -12
  170. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  171. package/lib/cjs/tile/PntsTileIO.js +5 -5
  172. package/lib/cjs/tile/PntsTileIO.js.map +1 -1
  173. package/lib/cjs/tile/TileIO.js +3 -3
  174. package/lib/cjs/tile/TileIO.js.map +1 -1
  175. package/lib/esm/AuthorizationClient.d.ts +9 -3
  176. package/lib/esm/AuthorizationClient.d.ts.map +1 -1
  177. package/lib/esm/AuthorizationClient.js.map +1 -1
  178. package/lib/esm/BackendTypes.d.ts +3 -3
  179. package/lib/esm/BackendTypes.d.ts.map +1 -1
  180. package/lib/esm/BackendTypes.js.map +1 -1
  181. package/lib/esm/BackgroundMapSettings.d.ts +2 -2
  182. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  183. package/lib/esm/CloudStorage.d.ts +5 -5
  184. package/lib/esm/CloudStorage.js +3 -3
  185. package/lib/esm/CloudStorage.js.map +1 -1
  186. package/lib/esm/CloudStorageTileCache.d.ts +1 -1
  187. package/lib/esm/CloudStorageTileCache.js +1 -1
  188. package/lib/esm/CloudStorageTileCache.js.map +1 -1
  189. package/lib/esm/Code.d.ts +31 -10
  190. package/lib/esm/Code.d.ts.map +1 -1
  191. package/lib/esm/Code.js +17 -29
  192. package/lib/esm/Code.js.map +1 -1
  193. package/lib/esm/ContextRealityModel.d.ts +30 -3
  194. package/lib/esm/ContextRealityModel.d.ts.map +1 -1
  195. package/lib/esm/ContextRealityModel.js +23 -8
  196. package/lib/esm/ContextRealityModel.js.map +1 -1
  197. package/lib/esm/DisplayStyleSettings.d.ts +4 -0
  198. package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
  199. package/lib/esm/DisplayStyleSettings.js +5 -1
  200. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  201. package/lib/esm/ElementMesh.js +2 -2
  202. package/lib/esm/ElementMesh.js.map +1 -1
  203. package/lib/esm/ElementProps.d.ts +5 -1
  204. package/lib/esm/ElementProps.d.ts.map +1 -1
  205. package/lib/esm/ElementProps.js.map +1 -1
  206. package/lib/esm/EntityProps.d.ts +2 -1
  207. package/lib/esm/EntityProps.d.ts.map +1 -1
  208. package/lib/esm/EntityProps.js +1 -0
  209. package/lib/esm/EntityProps.js.map +1 -1
  210. package/lib/esm/FeatureSymbology.d.ts +3 -3
  211. package/lib/esm/FeatureSymbology.js +3 -3
  212. package/lib/esm/FeatureSymbology.js.map +1 -1
  213. package/lib/esm/IModel.d.ts +1 -1
  214. package/lib/esm/IModel.js.map +1 -1
  215. package/lib/esm/IModelError.d.ts +10 -4
  216. package/lib/esm/IModelError.d.ts.map +1 -1
  217. package/lib/esm/IModelError.js +3 -2
  218. package/lib/esm/IModelError.js.map +1 -1
  219. package/lib/esm/Localization.d.ts +1 -1
  220. package/lib/esm/Localization.d.ts.map +1 -1
  221. package/lib/esm/Localization.js +8 -1
  222. package/lib/esm/Localization.js.map +1 -1
  223. package/lib/esm/MaterialProps.d.ts +42 -7
  224. package/lib/esm/MaterialProps.d.ts.map +1 -1
  225. package/lib/esm/MaterialProps.js +12 -0
  226. package/lib/esm/MaterialProps.js.map +1 -1
  227. package/lib/esm/RealityModelDisplaySettings.d.ts +65 -0
  228. package/lib/esm/RealityModelDisplaySettings.d.ts.map +1 -1
  229. package/lib/esm/RealityModelDisplaySettings.js +30 -2
  230. package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
  231. package/lib/esm/RenderMaterial.d.ts +1 -1
  232. package/lib/esm/RenderMaterial.d.ts.map +1 -1
  233. package/lib/esm/RenderMaterial.js +1 -1
  234. package/lib/esm/RenderMaterial.js.map +1 -1
  235. package/lib/esm/RenderTexture.d.ts +1 -1
  236. package/lib/esm/RenderTexture.js +1 -1
  237. package/lib/esm/RenderTexture.js.map +1 -1
  238. package/lib/esm/RpcInterface.d.ts.map +1 -1
  239. package/lib/esm/RpcInterface.js.map +1 -1
  240. package/lib/esm/RpcManager.d.ts.map +1 -1
  241. package/lib/esm/RpcManager.js.map +1 -1
  242. package/lib/esm/TerrainSettings.d.ts +1 -1
  243. package/lib/esm/TerrainSettings.js.map +1 -1
  244. package/lib/esm/TextureMapping.d.ts +5 -3
  245. package/lib/esm/TextureMapping.d.ts.map +1 -1
  246. package/lib/esm/TextureMapping.js.map +1 -1
  247. package/lib/esm/ViewFlags.d.ts +2 -6
  248. package/lib/esm/ViewFlags.d.ts.map +1 -1
  249. package/lib/esm/ViewFlags.js.map +1 -1
  250. package/lib/esm/ViewProps.d.ts +2 -2
  251. package/lib/esm/ViewProps.d.ts.map +1 -1
  252. package/lib/esm/ViewProps.js.map +1 -1
  253. package/lib/esm/core-common.d.ts +0 -1
  254. package/lib/esm/core-common.d.ts.map +1 -1
  255. package/lib/esm/core-common.js +0 -1
  256. package/lib/esm/core-common.js.map +1 -1
  257. package/lib/esm/geometry/BoundingSphere.d.ts +15 -2
  258. package/lib/esm/geometry/BoundingSphere.d.ts.map +1 -1
  259. package/lib/esm/geometry/BoundingSphere.js +18 -4
  260. package/lib/esm/geometry/BoundingSphere.js.map +1 -1
  261. package/lib/esm/geometry/FrustumPlanes.d.ts +59 -10
  262. package/lib/esm/geometry/FrustumPlanes.d.ts.map +1 -1
  263. package/lib/esm/geometry/FrustumPlanes.js +94 -33
  264. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  265. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  266. package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -1
  267. package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  268. package/lib/esm/rpc/IModelReadRpcInterface.js +12 -12
  269. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  270. package/lib/esm/rpc/IModelTileRpcInterface.d.ts +2 -2
  271. package/lib/esm/rpc/IModelTileRpcInterface.js +4 -4
  272. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  273. package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  274. package/lib/esm/rpc/TestRpcManager.d.ts.map +1 -1
  275. package/lib/esm/rpc/TestRpcManager.js +1 -0
  276. package/lib/esm/rpc/TestRpcManager.js.map +1 -1
  277. package/lib/esm/rpc/WipRpcInterface.js.map +1 -1
  278. package/lib/esm/rpc/core/RpcConfiguration.d.ts.map +1 -1
  279. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  280. package/lib/esm/rpc/core/RpcConstants.d.ts +6 -1
  281. package/lib/esm/rpc/core/RpcConstants.d.ts.map +1 -1
  282. package/lib/esm/rpc/core/RpcConstants.js +7 -1
  283. package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
  284. package/lib/esm/rpc/core/RpcControl.d.ts.map +1 -1
  285. package/lib/esm/rpc/core/RpcControl.js +1 -0
  286. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  287. package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
  288. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  289. package/lib/esm/rpc/core/RpcOperation.d.ts.map +1 -1
  290. package/lib/esm/rpc/core/RpcOperation.js +1 -0
  291. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  292. package/lib/esm/rpc/core/RpcPendingQueue.d.ts.map +1 -1
  293. package/lib/esm/rpc/core/RpcPendingQueue.js +1 -0
  294. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  295. package/lib/esm/rpc/core/RpcProtocol.d.ts.map +1 -1
  296. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  297. package/lib/esm/rpc/core/RpcPush.d.ts.map +1 -1
  298. package/lib/esm/rpc/core/RpcPush.js.map +1 -1
  299. package/lib/esm/rpc/core/RpcRegistry.d.ts.map +1 -1
  300. package/lib/esm/rpc/core/RpcRegistry.js +1 -0
  301. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  302. package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
  303. package/lib/esm/rpc/core/RpcRequest.js +1 -0
  304. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  305. package/lib/esm/rpc/core/RpcRequestContext.d.ts.map +1 -1
  306. package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
  307. package/lib/esm/rpc/core/RpcRoutingToken.d.ts.map +1 -1
  308. package/lib/esm/rpc/core/RpcRoutingToken.js +1 -0
  309. package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
  310. package/lib/esm/rpc/core/RpcSessionInvocation.d.ts.map +1 -1
  311. package/lib/esm/rpc/core/RpcSessionInvocation.js +1 -0
  312. package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
  313. package/lib/esm/rpc/web/BentleyCloudRpcManager.d.ts.map +1 -1
  314. package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  315. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
  316. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -0
  317. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  318. package/lib/esm/rpc/web/OpenAPI.d.ts +1 -0
  319. package/lib/esm/rpc/web/OpenAPI.d.ts.map +1 -1
  320. package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
  321. package/lib/esm/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
  322. package/lib/esm/rpc/web/WebAppRpcLogging.js +1 -0
  323. package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
  324. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +2 -0
  325. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  326. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  327. package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  328. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  329. package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
  330. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +1 -0
  331. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  332. package/lib/esm/tile/B3dmTileIO.js +5 -5
  333. package/lib/esm/tile/B3dmTileIO.js.map +1 -1
  334. package/lib/esm/tile/CompositeTileIO.js +2 -2
  335. package/lib/esm/tile/CompositeTileIO.js.map +1 -1
  336. package/lib/esm/tile/GltfTileIO.js +5 -5
  337. package/lib/esm/tile/GltfTileIO.js.map +1 -1
  338. package/lib/esm/tile/I3dmTileIO.js +6 -6
  339. package/lib/esm/tile/I3dmTileIO.js.map +1 -1
  340. package/lib/esm/tile/IModelTileIO.d.ts +2 -2
  341. package/lib/esm/tile/IModelTileIO.js +12 -12
  342. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  343. package/lib/esm/tile/PntsTileIO.js +5 -5
  344. package/lib/esm/tile/PntsTileIO.js.map +1 -1
  345. package/lib/esm/tile/TileIO.js +3 -3
  346. package/lib/esm/tile/TileIO.js.map +1 -1
  347. package/package.json +7 -7
  348. package/lib/cjs/FeatureGates.d.ts +0 -32
  349. package/lib/cjs/FeatureGates.d.ts.map +0 -1
  350. package/lib/cjs/FeatureGates.js +0 -56
  351. package/lib/cjs/FeatureGates.js.map +0 -1
  352. package/lib/esm/FeatureGates.d.ts +0 -32
  353. package/lib/esm/FeatureGates.d.ts.map +0 -1
  354. package/lib/esm/FeatureGates.js +0 -52
  355. package/lib/esm/FeatureGates.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,33 @@
1
1
  # Change Log - @itwin/core-common
2
2
 
3
- This log was last generated on Wed, 07 Dec 2022 19:12:36 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 26 Jan 2023 22:53:27 GMT and should not be manually modified.
4
+
5
+ ## 3.5.5
6
+ Thu, 26 Jan 2023 22:53:27 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.5.4
11
+ Wed, 18 Jan 2023 15:27:15 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.5.3
16
+ Fri, 13 Jan 2023 17:23:07 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 3.5.2
21
+ Wed, 11 Jan 2023 16:46:30 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 3.5.1
26
+ Thu, 15 Dec 2022 16:38:28 GMT
27
+
28
+ ### Updates
29
+
30
+ - Eye-Dome-Lighting
4
31
 
5
32
  ## 3.5.0
6
33
  Wed, 07 Dec 2022 19:12:36 GMT
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright © 2017-2022 Bentley Systems, Incorporated. All rights reserved.
3
+ Copyright © 2017-2023 Bentley Systems, Incorporated. All rights reserved.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -2,11 +2,17 @@
2
2
  * @module Authorization
3
3
  */
4
4
  import { AccessToken } from "@itwin/core-bentley";
5
- /** Interface to provide authorization information
6
- * @beta
5
+ /** Provides authorization to access APIs.
6
+ * Bentley's iTwin platform APIs [use OAuth 2.0](https://developer.bentley.com/apis/overview/authorization/) for authorization.
7
+ * Implementations are provided for [Electron](https://www.npmjs.com/package/@itwin/electron-authorization), [browsers](https://www.npmjs.com/package/@itwin/browser-authorization),
8
+ * [services](https://www.npmjs.com/package/@itwin/service-authorization), and [command-line applications](https://www.npmjs.com/package/@itwin/node-cli-authorization).
9
+ * @see [IModelHostOptions.authorizationClient]($backend) and [IModelAppOptions.authorizationClient]($frontend) to configure the client.
10
+ * @see [IModelHost.authorizationClient]($backend) and [IModelApp.authorizationClient]($frontend) to access the configured client.
11
+ * @note Access tokens expire periodically and are automatically refreshed when possible; therefore, tokens should always be requested via the client, not cached for later reuse.
12
+ @public
7
13
  */
8
14
  export interface AuthorizationClient {
9
- /** Get the AccessToken of the currently authorized user, or blank string if no token is available. */
15
+ /** Obtain an [[AccessToken]] for the currently authorized user, or blank string if no token is available. */
10
16
  getAccessToken(): Promise<AccessToken>;
11
17
  }
12
18
  //# sourceMappingURL=AuthorizationClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizationClient.d.ts","sourceRoot":"","sources":["../../src/AuthorizationClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sGAAsG;IACtG,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CACxC"}
1
+ {"version":3,"file":"AuthorizationClient.d.ts","sourceRoot":"","sources":["../../src/AuthorizationClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,6GAA6G;IAC7G,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CACxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizationClient.js","sourceRoot":"","sources":["../../src/AuthorizationClient.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Authorization\r\n */\r\n\r\nimport { AccessToken } from \"@itwin/core-bentley\";\r\n\r\n/** Interface to provide authorization information\r\n * @beta\r\n */\r\nexport interface AuthorizationClient {\r\n /** Get the AccessToken of the currently authorized user, or blank string if no token is available. */\r\n getAccessToken(): Promise<AccessToken>;\r\n}\r\n"]}
1
+ {"version":3,"file":"AuthorizationClient.js","sourceRoot":"","sources":["../../src/AuthorizationClient.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Authorization\r\n */\r\n\r\nimport { AccessToken } from \"@itwin/core-bentley\";\r\n\r\n/** Provides authorization to access APIs.\r\n * Bentley's iTwin platform APIs [use OAuth 2.0](https://developer.bentley.com/apis/overview/authorization/) for authorization.\r\n * Implementations are provided for [Electron](https://www.npmjs.com/package/@itwin/electron-authorization), [browsers](https://www.npmjs.com/package/@itwin/browser-authorization),\r\n * [services](https://www.npmjs.com/package/@itwin/service-authorization), and [command-line applications](https://www.npmjs.com/package/@itwin/node-cli-authorization).\r\n * @see [IModelHostOptions.authorizationClient]($backend) and [IModelAppOptions.authorizationClient]($frontend) to configure the client.\r\n * @see [IModelHost.authorizationClient]($backend) and [IModelApp.authorizationClient]($frontend) to access the configured client.\r\n * @note Access tokens expire periodically and are automatically refreshed when possible; therefore, tokens should always be requested via the client, not cached for later reuse.\r\n @public\r\n */\r\nexport interface AuthorizationClient {\r\n /** Obtain an [[AccessToken]] for the currently authorized user, or blank string if no token is available. */\r\n getAccessToken(): Promise<AccessToken>;\r\n}\r\n"]}
@@ -4,10 +4,10 @@
4
4
  /// <reference types="node" />
5
5
  import type { Readable, Writable } from "stream";
6
6
  import type { Buffer } from "buffer";
7
- /** @public @deprecated */
7
+ /** @public @deprecated in 3.x. */
8
8
  export declare type BackendReadable = Readable;
9
- /** @public @deprecated */
9
+ /** @public @deprecated in 3.x. */
10
10
  export declare type BackendWritable = Writable;
11
- /** @internal @deprecated */
11
+ /** @internal @deprecated in 3.x. */
12
12
  export declare type BackendBuffer = Buffer;
13
13
  //# sourceMappingURL=BackendTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackendTypes.d.ts","sourceRoot":"","sources":["../../src/BackendTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,0BAA0B;AAC1B,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,0BAA0B;AAC1B,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,4BAA4B;AAC5B,oBAAY,aAAa,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"BackendTypes.d.ts","sourceRoot":"","sources":["../../src/BackendTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,kCAAkC;AAClC,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,kCAAkC;AAClC,oBAAY,eAAe,GAAG,QAAQ,CAAC;AAEvC,oCAAoC;AACpC,oBAAY,aAAa,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BackendTypes.js","sourceRoot":"","sources":["../../src/BackendTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\nimport type { Readable, Writable } from \"stream\"; // Must be \"import type\" to avoid webpack polyfill errors\r\nimport type { Buffer } from \"buffer\"; // Must be \"import type\" to avoid webpack polyfill errors\r\n\r\n/*\r\nIMPORTANT:\r\nThis is a temporary source file for backwards compatibility only.\r\nDo not add any new types to this file.\r\nAll types here will be removed in 4.0\r\n*/\r\n\r\n/** @public @deprecated */\r\nexport type BackendReadable = Readable;\r\n\r\n/** @public @deprecated */\r\nexport type BackendWritable = Writable;\r\n\r\n/** @internal @deprecated */\r\nexport type BackendBuffer = Buffer;\r\n"]}
1
+ {"version":3,"file":"BackendTypes.js","sourceRoot":"","sources":["../../src/BackendTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\nimport type { Readable, Writable } from \"stream\"; // Must be \"import type\" to avoid webpack polyfill errors\r\nimport type { Buffer } from \"buffer\"; // Must be \"import type\" to avoid webpack polyfill errors\r\n\r\n/*\r\nIMPORTANT:\r\nThis is a temporary source file for backwards compatibility only.\r\nDo not add any new types to this file.\r\nAll types here will be removed in 4.0\r\n*/\r\n\r\n/** @public @deprecated in 3.x. */\r\nexport type BackendReadable = Readable;\r\n\r\n/** @public @deprecated in 3.x. */\r\nexport type BackendWritable = Writable;\r\n\r\n/** @internal @deprecated in 3.x. */\r\nexport type BackendBuffer = Buffer;\r\n"]}
@@ -58,11 +58,11 @@ export interface BackgroundMapProps {
58
58
  export interface DeprecatedBackgroundMapProps {
59
59
  /** Identifies the source of the map tiles. Currently supported providers are "BingProvider" and "MapBoxProvider".
60
60
  * Default value: "BingProvider"
61
- * @deprecated use MapImageryProps.backgroundBase.
61
+ * @deprecated in 3.x. use MapImageryProps.backgroundBase.
62
62
  */
63
63
  providerName?: string;
64
64
  /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.
65
- * @deprecated use MapImageryProps.backgroundBase
65
+ * @deprecated in 3.x. use MapImageryProps.backgroundBase
66
66
  */
67
67
  providerData?: {
68
68
  /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundMapSettings.js","sourceRoot":"","sources":["../../src/BackgroundMapSettings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mEAAmF;AACnF,qDAA+E;AAC/E,uDAAkE;AAElE;;;;;GAKG;AACH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAoC;IACpC,mDAAa,CAAA;IACb,8BAA8B;IAC9B,2CAAS,CAAA;AACX,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAgED,SAAS,kBAAkB,CAAC,IAAgB;IAC1C,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsB;IACnD,IAAI,QAAQ,KAAK,OAAO,KAAK;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAa,qBAAqB;IAqChC,YAAoB,KAAwD;;QAC1E,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,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,YAAiC;;QAC5C,IAAI,SAAS,KAAK,YAAY;YAC5B,OAAO,IAAI,CAAC;QAEd,MAAM,KAAK,GAAG;YACZ,UAAU,EAAE,MAAA,YAAY,CAAC,UAAU,mCAAI,IAAI,CAAC,UAAU;YACtD,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,IAAI,CAAC,YAAY;YAC5D,cAAc,EAAE,MAAA,YAAY,CAAC,cAAc,mCAAI,IAAI,CAAC,cAAc;YAClE,SAAS,EAAE,MAAA,YAAY,CAAC,SAAS,mCAAI,IAAI,CAAC,SAAS;YACnD,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,CAAC,IAAI,CAAC,UAAU;YAC3D,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,IAAI,CAAC,YAAY;YAC5D,eAAe,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YACjJ,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC5I,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YACjC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;SAC/C,CAAC;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;CACF;AAvJD,sDAuJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\r\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\r\n\r\n/** Describes the projection of the background map\r\n * @see [[BackgroundMapProps]]\r\n * @see [[DisplayStyleSettingsProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GlobeMode {\r\n /** Display Earth as 3d ellipsoid */\r\n Ellipsoid = 0,\r\n /** Display Earth as plane. */\r\n Plane = 1,\r\n}\r\n\r\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\r\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BackgroundMapProps {\r\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\r\n groundBias?: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\r\n * Default value: false.\r\n */\r\n transparency?: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n useDepthBuffer?: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n applyTerrain?: boolean;\r\n /** Properties associated with terrain display. */\r\n terrainSettings?: TerrainProps;\r\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\r\n globeMode?: GlobeMode;\r\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n nonLocatable?: boolean;\r\n /** A planar mask applied to the map geometry\r\n * @beta\r\n */\r\n planarClipMask?: PlanarClipMaskProps;\r\n\r\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\r\n providerName?: never;\r\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\r\n providerData?: never;\r\n}\r\n\r\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\r\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\r\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DeprecatedBackgroundMapProps {\r\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\r\n * Default value: \"BingProvider\"\r\n * @deprecated use MapImageryProps.backgroundBase.\r\n */\r\n providerName?: string;\r\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\r\n * @deprecated use MapImageryProps.backgroundBase\r\n */\r\n providerData?: {\r\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\r\n mapType?: BackgroundMapType;\r\n };\r\n}\r\n\r\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\r\n\r\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\r\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\r\n}\r\n\r\nfunction normalizeTransparency(trans?: number | false): number | false {\r\n if (\"number\" === typeof trans)\r\n return Math.min(1, Math.max(0, trans));\r\n\r\n return false;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\r\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\r\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\r\n * @public\r\n */\r\nexport class BackgroundMapSettings {\r\n /** Retained strictly for persistence. */\r\n private readonly _provider: BackgroundMapProvider;\r\n\r\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\r\n public readonly groundBias: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\r\n public readonly transparency: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n public readonly useDepthBuffer: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n public readonly applyTerrain: boolean;\r\n /** Settings associated with terrain display. */\r\n public readonly terrainSettings: TerrainSettings;\r\n /** Globe display mode. */\r\n public readonly globeMode: GlobeMode;\r\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\r\n * @beta\r\n */\r\n public readonly planarClipMask: PlanarClipMaskSettings;\r\n private readonly _locatable: boolean;\r\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n public get locatable(): boolean {\r\n // Handle legacy TerrainProps.nonLocatable:\r\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\r\n // - Otherwise, use BackgroundMapProps.nonLocatable.\r\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\r\n return false;\r\n\r\n return this._locatable;\r\n }\r\n\r\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\r\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\r\n\r\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\r\n this.groundBias = props.groundBias ?? 0;\r\n this.transparency = normalizeTransparency(props.transparency);\r\n this.useDepthBuffer = props.useDepthBuffer ?? false;\r\n this.applyTerrain = props.applyTerrain ?? false;\r\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\r\n this.globeMode = normalizeGlobeMode(props.globeMode);\r\n this._locatable = true !== props.nonLocatable;\r\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\r\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\r\n }\r\n\r\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\r\n * the iModel - otherwise, prefer [[fromJSON]].\r\n */\r\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\r\n return new this(json ?? {});\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields.\r\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\r\n */\r\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\r\n return new BackgroundMapSettings(json ?? {});\r\n }\r\n\r\n /** Convert these settings to their in-memory JSON representation.\r\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\r\n */\r\n public toJSON(): BackgroundMapProps {\r\n const props: BackgroundMapProps = {};\r\n if (0 !== this.groundBias)\r\n props.groundBias = this.groundBias;\r\n if (this.applyTerrain)\r\n props.applyTerrain = true;\r\n if (false !== this.transparency)\r\n props.transparency = this.transparency;\r\n if (GlobeMode.Ellipsoid !== this.globeMode)\r\n props.globeMode = this.globeMode;\r\n if (this.useDepthBuffer)\r\n props.useDepthBuffer = true;\r\n if (!this._locatable)\r\n props.nonLocatable = true;\r\n\r\n const terrainSettings = this.terrainSettings.toJSON();\r\n for (const prop of Object.values(terrainSettings)) {\r\n if (undefined !== prop) {\r\n props.terrainSettings = terrainSettings;\r\n break;\r\n }\r\n }\r\n\r\n if (this.planarClipMask.isValid)\r\n props.planarClipMask = this.planarClipMask.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\r\n * the iModel - otherwise, prefer [[toJSON]].\r\n */\r\n public toPersistentJSON(): PersistentBackgroundMapProps {\r\n const props = this.toJSON() as PersistentBackgroundMapProps;\r\n\r\n // Preserve deprecated imagery provider properties.\r\n if (\"BingProvider\" !== this._provider.name)\r\n props.providerName = this._provider.name; // eslint-disable-line deprecation/deprecation\r\n if (BackgroundMapType.Hybrid !== this._provider.type)\r\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line deprecation/deprecation\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\r\n public equalsJSON(json?: BackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromJSON(json));\r\n }\r\n\r\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\r\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\r\n }\r\n\r\n /** Returns true if these settings are equivalent to `other`. */\r\n public equals(other: BackgroundMapSettings): boolean {\r\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\r\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\r\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\r\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\r\n }\r\n\r\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n groundBias: changedProps.groundBias ?? this.groundBias,\r\n transparency: changedProps.transparency ?? this.transparency,\r\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\r\n globeMode: changedProps.globeMode ?? this.globeMode,\r\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\r\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\r\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\r\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\r\n providerName: this._provider.name,\r\n providerData: { mapType: this._provider.type },\r\n };\r\n\r\n return BackgroundMapSettings.fromPersistentJSON(props);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BackgroundMapSettings.js","sourceRoot":"","sources":["../../src/BackgroundMapSettings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mEAAmF;AACnF,qDAA+E;AAC/E,uDAAkE;AAElE;;;;;GAKG;AACH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAoC;IACpC,mDAAa,CAAA;IACb,8BAA8B;IAC9B,2CAAS,CAAA;AACX,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAgED,SAAS,kBAAkB,CAAC,IAAgB;IAC1C,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsB;IACnD,IAAI,QAAQ,KAAK,OAAO,KAAK;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAa,qBAAqB;IAqChC,YAAoB,KAAwD;;QAC1E,IAAI,CAAC,UAAU,GAAG,MAAA,KAAK,CAAC,UAAU,mCAAI,CAAC,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,CAAC,cAAc,GAAG,MAAA,KAAK,CAAC,cAAc,mCAAI,KAAK,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,MAAA,KAAK,CAAC,YAAY,mCAAI,KAAK,CAAC;QAChD,IAAI,CAAC,eAAe,GAAG,iCAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAA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AAI,IAAI,CAAC,SAAS;YACnD,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,CAAC,IAAI,CAAC,UAAU;YAC3D,YAAY,EAAE,MAAA,YAAY,CAAC,YAAY,mCAAI,IAAI,CAAC,YAAY;YAC5D,eAAe,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YACjJ,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC5I,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YACjC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;SAC/C,CAAC;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;CACF;AAvJD,sDAuJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\r\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\r\n\r\n/** Describes the projection of the background map\r\n * @see [[BackgroundMapProps]]\r\n * @see [[DisplayStyleSettingsProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GlobeMode {\r\n /** Display Earth as 3d ellipsoid */\r\n Ellipsoid = 0,\r\n /** Display Earth as plane. */\r\n Plane = 1,\r\n}\r\n\r\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\r\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BackgroundMapProps {\r\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\r\n groundBias?: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\r\n * Default value: false.\r\n */\r\n transparency?: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n useDepthBuffer?: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n applyTerrain?: boolean;\r\n /** Properties associated with terrain display. */\r\n terrainSettings?: TerrainProps;\r\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\r\n globeMode?: GlobeMode;\r\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n nonLocatable?: boolean;\r\n /** A planar mask applied to the map geometry\r\n * @beta\r\n */\r\n planarClipMask?: PlanarClipMaskProps;\r\n\r\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\r\n providerName?: never;\r\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\r\n providerData?: never;\r\n}\r\n\r\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\r\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\r\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DeprecatedBackgroundMapProps {\r\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\r\n * Default value: \"BingProvider\"\r\n * @deprecated in 3.x. use MapImageryProps.backgroundBase.\r\n */\r\n providerName?: string;\r\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\r\n * @deprecated in 3.x. use MapImageryProps.backgroundBase\r\n */\r\n providerData?: {\r\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\r\n mapType?: BackgroundMapType;\r\n };\r\n}\r\n\r\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\r\n * @public\r\n * @extensions\r\n */\r\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\r\n\r\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\r\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\r\n}\r\n\r\nfunction normalizeTransparency(trans?: number | false): number | false {\r\n if (\"number\" === typeof trans)\r\n return Math.min(1, Math.max(0, trans));\r\n\r\n return false;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\r\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\r\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\r\n * @public\r\n */\r\nexport class BackgroundMapSettings {\r\n /** Retained strictly for persistence. */\r\n private readonly _provider: BackgroundMapProvider;\r\n\r\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\r\n public readonly groundBias: number;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\r\n public readonly transparency: number | false;\r\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\r\n public readonly useDepthBuffer: boolean;\r\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\r\n public readonly applyTerrain: boolean;\r\n /** Settings associated with terrain display. */\r\n public readonly terrainSettings: TerrainSettings;\r\n /** Globe display mode. */\r\n public readonly globeMode: GlobeMode;\r\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\r\n * @beta\r\n */\r\n public readonly planarClipMask: PlanarClipMaskSettings;\r\n private readonly _locatable: boolean;\r\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\r\n * allows the user to select elements that are behind the map.\r\n */\r\n public get locatable(): boolean {\r\n // Handle legacy TerrainProps.nonLocatable:\r\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\r\n // - Otherwise, use BackgroundMapProps.nonLocatable.\r\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\r\n return false;\r\n\r\n return this._locatable;\r\n }\r\n\r\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\r\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\r\n\r\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\r\n this.groundBias = props.groundBias ?? 0;\r\n this.transparency = normalizeTransparency(props.transparency);\r\n this.useDepthBuffer = props.useDepthBuffer ?? false;\r\n this.applyTerrain = props.applyTerrain ?? false;\r\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\r\n this.globeMode = normalizeGlobeMode(props.globeMode);\r\n this._locatable = true !== props.nonLocatable;\r\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\r\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\r\n }\r\n\r\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\r\n * the iModel - otherwise, prefer [[fromJSON]].\r\n */\r\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\r\n return new this(json ?? {});\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields.\r\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\r\n */\r\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\r\n return new BackgroundMapSettings(json ?? {});\r\n }\r\n\r\n /** Convert these settings to their in-memory JSON representation.\r\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\r\n */\r\n public toJSON(): BackgroundMapProps {\r\n const props: BackgroundMapProps = {};\r\n if (0 !== this.groundBias)\r\n props.groundBias = this.groundBias;\r\n if (this.applyTerrain)\r\n props.applyTerrain = true;\r\n if (false !== this.transparency)\r\n props.transparency = this.transparency;\r\n if (GlobeMode.Ellipsoid !== this.globeMode)\r\n props.globeMode = this.globeMode;\r\n if (this.useDepthBuffer)\r\n props.useDepthBuffer = true;\r\n if (!this._locatable)\r\n props.nonLocatable = true;\r\n\r\n const terrainSettings = this.terrainSettings.toJSON();\r\n for (const prop of Object.values(terrainSettings)) {\r\n if (undefined !== prop) {\r\n props.terrainSettings = terrainSettings;\r\n break;\r\n }\r\n }\r\n\r\n if (this.planarClipMask.isValid)\r\n props.planarClipMask = this.planarClipMask.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\r\n * the iModel - otherwise, prefer [[toJSON]].\r\n */\r\n public toPersistentJSON(): PersistentBackgroundMapProps {\r\n const props = this.toJSON() as PersistentBackgroundMapProps;\r\n\r\n // Preserve deprecated imagery provider properties.\r\n if (\"BingProvider\" !== this._provider.name)\r\n props.providerName = this._provider.name; // eslint-disable-line deprecation/deprecation\r\n if (BackgroundMapType.Hybrid !== this._provider.type)\r\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line deprecation/deprecation\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\r\n public equalsJSON(json?: BackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromJSON(json));\r\n }\r\n\r\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\r\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\r\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\r\n }\r\n\r\n /** Returns true if these settings are equivalent to `other`. */\r\n public equals(other: BackgroundMapSettings): boolean {\r\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\r\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\r\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\r\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\r\n }\r\n\r\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n groundBias: changedProps.groundBias ?? this.groundBias,\r\n transparency: changedProps.transparency ?? this.transparency,\r\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\r\n globeMode: changedProps.globeMode ?? this.globeMode,\r\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\r\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\r\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\r\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\r\n providerName: this._provider.name,\r\n providerData: { mapType: this._provider.type },\r\n };\r\n\r\n return BackgroundMapSettings.fromPersistentJSON(props);\r\n }\r\n}\r\n"]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  /**
5
5
  * @beta
6
- * @deprecated
6
+ * @deprecated in 3.x.
7
7
  */
8
8
  export declare enum CloudStorageProvider {
9
9
  Azure = 0,
@@ -14,7 +14,7 @@ export declare enum CloudStorageProvider {
14
14
  }
15
15
  /**
16
16
  * @beta
17
- * @deprecated
17
+ * @deprecated in 3.x.
18
18
  */
19
19
  export interface CloudStorageContainerDescriptor {
20
20
  provider?: CloudStorageProvider;
@@ -23,7 +23,7 @@ export interface CloudStorageContainerDescriptor {
23
23
  }
24
24
  /**
25
25
  * @beta
26
- * @deprecated
26
+ * @deprecated in 3.x.
27
27
  */
28
28
  export interface CloudStorageContainerUrl {
29
29
  descriptor: CloudStorageContainerDescriptor;
@@ -36,14 +36,14 @@ export interface CloudStorageContainerUrl {
36
36
  }
37
37
  /**
38
38
  * @beta
39
- * @deprecated
39
+ * @deprecated in 3.x.
40
40
  */
41
41
  export declare namespace CloudStorageContainerUrl {
42
42
  function empty(): CloudStorageContainerUrl;
43
43
  }
44
44
  /**
45
45
  * @beta
46
- * @deprecated
46
+ * @deprecated in 3.x.
47
47
  */
48
48
  export declare abstract class CloudStorageCache<TContentId, TContentType> {
49
49
  private _containers;
@@ -12,7 +12,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
12
12
  /* eslint-disable deprecation/deprecation */
13
13
  /**
14
14
  * @beta
15
- * @deprecated
15
+ * @deprecated in 3.x.
16
16
  */
17
17
  var CloudStorageProvider;
18
18
  (function (CloudStorageProvider) {
@@ -24,7 +24,7 @@ var CloudStorageProvider;
24
24
  })(CloudStorageProvider = exports.CloudStorageProvider || (exports.CloudStorageProvider = {}));
25
25
  /**
26
26
  * @beta
27
- * @deprecated
27
+ * @deprecated in 3.x.
28
28
  */
29
29
  var CloudStorageContainerUrl;
30
30
  (function (CloudStorageContainerUrl) {
@@ -40,7 +40,7 @@ var CloudStorageContainerUrl;
40
40
  })(CloudStorageContainerUrl = exports.CloudStorageContainerUrl || (exports.CloudStorageContainerUrl = {}));
41
41
  /**
42
42
  * @beta
43
- * @deprecated
43
+ * @deprecated in 3.x.
44
44
  */
45
45
  class CloudStorageCache {
46
46
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"CloudStorage.js","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AAEvD,4CAA4C;AAE5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,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,GAAG,IAAI,SAAS,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE;YACpF,SAAS,GAAG,SAAS,CAAC;YACtB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,SAAS,EAAE;YACd,IAAI,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtD,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO,GAAG,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;oBAC9C,IAAI;wBACF,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;wBAClE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;wBACrC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC3C,OAAO,CAAC,SAAS,CAAC,CAAC;qBACpB;oBAAC,OAAO,GAAG,EAAE;wBACZ,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC3C,MAAM,CAAC,GAAG,CAAC,CAAC;qBACb;gBACH,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aAClD;YAED,OAAO,OAAO,CAAC;SAChB;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAtFD,8CAsFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CloudStorage\r\n */\r\n\r\nimport { UnexpectedErrors } from \"@itwin/core-bentley\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport enum CloudStorageProvider {\r\n Azure,\r\n Amazon,\r\n AliCloud,\r\n External,\r\n Unknown,\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport interface CloudStorageContainerDescriptor {\r\n provider?: CloudStorageProvider;\r\n name: string;\r\n resource?: string;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport interface CloudStorageContainerUrl {\r\n descriptor: CloudStorageContainerDescriptor;\r\n valid: number;\r\n expires: number;\r\n url: string;\r\n method?: string;\r\n headers?: Record<string, string>;\r\n bound?: boolean;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport namespace CloudStorageContainerUrl {\r\n export function empty(): CloudStorageContainerUrl {\r\n return {\r\n descriptor: { name: \"\" },\r\n valid: 0,\r\n expires: 0,\r\n url: \"\",\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport abstract class CloudStorageCache<TContentId, TContentType> {\r\n private _containers: Map<string, CloudStorageContainerUrl>;\r\n\r\n public provider: CloudStorageProvider = CloudStorageProvider.Unknown;\r\n public abstract formContainerName(id: TContentId): string;\r\n public abstract formResourceName(id: TContentId): string;\r\n protected formContainerKey(id: TContentId): string { return this.formContainerName(id); }\r\n protected abstract obtainContainerUrl(id: TContentId, descriptor: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl>;\r\n protected abstract instantiateResource(response: Response): Promise<TContentType | undefined>;\r\n protected supplyUrlBase(_container: CloudStorageContainerUrl, _id: TContentId): string | undefined { return undefined; }\r\n\r\n public constructor() {\r\n this._containers = new Map();\r\n }\r\n\r\n public async retrieve(id: TContentId): Promise<TContentType | undefined> {\r\n try {\r\n const container = await this.getContainer(id);\r\n if (!container.url)\r\n return undefined;\r\n\r\n const response = await this.requestResource(container, id);\r\n if (response.ok) {\r\n const content = await this.instantiateResource(response);\r\n return content;\r\n }\r\n } catch (err) {\r\n UnexpectedErrors.handle(err);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n protected async requestResource(container: CloudStorageContainerUrl, id: TContentId): Promise<Response> {\r\n const base = this.supplyUrlBase(container, id);\r\n const url = (undefined === base || \"\" === base) ? new URL(container.url) : new URL(container.url, base);\r\n\r\n if (!container.bound) {\r\n url.pathname += `/${this.formResourceName(id)}`;\r\n }\r\n\r\n const init: RequestInit = {\r\n headers: container.headers,\r\n method: \"GET\",\r\n };\r\n\r\n return fetch(url.toString(), init);\r\n }\r\n\r\n private _pendingContainerRequests: Map<string, Promise<CloudStorageContainerUrl>> = new Map();\r\n\r\n protected async getContainer(id: TContentId): Promise<CloudStorageContainerUrl> {\r\n const now = new Date().getTime();\r\n const name = this.formContainerName(id);\r\n const resource = this.formResourceName(id);\r\n const key = this.formContainerKey(id);\r\n\r\n let container = this._containers.get(key);\r\n if (container && container.url && (container.valid > now || container.expires < now)) {\r\n container = undefined;\r\n this._containers.delete(key);\r\n }\r\n\r\n if (!container) {\r\n let request = this._pendingContainerRequests.get(key);\r\n if (!request) {\r\n request = new Promise(async (resolve, reject) => {\r\n try {\r\n container = await this.obtainContainerUrl(id, { name, resource });\r\n this._containers.set(key, container);\r\n this._pendingContainerRequests.delete(key);\r\n resolve(container);\r\n } catch (err) {\r\n this._pendingContainerRequests.delete(key);\r\n reject(err);\r\n }\r\n });\r\n\r\n this._pendingContainerRequests.set(key, request);\r\n }\r\n\r\n return request;\r\n }\r\n\r\n return container;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CloudStorage.js","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AAEvD,4CAA4C;AAE5C;;;GAGG;AACH,IAAY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AAC;QAC1C,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,GAAG,IAAI,SAAS,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE;YACpF,SAAS,GAAG,SAAS,CAAC;YACtB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,SAAS,EAAE;YACd,IAAI,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtD,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO,GAAG,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;oBAC9C,IAAI;wBACF,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;wBAClE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;wBACrC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC3C,OAAO,CAAC,SAAS,CAAC,CAAC;qBACpB;oBAAC,OAAO,GAAG,EAAE;wBACZ,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC3C,MAAM,CAAC,GAAG,CAAC,CAAC;qBACb;gBACH,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aAClD;YAED,OAAO,OAAO,CAAC;SAChB;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAtFD,8CAsFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CloudStorage\r\n */\r\n\r\nimport { UnexpectedErrors } from \"@itwin/core-bentley\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x.\r\n */\r\nexport enum CloudStorageProvider {\r\n Azure,\r\n Amazon,\r\n AliCloud,\r\n External,\r\n Unknown,\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x.\r\n */\r\nexport interface CloudStorageContainerDescriptor {\r\n provider?: CloudStorageProvider;\r\n name: string;\r\n resource?: string;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x.\r\n */\r\nexport interface CloudStorageContainerUrl {\r\n descriptor: CloudStorageContainerDescriptor;\r\n valid: number;\r\n expires: number;\r\n url: string;\r\n method?: string;\r\n headers?: Record<string, string>;\r\n bound?: boolean;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x.\r\n */\r\nexport namespace CloudStorageContainerUrl {\r\n export function empty(): CloudStorageContainerUrl {\r\n return {\r\n descriptor: { name: \"\" },\r\n valid: 0,\r\n expires: 0,\r\n url: \"\",\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x.\r\n */\r\nexport abstract class CloudStorageCache<TContentId, TContentType> {\r\n private _containers: Map<string, CloudStorageContainerUrl>;\r\n\r\n public provider: CloudStorageProvider = CloudStorageProvider.Unknown;\r\n public abstract formContainerName(id: TContentId): string;\r\n public abstract formResourceName(id: TContentId): string;\r\n protected formContainerKey(id: TContentId): string { return this.formContainerName(id); }\r\n protected abstract obtainContainerUrl(id: TContentId, descriptor: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl>;\r\n protected abstract instantiateResource(response: Response): Promise<TContentType | undefined>;\r\n protected supplyUrlBase(_container: CloudStorageContainerUrl, _id: TContentId): string | undefined { return undefined; }\r\n\r\n public constructor() {\r\n this._containers = new Map();\r\n }\r\n\r\n public async retrieve(id: TContentId): Promise<TContentType | undefined> {\r\n try {\r\n const container = await this.getContainer(id);\r\n if (!container.url)\r\n return undefined;\r\n\r\n const response = await this.requestResource(container, id);\r\n if (response.ok) {\r\n const content = await this.instantiateResource(response);\r\n return content;\r\n }\r\n } catch (err) {\r\n UnexpectedErrors.handle(err);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n protected async requestResource(container: CloudStorageContainerUrl, id: TContentId): Promise<Response> {\r\n const base = this.supplyUrlBase(container, id);\r\n const url = (undefined === base || \"\" === base) ? new URL(container.url) : new URL(container.url, base);\r\n\r\n if (!container.bound) {\r\n url.pathname += `/${this.formResourceName(id)}`;\r\n }\r\n\r\n const init: RequestInit = {\r\n headers: container.headers,\r\n method: \"GET\",\r\n };\r\n\r\n return fetch(url.toString(), init);\r\n }\r\n\r\n private _pendingContainerRequests: Map<string, Promise<CloudStorageContainerUrl>> = new Map();\r\n\r\n protected async getContainer(id: TContentId): Promise<CloudStorageContainerUrl> {\r\n const now = new Date().getTime();\r\n const name = this.formContainerName(id);\r\n const resource = this.formResourceName(id);\r\n const key = this.formContainerKey(id);\r\n\r\n let container = this._containers.get(key);\r\n if (container && container.url && (container.valid > now || container.expires < now)) {\r\n container = undefined;\r\n this._containers.delete(key);\r\n }\r\n\r\n if (!container) {\r\n let request = this._pendingContainerRequests.get(key);\r\n if (!request) {\r\n request = new Promise(async (resolve, reject) => {\r\n try {\r\n container = await this.obtainContainerUrl(id, { name, resource });\r\n this._containers.set(key, container);\r\n this._pendingContainerRequests.delete(key);\r\n resolve(container);\r\n } catch (err) {\r\n this._pendingContainerRequests.delete(key);\r\n reject(err);\r\n }\r\n });\r\n\r\n this._pendingContainerRequests.set(key, request);\r\n }\r\n\r\n return request;\r\n }\r\n\r\n return container;\r\n }\r\n}\r\n"]}
@@ -12,7 +12,7 @@ export interface TileContentIdentifier {
12
12
  }
13
13
  /**
14
14
  * @beta
15
- * @deprecated
15
+ * @deprecated in 3.x.
16
16
  */
17
17
  export declare class CloudStorageTileCache extends CloudStorageCache<TileContentIdentifier, Uint8Array> {
18
18
  private static _instance;
@@ -13,7 +13,7 @@ const CloudStorage_1 = require("./CloudStorage");
13
13
  const IModelTileRpcInterface_1 = require("./rpc/IModelTileRpcInterface");
14
14
  /**
15
15
  * @beta
16
- * @deprecated
16
+ * @deprecated in 3.x.
17
17
  */
18
18
  class CloudStorageTileCache extends CloudStorage_1.CloudStorageCache {
19
19
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"CloudStorageTileCache.js","sourceRoot":"","sources":["../../src/CloudStorageTileCache.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA4C;AAE5C,iDAAoI;AAEpI,yEAAsE;AAUtE;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,gCAAoD;IA0B7F;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAzBM,MAAM,CAAC,QAAQ;QACpB,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE;YACpC,qBAAqB,CAAC,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;SAC/D;QAED,OAAO,qBAAqB,CAAC,SAAS,CAAC;IACzC,CAAC;IAEM,2BAA2B,CAAC,GAAoC;QACrE,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAE1B,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,WAAW;QAClC,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QAE5C,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACtB,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACtB,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAE5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAMS,KAAK,CAAC,kBAAkB,CAAC,EAAyB,EAAE,UAA2C;QACvG,MAAM,MAAM,GAAG,+CAAsB,CAAC,SAAS,EAAE,CAAC;QAClD,OAAO,MAAM,CAAC,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;IAES,KAAK,CAAC,mBAAmB,CAAC,QAAkB;QACpD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAEM,iBAAiB,CAAC,EAAyB;QAChD,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACrC,CAAC;IAEM,gBAAgB,CAAC,EAAyB;;QAC/C,MAAM,WAAW,GAAG,CAAA,MAAA,EAAE,CAAC,UAAU,CAAC,SAAS,0CAAE,EAAE,KAAI,OAAO,CAAC;QAC3D,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,oEAAoE;QACrH,OAAO,SAAS,EAAE,CAAC,MAAM,IAAI,OAAO,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;IACzD,CAAC;IAEkB,gBAAgB,CAAC,EAAyB;QAC3D,IAAI,IAAI,CAAC,QAAQ,KAAK,mCAAoB,CAAC,QAAQ,EAAE;YACnD,OAAO,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;SAC/D;QAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;CACF;AA7DD,sDA6DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CloudStorage\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nimport { CloudStorageCache, CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from \"./CloudStorage\";\r\nimport { IModelRpcProps } from \"./IModel\";\r\nimport { IModelTileRpcInterface } from \"./rpc/IModelTileRpcInterface\";\r\n\r\n/** @beta */\r\nexport interface TileContentIdentifier {\r\n tokenProps: IModelRpcProps;\r\n treeId: string;\r\n contentId: string;\r\n guid: string | undefined;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport class CloudStorageTileCache extends CloudStorageCache<TileContentIdentifier, Uint8Array> {\r\n private static _instance: CloudStorageTileCache;\r\n\r\n public static getCache(): CloudStorageTileCache {\r\n if (!CloudStorageTileCache._instance) {\r\n CloudStorageTileCache._instance = new CloudStorageTileCache();\r\n }\r\n\r\n return CloudStorageTileCache._instance;\r\n }\r\n\r\n public supplyExpiryForContainerUrl(_id: CloudStorageContainerDescriptor): Date {\r\n const expiry = new Date();\r\n\r\n const today = new Date().getDay();\r\n const rolloverDay = 6; // saturday\r\n expiry.setHours((rolloverDay - today) * 24);\r\n\r\n expiry.setHours(23);\r\n expiry.setMinutes(59);\r\n expiry.setSeconds(59);\r\n expiry.setMilliseconds(999);\r\n\r\n return expiry;\r\n }\r\n\r\n protected constructor() {\r\n super();\r\n }\r\n\r\n protected async obtainContainerUrl(id: TileContentIdentifier, descriptor: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl> {\r\n const client = IModelTileRpcInterface.getClient();\r\n return client.getTileCacheContainerUrl(id.tokenProps, descriptor);\r\n }\r\n\r\n protected async instantiateResource(response: Response): Promise<Uint8Array | undefined> {\r\n const data = await response.arrayBuffer();\r\n if (!data.byteLength) {\r\n return undefined;\r\n }\r\n\r\n return new Uint8Array(data);\r\n }\r\n\r\n public formContainerName(id: TileContentIdentifier): string {\r\n return `${id.tokenProps.iModelId}`;\r\n }\r\n\r\n public formResourceName(id: TileContentIdentifier): string {\r\n const changesetId = id.tokenProps.changeset?.id || \"first\";\r\n const version = id.guid ? id.guid : changesetId; // NB: id.guid can be null (backend) OR undefined (frontend) here...\r\n return `tiles/${id.treeId}/${version}/${id.contentId}`;\r\n }\r\n\r\n protected override formContainerKey(id: TileContentIdentifier): string {\r\n if (this.provider === CloudStorageProvider.AliCloud) {\r\n return this.formContainerName(id) + this.formResourceName(id);\r\n }\r\n\r\n return super.formContainerKey(id);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CloudStorageTileCache.js","sourceRoot":"","sources":["../../src/CloudStorageTileCache.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA4C;AAE5C,iDAAoI;AAEpI,yEAAsE;AAUtE;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,gCAAoD;IA0B7F;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAzBM,MAAM,CAAC,QAAQ;QACpB,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE;YACpC,qBAAqB,CAAC,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;SAC/D;QAED,OAAO,qBAAqB,CAAC,SAAS,CAAC;IACzC,CAAC;IAEM,2BAA2B,CAAC,GAAoC;QACrE,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAE1B,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,WAAW;QAClC,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QAE5C,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACtB,MAAM,CAAC,UAAU,CA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EAAE,CAAC,CAAC;IACpC,CAAC;CACF;AA7DD,sDA6DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CloudStorage\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nimport { CloudStorageCache, CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from \"./CloudStorage\";\r\nimport { IModelRpcProps } from \"./IModel\";\r\nimport { IModelTileRpcInterface } from \"./rpc/IModelTileRpcInterface\";\r\n\r\n/** @beta */\r\nexport interface TileContentIdentifier {\r\n tokenProps: IModelRpcProps;\r\n treeId: string;\r\n contentId: string;\r\n guid: string | undefined;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x.\r\n */\r\nexport class CloudStorageTileCache extends CloudStorageCache<TileContentIdentifier, Uint8Array> {\r\n private static _instance: CloudStorageTileCache;\r\n\r\n public static getCache(): CloudStorageTileCache {\r\n if (!CloudStorageTileCache._instance) {\r\n CloudStorageTileCache._instance = new CloudStorageTileCache();\r\n }\r\n\r\n return CloudStorageTileCache._instance;\r\n }\r\n\r\n public supplyExpiryForContainerUrl(_id: CloudStorageContainerDescriptor): Date {\r\n const expiry = new Date();\r\n\r\n const today = new Date().getDay();\r\n const rolloverDay = 6; // saturday\r\n expiry.setHours((rolloverDay - today) * 24);\r\n\r\n expiry.setHours(23);\r\n expiry.setMinutes(59);\r\n expiry.setSeconds(59);\r\n expiry.setMilliseconds(999);\r\n\r\n return expiry;\r\n }\r\n\r\n protected constructor() {\r\n super();\r\n }\r\n\r\n protected async obtainContainerUrl(id: TileContentIdentifier, descriptor: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl> {\r\n const client = IModelTileRpcInterface.getClient();\r\n return client.getTileCacheContainerUrl(id.tokenProps, descriptor);\r\n }\r\n\r\n protected async instantiateResource(response: Response): Promise<Uint8Array | undefined> {\r\n const data = await response.arrayBuffer();\r\n if (!data.byteLength) {\r\n return undefined;\r\n }\r\n\r\n return new Uint8Array(data);\r\n }\r\n\r\n public formContainerName(id: TileContentIdentifier): string {\r\n return `${id.tokenProps.iModelId}`;\r\n }\r\n\r\n public formResourceName(id: TileContentIdentifier): string {\r\n const changesetId = id.tokenProps.changeset?.id || \"first\";\r\n const version = id.guid ? id.guid : changesetId; // NB: id.guid can be null (backend) OR undefined (frontend) here...\r\n return `tiles/${id.treeId}/${version}/${id.contentId}`;\r\n }\r\n\r\n protected override formContainerKey(id: TileContentIdentifier): string {\r\n if (this.provider === CloudStorageProvider.AliCloud) {\r\n return this.formContainerName(id) + this.formResourceName(id);\r\n }\r\n\r\n return super.formContainerKey(id);\r\n }\r\n}\r\n"]}
package/lib/cjs/Code.d.ts CHANGED
@@ -199,16 +199,37 @@ export declare namespace CodeScopeSpec {
199
199
  /** The Code value must be unique among other elements also scoped by the same element */
200
200
  RelatedElement = 4
201
201
  }
202
- /** Requirements for how the CodeScope Element is identified.
202
+ /**
203
+ * Requirements for how the CodeScope Element is identified.
203
204
  * @public
204
205
  */
205
206
  enum ScopeRequirement {
206
- /** The Code is required to have a valid ElementId as its scope */
207
+ /** The ElementId of CodeScope element identifies its scope. Used for Codes that are unique only within a single iModel. */
207
208
  ElementId = 1,
208
- /** The Code is required to have a valid FederationGuid as its scope */
209
+ /** The FederationGuid of the CodeScope element identifies its scope. Used for Codes that are globally unique. */
209
210
  FederationGuid = 2
210
211
  }
211
212
  }
213
+ /**
214
+ * The JSON properties of a CodeSpec
215
+ * @public
216
+ */
217
+ export interface CodeSpecProperties {
218
+ scopeSpec: {
219
+ /** the type of CodeSpec */
220
+ type: CodeScopeSpec.Type;
221
+ /** If true, the federationGuid of the scope element identifies the scope, for Codes that are globally unique.
222
+ * Otherwise, the ElementId of the scopeElement is used, for Codes that are scoped only within a single iModel.
223
+ */
224
+ fGuidRequired?: boolean;
225
+ /** The relationship className (in the form "schema:class"), when `type` is `CodeScopeSpec.Type.RelatedElement` */
226
+ relationship?: string;
227
+ };
228
+ spec?: {
229
+ isManagedWithDgnDb?: boolean;
230
+ };
231
+ version?: string;
232
+ }
212
233
  /** A [Code Specification]($docs/bis/guide/references/glossary#codespec) captures the rules for encoding and decoding significant business information into
213
234
  * and from a Code (string). This specification is used to generate and validate Codes.
214
235
  *
@@ -224,12 +245,10 @@ export declare class CodeSpec {
224
245
  /** The name of this CodeSpec. */
225
246
  name: string;
226
247
  /** The JSON properties for this CodeSpec.
227
- * > Note: Use the getters and setters instead of accessing this directly.
248
+ * @note Use the getters and setters instead of accessing this directly.
228
249
  * @internal
229
250
  */
230
- properties: any;
231
- /** Internal-only constructor. Proper use is to supply `properties` only or `scopeType` and `scopeReq` but not `properties`.
232
- */
251
+ properties: CodeSpecProperties;
233
252
  private constructor();
234
253
  /** Create a new CodeSpec from the specified parameters
235
254
  * > Note: CodeSpec.id will not be valid until inserted
@@ -239,17 +258,19 @@ export declare class CodeSpec {
239
258
  /** Create a new CodeSpec directly from JSON. Used internally by the CodeSpecs.load function.
240
259
  * @internal
241
260
  */
242
- static createFromJson(iModel: IModel, id: Id64String, name: string, properties: any): CodeSpec;
261
+ static createFromJson(iModel: IModel, id: Id64String, name: string, properties?: CodeSpecProperties): CodeSpec;
243
262
  /** Will be true if the id of this CodeSpec is valid. */
244
263
  get isValid(): boolean;
245
264
  /** The scope type of this CodeSpec. */
246
265
  get scopeType(): CodeScopeSpec.Type;
247
266
  set scopeType(scopeType: CodeScopeSpec.Type);
248
- /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or `CodeScopeSpec.ScopeRequirement.ElementId` otherwise (which is the default). */
267
+ /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or
268
+ * CodeScopeSpec.ScopeRequirement.ElementId` otherwise (the default).
269
+ */
249
270
  get scopeReq(): CodeScopeSpec.ScopeRequirement;
250
271
  set scopeReq(req: CodeScopeSpec.ScopeRequirement);
251
272
  /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.
252
- * @beta
273
+ * @deprecated in 3.6 Use scopeReq instead.
253
274
  */
254
275
  get isManagedWithIModel(): boolean;
255
276
  set isManagedWithIModel(value: boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/Code.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAQ,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;GAKG;AACH,oBAAY,cAAc,GAAG,UAAU,GAAG,UAAU,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,mGAAmG;IACnG,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1B,uGAAuG;IACvG,KAAK,EAAE,cAAc,CAAC;IACtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,qBAAa,IAAK,YAAW,SAAS;IACpC,8FAA8F;IACvF,IAAI,EAAE,UAAU,CAAC;IACxB,+FAA+F;IACxF,KAAK,EAAE,UAAU,CAAC;IACzB;;OAEG;IACH,IAAW,KAAK,IACM,MAAM,CADoB;IAChD,IAAW,KAAK,CAAC,GAAG,EAAE,MAAM,EAAgC;IAC5D,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,SAAS,EAAE,SAAS;IAMhC,gEAAgE;WAClD,WAAW,IAAI,IAAI;WAKnB,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IACjC,MAAM,IAAI,SAAS;IACnB,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;IACnC,gBAAgB;WACF,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,GAAG,OA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S,IAAI,aAAa,CAAC,IAAI,CAA2C;IACrF,IAAW,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,EAAiD;IAEnG;;OAEG;IACH,IAAW,QAAQ,IAAI,aAAa,CAAC,gBAAgB,CAEpD;IACD,IAAW,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC,gBAAgB,EAKtD;IAED;;OAEG;IACH,IAAW,mBAAmB,IAAI,OAAO,CAExC;IACD,IAAW,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAK5C;CACF"}
package/lib/cjs/Code.js CHANGED
@@ -194,14 +194,15 @@ var CodeScopeSpec;
194
194
  /** The Code value must be unique among other elements also scoped by the same element */
195
195
  Type[Type["RelatedElement"] = 4] = "RelatedElement";
196
196
  })(Type = CodeScopeSpec.Type || (CodeScopeSpec.Type = {}));
197
- /** Requirements for how the CodeScope Element is identified.
197
+ /**
198
+ * Requirements for how the CodeScope Element is identified.
198
199
  * @public
199
200
  */
200
201
  let ScopeRequirement;
201
202
  (function (ScopeRequirement) {
202
- /** The Code is required to have a valid ElementId as its scope */
203
+ /** The ElementId of CodeScope element identifies its scope. Used for Codes that are unique only within a single iModel. */
203
204
  ScopeRequirement[ScopeRequirement["ElementId"] = 1] = "ElementId";
204
- /** The Code is required to have a valid FederationGuid as its scope */
205
+ /** The FederationGuid of the CodeScope element identifies its scope. Used for Codes that are globally unique. */
205
206
  ScopeRequirement[ScopeRequirement["FederationGuid"] = 2] = "FederationGuid";
206
207
  })(ScopeRequirement = CodeScopeSpec.ScopeRequirement || (CodeScopeSpec.ScopeRequirement = {}));
207
208
  })(CodeScopeSpec = exports.CodeScopeSpec || (exports.CodeScopeSpec = {}));
@@ -213,47 +214,36 @@ var CodeScopeSpec;
213
214
  * @public
214
215
  */
215
216
  class CodeSpec {
216
- /** Internal-only constructor. Proper use is to supply `properties` only or `scopeType` and `scopeReq` but not `properties`.
217
- */
218
- constructor(iModel, id, name, scopeType, scopeReq, properties) {
217
+ constructor(iModel, id, name, properties) {
219
218
  this.iModel = iModel;
220
219
  this.id = id;
221
220
  this.name = name;
222
- if (properties) {
223
- this.properties = properties;
224
- if (!this.properties.scopeSpec) {
225
- this.properties.scopeSpec = {};
226
- this.scopeType = CodeScopeSpec.Type.Repository;
227
- }
228
- }
229
- else {
230
- this.properties = { scopeSpec: {} };
231
- this.scopeType = CodeScopeSpec.Type.Repository;
232
- }
233
- if (undefined !== scopeType)
234
- this.scopeType = scopeType;
235
- if (undefined !== scopeReq)
236
- this.scopeReq = scopeReq;
221
+ this.properties = properties !== null && properties !== void 0 ? properties : { scopeSpec: { type: CodeScopeSpec.Type.Repository } };
237
222
  }
238
223
  /** Create a new CodeSpec from the specified parameters
239
224
  * > Note: CodeSpec.id will not be valid until inserted
240
225
  * @see [CodeSpecs.insert]($backend)
241
226
  */
242
227
  static create(iModel, name, scopeType, scopeReq) {
243
- return new CodeSpec(iModel, core_bentley_1.Id64.invalid, name, scopeType, scopeReq, undefined);
228
+ const props = { scopeSpec: { type: scopeType } };
229
+ if (scopeReq)
230
+ props.scopeSpec.fGuidRequired = scopeReq === CodeScopeSpec.ScopeRequirement.FederationGuid;
231
+ return new CodeSpec(iModel, core_bentley_1.Id64.invalid, name, props);
244
232
  }
245
233
  /** Create a new CodeSpec directly from JSON. Used internally by the CodeSpecs.load function.
246
234
  * @internal
247
235
  */
248
236
  static createFromJson(iModel, id, name, properties) {
249
- return new CodeSpec(iModel, id, name, undefined, undefined, properties); // eslint-disable-line deprecation/deprecation
237
+ return new CodeSpec(iModel, id, name, properties);
250
238
  }
251
239
  /** Will be true if the id of this CodeSpec is valid. */
252
240
  get isValid() { return core_bentley_1.Id64.isValid(this.id); }
253
241
  /** The scope type of this CodeSpec. */
254
242
  get scopeType() { return this.properties.scopeSpec.type; }
255
243
  set scopeType(scopeType) { this.properties.scopeSpec.type = scopeType; }
256
- /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or `CodeScopeSpec.ScopeRequirement.ElementId` otherwise (which is the default). */
244
+ /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or
245
+ * CodeScopeSpec.ScopeRequirement.ElementId` otherwise (the default).
246
+ */
257
247
  get scopeReq() {
258
248
  return this.properties.scopeSpec.fGuidRequired ? CodeScopeSpec.ScopeRequirement.FederationGuid : CodeScopeSpec.ScopeRequirement.ElementId;
259
249
  }
@@ -264,13 +254,11 @@ class CodeSpec {
264
254
  this.properties.scopeSpec.fGuidRequired = undefined;
265
255
  }
266
256
  /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.
267
- * @beta
257
+ * @deprecated in 3.6 Use scopeReq instead.
268
258
  */
269
259
  get isManagedWithIModel() {
270
- if (this.properties.spec && this.properties.spec.isManagedWithDgnDb !== undefined) {
271
- return this.properties.spec.isManagedWithDgnDb;
272
- }
273
- return true;
260
+ var _a, _b;
261
+ return (_b = (_a = this.properties.spec) === null || _a === void 0 ? void 0 : _a.isManagedWithDgnDb) !== null && _b !== void 0 ? _b : true;
274
262
  }
275
263
  set isManagedWithIModel(value) {
276
264
  if (!this.properties.spec)