@itwin/core-common 3.2.0-dev.7 → 3.2.0-dev.70

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 (632) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/lib/cjs/AnalysisStyle.d.ts +3 -0
  3. package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
  4. package/lib/cjs/AnalysisStyle.js.map +1 -1
  5. package/lib/cjs/BackgroundMapProvider.d.ts +6 -0
  6. package/lib/cjs/BackgroundMapProvider.d.ts.map +1 -1
  7. package/lib/cjs/BackgroundMapProvider.js +10 -0
  8. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  9. package/lib/cjs/BackgroundMapSettings.d.ts +4 -0
  10. package/lib/cjs/BackgroundMapSettings.d.ts.map +1 -1
  11. package/lib/cjs/BackgroundMapSettings.js +1 -0
  12. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  13. package/lib/cjs/Base64EncodedString.d.ts +1 -0
  14. package/lib/cjs/Base64EncodedString.d.ts.map +1 -1
  15. package/lib/cjs/Base64EncodedString.js.map +1 -1
  16. package/lib/cjs/BriefcaseTypes.d.ts +5 -0
  17. package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
  18. package/lib/cjs/BriefcaseTypes.js +2 -0
  19. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  20. package/lib/cjs/Camera.d.ts +1 -0
  21. package/lib/cjs/Camera.d.ts.map +1 -1
  22. package/lib/cjs/Camera.js.map +1 -1
  23. package/lib/cjs/ChangedElements.d.ts +2 -0
  24. package/lib/cjs/ChangedElements.d.ts.map +1 -1
  25. package/lib/cjs/ChangedElements.js +1 -0
  26. package/lib/cjs/ChangedElements.js.map +1 -1
  27. package/lib/cjs/ChangedEntities.d.ts +3 -0
  28. package/lib/cjs/ChangedEntities.d.ts.map +1 -1
  29. package/lib/cjs/ChangedEntities.js.map +1 -1
  30. package/lib/cjs/ChangesetProps.d.ts +9 -1
  31. package/lib/cjs/ChangesetProps.d.ts.map +1 -1
  32. package/lib/cjs/ChangesetProps.js +3 -1
  33. package/lib/cjs/ChangesetProps.js.map +1 -1
  34. package/lib/cjs/ClipStyle.d.ts +2 -0
  35. package/lib/cjs/ClipStyle.d.ts.map +1 -1
  36. package/lib/cjs/ClipStyle.js.map +1 -1
  37. package/lib/cjs/CloudStorage.d.ts.map +1 -1
  38. package/lib/cjs/CloudStorage.js +14 -20
  39. package/lib/cjs/CloudStorage.js.map +1 -1
  40. package/lib/cjs/Code.d.ts +3 -0
  41. package/lib/cjs/Code.d.ts.map +1 -1
  42. package/lib/cjs/Code.js +1 -0
  43. package/lib/cjs/Code.js.map +1 -1
  44. package/lib/cjs/ColorByName.d.ts +153 -152
  45. package/lib/cjs/ColorByName.d.ts.map +1 -1
  46. package/lib/cjs/ColorByName.js +153 -153
  47. package/lib/cjs/ColorByName.js.map +1 -1
  48. package/lib/cjs/ColorDef.d.ts +55 -46
  49. package/lib/cjs/ColorDef.d.ts.map +1 -1
  50. package/lib/cjs/ColorDef.js +49 -31
  51. package/lib/cjs/ColorDef.js.map +1 -1
  52. package/lib/cjs/CommonLoggerCategory.d.ts +1 -0
  53. package/lib/cjs/CommonLoggerCategory.d.ts.map +1 -1
  54. package/lib/cjs/CommonLoggerCategory.js +1 -0
  55. package/lib/cjs/CommonLoggerCategory.js.map +1 -1
  56. package/lib/cjs/ConcurrentQuery.d.ts +6 -1
  57. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  58. package/lib/cjs/ConcurrentQuery.js +1 -0
  59. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  60. package/lib/cjs/ContextRealityModel.d.ts +2 -0
  61. package/lib/cjs/ContextRealityModel.d.ts.map +1 -1
  62. package/lib/cjs/ContextRealityModel.js.map +1 -1
  63. package/lib/cjs/DisplayStyleSettings.d.ts +10 -0
  64. package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
  65. package/lib/cjs/DisplayStyleSettings.js +1 -0
  66. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  67. package/lib/cjs/ECSqlTypes.d.ts +6 -0
  68. package/lib/cjs/ECSqlTypes.d.ts.map +1 -1
  69. package/lib/cjs/ECSqlTypes.js +4 -0
  70. package/lib/cjs/ECSqlTypes.js.map +1 -1
  71. package/lib/cjs/ElementProps.d.ts +37 -1
  72. package/lib/cjs/ElementProps.d.ts.map +1 -1
  73. package/lib/cjs/ElementProps.js +2 -0
  74. package/lib/cjs/ElementProps.js.map +1 -1
  75. package/lib/cjs/EmphasizeElementsProps.d.ts +3 -0
  76. package/lib/cjs/EmphasizeElementsProps.d.ts.map +1 -1
  77. package/lib/cjs/EmphasizeElementsProps.js +1 -0
  78. package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
  79. package/lib/cjs/EntityProps.d.ts +4 -0
  80. package/lib/cjs/EntityProps.d.ts.map +1 -1
  81. package/lib/cjs/EntityProps.js.map +1 -1
  82. package/lib/cjs/Environment.d.ts +1 -0
  83. package/lib/cjs/Environment.d.ts.map +1 -1
  84. package/lib/cjs/Environment.js.map +1 -1
  85. package/lib/cjs/FeatureSymbology.d.ts +3 -0
  86. package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
  87. package/lib/cjs/FeatureSymbology.js.map +1 -1
  88. package/lib/cjs/FeatureTable.d.ts +1 -0
  89. package/lib/cjs/FeatureTable.d.ts.map +1 -1
  90. package/lib/cjs/FeatureTable.js +1 -0
  91. package/lib/cjs/FeatureTable.js.map +1 -1
  92. package/lib/cjs/Fonts.d.ts +3 -0
  93. package/lib/cjs/Fonts.d.ts.map +1 -1
  94. package/lib/cjs/Fonts.js +1 -0
  95. package/lib/cjs/Fonts.js.map +1 -1
  96. package/lib/cjs/Frustum.d.ts +1 -0
  97. package/lib/cjs/Frustum.d.ts.map +1 -1
  98. package/lib/cjs/Frustum.js +1 -0
  99. package/lib/cjs/Frustum.js.map +1 -1
  100. package/lib/cjs/GeoCoordinateServices.d.ts +1 -0
  101. package/lib/cjs/GeoCoordinateServices.d.ts.map +1 -1
  102. package/lib/cjs/GeoCoordinateServices.js +1 -0
  103. package/lib/cjs/GeoCoordinateServices.js.map +1 -1
  104. package/lib/cjs/GeometryContainment.d.ts +2 -0
  105. package/lib/cjs/GeometryContainment.d.ts.map +1 -1
  106. package/lib/cjs/GeometryContainment.js.map +1 -1
  107. package/lib/cjs/GeometryParams.d.ts +3 -0
  108. package/lib/cjs/GeometryParams.d.ts.map +1 -1
  109. package/lib/cjs/GeometryParams.js +3 -0
  110. package/lib/cjs/GeometryParams.js.map +1 -1
  111. package/lib/cjs/GeometrySummary.d.ts +3 -0
  112. package/lib/cjs/GeometrySummary.d.ts.map +1 -1
  113. package/lib/cjs/GeometrySummary.js +1 -0
  114. package/lib/cjs/GeometrySummary.js.map +1 -1
  115. package/lib/cjs/GraphicParams.d.ts +1 -0
  116. package/lib/cjs/GraphicParams.d.ts.map +1 -1
  117. package/lib/cjs/GraphicParams.js +1 -0
  118. package/lib/cjs/GraphicParams.js.map +1 -1
  119. package/lib/cjs/GroundPlane.d.ts +1 -0
  120. package/lib/cjs/GroundPlane.d.ts.map +1 -1
  121. package/lib/cjs/GroundPlane.js.map +1 -1
  122. package/lib/cjs/HSVColor.d.ts +4 -1
  123. package/lib/cjs/HSVColor.d.ts.map +1 -1
  124. package/lib/cjs/HSVColor.js +4 -1
  125. package/lib/cjs/HSVColor.js.map +1 -1
  126. package/lib/cjs/IModel.d.ts +6 -1
  127. package/lib/cjs/IModel.d.ts.map +1 -1
  128. package/lib/cjs/IModel.js.map +1 -1
  129. package/lib/cjs/Image.d.ts +2 -0
  130. package/lib/cjs/Image.d.ts.map +1 -1
  131. package/lib/cjs/Image.js +2 -0
  132. package/lib/cjs/Image.js.map +1 -1
  133. package/lib/cjs/IpcAppProps.d.ts +1 -0
  134. package/lib/cjs/IpcAppProps.d.ts.map +1 -1
  135. package/lib/cjs/IpcAppProps.js.map +1 -1
  136. package/lib/cjs/LightSettings.d.ts +5 -0
  137. package/lib/cjs/LightSettings.d.ts.map +1 -1
  138. package/lib/cjs/LightSettings.js.map +1 -1
  139. package/lib/cjs/LinePixels.d.ts +1 -0
  140. package/lib/cjs/LinePixels.d.ts.map +1 -1
  141. package/lib/cjs/LinePixels.js +1 -0
  142. package/lib/cjs/LinePixels.js.map +1 -1
  143. package/lib/cjs/Localization.d.ts +1 -0
  144. package/lib/cjs/Localization.d.ts.map +1 -1
  145. package/lib/cjs/Localization.js.map +1 -1
  146. package/lib/cjs/MassProperties.d.ts +27 -1
  147. package/lib/cjs/MassProperties.d.ts.map +1 -1
  148. package/lib/cjs/MassProperties.js +1 -0
  149. package/lib/cjs/MassProperties.js.map +1 -1
  150. package/lib/cjs/MaterialProps.d.ts +6 -0
  151. package/lib/cjs/MaterialProps.d.ts.map +1 -1
  152. package/lib/cjs/MaterialProps.js +1 -0
  153. package/lib/cjs/MaterialProps.js.map +1 -1
  154. package/lib/cjs/ModelClipGroup.d.ts +1 -0
  155. package/lib/cjs/ModelClipGroup.d.ts.map +1 -1
  156. package/lib/cjs/ModelClipGroup.js.map +1 -1
  157. package/lib/cjs/ModelGeometryChanges.d.ts +9 -1
  158. package/lib/cjs/ModelGeometryChanges.d.ts.map +1 -1
  159. package/lib/cjs/ModelGeometryChanges.js.map +1 -1
  160. package/lib/cjs/ModelProps.d.ts +6 -0
  161. package/lib/cjs/ModelProps.d.ts.map +1 -1
  162. package/lib/cjs/ModelProps.js.map +1 -1
  163. package/lib/cjs/PlanProjectionSettings.d.ts +1 -0
  164. package/lib/cjs/PlanProjectionSettings.d.ts.map +1 -1
  165. package/lib/cjs/PlanProjectionSettings.js.map +1 -1
  166. package/lib/cjs/PlanarClipMask.d.ts +3 -0
  167. package/lib/cjs/PlanarClipMask.d.ts.map +1 -1
  168. package/lib/cjs/PlanarClipMask.js +2 -0
  169. package/lib/cjs/PlanarClipMask.js.map +1 -1
  170. package/lib/cjs/RgbColor.d.ts +1 -0
  171. package/lib/cjs/RgbColor.d.ts.map +1 -1
  172. package/lib/cjs/RgbColor.js.map +1 -1
  173. package/lib/cjs/SessionProps.d.ts +1 -0
  174. package/lib/cjs/SessionProps.d.ts.map +1 -1
  175. package/lib/cjs/SessionProps.js.map +1 -1
  176. package/lib/cjs/SkyBox.d.ts +4 -0
  177. package/lib/cjs/SkyBox.d.ts.map +1 -1
  178. package/lib/cjs/SkyBox.js +1 -0
  179. package/lib/cjs/SkyBox.js.map +1 -1
  180. package/lib/cjs/SolarShadows.d.ts +1 -0
  181. package/lib/cjs/SolarShadows.d.ts.map +1 -1
  182. package/lib/cjs/SolarShadows.js.map +1 -1
  183. package/lib/cjs/SpatialClassification.d.ts +5 -0
  184. package/lib/cjs/SpatialClassification.d.ts.map +1 -1
  185. package/lib/cjs/SpatialClassification.js +2 -0
  186. package/lib/cjs/SpatialClassification.js.map +1 -1
  187. package/lib/cjs/TerrainSettings.d.ts +3 -0
  188. package/lib/cjs/TerrainSettings.d.ts.map +1 -1
  189. package/lib/cjs/TerrainSettings.js +1 -0
  190. package/lib/cjs/TerrainSettings.js.map +1 -1
  191. package/lib/cjs/TextureProps.d.ts +3 -0
  192. package/lib/cjs/TextureProps.d.ts.map +1 -1
  193. package/lib/cjs/TextureProps.js.map +1 -1
  194. package/lib/cjs/ThematicDisplay.d.ts +9 -1
  195. package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
  196. package/lib/cjs/ThematicDisplay.js +5 -1
  197. package/lib/cjs/ThematicDisplay.js.map +1 -1
  198. package/lib/cjs/Thumbnail.d.ts +2 -0
  199. package/lib/cjs/Thumbnail.d.ts.map +1 -1
  200. package/lib/cjs/Thumbnail.js.map +1 -1
  201. package/lib/cjs/TileProps.d.ts +1 -0
  202. package/lib/cjs/TileProps.d.ts.map +1 -1
  203. package/lib/cjs/TileProps.js.map +1 -1
  204. package/lib/cjs/Tween.d.ts +16 -4
  205. package/lib/cjs/Tween.d.ts.map +1 -1
  206. package/lib/cjs/Tween.js.map +1 -1
  207. package/lib/cjs/TxnAction.d.ts +1 -0
  208. package/lib/cjs/TxnAction.d.ts.map +1 -1
  209. package/lib/cjs/TxnAction.js +1 -0
  210. package/lib/cjs/TxnAction.js.map +1 -1
  211. package/lib/cjs/ViewDetails.d.ts +3 -0
  212. package/lib/cjs/ViewDetails.d.ts.map +1 -1
  213. package/lib/cjs/ViewDetails.js +1 -0
  214. package/lib/cjs/ViewDetails.js.map +1 -1
  215. package/lib/cjs/ViewFlags.d.ts +4 -0
  216. package/lib/cjs/ViewFlags.d.ts.map +1 -1
  217. package/lib/cjs/ViewFlags.js +1 -0
  218. package/lib/cjs/ViewFlags.js.map +1 -1
  219. package/lib/cjs/ViewProps.d.ts +69 -3
  220. package/lib/cjs/ViewProps.d.ts.map +1 -1
  221. package/lib/cjs/ViewProps.js.map +1 -1
  222. package/lib/cjs/WhiteOnWhiteReversalSettings.d.ts +1 -0
  223. package/lib/cjs/WhiteOnWhiteReversalSettings.d.ts.map +1 -1
  224. package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
  225. package/lib/cjs/domains/FunctionalElementProps.d.ts +4 -1
  226. package/lib/cjs/domains/FunctionalElementProps.d.ts.map +1 -1
  227. package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
  228. package/lib/cjs/domains/GenericElementProps.d.ts +8 -2
  229. package/lib/cjs/domains/GenericElementProps.d.ts.map +1 -1
  230. package/lib/cjs/domains/GenericElementProps.js.map +1 -1
  231. package/lib/cjs/geometry/AdditionalTransform.d.ts +2 -0
  232. package/lib/cjs/geometry/AdditionalTransform.d.ts.map +1 -1
  233. package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
  234. package/lib/cjs/geometry/Cartographic.d.ts +1 -0
  235. package/lib/cjs/geometry/Cartographic.d.ts.map +1 -1
  236. package/lib/cjs/geometry/Cartographic.js.map +1 -1
  237. package/lib/cjs/geometry/CoordinateReferenceSystem.d.ts +5 -0
  238. package/lib/cjs/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
  239. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  240. package/lib/cjs/geometry/ElementGeometry.d.ts +2 -0
  241. package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
  242. package/lib/cjs/geometry/ElementGeometry.js +1 -0
  243. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  244. package/lib/cjs/geometry/GeodeticDatum.d.ts +80 -1
  245. package/lib/cjs/geometry/GeodeticDatum.d.ts.map +1 -1
  246. package/lib/cjs/geometry/GeodeticDatum.js +79 -1
  247. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  248. package/lib/cjs/geometry/GeodeticEllipsoid.d.ts +1 -0
  249. package/lib/cjs/geometry/GeodeticEllipsoid.d.ts.map +1 -1
  250. package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
  251. package/lib/cjs/geometry/GeometryStream.d.ts +15 -0
  252. package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
  253. package/lib/cjs/geometry/GeometryStream.js +11 -7
  254. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  255. package/lib/cjs/geometry/ImageGraphic.d.ts +2 -0
  256. package/lib/cjs/geometry/ImageGraphic.d.ts.map +1 -1
  257. package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
  258. package/lib/cjs/geometry/Placement.d.ts +6 -0
  259. package/lib/cjs/geometry/Placement.d.ts.map +1 -1
  260. package/lib/cjs/geometry/Placement.js.map +1 -1
  261. package/lib/cjs/geometry/Projection.d.ts +6 -0
  262. package/lib/cjs/geometry/Projection.d.ts.map +1 -1
  263. package/lib/cjs/geometry/Projection.js.map +1 -1
  264. package/lib/cjs/geometry/TextString.d.ts +1 -0
  265. package/lib/cjs/geometry/TextString.d.ts.map +1 -1
  266. package/lib/cjs/geometry/TextString.js.map +1 -1
  267. package/lib/cjs/ipc/IpcSocket.d.ts +1 -0
  268. package/lib/cjs/ipc/IpcSocket.d.ts.map +1 -1
  269. package/lib/cjs/ipc/IpcSocket.js.map +1 -1
  270. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +5 -2
  271. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  272. package/lib/cjs/rpc/IModelReadRpcInterface.js +4 -1
  273. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  274. package/lib/cjs/rpc/IModelTileRpcInterface.d.ts +4 -2
  275. package/lib/cjs/rpc/IModelTileRpcInterface.d.ts.map +1 -1
  276. package/lib/cjs/rpc/IModelTileRpcInterface.js +4 -2
  277. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  278. package/lib/cjs/rpc/core/RpcInvocation.d.ts +3 -0
  279. package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
  280. package/lib/cjs/rpc/core/RpcInvocation.js +33 -7
  281. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  282. package/lib/cjs/rpc/core/RpcMarshaling.d.ts.map +1 -1
  283. package/lib/cjs/rpc/core/RpcMarshaling.js +2 -1
  284. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  285. package/lib/cjs/rpc/core/RpcOperation.d.ts +2 -0
  286. package/lib/cjs/rpc/core/RpcOperation.d.ts.map +1 -1
  287. package/lib/cjs/rpc/core/RpcOperation.js +2 -0
  288. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  289. package/lib/cjs/rpc/core/RpcProtocol.d.ts +22 -1
  290. package/lib/cjs/rpc/core/RpcProtocol.d.ts.map +1 -1
  291. package/lib/cjs/rpc/core/RpcProtocol.js +13 -2
  292. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  293. package/lib/cjs/rpc/core/RpcRequest.d.ts +3 -0
  294. package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
  295. package/lib/cjs/rpc/core/RpcRequest.js +35 -1
  296. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  297. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
  298. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -2
  299. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  300. package/lib/cjs/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
  301. package/lib/cjs/rpc/web/WebAppRpcLogging.js +14 -10
  302. package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
  303. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +1 -0
  304. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  305. package/lib/cjs/rpc/web/WebAppRpcProtocol.js +2 -1
  306. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  307. package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts +5 -6
  308. package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  309. package/lib/cjs/rpc/web/WebAppRpcRequest.js +47 -25
  310. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  311. package/lib/cjs/tile/ElementGraphics.d.ts +8 -0
  312. package/lib/cjs/tile/ElementGraphics.d.ts.map +1 -1
  313. package/lib/cjs/tile/ElementGraphics.js.map +1 -1
  314. package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
  315. package/lib/cjs/tile/IModelTileIO.js +2 -2
  316. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  317. package/lib/esm/AnalysisStyle.d.ts +3 -0
  318. package/lib/esm/AnalysisStyle.d.ts.map +1 -1
  319. package/lib/esm/AnalysisStyle.js.map +1 -1
  320. package/lib/esm/BackgroundMapProvider.d.ts +6 -0
  321. package/lib/esm/BackgroundMapProvider.d.ts.map +1 -1
  322. package/lib/esm/BackgroundMapProvider.js +10 -0
  323. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  324. package/lib/esm/BackgroundMapSettings.d.ts +4 -0
  325. package/lib/esm/BackgroundMapSettings.d.ts.map +1 -1
  326. package/lib/esm/BackgroundMapSettings.js +1 -0
  327. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  328. package/lib/esm/Base64EncodedString.d.ts +1 -0
  329. package/lib/esm/Base64EncodedString.d.ts.map +1 -1
  330. package/lib/esm/Base64EncodedString.js.map +1 -1
  331. package/lib/esm/BriefcaseTypes.d.ts +5 -0
  332. package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
  333. package/lib/esm/BriefcaseTypes.js +2 -0
  334. package/lib/esm/BriefcaseTypes.js.map +1 -1
  335. package/lib/esm/Camera.d.ts +1 -0
  336. package/lib/esm/Camera.d.ts.map +1 -1
  337. package/lib/esm/Camera.js.map +1 -1
  338. package/lib/esm/ChangedElements.d.ts +2 -0
  339. package/lib/esm/ChangedElements.d.ts.map +1 -1
  340. package/lib/esm/ChangedElements.js +1 -0
  341. package/lib/esm/ChangedElements.js.map +1 -1
  342. package/lib/esm/ChangedEntities.d.ts +3 -0
  343. package/lib/esm/ChangedEntities.d.ts.map +1 -1
  344. package/lib/esm/ChangedEntities.js.map +1 -1
  345. package/lib/esm/ChangesetProps.d.ts +9 -1
  346. package/lib/esm/ChangesetProps.d.ts.map +1 -1
  347. package/lib/esm/ChangesetProps.js +3 -1
  348. package/lib/esm/ChangesetProps.js.map +1 -1
  349. package/lib/esm/ClipStyle.d.ts +2 -0
  350. package/lib/esm/ClipStyle.d.ts.map +1 -1
  351. package/lib/esm/ClipStyle.js.map +1 -1
  352. package/lib/esm/CloudStorage.d.ts.map +1 -1
  353. package/lib/esm/CloudStorage.js +14 -20
  354. package/lib/esm/CloudStorage.js.map +1 -1
  355. package/lib/esm/Code.d.ts +3 -0
  356. package/lib/esm/Code.d.ts.map +1 -1
  357. package/lib/esm/Code.js +1 -0
  358. package/lib/esm/Code.js.map +1 -1
  359. package/lib/esm/ColorByName.d.ts +153 -152
  360. package/lib/esm/ColorByName.d.ts.map +1 -1
  361. package/lib/esm/ColorByName.js +153 -153
  362. package/lib/esm/ColorByName.js.map +1 -1
  363. package/lib/esm/ColorDef.d.ts +55 -46
  364. package/lib/esm/ColorDef.d.ts.map +1 -1
  365. package/lib/esm/ColorDef.js +49 -31
  366. package/lib/esm/ColorDef.js.map +1 -1
  367. package/lib/esm/CommonLoggerCategory.d.ts +1 -0
  368. package/lib/esm/CommonLoggerCategory.d.ts.map +1 -1
  369. package/lib/esm/CommonLoggerCategory.js +1 -0
  370. package/lib/esm/CommonLoggerCategory.js.map +1 -1
  371. package/lib/esm/ConcurrentQuery.d.ts +6 -1
  372. package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
  373. package/lib/esm/ConcurrentQuery.js +1 -0
  374. package/lib/esm/ConcurrentQuery.js.map +1 -1
  375. package/lib/esm/ContextRealityModel.d.ts +2 -0
  376. package/lib/esm/ContextRealityModel.d.ts.map +1 -1
  377. package/lib/esm/ContextRealityModel.js.map +1 -1
  378. package/lib/esm/DisplayStyleSettings.d.ts +10 -0
  379. package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
  380. package/lib/esm/DisplayStyleSettings.js +1 -0
  381. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  382. package/lib/esm/ECSqlTypes.d.ts +6 -0
  383. package/lib/esm/ECSqlTypes.d.ts.map +1 -1
  384. package/lib/esm/ECSqlTypes.js +4 -0
  385. package/lib/esm/ECSqlTypes.js.map +1 -1
  386. package/lib/esm/ElementProps.d.ts +37 -1
  387. package/lib/esm/ElementProps.d.ts.map +1 -1
  388. package/lib/esm/ElementProps.js +2 -0
  389. package/lib/esm/ElementProps.js.map +1 -1
  390. package/lib/esm/EmphasizeElementsProps.d.ts +3 -0
  391. package/lib/esm/EmphasizeElementsProps.d.ts.map +1 -1
  392. package/lib/esm/EmphasizeElementsProps.js +1 -0
  393. package/lib/esm/EmphasizeElementsProps.js.map +1 -1
  394. package/lib/esm/EntityProps.d.ts +4 -0
  395. package/lib/esm/EntityProps.d.ts.map +1 -1
  396. package/lib/esm/EntityProps.js.map +1 -1
  397. package/lib/esm/Environment.d.ts +1 -0
  398. package/lib/esm/Environment.d.ts.map +1 -1
  399. package/lib/esm/Environment.js.map +1 -1
  400. package/lib/esm/FeatureSymbology.d.ts +3 -0
  401. package/lib/esm/FeatureSymbology.d.ts.map +1 -1
  402. package/lib/esm/FeatureSymbology.js.map +1 -1
  403. package/lib/esm/FeatureTable.d.ts +1 -0
  404. package/lib/esm/FeatureTable.d.ts.map +1 -1
  405. package/lib/esm/FeatureTable.js +1 -0
  406. package/lib/esm/FeatureTable.js.map +1 -1
  407. package/lib/esm/Fonts.d.ts +3 -0
  408. package/lib/esm/Fonts.d.ts.map +1 -1
  409. package/lib/esm/Fonts.js +1 -0
  410. package/lib/esm/Fonts.js.map +1 -1
  411. package/lib/esm/Frustum.d.ts +1 -0
  412. package/lib/esm/Frustum.d.ts.map +1 -1
  413. package/lib/esm/Frustum.js +1 -0
  414. package/lib/esm/Frustum.js.map +1 -1
  415. package/lib/esm/GeoCoordinateServices.d.ts +1 -0
  416. package/lib/esm/GeoCoordinateServices.d.ts.map +1 -1
  417. package/lib/esm/GeoCoordinateServices.js +1 -0
  418. package/lib/esm/GeoCoordinateServices.js.map +1 -1
  419. package/lib/esm/GeometryContainment.d.ts +2 -0
  420. package/lib/esm/GeometryContainment.d.ts.map +1 -1
  421. package/lib/esm/GeometryContainment.js.map +1 -1
  422. package/lib/esm/GeometryParams.d.ts +3 -0
  423. package/lib/esm/GeometryParams.d.ts.map +1 -1
  424. package/lib/esm/GeometryParams.js +3 -0
  425. package/lib/esm/GeometryParams.js.map +1 -1
  426. package/lib/esm/GeometrySummary.d.ts +3 -0
  427. package/lib/esm/GeometrySummary.d.ts.map +1 -1
  428. package/lib/esm/GeometrySummary.js +1 -0
  429. package/lib/esm/GeometrySummary.js.map +1 -1
  430. package/lib/esm/GraphicParams.d.ts +1 -0
  431. package/lib/esm/GraphicParams.d.ts.map +1 -1
  432. package/lib/esm/GraphicParams.js +1 -0
  433. package/lib/esm/GraphicParams.js.map +1 -1
  434. package/lib/esm/GroundPlane.d.ts +1 -0
  435. package/lib/esm/GroundPlane.d.ts.map +1 -1
  436. package/lib/esm/GroundPlane.js.map +1 -1
  437. package/lib/esm/HSVColor.d.ts +4 -1
  438. package/lib/esm/HSVColor.d.ts.map +1 -1
  439. package/lib/esm/HSVColor.js +4 -1
  440. package/lib/esm/HSVColor.js.map +1 -1
  441. package/lib/esm/IModel.d.ts +6 -1
  442. package/lib/esm/IModel.d.ts.map +1 -1
  443. package/lib/esm/IModel.js.map +1 -1
  444. package/lib/esm/Image.d.ts +2 -0
  445. package/lib/esm/Image.d.ts.map +1 -1
  446. package/lib/esm/Image.js +2 -0
  447. package/lib/esm/Image.js.map +1 -1
  448. package/lib/esm/IpcAppProps.d.ts +1 -0
  449. package/lib/esm/IpcAppProps.d.ts.map +1 -1
  450. package/lib/esm/IpcAppProps.js.map +1 -1
  451. package/lib/esm/LightSettings.d.ts +5 -0
  452. package/lib/esm/LightSettings.d.ts.map +1 -1
  453. package/lib/esm/LightSettings.js.map +1 -1
  454. package/lib/esm/LinePixels.d.ts +1 -0
  455. package/lib/esm/LinePixels.d.ts.map +1 -1
  456. package/lib/esm/LinePixels.js +1 -0
  457. package/lib/esm/LinePixels.js.map +1 -1
  458. package/lib/esm/Localization.d.ts +1 -0
  459. package/lib/esm/Localization.d.ts.map +1 -1
  460. package/lib/esm/Localization.js.map +1 -1
  461. package/lib/esm/MassProperties.d.ts +27 -1
  462. package/lib/esm/MassProperties.d.ts.map +1 -1
  463. package/lib/esm/MassProperties.js +1 -0
  464. package/lib/esm/MassProperties.js.map +1 -1
  465. package/lib/esm/MaterialProps.d.ts +6 -0
  466. package/lib/esm/MaterialProps.d.ts.map +1 -1
  467. package/lib/esm/MaterialProps.js +1 -0
  468. package/lib/esm/MaterialProps.js.map +1 -1
  469. package/lib/esm/ModelClipGroup.d.ts +1 -0
  470. package/lib/esm/ModelClipGroup.d.ts.map +1 -1
  471. package/lib/esm/ModelClipGroup.js.map +1 -1
  472. package/lib/esm/ModelGeometryChanges.d.ts +9 -1
  473. package/lib/esm/ModelGeometryChanges.d.ts.map +1 -1
  474. package/lib/esm/ModelGeometryChanges.js.map +1 -1
  475. package/lib/esm/ModelProps.d.ts +6 -0
  476. package/lib/esm/ModelProps.d.ts.map +1 -1
  477. package/lib/esm/ModelProps.js.map +1 -1
  478. package/lib/esm/PlanProjectionSettings.d.ts +1 -0
  479. package/lib/esm/PlanProjectionSettings.d.ts.map +1 -1
  480. package/lib/esm/PlanProjectionSettings.js.map +1 -1
  481. package/lib/esm/PlanarClipMask.d.ts +3 -0
  482. package/lib/esm/PlanarClipMask.d.ts.map +1 -1
  483. package/lib/esm/PlanarClipMask.js +2 -0
  484. package/lib/esm/PlanarClipMask.js.map +1 -1
  485. package/lib/esm/RgbColor.d.ts +1 -0
  486. package/lib/esm/RgbColor.d.ts.map +1 -1
  487. package/lib/esm/RgbColor.js.map +1 -1
  488. package/lib/esm/SessionProps.d.ts +1 -0
  489. package/lib/esm/SessionProps.d.ts.map +1 -1
  490. package/lib/esm/SessionProps.js.map +1 -1
  491. package/lib/esm/SkyBox.d.ts +4 -0
  492. package/lib/esm/SkyBox.d.ts.map +1 -1
  493. package/lib/esm/SkyBox.js +1 -0
  494. package/lib/esm/SkyBox.js.map +1 -1
  495. package/lib/esm/SolarShadows.d.ts +1 -0
  496. package/lib/esm/SolarShadows.d.ts.map +1 -1
  497. package/lib/esm/SolarShadows.js.map +1 -1
  498. package/lib/esm/SpatialClassification.d.ts +5 -0
  499. package/lib/esm/SpatialClassification.d.ts.map +1 -1
  500. package/lib/esm/SpatialClassification.js +2 -0
  501. package/lib/esm/SpatialClassification.js.map +1 -1
  502. package/lib/esm/TerrainSettings.d.ts +3 -0
  503. package/lib/esm/TerrainSettings.d.ts.map +1 -1
  504. package/lib/esm/TerrainSettings.js +1 -0
  505. package/lib/esm/TerrainSettings.js.map +1 -1
  506. package/lib/esm/TextureProps.d.ts +3 -0
  507. package/lib/esm/TextureProps.d.ts.map +1 -1
  508. package/lib/esm/TextureProps.js.map +1 -1
  509. package/lib/esm/ThematicDisplay.d.ts +9 -1
  510. package/lib/esm/ThematicDisplay.d.ts.map +1 -1
  511. package/lib/esm/ThematicDisplay.js +5 -1
  512. package/lib/esm/ThematicDisplay.js.map +1 -1
  513. package/lib/esm/Thumbnail.d.ts +2 -0
  514. package/lib/esm/Thumbnail.d.ts.map +1 -1
  515. package/lib/esm/Thumbnail.js.map +1 -1
  516. package/lib/esm/TileProps.d.ts +1 -0
  517. package/lib/esm/TileProps.d.ts.map +1 -1
  518. package/lib/esm/TileProps.js.map +1 -1
  519. package/lib/esm/Tween.d.ts +16 -4
  520. package/lib/esm/Tween.d.ts.map +1 -1
  521. package/lib/esm/Tween.js.map +1 -1
  522. package/lib/esm/TxnAction.d.ts +1 -0
  523. package/lib/esm/TxnAction.d.ts.map +1 -1
  524. package/lib/esm/TxnAction.js +1 -0
  525. package/lib/esm/TxnAction.js.map +1 -1
  526. package/lib/esm/ViewDetails.d.ts +3 -0
  527. package/lib/esm/ViewDetails.d.ts.map +1 -1
  528. package/lib/esm/ViewDetails.js +1 -0
  529. package/lib/esm/ViewDetails.js.map +1 -1
  530. package/lib/esm/ViewFlags.d.ts +4 -0
  531. package/lib/esm/ViewFlags.d.ts.map +1 -1
  532. package/lib/esm/ViewFlags.js +1 -0
  533. package/lib/esm/ViewFlags.js.map +1 -1
  534. package/lib/esm/ViewProps.d.ts +69 -3
  535. package/lib/esm/ViewProps.d.ts.map +1 -1
  536. package/lib/esm/ViewProps.js.map +1 -1
  537. package/lib/esm/WhiteOnWhiteReversalSettings.d.ts +1 -0
  538. package/lib/esm/WhiteOnWhiteReversalSettings.d.ts.map +1 -1
  539. package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
  540. package/lib/esm/domains/FunctionalElementProps.d.ts +4 -1
  541. package/lib/esm/domains/FunctionalElementProps.d.ts.map +1 -1
  542. package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
  543. package/lib/esm/domains/GenericElementProps.d.ts +8 -2
  544. package/lib/esm/domains/GenericElementProps.d.ts.map +1 -1
  545. package/lib/esm/domains/GenericElementProps.js.map +1 -1
  546. package/lib/esm/geometry/AdditionalTransform.d.ts +2 -0
  547. package/lib/esm/geometry/AdditionalTransform.d.ts.map +1 -1
  548. package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
  549. package/lib/esm/geometry/Cartographic.d.ts +1 -0
  550. package/lib/esm/geometry/Cartographic.d.ts.map +1 -1
  551. package/lib/esm/geometry/Cartographic.js.map +1 -1
  552. package/lib/esm/geometry/CoordinateReferenceSystem.d.ts +5 -0
  553. package/lib/esm/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
  554. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  555. package/lib/esm/geometry/ElementGeometry.d.ts +2 -0
  556. package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
  557. package/lib/esm/geometry/ElementGeometry.js +1 -0
  558. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  559. package/lib/esm/geometry/GeodeticDatum.d.ts +80 -1
  560. package/lib/esm/geometry/GeodeticDatum.d.ts.map +1 -1
  561. package/lib/esm/geometry/GeodeticDatum.js +77 -0
  562. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  563. package/lib/esm/geometry/GeodeticEllipsoid.d.ts +1 -0
  564. package/lib/esm/geometry/GeodeticEllipsoid.d.ts.map +1 -1
  565. package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
  566. package/lib/esm/geometry/GeometryStream.d.ts +15 -0
  567. package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
  568. package/lib/esm/geometry/GeometryStream.js +11 -7
  569. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  570. package/lib/esm/geometry/ImageGraphic.d.ts +2 -0
  571. package/lib/esm/geometry/ImageGraphic.d.ts.map +1 -1
  572. package/lib/esm/geometry/ImageGraphic.js.map +1 -1
  573. package/lib/esm/geometry/Placement.d.ts +6 -0
  574. package/lib/esm/geometry/Placement.d.ts.map +1 -1
  575. package/lib/esm/geometry/Placement.js.map +1 -1
  576. package/lib/esm/geometry/Projection.d.ts +6 -0
  577. package/lib/esm/geometry/Projection.d.ts.map +1 -1
  578. package/lib/esm/geometry/Projection.js.map +1 -1
  579. package/lib/esm/geometry/TextString.d.ts +1 -0
  580. package/lib/esm/geometry/TextString.d.ts.map +1 -1
  581. package/lib/esm/geometry/TextString.js.map +1 -1
  582. package/lib/esm/ipc/IpcSocket.d.ts +1 -0
  583. package/lib/esm/ipc/IpcSocket.d.ts.map +1 -1
  584. package/lib/esm/ipc/IpcSocket.js.map +1 -1
  585. package/lib/esm/rpc/IModelReadRpcInterface.d.ts +5 -2
  586. package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  587. package/lib/esm/rpc/IModelReadRpcInterface.js +4 -1
  588. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  589. package/lib/esm/rpc/IModelTileRpcInterface.d.ts +4 -2
  590. package/lib/esm/rpc/IModelTileRpcInterface.d.ts.map +1 -1
  591. package/lib/esm/rpc/IModelTileRpcInterface.js +4 -2
  592. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  593. package/lib/esm/rpc/core/RpcInvocation.d.ts +3 -0
  594. package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
  595. package/lib/esm/rpc/core/RpcInvocation.js +35 -9
  596. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  597. package/lib/esm/rpc/core/RpcMarshaling.d.ts.map +1 -1
  598. package/lib/esm/rpc/core/RpcMarshaling.js +1 -0
  599. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  600. package/lib/esm/rpc/core/RpcOperation.d.ts +2 -0
  601. package/lib/esm/rpc/core/RpcOperation.d.ts.map +1 -1
  602. package/lib/esm/rpc/core/RpcOperation.js +2 -0
  603. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  604. package/lib/esm/rpc/core/RpcProtocol.d.ts +22 -1
  605. package/lib/esm/rpc/core/RpcProtocol.d.ts.map +1 -1
  606. package/lib/esm/rpc/core/RpcProtocol.js +12 -1
  607. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  608. package/lib/esm/rpc/core/RpcRequest.d.ts +3 -0
  609. package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
  610. package/lib/esm/rpc/core/RpcRequest.js +36 -2
  611. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  612. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
  613. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +0 -1
  614. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  615. package/lib/esm/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
  616. package/lib/esm/rpc/web/WebAppRpcLogging.js +14 -10
  617. package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
  618. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +1 -0
  619. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  620. package/lib/esm/rpc/web/WebAppRpcProtocol.js +2 -1
  621. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  622. package/lib/esm/rpc/web/WebAppRpcRequest.d.ts +5 -6
  623. package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  624. package/lib/esm/rpc/web/WebAppRpcRequest.js +47 -25
  625. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  626. package/lib/esm/tile/ElementGraphics.d.ts +8 -0
  627. package/lib/esm/tile/ElementGraphics.d.ts.map +1 -1
  628. package/lib/esm/tile/ElementGraphics.js.map +1 -1
  629. package/lib/esm/tile/IModelTileIO.d.ts +2 -2
  630. package/lib/esm/tile/IModelTileIO.js +2 -2
  631. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  632. package/package.json +24 -11
@@ -9,6 +9,7 @@ import { RpcOperation } from "./RpcOperation";
9
9
  import { RpcProtocol, RpcRequestFulfillment, SerializedRpcRequest } from "./RpcProtocol";
10
10
  /** The properties of an RpcActivity.
11
11
  * @public
12
+ * @extensions
12
13
  */
13
14
  export interface RpcActivity extends SessionProps {
14
15
  /** Used for logging to correlate an Rpc activity between frontend and backend */
@@ -81,7 +82,9 @@ export declare class RpcInvocation {
81
82
  private fulfillResolved;
82
83
  private fulfillRejected;
83
84
  private supportsNoContent;
85
+ private supportsStatusCategory;
84
86
  private fulfill;
85
87
  private lookupOperationFunction;
88
+ private transformResponseStatus;
86
89
  }
87
90
  //# sourceMappingURL=RpcInvocation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RpcInvocation.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcInvocation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAA+B,UAAU,EAA4C,MAAM,qBAAqB,CAAC;AAIrI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAoB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGzF;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,iFAAiF;IACjF,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC,yCAAyC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SA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, IModelStatus, Logger, RpcInterfaceStatus } from "@itwin/core-bentley";
9
+ import { BentleyError, BentleyStatus, IModelStatus, Logger, RpcInterfaceStatus, StatusCategory } from "@itwin/core-bentley";
10
10
  import { CommonLoggerCategory } from "../../CommonLoggerCategory";
11
11
  import { IModelError } from "../../IModelError";
12
12
  import { RpcInterface } from "../../RpcInterface";
@@ -15,7 +15,7 @@ import { RpcProtocolEvent, RpcRequestStatus } from "./RpcConstants";
15
15
  import { RpcNotFoundResponse, RpcPendingResponse } from "./RpcControl";
16
16
  import { RpcMarshaling } from "./RpcMarshaling";
17
17
  import { RpcOperation } from "./RpcOperation";
18
- import { RpcProtocol } from "./RpcProtocol";
18
+ import { RpcProtocol, RpcProtocolVersion } from "./RpcProtocol";
19
19
  import { CURRENT_INVOCATION, RpcRegistry } from "./RpcRegistry";
20
20
  /** An RPC operation invocation in response to a request.
21
21
  * @internal
@@ -153,18 +153,13 @@ export class RpcInvocation {
153
153
  if (!RpcConfiguration.developmentMode)
154
154
  reason.stack = undefined;
155
155
  const result = await RpcMarshaling.serialize(this.protocol, reason);
156
- let isNoContentError = false;
157
- try {
158
- isNoContentError = reason.errorNumber === IModelStatus.NoContent;
159
- }
160
- catch { }
161
156
  if (reason instanceof RpcPendingResponse) {
162
157
  this._pending = true;
163
158
  this._threw = false;
164
159
  result.objects = reason.message;
165
160
  this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedPending, this);
166
161
  }
167
- else if (this.supportsNoContent() && isNoContentError) {
162
+ else if (this.supportsNoContent() && (reason === null || reason === void 0 ? void 0 : reason.errorNumber) === IModelStatus.NoContent) {
168
163
  this._noContent = true;
169
164
  this._threw = false;
170
165
  this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNoContent, this);
@@ -184,7 +179,16 @@ export class RpcInvocation {
184
179
  if (!this.request.protocolVersion) {
185
180
  return false;
186
181
  }
187
- return RpcProtocol.protocolVersion >= 1 && this.request.protocolVersion >= 1;
182
+ return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedNoContent && this.request.protocolVersion >= RpcProtocolVersion.IntroducedNoContent;
183
+ }
184
+ supportsStatusCategory() {
185
+ if (!this.request.protocolVersion) {
186
+ return false;
187
+ }
188
+ if (!this.protocol.supportsStatusCategory) {
189
+ return false;
190
+ }
191
+ return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.request.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;
188
192
  }
189
193
  fulfill(result, rawResult) {
190
194
  const fulfillment = {
@@ -193,7 +197,9 @@ export class RpcInvocation {
193
197
  status: this.protocol.getCode(this.status),
194
198
  id: this.request.id,
195
199
  interfaceName: (typeof (this.operation) === "undefined") ? "" : this.operation.interfaceDefinition.interfaceName,
200
+ allowCompression: this.operation.policy.allowResponseCompression,
196
201
  };
202
+ this.transformResponseStatus(fulfillment, rawResult);
197
203
  try {
198
204
  const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition);
199
205
  if (impl[CURRENT_INVOCATION] === this) {
@@ -209,6 +215,26 @@ export class RpcInvocation {
209
215
  throw new IModelError(BentleyStatus.ERROR, `RPC interface class "${implementation.constructor.name}" does not implement operation "${this.operation.operationName}".`);
210
216
  return func;
211
217
  }
218
+ transformResponseStatus(fulfillment, rawResult) {
219
+ if (!this.supportsStatusCategory()) {
220
+ return;
221
+ }
222
+ let managedStatus;
223
+ if (this._pending) {
224
+ managedStatus = "pending";
225
+ }
226
+ else if (this._notFound) {
227
+ managedStatus = "notFound";
228
+ }
229
+ if (managedStatus) {
230
+ const responseValue = fulfillment.result.objects;
231
+ const status = { iTwinRpcCoreResponse: true, managedStatus, responseValue };
232
+ fulfillment.result.objects = JSON.stringify(status);
233
+ }
234
+ if (rawResult instanceof BentleyError) {
235
+ fulfillment.status = StatusCategory.for(rawResult).code;
236
+ }
237
+ }
212
238
  }
213
239
  _a = RpcInvocation;
214
240
  RpcInvocation.runActivity = async (_activity, fn) => fn();
@@ -1 +1 @@
1
- {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YACT,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;YAC1C,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,aAAa,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,aAAa;SACjH,CAAC;QAEF,IAAI;YACF,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAQ,CAAC;YACjG,IAAI,IAAI,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAAE;gBACrC,IAAI,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;aACtC;SACF;QAAC,OAAO,IAAI,EAAE,GAAG;QAElB,OAAO,WAAW,CAAC;IACrB,CAAC;IAEO,uBAAuB,CAAC,cAA4B;QAC1D,MAAM,IAAI,GAAI,cAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,UAAU;YACvC,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,wBAAwB,cAAc,CAAC,WAAW,CAAC,IAAI,mCAAmC,IAAI,CAAC,SAAS,CAAC,aAAa,IAAI,CAAC,CAAC;QAEzK,OAAO,IAAI,CAAC;IACd,CAAC;;;AA5Na,yBAAW,GAAmB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAG,CAAA","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 RpcInterface\r\n */\r\n\r\nimport { AccessToken, BentleyError, BentleyStatus, GuidString, IModelStatus, Logger, RpcInterfaceStatus } from \"@itwin/core-bentley\";\r\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { SessionProps } from \"../../SessionProps\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcProtocolEvent, RpcRequestStatus } from \"./RpcConstants\";\r\nimport { RpcNotFoundResponse, RpcPendingResponse } from \"./RpcControl\";\r\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcProtocol, RpcRequestFulfillment, SerializedRpcRequest } from \"./RpcProtocol\";\r\nimport { CURRENT_INVOCATION, RpcRegistry } from \"./RpcRegistry\";\r\n\r\n/** The properties of an RpcActivity.\r\n * @public\r\n */\r\nexport interface RpcActivity extends SessionProps {\r\n /** Used for logging to correlate an Rpc activity between frontend and backend */\r\n readonly activityId: GuidString;\r\n\r\n /** access token for authorization */\r\n readonly accessToken: AccessToken;\r\n\r\n /** the name of the current rpc method */\r\n readonly rpcMethod?: string;\r\n}\r\n\r\n/** Serialized format for sending the request across the RPC layer\r\n * @public\r\n */\r\nexport interface SerializedRpcActivity {\r\n id: string;\r\n applicationId: string;\r\n applicationVersion: string;\r\n sessionId: string;\r\n authorization: string;\r\n csrfToken?: { headerName: string, headerValue: string };\r\n}\r\n\r\n/** @internal */\r\nexport type RpcActivityRun = (activity: RpcActivity, fn: () => Promise<any>) => Promise<any>;\r\n\r\n/** An RPC operation invocation in response to a request.\r\n * @internal\r\n */\r\nexport class RpcInvocation {\r\n public static runActivity: RpcActivityRun = async (_activity, fn) => fn();\r\n private _threw: boolean = false;\r\n private _pending: boolean = false;\r\n private _notFound: boolean = false;\r\n private _noContent: boolean = false;\r\n private _timeIn: number = 0;\r\n private _timeOut: number = 0;\r\n\r\n /** The protocol for this invocation. */\r\n public readonly protocol: RpcProtocol;\r\n\r\n /** The received request. */\r\n public readonly request: SerializedRpcRequest;\r\n\r\n /** The operation of the request. */\r\n public readonly operation: RpcOperation = undefined as any;\r\n\r\n /** The implementation response. */\r\n public readonly result: Promise<any>;\r\n\r\n /** The fulfillment for this request. */\r\n public readonly fulfillment: Promise<RpcRequestFulfillment>;\r\n\r\n /** The status for this request. */\r\n public get status(): RpcRequestStatus {\r\n return this._threw ? RpcRequestStatus.Rejected :\r\n this._pending ? RpcRequestStatus.Pending :\r\n this._notFound ? RpcRequestStatus.NotFound :\r\n this._noContent ? RpcRequestStatus.NoContent :\r\n RpcRequestStatus.Resolved;\r\n }\r\n\r\n /** The elapsed time for this invocation. */\r\n public get elapsed(): number {\r\n return this._timeOut - this._timeIn;\r\n }\r\n\r\n /**\r\n * The invocation for the current RPC operation.\r\n * @note The return value of this function is only reliable in an RPC impl class member function where program control was received from the RpcInvocation constructor function.\r\n */\r\n public static current(rpcImpl: RpcInterface): RpcInvocation {\r\n return (rpcImpl as any)[CURRENT_INVOCATION];\r\n }\r\n\r\n /** Constructs an invocation. */\r\n public constructor(protocol: RpcProtocol, request: SerializedRpcRequest) {\r\n this._timeIn = new Date().getTime();\r\n this.protocol = protocol;\r\n this.request = request;\r\n\r\n try {\r\n try {\r\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\r\n\r\n const backend = this.operation.interfaceVersion;\r\n const frontend = this.request.operation.interfaceVersion;\r\n if (!RpcInterface.isVersionCompatible(backend, frontend)) {\r\n throw new IModelError(RpcInterfaceStatus.IncompatibleVersion, `Backend version ${backend} does not match frontend version ${frontend} for RPC interface ${this.operation.operationName}.`);\r\n }\r\n } catch (error) {\r\n if (this.handleUnknownOperation(error)) {\r\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\r\n } else {\r\n throw error;\r\n }\r\n }\r\n\r\n this.result = this.resolve();\r\n } catch (error) {\r\n this.result = this.reject(error);\r\n }\r\n\r\n this.fulfillment = this.result.then(async (value) => this._threw ? this.fulfillRejected(value) : this.fulfillResolved(value), async (reason) => this.fulfillRejected(reason));\r\n }\r\n\r\n private handleUnknownOperation(error: any): boolean {\r\n return this.protocol.configuration.controlChannel.handleUnknownOperation(this, error);\r\n }\r\n\r\n public static sanitizeForLog(activity?: RpcActivity) {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n return activity ? {\r\n ActivityId: activity.activityId, SessionId: activity.sessionId, ApplicationId: activity.applicationId, ApplicationVersion: activity.applicationVersion, rpcMethod: activity.rpcMethod,\r\n } : undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention */\r\n }\r\n\r\n private async resolve(): Promise<any> {\r\n const request = this.request;\r\n const activity: RpcActivity = {\r\n activityId: request.id,\r\n applicationId: request.applicationId,\r\n applicationVersion: request.applicationVersion,\r\n sessionId: request.sessionId,\r\n accessToken: request.authorization,\r\n rpcMethod: request.operation.operationName,\r\n };\r\n\r\n try {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestReceived, this);\r\n\r\n const parameters = RpcMarshaling.deserialize(this.protocol, request.parameters);\r\n this.applyPolicies(parameters);\r\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition);\r\n (impl as any)[CURRENT_INVOCATION] = this;\r\n const op = this.lookupOperationFunction(impl);\r\n\r\n return await RpcInvocation.runActivity(activity, async () => op.call(impl, ...parameters));\r\n } catch (error: unknown) {\r\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, \"Error in RPC operation\", { error: BentleyError.getErrorProps(error), ...RpcInvocation.sanitizeForLog(activity) });\r\n return this.reject(error);\r\n }\r\n }\r\n\r\n private applyPolicies(parameters: any) {\r\n if (!parameters || !Array.isArray(parameters))\r\n return;\r\n\r\n for (let i = 0; i !== parameters.length; ++i) {\r\n const parameter = parameters[i];\r\n const isToken = typeof (parameter) === \"object\" && parameter !== null && parameter.hasOwnProperty(\"iModelId\") && parameter.hasOwnProperty(\"iTwinId\");\r\n if (isToken && this.protocol.checkToken && !this.operation.policy.allowTokenMismatch) {\r\n const inflated = this.protocol.inflateToken(parameter, this.request);\r\n parameters[i] = inflated;\r\n\r\n if (!RpcInvocation.compareTokens(parameter, inflated)) {\r\n if (RpcConfiguration.throwOnTokenMismatch) {\r\n throw new IModelError(BentleyStatus.ERROR, \"IModelRpcProps mismatch detected for this request.\");\r\n } else {\r\n Logger.logWarning(CommonLoggerCategory.RpcInterfaceBackend, \"IModelRpcProps mismatch detected for this request.\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private static compareTokens(a: IModelRpcProps, b: IModelRpcProps): boolean {\r\n return a.key === b.key &&\r\n a.iTwinId === b.iTwinId &&\r\n a.iModelId === b.iModelId &&\r\n (undefined === a.changeset || (a.changeset.id === b.changeset?.id));\r\n }\r\n\r\n private async reject(error: any): Promise<any> {\r\n this._threw = true;\r\n return error;\r\n }\r\n\r\n private async fulfillResolved(value: any): Promise<RpcRequestFulfillment> {\r\n this._timeOut = new Date().getTime();\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendResponseCreated, this);\r\n const result = await RpcMarshaling.serialize(this.protocol, value);\r\n return this.fulfill(result, value);\r\n }\r\n\r\n private async fulfillRejected(reason: any): Promise<RpcRequestFulfillment> {\r\n this._timeOut = new Date().getTime();\r\n if (!RpcConfiguration.developmentMode)\r\n reason.stack = undefined;\r\n\r\n const result = await RpcMarshaling.serialize(this.protocol, reason);\r\n\r\n let isNoContentError = false;\r\n try { isNoContentError = reason.errorNumber === IModelStatus.NoContent; } catch { }\r\n\r\n if (reason instanceof RpcPendingResponse) {\r\n this._pending = true;\r\n this._threw = false;\r\n result.objects = reason.message;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedPending, this);\r\n } else if (this.supportsNoContent() && isNoContentError) {\r\n this._noContent = true;\r\n this._threw = false;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNoContent, this);\r\n } else if (reason instanceof RpcNotFoundResponse) {\r\n this._notFound = true;\r\n this._threw = false;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNotFound, this);\r\n } else {\r\n this._threw = true;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorOccurred, this);\r\n }\r\n\r\n return this.fulfill(result, reason);\r\n }\r\n\r\n private supportsNoContent() {\r\n if (!this.request.protocolVersion) {\r\n return false;\r\n }\r\n\r\n return RpcProtocol.protocolVersion >= 1 && this.request.protocolVersion >= 1;\r\n }\r\n\r\n private fulfill(result: RpcSerializedValue, rawResult: any): RpcRequestFulfillment {\r\n const fulfillment: RpcRequestFulfillment = {\r\n result,\r\n rawResult,\r\n status: this.protocol.getCode(this.status),\r\n id: this.request.id,\r\n interfaceName: (typeof (this.operation) === \"undefined\") ? \"\" : this.operation.interfaceDefinition.interfaceName,\r\n };\r\n\r\n try {\r\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition) as any;\r\n if (impl[CURRENT_INVOCATION] === this) {\r\n impl[CURRENT_INVOCATION] = undefined;\r\n }\r\n } catch (_err) { }\r\n\r\n return fulfillment;\r\n }\r\n\r\n private lookupOperationFunction(implementation: RpcInterface): (...args: any[]) => Promise<any> {\r\n const func = (implementation as any)[this.operation.operationName];\r\n if (!func || typeof (func) !== \"function\")\r\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${implementation.constructor.name}\" does not implement operation \"${this.operation.operationName}\".`);\r\n\r\n return func;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RpcInvocation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcInvocation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH,OAAO,EAAe,YAAY,EAAE,aAAa,EAAc,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrJ,OAAO,EAAE,oBAAo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AAE,EAAE;YAClC,OAAO;SACR;QAED,IAAI,aAAiD,CAAC;QACtD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,aAAa,GAAG,SAAS,CAAC;SAC3B;aAAM,IAAI,IAAI,CAAC,SAAS,EAAE;YACzB,aAAa,GAAG,UAAU,CAAC;SAC5B;QAED,IAAI,aAAa,EAAE;YACjB,MAAM,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC;YACjD,MAAM,MAAM,GAAqB,EAAE,oBAAoB,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;YAC9F,WAAW,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SACrD;QAED,IAAI,SAAS,YAAY,YAAY,EAAE;YACrC,WAAW,CAAC,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;SACzD;IACH,CAAC;;;AA/Pa,yBAAW,GAAmB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAG,CAAA","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 RpcInterface\r\n */\r\n\r\nimport { AccessToken, BentleyError, BentleyStatus, GuidString, IModelStatus, Logger, RpcInterfaceStatus, StatusCategory } from \"@itwin/core-bentley\";\r\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { SessionProps } from \"../../SessionProps\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcProtocolEvent, RpcRequestStatus } from \"./RpcConstants\";\r\nimport { RpcNotFoundResponse, RpcPendingResponse } from \"./RpcControl\";\r\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcManagedStatus, RpcProtocol, RpcProtocolVersion, RpcRequestFulfillment, SerializedRpcRequest } from \"./RpcProtocol\";\r\nimport { CURRENT_INVOCATION, RpcRegistry } from \"./RpcRegistry\";\r\n\r\n/** The properties of an RpcActivity.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface RpcActivity extends SessionProps {\r\n /** Used for logging to correlate an Rpc activity between frontend and backend */\r\n readonly activityId: GuidString;\r\n\r\n /** access token for authorization */\r\n readonly accessToken: AccessToken;\r\n\r\n /** the name of the current rpc method */\r\n readonly rpcMethod?: string;\r\n}\r\n\r\n/** Serialized format for sending the request across the RPC layer\r\n * @public\r\n */\r\nexport interface SerializedRpcActivity {\r\n id: string;\r\n applicationId: string;\r\n applicationVersion: string;\r\n sessionId: string;\r\n authorization: string;\r\n csrfToken?: { headerName: string, headerValue: string };\r\n}\r\n\r\n/** @internal */\r\nexport type RpcActivityRun = (activity: RpcActivity, fn: () => Promise<any>) => Promise<any>;\r\n\r\n/** An RPC operation invocation in response to a request.\r\n * @internal\r\n */\r\nexport class RpcInvocation {\r\n public static runActivity: RpcActivityRun = async (_activity, fn) => fn();\r\n private _threw: boolean = false;\r\n private _pending: boolean = false;\r\n private _notFound: boolean = false;\r\n private _noContent: boolean = false;\r\n private _timeIn: number = 0;\r\n private _timeOut: number = 0;\r\n\r\n /** The protocol for this invocation. */\r\n public readonly protocol: RpcProtocol;\r\n\r\n /** The received request. */\r\n public readonly request: SerializedRpcRequest;\r\n\r\n /** The operation of the request. */\r\n public readonly operation: RpcOperation = undefined as any;\r\n\r\n /** The implementation response. */\r\n public readonly result: Promise<any>;\r\n\r\n /** The fulfillment for this request. */\r\n public readonly fulfillment: Promise<RpcRequestFulfillment>;\r\n\r\n /** The status for this request. */\r\n public get status(): RpcRequestStatus {\r\n return this._threw ? RpcRequestStatus.Rejected :\r\n this._pending ? RpcRequestStatus.Pending :\r\n this._notFound ? RpcRequestStatus.NotFound :\r\n this._noContent ? RpcRequestStatus.NoContent :\r\n RpcRequestStatus.Resolved;\r\n }\r\n\r\n /** The elapsed time for this invocation. */\r\n public get elapsed(): number {\r\n return this._timeOut - this._timeIn;\r\n }\r\n\r\n /**\r\n * The invocation for the current RPC operation.\r\n * @note The return value of this function is only reliable in an RPC impl class member function where program control was received from the RpcInvocation constructor function.\r\n */\r\n public static current(rpcImpl: RpcInterface): RpcInvocation {\r\n return (rpcImpl as any)[CURRENT_INVOCATION];\r\n }\r\n\r\n /** Constructs an invocation. */\r\n public constructor(protocol: RpcProtocol, request: SerializedRpcRequest) {\r\n this._timeIn = new Date().getTime();\r\n this.protocol = protocol;\r\n this.request = request;\r\n\r\n try {\r\n try {\r\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\r\n\r\n const backend = this.operation.interfaceVersion;\r\n const frontend = this.request.operation.interfaceVersion;\r\n if (!RpcInterface.isVersionCompatible(backend, frontend)) {\r\n throw new IModelError(RpcInterfaceStatus.IncompatibleVersion, `Backend version ${backend} does not match frontend version ${frontend} for RPC interface ${this.operation.operationName}.`);\r\n }\r\n } catch (error) {\r\n if (this.handleUnknownOperation(error)) {\r\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\r\n } else {\r\n throw error;\r\n }\r\n }\r\n\r\n this.result = this.resolve();\r\n } catch (error) {\r\n this.result = this.reject(error);\r\n }\r\n\r\n this.fulfillment = this.result.then(async (value) => this._threw ? this.fulfillRejected(value) : this.fulfillResolved(value), async (reason) => this.fulfillRejected(reason));\r\n }\r\n\r\n private handleUnknownOperation(error: any): boolean {\r\n return this.protocol.configuration.controlChannel.handleUnknownOperation(this, error);\r\n }\r\n\r\n public static sanitizeForLog(activity?: RpcActivity) {\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n return activity ? {\r\n ActivityId: activity.activityId, SessionId: activity.sessionId, ApplicationId: activity.applicationId, ApplicationVersion: activity.applicationVersion, rpcMethod: activity.rpcMethod,\r\n } : undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention */\r\n }\r\n\r\n private async resolve(): Promise<any> {\r\n const request = this.request;\r\n const activity: RpcActivity = {\r\n activityId: request.id,\r\n applicationId: request.applicationId,\r\n applicationVersion: request.applicationVersion,\r\n sessionId: request.sessionId,\r\n accessToken: request.authorization,\r\n rpcMethod: request.operation.operationName,\r\n };\r\n\r\n try {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestReceived, this);\r\n\r\n const parameters = RpcMarshaling.deserialize(this.protocol, request.parameters);\r\n this.applyPolicies(parameters);\r\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition);\r\n (impl as any)[CURRENT_INVOCATION] = this;\r\n const op = this.lookupOperationFunction(impl);\r\n\r\n return await RpcInvocation.runActivity(activity, async () => op.call(impl, ...parameters));\r\n } catch (error: unknown) {\r\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, \"Error in RPC operation\", { error: BentleyError.getErrorProps(error), ...RpcInvocation.sanitizeForLog(activity) });\r\n return this.reject(error);\r\n }\r\n }\r\n\r\n private applyPolicies(parameters: any) {\r\n if (!parameters || !Array.isArray(parameters))\r\n return;\r\n\r\n for (let i = 0; i !== parameters.length; ++i) {\r\n const parameter = parameters[i];\r\n const isToken = typeof (parameter) === \"object\" && parameter !== null && parameter.hasOwnProperty(\"iModelId\") && parameter.hasOwnProperty(\"iTwinId\");\r\n if (isToken && this.protocol.checkToken && !this.operation.policy.allowTokenMismatch) {\r\n const inflated = this.protocol.inflateToken(parameter, this.request);\r\n parameters[i] = inflated;\r\n\r\n if (!RpcInvocation.compareTokens(parameter, inflated)) {\r\n if (RpcConfiguration.throwOnTokenMismatch) {\r\n throw new IModelError(BentleyStatus.ERROR, \"IModelRpcProps mismatch detected for this request.\");\r\n } else {\r\n Logger.logWarning(CommonLoggerCategory.RpcInterfaceBackend, \"IModelRpcProps mismatch detected for this request.\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private static compareTokens(a: IModelRpcProps, b: IModelRpcProps): boolean {\r\n return a.key === b.key &&\r\n a.iTwinId === b.iTwinId &&\r\n a.iModelId === b.iModelId &&\r\n (undefined === a.changeset || (a.changeset.id === b.changeset?.id));\r\n }\r\n\r\n private async reject(error: any): Promise<any> {\r\n this._threw = true;\r\n return error;\r\n }\r\n\r\n private async fulfillResolved(value: any): Promise<RpcRequestFulfillment> {\r\n this._timeOut = new Date().getTime();\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendResponseCreated, this);\r\n const result = await RpcMarshaling.serialize(this.protocol, value);\r\n return this.fulfill(result, value);\r\n }\r\n\r\n private async fulfillRejected(reason: any): Promise<RpcRequestFulfillment> {\r\n this._timeOut = new Date().getTime();\r\n if (!RpcConfiguration.developmentMode)\r\n reason.stack = undefined;\r\n\r\n const result = await RpcMarshaling.serialize(this.protocol, reason);\r\n\r\n if (reason instanceof RpcPendingResponse) {\r\n this._pending = true;\r\n this._threw = false;\r\n result.objects = reason.message;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedPending, this);\r\n } else if (this.supportsNoContent() && reason?.errorNumber === IModelStatus.NoContent) {\r\n this._noContent = true;\r\n this._threw = false;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNoContent, this);\r\n } else if (reason instanceof RpcNotFoundResponse) {\r\n this._notFound = true;\r\n this._threw = false;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNotFound, this);\r\n } else {\r\n this._threw = true;\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorOccurred, this);\r\n }\r\n\r\n return this.fulfill(result, reason);\r\n }\r\n\r\n private supportsNoContent() {\r\n if (!this.request.protocolVersion) {\r\n return false;\r\n }\r\n\r\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedNoContent && this.request.protocolVersion >= RpcProtocolVersion.IntroducedNoContent;\r\n }\r\n\r\n private supportsStatusCategory() {\r\n if (!this.request.protocolVersion) {\r\n return false;\r\n }\r\n\r\n if (!this.protocol.supportsStatusCategory) {\r\n return false;\r\n }\r\n\r\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.request.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;\r\n }\r\n\r\n private fulfill(result: RpcSerializedValue, rawResult: any): RpcRequestFulfillment {\r\n const fulfillment: RpcRequestFulfillment = {\r\n result,\r\n rawResult,\r\n status: this.protocol.getCode(this.status),\r\n id: this.request.id,\r\n interfaceName: (typeof (this.operation) === \"undefined\") ? \"\" : this.operation.interfaceDefinition.interfaceName,\r\n allowCompression: this.operation.policy.allowResponseCompression,\r\n };\r\n\r\n this.transformResponseStatus(fulfillment, rawResult);\r\n\r\n try {\r\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition) as any;\r\n if (impl[CURRENT_INVOCATION] === this) {\r\n impl[CURRENT_INVOCATION] = undefined;\r\n }\r\n } catch (_err) { }\r\n\r\n return fulfillment;\r\n }\r\n\r\n private lookupOperationFunction(implementation: RpcInterface): (...args: any[]) => Promise<any> {\r\n const func = (implementation as any)[this.operation.operationName];\r\n if (!func || typeof (func) !== \"function\")\r\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${implementation.constructor.name}\" does not implement operation \"${this.operation.operationName}\".`);\r\n\r\n return func;\r\n }\r\n\r\n private transformResponseStatus(fulfillment: RpcRequestFulfillment, rawResult: any) {\r\n if (!this.supportsStatusCategory()) {\r\n return;\r\n }\r\n\r\n let managedStatus: \"notFound\" | \"pending\" | undefined;\r\n if (this._pending) {\r\n managedStatus = \"pending\";\r\n } else if (this._notFound) {\r\n managedStatus = \"notFound\";\r\n }\r\n\r\n if (managedStatus) {\r\n const responseValue = fulfillment.result.objects;\r\n const status: RpcManagedStatus = { iTwinRpcCoreResponse: true, managedStatus, responseValue };\r\n fulfillment.result.objects = JSON.stringify(status);\r\n }\r\n\r\n if (rawResult instanceof BentleyError) {\r\n fulfillment.status = StatusCategory.for(rawResult).code;\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,yBAAiB,sBAAsB,CAAC;IACtC,SAAgB,aAAa,IAAI,sBAAsB,CAEtD;CACF;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACN,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgBzG,4BAA4B;WACd,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,GAAG;CAoB7F"}
1
+ {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,yBAAiB,sBAAsB,CAAC;IACtC,SAAgB,aAAa,IAAI,sBAAsB,CAEtD;CACF;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACN,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgBzG,4BAA4B;WACd,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,GAAG;CAoB7F"}
@@ -5,6 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module RpcInterface
7
7
  */
8
+ import { Buffer } from "buffer";
8
9
  import { BentleyStatus, IModelError } from "../../IModelError";
9
10
  // cspell:ignore unmarshal
10
11
  let marshalingTarget;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","s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AAI,CAAC;SACb;IACH,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAU;QACpC,IAAI,KAAK,YAAY,KAAK,EAAE;YAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;YACtD,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACtF,KAAK,CAAC,IAAI,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACzF,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/F,KAAK,CAAC,KAAK,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;SAC/C;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 RpcInterface\r\n */\r\n\r\nimport { Readable } from \"stream\";\r\nimport { BentleyStatus, IModelError } from \"../../IModelError\";\r\nimport { RpcProtocol } from \"./RpcProtocol\";\r\n\r\n// cspell:ignore unmarshal\r\n\r\nlet marshalingTarget: RpcSerializedValue;\r\nlet chunkThreshold = 0;\r\n\r\n/** @internal */\r\nexport interface MarshalingBinaryMarker {\r\n isBinary: true;\r\n index: number;\r\n size: number;\r\n chunks: number;\r\n}\r\n\r\n/** @internal */\r\nexport namespace MarshalingBinaryMarker {\r\n export function createDefault(): MarshalingBinaryMarker {\r\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface RpcSerializedValue {\r\n objects: string;\r\n data: Uint8Array[];\r\n chunks?: number;\r\n stream?: Readable;\r\n}\r\n\r\n/** @internal */\r\nexport namespace RpcSerializedValue {\r\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\r\n return { objects, data };\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class RpcMarshaling {\r\n private constructor() { }\r\n\r\n /** Serializes a value. */\r\n public static async serialize(protocol: RpcProtocol | undefined, value: any): Promise<RpcSerializedValue> {\r\n const serialized = RpcSerializedValue.create();\r\n\r\n if (typeof (value) === \"undefined\") {\r\n return serialized;\r\n }\r\n\r\n marshalingTarget = serialized;\r\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\r\n serialized.objects = JSON.stringify(value, WireFormat.marshal);\r\n marshalingTarget = undefined as any;\r\n chunkThreshold = 0;\r\n\r\n return serialized;\r\n }\r\n\r\n /** Deserializes a value. */\r\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\r\n if (value.objects === \"\") {\r\n return undefined;\r\n }\r\n\r\n marshalingTarget = value;\r\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\r\n let result;\r\n try {\r\n result = JSON.parse(value.objects, WireFormat.unmarshal);\r\n } catch (error) {\r\n if (error instanceof SyntaxError)\r\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\r\n throw error;\r\n }\r\n marshalingTarget = undefined as any;\r\n chunkThreshold = 0;\r\n\r\n return result;\r\n }\r\n}\r\n\r\nclass WireFormat {\r\n /** JSON.stringify replacer callback. */\r\n public static marshal(this: any, _key: string, value: any) {\r\n const asBinary = WireFormat.marshalBinary(value);\r\n if (asBinary) {\r\n return asBinary;\r\n }\r\n\r\n const asError = WireFormat.marshalError(value);\r\n if (asError) {\r\n return asError;\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /** JSON.parse reviver callback. */\r\n public static unmarshal(_key: string, value: any) {\r\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\r\n return WireFormat.unmarshalBinary(value);\r\n }\r\n\r\n return value;\r\n }\r\n\r\n private static marshalBinary(value: any): any {\r\n if (value instanceof Uint8Array || Buffer.isBuffer(value)) {\r\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\r\n\r\n if (chunkThreshold && value.byteLength > chunkThreshold) {\r\n marker.index = marshalingTarget.data.length;\r\n marker.chunks = 0;\r\n\r\n let cursor = value.byteOffset;\r\n const end = cursor + value.byteLength;\r\n let chunk = chunkThreshold;\r\n\r\n for (; ;) {\r\n if (cursor >= end) {\r\n break;\r\n }\r\n\r\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\r\n ++marker.chunks;\r\n cursor += chunk;\r\n\r\n const consumed = cursor - value.byteOffset;\r\n const remaining = value.byteLength - consumed;\r\n chunk = Math.min(chunkThreshold, remaining);\r\n }\r\n } else {\r\n marker.index = marshalingTarget.data.push(value) - 1;\r\n }\r\n\r\n return marker;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n private static unmarshalBinary(value: MarshalingBinaryMarker): any {\r\n if (value.index >= marshalingTarget.data.length) {\r\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\r\n }\r\n\r\n if (value.chunks === 0) {\r\n return new Uint8Array();\r\n } else if (value.chunks === 1) {\r\n return new Uint8Array(marshalingTarget.data[value.index]);\r\n } else {\r\n const buffer = new ArrayBuffer(value.size);\r\n const view = new Uint8Array(buffer);\r\n\r\n let cursor = 0;\r\n for (let c = 0; c !== value.chunks; ++c) {\r\n const chunk = marshalingTarget.data[value.index + c];\r\n view.set(chunk, cursor);\r\n cursor += chunk.byteLength;\r\n }\r\n\r\n return view;\r\n }\r\n }\r\n\r\n private static marshalError(value: any) {\r\n if (value instanceof Error) {\r\n const props = Object.getOwnPropertyDescriptors(value);\r\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\r\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\r\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\r\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\r\n return Object.create(Object.prototype, props);\r\n }\r\n\r\n return undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG/D,0BAA0B;AAE1B,IAAI,gBAAoC,CAAC;AACzC,IAAI,cAAc,GAAG,CAAC,CAAC;AAUvB,gBAAgB;AAChB,MAAM,KAAW,sBAAsB,CAItC;AAJD,WAAiB,sBAAsB;IACrC,SAAgB,aAAa;QAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC;IAFe,oCAAa,gBAE5B,CAAA;AACH,CAAC,EAJgB,sBAAsB,KAAtB,sBAAsB,QAItC;AAUD,gBAAgB;AAChB,MAAM,KAAW,kBAAkB,CAIlC;AAJD,WAAiB,kBAAkB;IACjC,SAAgB,MAAM,CAAC,OAAO,GAAG,EAAE,EAAE,OAAqB,EAAE;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;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,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;SAC/C;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 RpcInterface\r\n */\r\n\r\nimport { Buffer } from \"buffer\";\r\nimport { Readable } from \"stream\";\r\nimport { BentleyStatus, IModelError } from \"../../IModelError\";\r\nimport { RpcProtocol } from \"./RpcProtocol\";\r\n\r\n// cspell:ignore unmarshal\r\n\r\nlet marshalingTarget: RpcSerializedValue;\r\nlet chunkThreshold = 0;\r\n\r\n/** @internal */\r\nexport interface MarshalingBinaryMarker {\r\n isBinary: true;\r\n index: number;\r\n size: number;\r\n chunks: number;\r\n}\r\n\r\n/** @internal */\r\nexport namespace MarshalingBinaryMarker {\r\n export function createDefault(): MarshalingBinaryMarker {\r\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface RpcSerializedValue {\r\n objects: string;\r\n data: Uint8Array[];\r\n chunks?: number;\r\n stream?: Readable;\r\n}\r\n\r\n/** @internal */\r\nexport namespace RpcSerializedValue {\r\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\r\n return { objects, data };\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class RpcMarshaling {\r\n private constructor() { }\r\n\r\n /** Serializes a value. */\r\n public static async serialize(protocol: RpcProtocol | undefined, value: any): Promise<RpcSerializedValue> {\r\n const serialized = RpcSerializedValue.create();\r\n\r\n if (typeof (value) === \"undefined\") {\r\n return serialized;\r\n }\r\n\r\n marshalingTarget = serialized;\r\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\r\n serialized.objects = JSON.stringify(value, WireFormat.marshal);\r\n marshalingTarget = undefined as any;\r\n chunkThreshold = 0;\r\n\r\n return serialized;\r\n }\r\n\r\n /** Deserializes a value. */\r\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\r\n if (value.objects === \"\") {\r\n return undefined;\r\n }\r\n\r\n marshalingTarget = value;\r\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\r\n let result;\r\n try {\r\n result = JSON.parse(value.objects, WireFormat.unmarshal);\r\n } catch (error) {\r\n if (error instanceof SyntaxError)\r\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\r\n throw error;\r\n }\r\n marshalingTarget = undefined as any;\r\n chunkThreshold = 0;\r\n\r\n return result;\r\n }\r\n}\r\n\r\nclass WireFormat {\r\n /** JSON.stringify replacer callback. */\r\n public static marshal(this: any, _key: string, value: any) {\r\n const asBinary = WireFormat.marshalBinary(value);\r\n if (asBinary) {\r\n return asBinary;\r\n }\r\n\r\n const asError = WireFormat.marshalError(value);\r\n if (asError) {\r\n return asError;\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /** JSON.parse reviver callback. */\r\n public static unmarshal(_key: string, value: any) {\r\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\r\n return WireFormat.unmarshalBinary(value);\r\n }\r\n\r\n return value;\r\n }\r\n\r\n private static marshalBinary(value: any): any {\r\n if (value instanceof Uint8Array || Buffer.isBuffer(value)) {\r\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\r\n\r\n if (chunkThreshold && value.byteLength > chunkThreshold) {\r\n marker.index = marshalingTarget.data.length;\r\n marker.chunks = 0;\r\n\r\n let cursor = value.byteOffset;\r\n const end = cursor + value.byteLength;\r\n let chunk = chunkThreshold;\r\n\r\n for (; ;) {\r\n if (cursor >= end) {\r\n break;\r\n }\r\n\r\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\r\n ++marker.chunks;\r\n cursor += chunk;\r\n\r\n const consumed = cursor - value.byteOffset;\r\n const remaining = value.byteLength - consumed;\r\n chunk = Math.min(chunkThreshold, remaining);\r\n }\r\n } else {\r\n marker.index = marshalingTarget.data.push(value) - 1;\r\n }\r\n\r\n return marker;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n private static unmarshalBinary(value: MarshalingBinaryMarker): any {\r\n if (value.index >= marshalingTarget.data.length) {\r\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\r\n }\r\n\r\n if (value.chunks === 0) {\r\n return new Uint8Array();\r\n } else if (value.chunks === 1) {\r\n return new Uint8Array(marshalingTarget.data[value.index]);\r\n } else {\r\n const buffer = new ArrayBuffer(value.size);\r\n const view = new Uint8Array(buffer);\r\n\r\n let cursor = 0;\r\n for (let c = 0; c !== value.chunks; ++c) {\r\n const chunk = marshalingTarget.data[value.index + c];\r\n view.set(chunk, cursor);\r\n cursor += chunk.byteLength;\r\n }\r\n\r\n return view;\r\n }\r\n }\r\n\r\n private static marshalError(value: any) {\r\n if (value instanceof Error) {\r\n const props = Object.getOwnPropertyDescriptors(value);\r\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\r\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\r\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\r\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\r\n return Object.create(Object.prototype, props);\r\n }\r\n\r\n return undefined;\r\n }\r\n}\r\n"]}
@@ -26,6 +26,8 @@ export declare class RpcOperationPolicy {
26
26
  forceStrictMode: boolean;
27
27
  /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */
28
28
  allowTokenMismatch: boolean;
29
+ /** Whether to compress the operation response with one of the client's supported encodings. */
30
+ allowResponseCompression: boolean;
29
31
  }
30
32
  /** An RPC operation descriptor.
31
33
  * @internal
@@ -1 +1 @@
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AgB,oBAAoB,CAAC,OAAO,GAAE,uBAA2D,oDAC/C,MAAM,cAAc,kBAAkB,UAK/F;IAED,mHAAmH;IACnH,SAAgB,eAAe,CAAC,OAAO,EAAE,yBAAyB,oDACR,MAAM,cAAc,kBAAkB,UAK/F;IAED,sFAAsF;IACtF,SAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,uBAAuB,2EAIpF;CACF"}
@@ -31,6 +31,8 @@ export class RpcOperationPolicy {
31
31
  this.forceStrictMode = false;
32
32
  /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */
33
33
  this.allowTokenMismatch = false;
34
+ /** Whether to compress the operation response with one of the client's supported encodings. */
35
+ this.allowResponseCompression = false;
34
36
  }
35
37
  }
36
38
  /** An RPC operation descriptor.
@@ -1 +1 @@
1
- {"version":3,"file":"RpcOperation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcOperation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK/D;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACE,4DAA4D;QACrD,UAAK,GAA8B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC;QAEzF,oEAAoE;QAC7D,kBAAa,GAA6C,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,6BAA6B,CAAC;QAEhI,qEAAqE;QAC9D,oBAAe,GAAyB,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC;QAEjE,oEAAoE;QAC7D,iBAAY,GAAyB,CAAC,QAAQ,EAAE,EAAE,GA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IACJ,CAAC;IAJe,sBAAS,YAIxB,CAAA;IAED,8FAA8F;IAC9F,SAAgB,oBAAoB,CAAC,UAAmC,uBAAuB,CAAC,SAAS;QACvG,OAAO,CAAyB,MAAS,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;YAChG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,WAAkB,EAAE,WAAW,EAAE,IAAI,KAAM,SAAQ,kBAAkB;gBAAhC;;oBACzE,yBAAoB,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC;gBACvD,CAAC;aAAA,EAAE,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC;IANe,iCAAoB,uBAMnC,CAAA;IAED,mHAAmH;IACnH,SAAgB,eAAe,CAAC,OAAkC;QAChE,OAAO,CAAyB,MAAS,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;YAChG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,WAAkB,EAAE,WAAW,EAAE,IAAI,KAAM,SAAQ,kBAAkB;gBAAhC;;oBACzE,UAAK,GAAG,OAAO,CAAC;gBAClC,CAAC;aAAA,EAAE,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC;IANe,4BAAe,kBAM9B,CAAA;IAED,sFAAsF;IACtF,SAAgB,gBAAgB,CAAC,MAAoD;QACnF,OAAO,CAAyB,UAAqC,EAAE,EAAE;YACtE,UAAkB,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC;IAJe,6BAAgB,mBAI/B,CAAA;AACH,CAAC,EA1CgB,YAAY,KAAZ,YAAY,QA0C5B","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 RpcInterface\r\n */\r\n\r\nimport { BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\r\nimport { RpcResponseCacheControl } from \"./RpcConstants\";\r\nimport { OPERATION, POLICY, RpcRegistry } from \"./RpcRegistry\";\r\nimport {\r\n RpcRequestCallback_T, RpcRequestInitialRetryIntervalSupplier_T, RpcRequestTokenSupplier_T, RpcResponseCachingCallback_T,\r\n} from \"./RpcRequest\";\r\n\r\n/** The policy for an RPC operation.\r\n * @internal\r\n */\r\nexport class RpcOperationPolicy {\r\n /** Supplies the IModelRpcProps for an operation request. */\r\n public token: RpcRequestTokenSupplier_T = (request) => request.findTokenPropsParameter();\r\n\r\n /** Supplies the initial retry interval for an operation request. */\r\n public retryInterval: RpcRequestInitialRetryIntervalSupplier_T = (configuration) => configuration.pendingOperationRetryInterval;\r\n\r\n /** Called before every operation request on the frontend is sent. */\r\n public requestCallback: RpcRequestCallback_T = (_request) => { };\r\n\r\n /** Called after every operation request on the frontend is sent. */\r\n public sentCallback: RpcRequestCallback_T = (_request) => { };\r\n\r\n /**\r\n * Determines if caching is permitted for an operation response.\r\n * @note Not all RPC protocols support caching.\r\n */\r\n public allowResponseCaching: RpcResponseCachingCallback_T = (_request) => RpcResponseCacheControl.None;\r\n\r\n /** Forces RpcConfiguration.strictMode for this operation. */\r\n public forceStrictMode: boolean = false;\r\n\r\n /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */\r\n public allowTokenMismatch: boolean = false;\r\n}\r\n\r\n/** An RPC operation descriptor.\r\n * @internal\r\n */\r\nexport class RpcOperation {\r\n /** A fallback token to use for RPC requests that do not semantically depend on an iModel. */\r\n public static fallbackToken: IModelRpcProps | undefined = undefined;\r\n\r\n /** Looks up an RPC operation by name. */\r\n public static lookup(target: string | RpcInterfaceDefinition, operationName: string): RpcOperation {\r\n const definition = typeof (target) === \"string\" ? RpcRegistry.instance.lookupInterfaceDefinition(target) : target;\r\n const propertyName: string | symbol = RpcOperation.computeOperationName(operationName);\r\n\r\n const proto = (definition.prototype as any);\r\n if (!proto.hasOwnProperty(propertyName))\r\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${definition.interfaceName}\" does not does not declare operation \"${operationName}\"`);\r\n\r\n return proto[propertyName][OPERATION];\r\n }\r\n\r\n /** Iterates the operations of an RPC interface definition. */\r\n public static forEach(definition: RpcInterfaceDefinition, callback: (operation: RpcOperation) => void): void {\r\n Object.getOwnPropertyNames(definition.prototype).forEach((operationName) => {\r\n if (operationName === \"constructor\" || operationName === \"configurationSupplier\")\r\n return;\r\n\r\n const propertyName = RpcOperation.computeOperationName(operationName);\r\n callback((definition.prototype as any)[propertyName][OPERATION]);\r\n });\r\n }\r\n\r\n /** The RPC interface definition for this operation. */\r\n public readonly interfaceDefinition: RpcInterfaceDefinition;\r\n\r\n /** The name of this operation. */\r\n public readonly operationName: string;\r\n\r\n /** The version of this operation. */\r\n public get interfaceVersion(): string { return this.interfaceDefinition.interfaceVersion; }\r\n\r\n /** The policy for this operation. */\r\n public policy: RpcOperationPolicy;\r\n\r\n /** @internal */\r\n public constructor(definition: RpcInterfaceDefinition, operation: string, policy: RpcOperationPolicy) {\r\n this.interfaceDefinition = definition;\r\n this.operationName = operation;\r\n this.policy = policy;\r\n }\r\n\r\n /** @internal */\r\n public static computeOperationName(identifier: string): string {\r\n const c = identifier.indexOf(\":\");\r\n if (c === -1)\r\n return identifier;\r\n\r\n return identifier.substring(0, c + 1);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport type RpcOperationPolicyProps = Partial<RpcOperationPolicy>;\r\n\r\n/** @internal */\r\nexport namespace RpcOperation { // eslint-disable-line no-redeclare\r\n function obtainInstance(obj: RpcOperationPolicy | RpcOperationPolicyProps) {\r\n if (obj instanceof RpcOperationPolicy) {\r\n return obj;\r\n } else {\r\n const instance = new RpcOperationPolicy();\r\n Object.assign(instance, obj);\r\n return instance;\r\n }\r\n }\r\n\r\n /** Decorator for setting the policy for an RPC operation function. */\r\n export function setPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\r\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, obtainInstance(policy));\r\n };\r\n }\r\n\r\n /** Convenience decorator for setting an RPC operation policy that allows response caching. */\r\n export function allowResponseCaching(control: RpcResponseCacheControl = RpcResponseCacheControl.Immutable) {\r\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\r\n public override allowResponseCaching = () => control;\r\n }());\r\n };\r\n }\r\n\r\n /** Convenience decorator for setting an RPC operation policy that supplies the IModelRpcProps for an operation. */\r\n export function setRoutingProps(handler: RpcRequestTokenSupplier_T) {\r\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\r\n public override token = handler;\r\n }());\r\n };\r\n }\r\n\r\n /** Decorator for setting the default policy for an RPC interface definition class. */\r\n export function setDefaultPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\r\n return <T extends RpcInterface>(definition: RpcInterfaceDefinition<T>) => {\r\n (definition as any)[POLICY] = obtainInstance(policy);\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RpcOperation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcOperation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,uBAAuB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hC;;oBACzE,UAAK,GAAG,OAAO,CAAC;gBAClC,CAAC;aAAA,EAAE,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC;IANe,4BAAe,kBAM9B,CAAA;IAED,sFAAsF;IACtF,SAAgB,gBAAgB,CAAC,MAAoD;QACnF,OAAO,CAAyB,UAAqC,EAAE,EAAE;YACtE,UAAkB,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC;IAJe,6BAAgB,mBAI/B,CAAA;AACH,CAAC,EA1CgB,YAAY,KAAZ,YAAY,QA0C5B","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 RpcInterface\r\n */\r\n\r\nimport { BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\r\nimport { RpcResponseCacheControl } from \"./RpcConstants\";\r\nimport { OPERATION, POLICY, RpcRegistry } from \"./RpcRegistry\";\r\nimport {\r\n RpcRequestCallback_T, RpcRequestInitialRetryIntervalSupplier_T, RpcRequestTokenSupplier_T, RpcResponseCachingCallback_T,\r\n} from \"./RpcRequest\";\r\n\r\n/** The policy for an RPC operation.\r\n * @internal\r\n */\r\nexport class RpcOperationPolicy {\r\n /** Supplies the IModelRpcProps for an operation request. */\r\n public token: RpcRequestTokenSupplier_T = (request) => request.findTokenPropsParameter();\r\n\r\n /** Supplies the initial retry interval for an operation request. */\r\n public retryInterval: RpcRequestInitialRetryIntervalSupplier_T = (configuration) => configuration.pendingOperationRetryInterval;\r\n\r\n /** Called before every operation request on the frontend is sent. */\r\n public requestCallback: RpcRequestCallback_T = (_request) => { };\r\n\r\n /** Called after every operation request on the frontend is sent. */\r\n public sentCallback: RpcRequestCallback_T = (_request) => { };\r\n\r\n /**\r\n * Determines if caching is permitted for an operation response.\r\n * @note Not all RPC protocols support caching.\r\n */\r\n public allowResponseCaching: RpcResponseCachingCallback_T = (_request) => RpcResponseCacheControl.None;\r\n\r\n /** Forces RpcConfiguration.strictMode for this operation. */\r\n public forceStrictMode: boolean = false;\r\n\r\n /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */\r\n public allowTokenMismatch: boolean = false;\r\n\r\n /** Whether to compress the operation response with one of the client's supported encodings. */\r\n public allowResponseCompression: boolean = false;\r\n}\r\n\r\n/** An RPC operation descriptor.\r\n * @internal\r\n */\r\nexport class RpcOperation {\r\n /** A fallback token to use for RPC requests that do not semantically depend on an iModel. */\r\n public static fallbackToken: IModelRpcProps | undefined = undefined;\r\n\r\n /** Looks up an RPC operation by name. */\r\n public static lookup(target: string | RpcInterfaceDefinition, operationName: string): RpcOperation {\r\n const definition = typeof (target) === \"string\" ? RpcRegistry.instance.lookupInterfaceDefinition(target) : target;\r\n const propertyName: string | symbol = RpcOperation.computeOperationName(operationName);\r\n\r\n const proto = (definition.prototype as any);\r\n if (!proto.hasOwnProperty(propertyName))\r\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${definition.interfaceName}\" does not does not declare operation \"${operationName}\"`);\r\n\r\n return proto[propertyName][OPERATION];\r\n }\r\n\r\n /** Iterates the operations of an RPC interface definition. */\r\n public static forEach(definition: RpcInterfaceDefinition, callback: (operation: RpcOperation) => void): void {\r\n Object.getOwnPropertyNames(definition.prototype).forEach((operationName) => {\r\n if (operationName === \"constructor\" || operationName === \"configurationSupplier\")\r\n return;\r\n\r\n const propertyName = RpcOperation.computeOperationName(operationName);\r\n callback((definition.prototype as any)[propertyName][OPERATION]);\r\n });\r\n }\r\n\r\n /** The RPC interface definition for this operation. */\r\n public readonly interfaceDefinition: RpcInterfaceDefinition;\r\n\r\n /** The name of this operation. */\r\n public readonly operationName: string;\r\n\r\n /** The version of this operation. */\r\n public get interfaceVersion(): string { return this.interfaceDefinition.interfaceVersion; }\r\n\r\n /** The policy for this operation. */\r\n public policy: RpcOperationPolicy;\r\n\r\n /** @internal */\r\n public constructor(definition: RpcInterfaceDefinition, operation: string, policy: RpcOperationPolicy) {\r\n this.interfaceDefinition = definition;\r\n this.operationName = operation;\r\n this.policy = policy;\r\n }\r\n\r\n /** @internal */\r\n public static computeOperationName(identifier: string): string {\r\n const c = identifier.indexOf(\":\");\r\n if (c === -1)\r\n return identifier;\r\n\r\n return identifier.substring(0, c + 1);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport type RpcOperationPolicyProps = Partial<RpcOperationPolicy>;\r\n\r\n/** @internal */\r\nexport namespace RpcOperation { // eslint-disable-line no-redeclare\r\n function obtainInstance(obj: RpcOperationPolicy | RpcOperationPolicyProps) {\r\n if (obj instanceof RpcOperationPolicy) {\r\n return obj;\r\n } else {\r\n const instance = new RpcOperationPolicy();\r\n Object.assign(instance, obj);\r\n return instance;\r\n }\r\n }\r\n\r\n /** Decorator for setting the policy for an RPC operation function. */\r\n export function setPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\r\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, obtainInstance(policy));\r\n };\r\n }\r\n\r\n /** Convenience decorator for setting an RPC operation policy that allows response caching. */\r\n export function allowResponseCaching(control: RpcResponseCacheControl = RpcResponseCacheControl.Immutable) {\r\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\r\n public override allowResponseCaching = () => control;\r\n }());\r\n };\r\n }\r\n\r\n /** Convenience decorator for setting an RPC operation policy that supplies the IModelRpcProps for an operation. */\r\n export function setRoutingProps(handler: RpcRequestTokenSupplier_T) {\r\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\r\n public override token = handler;\r\n }());\r\n };\r\n }\r\n\r\n /** Decorator for setting the default policy for an RPC interface definition class. */\r\n export function setDefaultPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\r\n return <T extends RpcInterface>(definition: RpcInterfaceDefinition<T>) => {\r\n (definition as any)[POLICY] = obtainInstance(policy);\r\n };\r\n }\r\n}\r\n"]}
@@ -46,6 +46,8 @@ export interface RpcRequestFulfillment {
46
46
  /** A protocol-specific status code value for the request. */
47
47
  status: number;
48
48
  retry?: string;
49
+ /** Whether to compress the result with one of the client's supported encodings. */
50
+ allowCompression?: boolean;
49
51
  }
50
52
  /** @internal */
51
53
  export declare namespace RpcRequestFulfillment {
@@ -55,6 +57,23 @@ export declare namespace RpcRequestFulfillment {
55
57
  * @internal
56
58
  */
57
59
  export declare type RpcProtocolEventHandler = (type: RpcProtocolEvent, object: RpcRequest | RpcInvocation, err?: any) => void;
60
+ /** Documents changes to the RPC protocol version.
61
+ * @internal
62
+ */
63
+ export declare enum RpcProtocolVersion {
64
+ None = 0,
65
+ IntroducedNoContent = 1,
66
+ IntroducedStatusCategory = 2
67
+ }
68
+ /**
69
+ * A backend response that is handled internally by the RPC system.
70
+ * @internal
71
+ */
72
+ export interface RpcManagedStatus {
73
+ iTwinRpcCoreResponse: true;
74
+ managedStatus: "pending" | "notFound";
75
+ responseValue: string;
76
+ }
58
77
  /** An application protocol for an RPC interface.
59
78
  * @internal
60
79
  */
@@ -62,7 +81,7 @@ export declare abstract class RpcProtocol {
62
81
  /** Events raised by all protocols. See [[RpcProtocolEvent]] */
63
82
  static readonly events: BeEvent<RpcProtocolEventHandler>;
64
83
  /** A version code that identifies the RPC protocol capabilties of this endpoint. */
65
- static readonly protocolVersion = 1;
84
+ static readonly protocolVersion: number;
66
85
  /** The name of the RPC protocol version header. */
67
86
  protocolVersionHeaderName: string;
68
87
  /** Events raised by the protocol. See [[RpcProtocolEvent]] */
@@ -80,6 +99,8 @@ export declare abstract class RpcProtocol {
80
99
  preserveStreams: boolean;
81
100
  /** Used by protocols that can transmit IModelRpcProps values natively. */
82
101
  checkToken: boolean;
102
+ /** Used by protocols that support user-defined status codes. */
103
+ supportsStatusCategory: boolean;
83
104
  /** If checkToken is true, will be called on the backend to inflate the IModelRpcProps for each request. */
84
105
  inflateToken(tokenFromBody: IModelRpcProps, _request: SerializedRpcRequest): IModelRpcProps;
85
106
  /** Override to supply the status corresponding to a protocol-specific code value. */
@@ -1 +1 @@
1
- {"version":3,"file":"RpcProtocol.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcProtocol.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW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,6 +25,15 @@ export var RpcRequestFulfillment;
25
25
  }
26
26
  RpcRequestFulfillment.forUnknownError = forUnknownError;
27
27
  })(RpcRequestFulfillment || (RpcRequestFulfillment = {}));
28
+ /** Documents changes to the RPC protocol version.
29
+ * @internal
30
+ */
31
+ export var RpcProtocolVersion;
32
+ (function (RpcProtocolVersion) {
33
+ RpcProtocolVersion[RpcProtocolVersion["None"] = 0] = "None";
34
+ RpcProtocolVersion[RpcProtocolVersion["IntroducedNoContent"] = 1] = "IntroducedNoContent";
35
+ RpcProtocolVersion[RpcProtocolVersion["IntroducedStatusCategory"] = 2] = "IntroducedStatusCategory";
36
+ })(RpcProtocolVersion || (RpcProtocolVersion = {}));
28
37
  /** An application protocol for an RPC interface.
29
38
  * @internal
30
39
  */
@@ -55,6 +64,8 @@ export class RpcProtocol {
55
64
  this.preserveStreams = false;
56
65
  /** Used by protocols that can transmit IModelRpcProps values natively. */
57
66
  this.checkToken = false;
67
+ /** Used by protocols that support user-defined status codes. */
68
+ this.supportsStatusCategory = false;
58
69
  this.configuration = configuration;
59
70
  this.events.addListener((type, object) => RpcProtocol.events.raiseEvent(type, object));
60
71
  }
@@ -109,5 +120,5 @@ export class RpcProtocol {
109
120
  /** Events raised by all protocols. See [[RpcProtocolEvent]] */
110
121
  RpcProtocol.events = new BeEvent();
111
122
  /** A version code that identifies the RPC protocol capabilties of this endpoint. */
112
- RpcProtocol.protocolVersion = 1;
123
+ RpcProtocol.protocolVersion = RpcProtocolVersion.IntroducedStatusCategory;
113
124
  //# sourceMappingURL=RpcProtocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcProtocol.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAoB,gBAAgB,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OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,MAAM,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC;YAC/E,OAAO,EAAE,uBAAuB,CAAC,IAAI;YACrC,eAAe,EAAE,WAAW,CAAC,eAAe;SAC7C,CAAC;IACJ,CAAC;IAQD,gBAAgB;IACT,sBAAsB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAEnG,gBAAgB;IACT,oBAAoB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;IAE/F,gBAAgB;IACT,qBAAqB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAElG,gBAAgB;IACT,mBAAmB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;;AA7G9F,+DAA+D;AACxC,kBAAM,GAAqC,IAAI,OAAO,EAAE,CAAC;AAEhF,oFAAoF;AAC7D,2BAAe,GAAG,CAAC,CAAC","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 RpcInterface\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcProtocolEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\r\nimport { RpcInvocation, SerializedRpcActivity } from \"./RpcInvocation\";\r\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcRequest } from \"./RpcRequest\";\r\n\r\n/** A serialized RPC operation descriptor.\r\n * @internal\r\n */\r\nexport interface SerializedRpcOperation {\r\n interfaceDefinition: string;\r\n operationName: string;\r\n interfaceVersion: string;\r\n encodedRequest?: string;\r\n}\r\n\r\n/** A serialized RPC operation request.\r\n * @internal\r\n */\r\nexport interface SerializedRpcRequest extends SerializedRpcActivity {\r\n operation: SerializedRpcOperation;\r\n method: string;\r\n path: string;\r\n parameters: RpcSerializedValue;\r\n caching: RpcResponseCacheControl;\r\n ip?: string;\r\n protocolVersion?: number;\r\n}\r\n\r\n/** An RPC operation request fulfillment.\r\n * @internal\r\n */\r\nexport interface RpcRequestFulfillment {\r\n /** The RPC interface for the request. */\r\n interfaceName: string;\r\n\r\n /** The id for the request. */\r\n id: string;\r\n\r\n /** The result for the request. */\r\n result: RpcSerializedValue;\r\n\r\n /** The un-serialized result for the request. */\r\n rawResult: any;\r\n\r\n /** A protocol-specific status code value for the request. */\r\n status: number;\r\n\r\n /* A protocol-specific value for retrying this request. */\r\n retry?: string;\r\n}\r\n\r\n/** @internal */\r\nexport namespace RpcRequestFulfillment {\r\n export async function forUnknownError(request: SerializedRpcRequest, error: any): Promise<RpcRequestFulfillment> {\r\n const result = await RpcMarshaling.serialize(undefined, error);\r\n\r\n return {\r\n interfaceName: request.operation.interfaceDefinition,\r\n id: request.id,\r\n result,\r\n rawResult: error,\r\n status: RpcRequestStatus.Rejected,\r\n };\r\n }\r\n}\r\n\r\n/** Handles RPC protocol events.\r\n * @internal\r\n */\r\nexport type RpcProtocolEventHandler = (type: RpcProtocolEvent, object: RpcRequest | RpcInvocation, err?: any) => void;\r\n\r\n/** An application protocol for an RPC interface.\r\n * @internal\r\n */\r\nexport abstract class RpcProtocol {\r\n /** Events raised by all protocols. See [[RpcProtocolEvent]] */\r\n public static readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\r\n\r\n /** A version code that identifies the RPC protocol capabilties of this endpoint. */\r\n public static readonly protocolVersion = 1;\r\n\r\n /** The name of the RPC protocol version header. */\r\n public protocolVersionHeaderName = \"\";\r\n\r\n /** Events raised by the protocol. See [[RpcProtocolEvent]] */\r\n public readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\r\n\r\n /** The configuration for the protocol. */\r\n public readonly configuration: RpcConfiguration;\r\n\r\n /** The RPC request class for this protocol. */\r\n public abstract readonly requestType: typeof RpcRequest;\r\n\r\n /** The RPC invocation class for this protocol. */\r\n public readonly invocationType: typeof RpcInvocation = RpcInvocation;\r\n\r\n public serializedClientRequestContextHeaderNames: SerializedRpcActivity = {\r\n /** The name of the request id header. */\r\n id: \"\",\r\n\r\n /** The name of the application id header */\r\n applicationId: \"\",\r\n\r\n /** The name of the version header. */\r\n applicationVersion: \"\",\r\n\r\n /** The name of the session id header */\r\n sessionId: \"\",\r\n\r\n /** The name of the authorization header. */\r\n authorization: \"\",\r\n };\r\n\r\n /** If greater than zero, specifies where to break large binary request payloads. */\r\n public transferChunkThreshold: number = 0;\r\n\r\n /** Used by protocols that can transmit stream values natively. */\r\n public preserveStreams: boolean = false;\r\n\r\n /** Used by protocols that can transmit IModelRpcProps values natively. */\r\n public checkToken: boolean = false;\r\n\r\n /** If checkToken is true, will be called on the backend to inflate the IModelRpcProps for each request. */\r\n public inflateToken(tokenFromBody: IModelRpcProps, _request: SerializedRpcRequest): IModelRpcProps { return tokenFromBody; }\r\n\r\n /** Override to supply the status corresponding to a protocol-specific code value. */\r\n public getStatus(code: number): RpcRequestStatus {\r\n return code;\r\n }\r\n\r\n /** Override to supply the protocol-specific code corresponding to a status value. */\r\n public getCode(status: RpcRequestStatus): number {\r\n return status;\r\n }\r\n\r\n /** Override to supply the protocol-specific path value for an RPC operation. */\r\n public supplyPathForOperation(operation: RpcOperation, _request: RpcRequest | undefined): string {\r\n return JSON.stringify(operation);\r\n }\r\n\r\n /** Override to supply the operation for a protocol-specific path value. */\r\n public getOperationFromPath(path: string): SerializedRpcOperation {\r\n return JSON.parse(path);\r\n }\r\n\r\n /** Obtains the implementation result on the backend for an RPC operation request. */\r\n public async fulfill(request: SerializedRpcRequest): Promise<RpcRequestFulfillment> {\r\n return new (this.invocationType)(this, request).fulfillment;\r\n }\r\n\r\n /** Serializes a request. */\r\n public async serialize(request: RpcRequest): Promise<SerializedRpcRequest> {\r\n const serializedContext = await RpcConfiguration.requestContext.serialize(request);\r\n return {\r\n ...serializedContext,\r\n operation: {\r\n interfaceDefinition: request.operation.interfaceDefinition.interfaceName,\r\n operationName: request.operation.operationName,\r\n interfaceVersion: request.operation.interfaceVersion,\r\n },\r\n method: request.method,\r\n path: request.path,\r\n parameters: await RpcMarshaling.serialize(request.protocol, request.parameters),\r\n caching: RpcResponseCacheControl.None,\r\n protocolVersion: RpcProtocol.protocolVersion,\r\n };\r\n }\r\n\r\n /** Constructs a protocol. */\r\n public constructor(configuration: RpcConfiguration) {\r\n this.configuration = configuration;\r\n this.events.addListener((type, object) => RpcProtocol.events.raiseEvent(type, object));\r\n }\r\n\r\n /** @internal */\r\n public onRpcClientInitialized(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\r\n\r\n /** @internal */\r\n public onRpcImplInitialized(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\r\n\r\n /** @internal */\r\n public onRpcClientTerminated(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\r\n\r\n /** @internal */\r\n public onRpcImplTerminated(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\r\n}\r\n"]}
1
+ {"version":3,"file":"RpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcProtocol.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAoB,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAyB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAA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a;gBAC9C,gBAAgB,EAAE,OAAO,CAAC,SAAS,CAAC,gBAAgB;aACrD;YACD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,MAAM,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC;YAC/E,OAAO,EAAE,uBAAuB,CAAC,IAAI;YACrC,eAAe,EAAE,WAAW,CAAC,eAAe;SAC7C,CAAC;IACJ,CAAC;IAQD,gBAAgB;IACT,sBAAsB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAEnG,gBAAgB;IACT,oBAAoB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;IAE/F,gBAAgB;IACT,qBAAqB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAElG,gBAAgB;IACT,mBAAmB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;;AAhH9F,+DAA+D;AACxC,kBAAM,GAAqC,IAAI,OAAO,EAAE,CAAC;AAEhF,oFAAoF;AAC7D,2BAAe,GAAW,kBAAkB,CAAC,wBAAwB,CAAC","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 RpcInterface\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcProtocolEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\r\nimport { RpcInvocation, SerializedRpcActivity } from \"./RpcInvocation\";\r\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcRequest } from \"./RpcRequest\";\r\n\r\n/** A serialized RPC operation descriptor.\r\n * @internal\r\n */\r\nexport interface SerializedRpcOperation {\r\n interfaceDefinition: string;\r\n operationName: string;\r\n interfaceVersion: string;\r\n encodedRequest?: string;\r\n}\r\n\r\n/** A serialized RPC operation request.\r\n * @internal\r\n */\r\nexport interface SerializedRpcRequest extends SerializedRpcActivity {\r\n operation: SerializedRpcOperation;\r\n method: string;\r\n path: string;\r\n parameters: RpcSerializedValue;\r\n caching: RpcResponseCacheControl;\r\n ip?: string;\r\n protocolVersion?: number;\r\n}\r\n\r\n/** An RPC operation request fulfillment.\r\n * @internal\r\n */\r\nexport interface RpcRequestFulfillment {\r\n /** The RPC interface for the request. */\r\n interfaceName: string;\r\n\r\n /** The id for the request. */\r\n id: string;\r\n\r\n /** The result for the request. */\r\n result: RpcSerializedValue;\r\n\r\n /** The un-serialized result for the request. */\r\n rawResult: any;\r\n\r\n /** A protocol-specific status code value for the request. */\r\n status: number;\r\n\r\n /* A protocol-specific value for retrying this request. */\r\n retry?: string;\r\n\r\n /** Whether to compress the result with one of the client's supported encodings. */\r\n allowCompression?: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport namespace RpcRequestFulfillment {\r\n export async function forUnknownError(request: SerializedRpcRequest, error: any): Promise<RpcRequestFulfillment> {\r\n const result = await RpcMarshaling.serialize(undefined, error);\r\n\r\n return {\r\n interfaceName: request.operation.interfaceDefinition,\r\n id: request.id,\r\n result,\r\n rawResult: error,\r\n status: RpcRequestStatus.Rejected,\r\n };\r\n }\r\n}\r\n\r\n/** Handles RPC protocol events.\r\n * @internal\r\n */\r\nexport type RpcProtocolEventHandler = (type: RpcProtocolEvent, object: RpcRequest | RpcInvocation, err?: any) => void;\r\n\r\n/** Documents changes to the RPC protocol version.\r\n * @internal\r\n */\r\nexport enum RpcProtocolVersion {\r\n None = 0,\r\n IntroducedNoContent = 1,\r\n IntroducedStatusCategory = 2\r\n}\r\n\r\n/**\r\n * A backend response that is handled internally by the RPC system.\r\n * @internal\r\n */\r\nexport interface RpcManagedStatus {\r\n iTwinRpcCoreResponse: true;\r\n managedStatus: \"pending\" | \"notFound\";\r\n responseValue: string;\r\n}\r\n\r\n/** An application protocol for an RPC interface.\r\n * @internal\r\n */\r\nexport abstract class RpcProtocol {\r\n /** Events raised by all protocols. See [[RpcProtocolEvent]] */\r\n public static readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\r\n\r\n /** A version code that identifies the RPC protocol capabilties of this endpoint. */\r\n public static readonly protocolVersion: number = RpcProtocolVersion.IntroducedStatusCategory;\r\n\r\n /** The name of the RPC protocol version header. */\r\n public protocolVersionHeaderName = \"\";\r\n\r\n /** Events raised by the protocol. See [[RpcProtocolEvent]] */\r\n public readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\r\n\r\n /** The configuration for the protocol. */\r\n public readonly configuration: RpcConfiguration;\r\n\r\n /** The RPC request class for this protocol. */\r\n public abstract readonly requestType: typeof RpcRequest;\r\n\r\n /** The RPC invocation class for this protocol. */\r\n public readonly invocationType: typeof RpcInvocation = RpcInvocation;\r\n\r\n public serializedClientRequestContextHeaderNames: SerializedRpcActivity = {\r\n /** The name of the request id header. */\r\n id: \"\",\r\n\r\n /** The name of the application id header */\r\n applicationId: \"\",\r\n\r\n /** The name of the version header. */\r\n applicationVersion: \"\",\r\n\r\n /** The name of the session id header */\r\n sessionId: \"\",\r\n\r\n /** The name of the authorization header. */\r\n authorization: \"\",\r\n };\r\n\r\n /** If greater than zero, specifies where to break large binary request payloads. */\r\n public transferChunkThreshold: number = 0;\r\n\r\n /** Used by protocols that can transmit stream values natively. */\r\n public preserveStreams: boolean = false;\r\n\r\n /** Used by protocols that can transmit IModelRpcProps values natively. */\r\n public checkToken: boolean = false;\r\n\r\n /** Used by protocols that support user-defined status codes. */\r\n public supportsStatusCategory: boolean = false;\r\n\r\n /** If checkToken is true, will be called on the backend to inflate the IModelRpcProps for each request. */\r\n public inflateToken(tokenFromBody: IModelRpcProps, _request: SerializedRpcRequest): IModelRpcProps { return tokenFromBody; }\r\n\r\n /** Override to supply the status corresponding to a protocol-specific code value. */\r\n public getStatus(code: number): RpcRequestStatus {\r\n return code;\r\n }\r\n\r\n /** Override to supply the protocol-specific code corresponding to a status value. */\r\n public getCode(status: RpcRequestStatus): number {\r\n return status;\r\n }\r\n\r\n /** Override to supply the protocol-specific path value for an RPC operation. */\r\n public supplyPathForOperation(operation: RpcOperation, _request: RpcRequest | undefined): string {\r\n return JSON.stringify(operation);\r\n }\r\n\r\n /** Override to supply the operation for a protocol-specific path value. */\r\n public getOperationFromPath(path: string): SerializedRpcOperation {\r\n return JSON.parse(path);\r\n }\r\n\r\n /** Obtains the implementation result on the backend for an RPC operation request. */\r\n public async fulfill(request: SerializedRpcRequest): Promise<RpcRequestFulfillment> {\r\n return new (this.invocationType)(this, request).fulfillment;\r\n }\r\n\r\n /** Serializes a request. */\r\n public async serialize(request: RpcRequest): Promise<SerializedRpcRequest> {\r\n const serializedContext = await RpcConfiguration.requestContext.serialize(request);\r\n return {\r\n ...serializedContext,\r\n operation: {\r\n interfaceDefinition: request.operation.interfaceDefinition.interfaceName,\r\n operationName: request.operation.operationName,\r\n interfaceVersion: request.operation.interfaceVersion,\r\n },\r\n method: request.method,\r\n path: request.path,\r\n parameters: await RpcMarshaling.serialize(request.protocol, request.parameters),\r\n caching: RpcResponseCacheControl.None,\r\n protocolVersion: RpcProtocol.protocolVersion,\r\n };\r\n }\r\n\r\n /** Constructs a protocol. */\r\n public constructor(configuration: RpcConfiguration) {\r\n this.configuration = configuration;\r\n this.events.addListener((type, object) => RpcProtocol.events.raiseEvent(type, object));\r\n }\r\n\r\n /** @internal */\r\n public onRpcClientInitialized(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\r\n\r\n /** @internal */\r\n public onRpcImplInitialized(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\r\n\r\n /** @internal */\r\n public onRpcClientTerminated(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\r\n\r\n /** @internal */\r\n public onRpcImplTerminated(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\r\n}\r\n"]}
@@ -86,6 +86,7 @@ export declare abstract class RpcRequest<TResponse = any> {
86
86
  private _transientFaults;
87
87
  protected _response: Response | undefined;
88
88
  protected _rawPromise: Promise<Response | undefined>;
89
+ protected responseProtocolVersion: number;
89
90
  /** All RPC requests that are currently in flight. */
90
91
  static get activeRequests(): ReadonlyMap<string, RpcRequest>;
91
92
  /** Events raised by RpcRequest. See [[RpcRequestEvent]] */
@@ -156,10 +157,12 @@ export declare abstract class RpcRequest<TResponse = any> {
156
157
  protected computeRetryAfter(attempts: number): number;
157
158
  protected recordTransientFault(): void;
158
159
  protected resetTransientFaultCount(): void;
160
+ protected supportsStatusCategory(): boolean;
159
161
  cancel(): void;
160
162
  submit(): Promise<void>;
161
163
  protected handleUnknownResponse(code: number): void;
162
164
  private handleResponse;
165
+ private transformResponseStatus;
163
166
  private handleResolved;
164
167
  private handleRejected;
165
168
  private handleNoContent;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcRequest.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcRequest.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAuB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAoB,eAAe,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C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