@itwin/core-common 3.3.0-dev.9 → 3.4.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -1
- package/lib/cjs/AnalysisStyle.d.ts +7 -7
- package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.d.ts +2 -2
- package/lib/cjs/BackgroundMapProvider.js +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.d.ts +2 -2
- package/lib/cjs/BackgroundMapSettings.d.ts.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/ChangedEntities.d.ts +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/Code.d.ts +7 -7
- package/lib/cjs/Code.d.ts.map +1 -1
- package/lib/cjs/Code.js +5 -5
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorDef.d.ts +2 -0
- package/lib/cjs/ColorDef.d.ts.map +1 -1
- package/lib/cjs/ColorDef.js +4 -0
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/ContextRealityModel.d.ts +6 -6
- package/lib/cjs/ContextRealityModel.d.ts.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.d.ts +58 -57
- package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +23 -26
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +6 -6
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.d.ts +8 -8
- package/lib/cjs/EmphasizeElementsProps.d.ts.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.d.ts +2 -2
- package/lib/cjs/EntityProps.d.ts.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/Environment.d.ts +2 -2
- package/lib/cjs/Environment.d.ts.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.d.ts +0 -1
- package/lib/cjs/FeatureIndex.d.ts.map +1 -1
- package/lib/cjs/FeatureIndex.js +0 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts +40 -9
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +41 -6
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.d.ts +6 -2
- package/lib/cjs/FeatureTable.d.ts.map +1 -1
- package/lib/cjs/FeatureTable.js +26 -6
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/HiddenLine.d.ts +3 -3
- package/lib/cjs/HiddenLine.d.ts.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/IModel.d.ts +9 -6
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.d.ts +3 -3
- package/lib/cjs/IModelError.d.ts.map +1 -1
- package/lib/cjs/IModelError.js +1 -2
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/LightSettings.d.ts +4 -4
- package/lib/cjs/LightSettings.d.ts.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/MapImagerySettings.d.ts +7 -7
- package/lib/cjs/MapImagerySettings.d.ts.map +1 -1
- package/lib/cjs/MapImagerySettings.js +3 -3
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +21 -14
- package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
- package/lib/cjs/MapLayerSettings.js +6 -6
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/ModelProps.d.ts +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.d.ts +4 -4
- package/lib/cjs/PlanProjectionSettings.d.ts.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.d.ts +11 -11
- package/lib/cjs/PlanarClipMask.d.ts.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/RenderSchedule.d.ts +66 -8
- package/lib/cjs/RenderSchedule.d.ts.map +1 -1
- package/lib/cjs/RenderSchedule.js +228 -8
- package/lib/cjs/RenderSchedule.js.map +1 -1
- package/lib/cjs/RgbColor.d.ts +1 -0
- package/lib/cjs/RgbColor.d.ts.map +1 -1
- package/lib/cjs/RgbColor.js +4 -0
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.d.ts.map +1 -1
- package/lib/cjs/RpcInterface.js +91 -4
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/SpatialClassification.d.ts +9 -9
- package/lib/cjs/SpatialClassification.d.ts.map +1 -1
- package/lib/cjs/SpatialClassification.js +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.d.ts +10 -10
- package/lib/cjs/SubCategoryAppearance.d.ts.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.d.ts +6 -6
- package/lib/cjs/SubCategoryOverride.d.ts.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/ViewFlags.d.ts +3 -3
- package/lib/cjs/ViewFlags.d.ts.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.d.ts +3 -1
- package/lib/cjs/ViewProps.d.ts.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/core-common.d.ts +7 -1
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +7 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.d.ts +24 -0
- package/lib/cjs/ipc/IpcSession.d.ts.map +1 -0
- package/lib/cjs/ipc/IpcSession.js +28 -0
- package/lib/cjs/ipc/IpcSession.js.map +1 -0
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +4 -2
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +42 -2
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +16 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.d.ts +2 -0
- package/lib/cjs/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +13 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +17 -4
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.d.ts +6 -2
- package/lib/cjs/rpc/core/RpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts +11 -6
- package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +12 -14
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.d.ts +11 -0
- package/lib/cjs/rpc/core/RpcSessionInvocation.d.ts.map +1 -0
- package/lib/cjs/rpc/core/RpcSessionInvocation.js +60 -0
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -0
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +0 -5
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js +0 -47
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts +2 -3
- package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +25 -20
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.d.ts +4 -0
- package/lib/cjs/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
- package/lib/cjs/tile/IModelTileIO.js +2 -2
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/AnalysisStyle.d.ts +7 -7
- package/lib/esm/AnalysisStyle.d.ts.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.d.ts +2 -2
- package/lib/esm/BackgroundMapProvider.js +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.d.ts +2 -2
- package/lib/esm/BackgroundMapSettings.d.ts.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/ChangedEntities.d.ts +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/Code.d.ts +7 -7
- package/lib/esm/Code.d.ts.map +1 -1
- package/lib/esm/Code.js +5 -5
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorDef.d.ts +2 -0
- package/lib/esm/ColorDef.d.ts.map +1 -1
- package/lib/esm/ColorDef.js +4 -0
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/ContextRealityModel.d.ts +6 -6
- package/lib/esm/ContextRealityModel.d.ts.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.d.ts +58 -57
- package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +23 -26
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +6 -6
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.d.ts +8 -8
- package/lib/esm/EmphasizeElementsProps.d.ts.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.d.ts +2 -2
- package/lib/esm/EntityProps.d.ts.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/Environment.d.ts +2 -2
- package/lib/esm/Environment.d.ts.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.d.ts +0 -1
- package/lib/esm/FeatureIndex.d.ts.map +1 -1
- package/lib/esm/FeatureIndex.js +0 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts +40 -9
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +41 -6
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.d.ts +6 -2
- package/lib/esm/FeatureTable.d.ts.map +1 -1
- package/lib/esm/FeatureTable.js +26 -6
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/HiddenLine.d.ts +3 -3
- package/lib/esm/HiddenLine.d.ts.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/IModel.d.ts +9 -6
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.d.ts +3 -3
- package/lib/esm/IModelError.d.ts.map +1 -1
- package/lib/esm/IModelError.js +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/LightSettings.d.ts +4 -4
- package/lib/esm/LightSettings.d.ts.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/MapImagerySettings.d.ts +7 -7
- package/lib/esm/MapImagerySettings.d.ts.map +1 -1
- package/lib/esm/MapImagerySettings.js +3 -3
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +21 -14
- package/lib/esm/MapLayerSettings.d.ts.map +1 -1
- package/lib/esm/MapLayerSettings.js +6 -6
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/ModelProps.d.ts +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.d.ts +4 -4
- package/lib/esm/PlanProjectionSettings.d.ts.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.d.ts +11 -11
- package/lib/esm/PlanarClipMask.d.ts.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/RenderSchedule.d.ts +66 -8
- package/lib/esm/RenderSchedule.d.ts.map +1 -1
- package/lib/esm/RenderSchedule.js +229 -9
- package/lib/esm/RenderSchedule.js.map +1 -1
- package/lib/esm/RgbColor.d.ts +1 -0
- package/lib/esm/RgbColor.d.ts.map +1 -1
- package/lib/esm/RgbColor.js +4 -0
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.d.ts.map +1 -1
- package/lib/esm/RpcInterface.js +91 -4
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/SpatialClassification.d.ts +9 -9
- package/lib/esm/SpatialClassification.d.ts.map +1 -1
- package/lib/esm/SpatialClassification.js +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.d.ts +10 -10
- package/lib/esm/SubCategoryAppearance.d.ts.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.d.ts +6 -6
- package/lib/esm/SubCategoryOverride.d.ts.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/ViewFlags.d.ts +3 -3
- package/lib/esm/ViewFlags.d.ts.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.d.ts +3 -1
- package/lib/esm/ViewProps.d.ts.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/core-common.d.ts +7 -1
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +7 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/ipc/IpcSession.d.ts +24 -0
- package/lib/esm/ipc/IpcSession.d.ts.map +1 -0
- package/lib/esm/ipc/IpcSession.js +24 -0
- package/lib/esm/ipc/IpcSession.js.map +1 -0
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +4 -2
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +41 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +15 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.d.ts +2 -0
- package/lib/esm/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +13 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +18 -5
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.d.ts +6 -2
- package/lib/esm/rpc/core/RpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts +11 -6
- package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +6 -8
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.d.ts +11 -0
- package/lib/esm/rpc/core/RpcSessionInvocation.d.ts.map +1 -0
- package/lib/esm/rpc/core/RpcSessionInvocation.js +56 -0
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -0
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +0 -5
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js +0 -47
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.d.ts +2 -3
- package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +25 -20
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.d.ts +4 -0
- package/lib/esm/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +2 -2
- package/lib/esm/tile/IModelTileIO.js +2 -2
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/package.json +13 -13
|
@@ -6,8 +6,16 @@
|
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module RpcInterface
|
|
8
8
|
*/
|
|
9
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
12
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
|
+
};
|
|
9
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
16
|
exports.IModelReadRpcInterface = exports.IModelNotFoundResponse = void 0;
|
|
17
|
+
const RpcConstants_1 = require("./core/RpcConstants");
|
|
18
|
+
const RpcOperation_1 = require("./core/RpcOperation");
|
|
11
19
|
const RpcInterface_1 = require("../RpcInterface");
|
|
12
20
|
const RpcManager_1 = require("../RpcManager");
|
|
13
21
|
const RpcControl_1 = require("./core/RpcControl");
|
|
@@ -19,6 +27,7 @@ class IModelNotFoundResponse extends RpcControl_1.RpcNotFoundResponse {
|
|
|
19
27
|
constructor() {
|
|
20
28
|
super(...arguments);
|
|
21
29
|
this.isIModelNotFoundResponse = true;
|
|
30
|
+
this.message = "iModel not found";
|
|
22
31
|
}
|
|
23
32
|
}
|
|
24
33
|
exports.IModelNotFoundResponse = IModelNotFoundResponse;
|
|
@@ -38,6 +47,7 @@ class IModelReadRpcInterface extends RpcInterface_1.RpcInterface {
|
|
|
38
47
|
===========================================================================================*/
|
|
39
48
|
async getConnectionProps(_iModelToken) { return this.forward(arguments); }
|
|
40
49
|
async queryRows(_iModelToken, _request) { return this.forward(arguments); }
|
|
50
|
+
async querySubCategories(_iModelToken, _categoryIds) { return this.forward(arguments); }
|
|
41
51
|
async queryBlob(_iModelToken, _request) { return this.forward(arguments); }
|
|
42
52
|
async getModelProps(_iModelToken, _modelIds) { return this.forward(arguments); }
|
|
43
53
|
async queryModelRanges(_iModelToken, _modelIds) { return this.forward(arguments); }
|
|
@@ -68,9 +78,39 @@ class IModelReadRpcInterface extends RpcInterface_1.RpcInterface {
|
|
|
68
78
|
return this.forward(arguments);
|
|
69
79
|
}
|
|
70
80
|
}
|
|
71
|
-
exports.IModelReadRpcInterface = IModelReadRpcInterface;
|
|
72
81
|
/** The immutable name of the interface. */
|
|
73
82
|
IModelReadRpcInterface.interfaceName = "IModelReadRpcInterface";
|
|
74
83
|
/** The semantic version of the interface. */
|
|
75
|
-
IModelReadRpcInterface.interfaceVersion = "3.
|
|
84
|
+
IModelReadRpcInterface.interfaceVersion = "3.2.0";
|
|
85
|
+
__decorate([
|
|
86
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
87
|
+
], IModelReadRpcInterface.prototype, "getConnectionProps", null);
|
|
88
|
+
__decorate([
|
|
89
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
90
|
+
], IModelReadRpcInterface.prototype, "querySubCategories", null);
|
|
91
|
+
__decorate([
|
|
92
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
93
|
+
], IModelReadRpcInterface.prototype, "getModelProps", null);
|
|
94
|
+
__decorate([
|
|
95
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
96
|
+
], IModelReadRpcInterface.prototype, "queryModelRanges", null);
|
|
97
|
+
__decorate([
|
|
98
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
99
|
+
], IModelReadRpcInterface.prototype, "getClassHierarchy", null);
|
|
100
|
+
__decorate([
|
|
101
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
102
|
+
], IModelReadRpcInterface.prototype, "getViewStateData", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
105
|
+
], IModelReadRpcInterface.prototype, "getDefaultViewId", null);
|
|
106
|
+
__decorate([
|
|
107
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
108
|
+
], IModelReadRpcInterface.prototype, "getCustomViewState3dData", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
111
|
+
], IModelReadRpcInterface.prototype, "hydrateViewState", null);
|
|
112
|
+
__decorate([
|
|
113
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
114
|
+
], IModelReadRpcInterface.prototype, "getGeoCoordinatesFromIModelCoordinates", null);
|
|
115
|
+
exports.IModelReadRpcInterface = IModelReadRpcInterface;
|
|
76
116
|
//# sourceMappingURL=IModelReadRpcInterface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelReadRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/IModelReadRpcInterface.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAiBH,kDAA+C;AAC/C,8CAA2C;AAI3C,kDAAwD;AAGxD;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,gCAAmB;IAA/D;;QACS,6BAAwB,GAAY,IAAI,CAAC;IAClD,CAAC;CAAA;AAFD,wDAEC;AAED;;;;GAIG;AACH,MAAsB,sBAAuB,SAAQ,2BAAY;IAC/D,oEAAoE;IAC7D,MAAM,CAAC,SAAS,KAA6B,OAAO,uBAAU,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAEtH,0FAA0F;IACnF,MAAM,CAAC,mBAAmB,CAAC,KAAsB,IAA4B,OAAO,uBAAU,CAAC,qBAAqB,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAQ7J;;;iGAG6F;IACtF,KAAK,CAAC,kBAAkB,CAAC,YAAgC,IAAoC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS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E,MAAkC,IAA0C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACnK,KAAK,CAAC,6BAA6B,CAAC,YAA4B,EAAE,MAA8C,IAAwD,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACzM,KAAK,CAAC,sCAAsC,CAAC,YAA4B,EAAE,MAAqC,IAA6C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9L,KAAK,CAAC,sCAAsC,CAAC,YAA4B,EAAE,MAAkC,IAA0C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACxL,KAAK,CAAC,kBAAkB,CAAC,YAA4B,EAAE,MAAmC,IAAqB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAChJ,KAAK,CAAC,gBAAgB,CAAC,YAA4B,EAAE,iBAAmC,IAAsC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/J,KAAK,CAAC,gBAAgB,CAAC,YAA4B,EAAE,kBAAuD,EAAE,QAA6B;QAChJ,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;;AA/CH,wDAgDC;AAzCC,2CAA2C;AACpB,oCAAa,GAAG,wBAAwB,CAAC;AAEhE,6CAA6C;AAC/B,uCAAgB,GAAG,OAAO,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 { GuidString, Id64String } from \"@itwin/core-bentley\";\r\nimport { Range3dProps } from \"@itwin/core-geometry\";\r\nimport { CodeProps } from \"../Code\";\r\nimport { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse } from \"../ConcurrentQuery\";\r\nimport { ElementLoadOptions, ElementProps } from \"../ElementProps\";\r\nimport { EntityQueryParams } from \"../EntityProps\";\r\nimport { FontMapProps } from \"../Fonts\";\r\nimport {\r\n GeoCoordinatesRequestProps, GeoCoordinatesResponseProps, IModelCoordinatesRequestProps, IModelCoordinatesResponseProps,\r\n} from \"../GeoCoordinateServices\";\r\nimport { GeometryContainmentRequestProps, GeometryContainmentResponseProps } from \"../GeometryContainment\";\r\nimport { GeometrySummaryRequestProps } from \"../GeometrySummary\";\r\nimport { IModelConnectionProps, IModelRpcOpenProps, IModelRpcProps } from \"../IModel\";\r\nimport { MassPropertiesPerCandidateRequestProps, MassPropertiesPerCandidateResponseProps, MassPropertiesRequestProps, MassPropertiesResponseProps } from \"../MassProperties\";\r\nimport { ModelProps } from \"../ModelProps\";\r\nimport { RpcInterface } from \"../RpcInterface\";\r\nimport { RpcManager } from \"../RpcManager\";\r\nimport { SnapRequestProps, SnapResponseProps } from \"../Snapping\";\r\nimport { TextureData, TextureLoadProps } from \"../TextureProps\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, HydrateViewStateRequestProps, HydrateViewStateResponseProps, ViewStateLoadProps, ViewStateProps } from \"../ViewProps\";\r\nimport { RpcNotFoundResponse } from \"./core/RpcControl\";\r\nimport { RpcRoutingToken } from \"./core/RpcRoutingToken\";\r\n\r\n/** Response if the IModelDb was not found at the backend\r\n * (if the service has moved)\r\n * @public\r\n */\r\nexport class IModelNotFoundResponse extends RpcNotFoundResponse {\r\n public isIModelNotFoundResponse: boolean = true;\r\n}\r\n\r\n/** The RPC interface for reading from an iModel.\r\n * All operations only require read-only access.\r\n * This interface is not normally used directly. See IModelConnection for higher-level and more convenient API for accessing iModels from a frontend.\r\n * @internal\r\n */\r\nexport abstract class IModelReadRpcInterface extends RpcInterface {\r\n /** Returns the IModelReadRpcInterface instance for the frontend. */\r\n public static getClient(): IModelReadRpcInterface { return RpcManager.getClientForInterface(IModelReadRpcInterface); }\r\n\r\n /** Returns the IModelReadRpcInterface instance for a custom RPC routing configuration. */\r\n public static getClientForRouting(token: RpcRoutingToken): IModelReadRpcInterface { return RpcManager.getClientForInterface(IModelReadRpcInterface, token); }\r\n\r\n /** The immutable name of the interface. */\r\n public static readonly interfaceName = \"IModelReadRpcInterface\";\r\n\r\n /** The semantic version of the interface. */\r\n public static interfaceVersion = \"3.1.0\";\r\n\r\n /*===========================================================================================\r\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\r\n NOTE: Please consult the README in this folder for the semantic versioning rules.\r\n ===========================================================================================*/\r\n public async getConnectionProps(_iModelToken: IModelRpcOpenProps): Promise<IModelConnectionProps> { return this.forward(arguments); }\r\n public async queryRows(_iModelToken: IModelRpcProps, _request: DbQueryRequest): Promise<DbQueryResponse> { return this.forward(arguments); }\r\n public async queryBlob(_iModelToken: IModelRpcProps, _request: DbBlobRequest): Promise<DbBlobResponse> { return this.forward(arguments); }\r\n public async getModelProps(_iModelToken: IModelRpcProps, _modelIds: Id64String[]): Promise<ModelProps[]> { return this.forward(arguments); }\r\n public async queryModelRanges(_iModelToken: IModelRpcProps, _modelIds: Id64String[]): Promise<Range3dProps[]> { return this.forward(arguments); }\r\n public async queryModelProps(_iModelToken: IModelRpcProps, _params: EntityQueryParams): Promise<ModelProps[]> { return this.forward(arguments); }\r\n public async getElementProps(_iModelToken: IModelRpcProps, _elementIds: Id64String[]): Promise<ElementProps[]> { return this.forward(arguments); }\r\n public async queryElementProps(_iModelToken: IModelRpcProps, _params: EntityQueryParams): Promise<ElementProps[]> { return this.forward(arguments); }\r\n public async queryEntityIds(_iModelToken: IModelRpcProps, _params: EntityQueryParams): Promise<Id64String[]> { return this.forward(arguments); }\r\n public async getClassHierarchy(_iModelToken: IModelRpcProps, _startClassName: string): Promise<string[]> { return this.forward(arguments); }\r\n public async getAllCodeSpecs(_iModelToken: IModelRpcProps): Promise<any[]> { return this.forward(arguments); }\r\n public async getViewStateData(_iModelToken: IModelRpcProps, _viewDefinitionId: string, _options?: ViewStateLoadProps): Promise<ViewStateProps> { return this.forward(arguments); }\r\n public async readFontJson(_iModelToken: IModelRpcProps): Promise<FontMapProps> { return this.forward(arguments); }\r\n public async getToolTipMessage(_iModelToken: IModelRpcProps, _elementId: string): Promise<string[]> { return this.forward(arguments); }\r\n /** @deprecated */\r\n public async getViewThumbnail(_iModelToken: IModelRpcProps, _viewId: string): Promise<Uint8Array> { return this.forward(arguments); }\r\n public async getDefaultViewId(_iModelToken: IModelRpcProps): Promise<Id64String> { return this.forward(arguments); }\r\n public async getCustomViewState3dData(_iModelToken: IModelRpcProps, _options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> { return this.forward(arguments); }\r\n public async hydrateViewState(_iModelToken: IModelRpcProps, _options: HydrateViewStateRequestProps): Promise<HydrateViewStateResponseProps> { return this.forward(arguments); }\r\n public async requestSnap(_iModelToken: IModelRpcProps, _sessionId: string, _props: SnapRequestProps): Promise<SnapResponseProps> { return this.forward(arguments); }\r\n public async cancelSnap(_iModelToken: IModelRpcProps, _sessionId: string): Promise<void> { return this.forward(arguments); }\r\n public async getGeometryContainment(_iModelToken: IModelRpcProps, _props: GeometryContainmentRequestProps): Promise<GeometryContainmentResponseProps> { return this.forward(arguments); }\r\n public async getMassProperties(_iModelToken: IModelRpcProps, _props: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> { return this.forward(arguments); }\r\n public async getMassPropertiesPerCandidate(_iModelToken: IModelRpcProps, _props: MassPropertiesPerCandidateRequestProps): Promise<MassPropertiesPerCandidateResponseProps[]> { return this.forward(arguments); }\r\n public async getIModelCoordinatesFromGeoCoordinates(_iModelToken: IModelRpcProps, _props: IModelCoordinatesRequestProps): Promise<IModelCoordinatesResponseProps> { return this.forward(arguments); }\r\n public async getGeoCoordinatesFromIModelCoordinates(_iModelToken: IModelRpcProps, _props: GeoCoordinatesRequestProps): Promise<GeoCoordinatesResponseProps> { return this.forward(arguments); }\r\n public async getGeometrySummary(_iModelToken: IModelRpcProps, _props: GeometrySummaryRequestProps): Promise<string> { return this.forward(arguments); }\r\n public async queryTextureData(_iModelToken: IModelRpcProps, _textureLoadProps: TextureLoadProps): Promise<TextureData | undefined> { return this.forward(arguments); }\r\n public async loadElementProps(_iModelToken: IModelRpcProps, _elementIdentifier: Id64String | GuidString | CodeProps, _options?: ElementLoadOptions): Promise<ElementProps | undefined> {\r\n return this.forward(arguments);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IModelReadRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/IModelReadRpcInterface.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;AAMH,sDAA8D;AAC9D,sDAAmD;AAYnD,kDAA+C;AAC/C,8CAA2C;AAI3C,kDAAwD;AAGxD;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,gCAAmB;IAA/D;;QACS,6BAAwB,GAAY,IAAI,CAAC;QAChC,YAAO,GAAG,kBAAkB,CAAC;IAC/C,CAAC;CAAA;AAHD,wDAGC;AAED;;;;GAIG;AACH,MAAsB,sBAAuB,SAAQ,2BAAY;IAC/D,oEAAoE;IAC7D,MAAM,CAAC,SAAS,KAA6B,OAAO,uBAAU,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAEtH,0FAA0F;IACnF,MAAM,CAAC,mBAAmB,CAAC,KAAsB,IAA4B,OAAO,uBAAU,CAAC,qBAAqB,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAQ7J;;;iGAG6F;IAEtF,KAAK,CAAC,kBAAkB,CAAC,YAAgC,IAAoC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9H,KAAK,CAAC,SAAS,CAAC,YAA4B,EAAE,QAAwB,IAA8B,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAErI,K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AuB,CAAC,SAAS,CAAC;+DACuE;AAG5I;IADC,2BAAY,CAAC,oBAAoB,CAAC,sCAAuB,CAAC,SAAS,CAAC;8DAC6G;AAMlL;IADC,2BAAY,CAAC,oBAAoB,CAAC,sCAAuB,CAAC,SAAS,CAAC;8DAC+C;AAEpH;IADC,2BAAY,CAAC,oBAAoB,CAAC,sCAAuB,CAAC,SAAS,CAAC;sEAC8G;AAEnL;IADC,2BAAY,CAAC,oBAAoB,CAAC,sCAAuB,CAAC,SAAS,CAAC;8DAC0G;AAQ/K;IADC,2BAAY,CAAC,oBAAoB,CAAC,sCAAuB,CAAC,SAAS,CAAC;oFAC0H;AArDjM,wDA2DC","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 { CompressedId64Set, GuidString, Id64String } from \"@itwin/core-bentley\";\r\nimport { Range3dProps } from \"@itwin/core-geometry\";\r\nimport { CodeProps } from \"../Code\";\r\nimport { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse } from \"../ConcurrentQuery\";\r\nimport { RpcResponseCacheControl } from \"./core/RpcConstants\";\r\nimport { RpcOperation } from \"./core/RpcOperation\";\r\nimport { ElementLoadOptions, ElementProps } from \"../ElementProps\";\r\nimport { EntityQueryParams } from \"../EntityProps\";\r\nimport { FontMapProps } from \"../Fonts\";\r\nimport {\r\n GeoCoordinatesRequestProps, GeoCoordinatesResponseProps, IModelCoordinatesRequestProps, IModelCoordinatesResponseProps,\r\n} from \"../GeoCoordinateServices\";\r\nimport { GeometryContainmentRequestProps, GeometryContainmentResponseProps } from \"../GeometryContainment\";\r\nimport { GeometrySummaryRequestProps } from \"../GeometrySummary\";\r\nimport { IModelConnectionProps, IModelRpcOpenProps, IModelRpcProps } from \"../IModel\";\r\nimport { MassPropertiesPerCandidateRequestProps, MassPropertiesPerCandidateResponseProps, MassPropertiesRequestProps, MassPropertiesResponseProps } from \"../MassProperties\";\r\nimport { ModelProps } from \"../ModelProps\";\r\nimport { RpcInterface } from \"../RpcInterface\";\r\nimport { RpcManager } from \"../RpcManager\";\r\nimport { SnapRequestProps, SnapResponseProps } from \"../Snapping\";\r\nimport { TextureData, TextureLoadProps } from \"../TextureProps\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, HydrateViewStateRequestProps, HydrateViewStateResponseProps, SubCategoryResultRow, ViewStateLoadProps, ViewStateProps } from \"../ViewProps\";\r\nimport { RpcNotFoundResponse } from \"./core/RpcControl\";\r\nimport { RpcRoutingToken } from \"./core/RpcRoutingToken\";\r\n\r\n/** Response if the IModelDb was not found at the backend\r\n * (if the service has moved)\r\n * @public\r\n */\r\nexport class IModelNotFoundResponse extends RpcNotFoundResponse {\r\n public isIModelNotFoundResponse: boolean = true;\r\n public override message = \"iModel not found\";\r\n}\r\n\r\n/** The RPC interface for reading from an iModel.\r\n * All operations only require read-only access.\r\n * This interface is not normally used directly. See IModelConnection for higher-level and more convenient API for accessing iModels from a frontend.\r\n * @internal\r\n */\r\nexport abstract class IModelReadRpcInterface extends RpcInterface {\r\n /** Returns the IModelReadRpcInterface instance for the frontend. */\r\n public static getClient(): IModelReadRpcInterface { return RpcManager.getClientForInterface(IModelReadRpcInterface); }\r\n\r\n /** Returns the IModelReadRpcInterface instance for a custom RPC routing configuration. */\r\n public static getClientForRouting(token: RpcRoutingToken): IModelReadRpcInterface { return RpcManager.getClientForInterface(IModelReadRpcInterface, token); }\r\n\r\n /** The immutable name of the interface. */\r\n public static readonly interfaceName = \"IModelReadRpcInterface\";\r\n\r\n /** The semantic version of the interface. */\r\n public static interfaceVersion = \"3.2.0\";\r\n\r\n /*===========================================================================================\r\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\r\n NOTE: Please consult the README in this folder for the semantic versioning rules.\r\n ===========================================================================================*/\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getConnectionProps(_iModelToken: IModelRpcOpenProps): Promise<IModelConnectionProps> { return this.forward(arguments); }\r\n public async queryRows(_iModelToken: IModelRpcProps, _request: DbQueryRequest): Promise<DbQueryResponse> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async querySubCategories(_iModelToken: IModelRpcProps, _categoryIds: CompressedId64Set): Promise<SubCategoryResultRow[]> { return this.forward(arguments); }\r\n public async queryBlob(_iModelToken: IModelRpcProps, _request: DbBlobRequest): Promise<DbBlobResponse> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getModelProps(_iModelToken: IModelRpcProps, _modelIds: Id64String[]): Promise<ModelProps[]> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async queryModelRanges(_iModelToken: IModelRpcProps, _modelIds: Id64String[]): Promise<Range3dProps[]> { return this.forward(arguments); }\r\n public async queryModelProps(_iModelToken: IModelRpcProps, _params: EntityQueryParams): Promise<ModelProps[]> { return this.forward(arguments); }\r\n public async getElementProps(_iModelToken: IModelRpcProps, _elementIds: Id64String[]): Promise<ElementProps[]> { return this.forward(arguments); }\r\n public async queryElementProps(_iModelToken: IModelRpcProps, _params: EntityQueryParams): Promise<ElementProps[]> { return this.forward(arguments); }\r\n public async queryEntityIds(_iModelToken: IModelRpcProps, _params: EntityQueryParams): Promise<Id64String[]> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getClassHierarchy(_iModelToken: IModelRpcProps, _startClassName: string): Promise<string[]> { return this.forward(arguments); }\r\n public async getAllCodeSpecs(_iModelToken: IModelRpcProps): Promise<any[]> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getViewStateData(_iModelToken: IModelRpcProps, _viewDefinitionId: string, _options?: ViewStateLoadProps): Promise<ViewStateProps> { return this.forward(arguments); }\r\n public async readFontJson(_iModelToken: IModelRpcProps): Promise<FontMapProps> { return this.forward(arguments); }\r\n public async getToolTipMessage(_iModelToken: IModelRpcProps, _elementId: string): Promise<string[]> { return this.forward(arguments); }\r\n /** @deprecated */\r\n public async getViewThumbnail(_iModelToken: IModelRpcProps, _viewId: string): Promise<Uint8Array> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getDefaultViewId(_iModelToken: IModelRpcProps): Promise<Id64String> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getCustomViewState3dData(_iModelToken: IModelRpcProps, _options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async hydrateViewState(_iModelToken: IModelRpcProps, _options: HydrateViewStateRequestProps): Promise<HydrateViewStateResponseProps> { return this.forward(arguments); }\r\n public async requestSnap(_iModelToken: IModelRpcProps, _sessionId: string, _props: SnapRequestProps): Promise<SnapResponseProps> { return this.forward(arguments); }\r\n public async cancelSnap(_iModelToken: IModelRpcProps, _sessionId: string): Promise<void> { return this.forward(arguments); }\r\n public async getGeometryContainment(_iModelToken: IModelRpcProps, _props: GeometryContainmentRequestProps): Promise<GeometryContainmentResponseProps> { return this.forward(arguments); }\r\n public async getMassProperties(_iModelToken: IModelRpcProps, _props: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> { return this.forward(arguments); }\r\n public async getMassPropertiesPerCandidate(_iModelToken: IModelRpcProps, _props: MassPropertiesPerCandidateRequestProps): Promise<MassPropertiesPerCandidateResponseProps[]> { return this.forward(arguments); }\r\n public async getIModelCoordinatesFromGeoCoordinates(_iModelToken: IModelRpcProps, _props: IModelCoordinatesRequestProps): Promise<IModelCoordinatesResponseProps> { return this.forward(arguments); }\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getGeoCoordinatesFromIModelCoordinates(_iModelToken: IModelRpcProps, _props: GeoCoordinatesRequestProps): Promise<GeoCoordinatesResponseProps> { return this.forward(arguments); }\r\n public async getGeometrySummary(_iModelToken: IModelRpcProps, _props: GeometrySummaryRequestProps): Promise<string> { return this.forward(arguments); }\r\n public async queryTextureData(_iModelToken: IModelRpcProps, _textureLoadProps: TextureLoadProps): Promise<TextureData | undefined> { return this.forward(arguments); }\r\n public async loadElementProps(_iModelToken: IModelRpcProps, _elementIdentifier: Id64String | GuidString | CodeProps, _options?: ElementLoadOptions): Promise<ElementProps | undefined> {\r\n return this.forward(arguments);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTileRpcInterface.d.ts","sourceRoot":"","sources":["../../../src/rpc/IModelTileRpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"IModelTileRpcInterface.d.ts","sourceRoot":"","sources":["../../../src/rpc/IModelTileRpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,mBAAmB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|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
12
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
|
+
};
|
|
9
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
16
|
exports.IModelTileRpcInterface = void 0;
|
|
17
|
+
const RpcConstants_1 = require("./core/RpcConstants");
|
|
18
|
+
const RpcOperation_1 = require("./core/RpcOperation");
|
|
11
19
|
const RpcInterface_1 = require("../RpcInterface");
|
|
12
20
|
const RpcManager_1 = require("../RpcManager");
|
|
13
21
|
/** @public */
|
|
@@ -65,9 +73,15 @@ class IModelTileRpcInterface extends RpcInterface_1.RpcInterface {
|
|
|
65
73
|
return this.forward(arguments);
|
|
66
74
|
}
|
|
67
75
|
}
|
|
68
|
-
exports.IModelTileRpcInterface = IModelTileRpcInterface;
|
|
69
76
|
/** The immutable name of the interface. */
|
|
70
77
|
IModelTileRpcInterface.interfaceName = "IModelTileRpcInterface";
|
|
71
78
|
/** The semantic version of the interface. */
|
|
72
|
-
IModelTileRpcInterface.interfaceVersion = "3.
|
|
79
|
+
IModelTileRpcInterface.interfaceVersion = "3.1.0";
|
|
80
|
+
__decorate([
|
|
81
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
82
|
+
], IModelTileRpcInterface.prototype, "getTileCacheContainerUrl", null);
|
|
83
|
+
__decorate([
|
|
84
|
+
RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
|
|
85
|
+
], IModelTileRpcInterface.prototype, "requestTileTreeProps", null);
|
|
86
|
+
exports.IModelTileRpcInterface = IModelTileRpcInterface;
|
|
73
87
|
//# sourceMappingURL=IModelTileRpcInterface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTileRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/IModelTileRpcInterface.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG
|
|
1
|
+
{"version":3,"file":"IModelTileRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/IModelTileRpcInterface.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;AAKH,sDAA8D;AAC9D,sDAAmD;AAEnD,kDAA+C;AAC/C,8CAA2C;AAI3C,cAAc;AACd,MAAsB,sBAAuB,SAAQ,2BAAY;IACxD,MAAM,CAAC,SAAS,KAA6B,OAAO,uBAAU,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAQtH;;;iGAG6F;IAE7F;;OAEG;IAEI,KAAK,CAAC,wBAAwB,CAAC,WAA2B,EAAE,GAAoC;QACrG,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,wBAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,gBAAgB;IAET,KAAK,CAAC,oBAAoB,CAAC,WAA2B,EAAE,GAAW,IAAkC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAE7I;;;;OAIG;IACI,KAAK,CAAC,mBAAmB,CAAC,SAAyB,EAAE,OAAe,EAAE,UAAkB,EAAE,KAAyB;QACxH,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,mBAAmB,CAAC,SAAyB,EAAE,IAA2B;QACrF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,gBAAgB;IACT,KAAK,CAAC,gBAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,cAAc,CAAC,WAA2B,EAAE,SAAgC,IAAmB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAE7I;;;;OAIG;IACI,KAAK,CAAC,sBAAsB,CAAC,SAAyB,EAAE,QAAqC;QAClG,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;;AAlED,2CAA2C;AACpB,oCAAa,GAAG,wBAAwB,CAAC;AAEhE,6CAA6C;AAC/B,uCAAgB,GAAG,OAAO,CAAC;AAWzC;IADC,2BAAY,CAAC,oBAAoB,CAAC,sCAAuB,CAAC,SAAS,CAAC;sEAGpE;AAWD;IADC,2BAAY,CAAC,oBAAoB,CAAC,sCAAuB,CAAC,SAAS,CAAC;kEACwE;AA/B/I,wDAsEC","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 { Id64Array } from \"@itwin/core-bentley\";\r\nimport { CloudStorageContainerDescriptor, CloudStorageContainerUrl } from \"../CloudStorage\";\r\nimport { TileContentIdentifier } from \"../CloudStorageTileCache\";\r\nimport { RpcResponseCacheControl } from \"./core/RpcConstants\";\r\nimport { RpcOperation } from \"./core/RpcOperation\";\r\nimport { IModelRpcProps } from \"../IModel\";\r\nimport { RpcInterface } from \"../RpcInterface\";\r\nimport { RpcManager } from \"../RpcManager\";\r\nimport { ElementGraphicsRequestProps } from \"../tile/ElementGraphics\";\r\nimport { IModelTileTreeProps, TileContentSource, TileVersionInfo } from \"../TileProps\";\r\n\r\n/** @public */\r\nexport abstract class IModelTileRpcInterface extends RpcInterface {\r\n public static getClient(): IModelTileRpcInterface { return RpcManager.getClientForInterface(IModelTileRpcInterface); }\r\n\r\n /** The immutable name of the interface. */\r\n public static readonly interfaceName = \"IModelTileRpcInterface\";\r\n\r\n /** The semantic version of the interface. */\r\n public static interfaceVersion = \"3.1.0\";\r\n\r\n /*===========================================================================================\r\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\r\n NOTE: Please consult the README in this folder for the semantic versioning rules.\r\n ===========================================================================================*/\r\n\r\n /** Returns connection information for external tile cache or an empty `CloudStorageContainerUrl` if no external tile cache is configured on the backend.\r\n * @beta\r\n */\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async getTileCacheContainerUrl(_tokenProps: IModelRpcProps, _id: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** Returns true if an external tile cache is configured on the backend.\r\n * @internal @deprecated\r\n */\r\n public async isUsingExternalTileCache(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @internal */\r\n @RpcOperation.allowResponseCaching(RpcResponseCacheControl.Immutable)\r\n public async requestTileTreeProps(_tokenProps: IModelRpcProps, _id: string): Promise<IModelTileTreeProps> { return this.forward(arguments); }\r\n\r\n /** Ask the backend to generate content for the specified tile. This function, unlike the deprecated `requestTileContent`, does not check the cloud storage tile cache -\r\n * Use `CloudStorageTileCache.retrieve` for that.\r\n * @returns TileContentSource - if Backend, use retrieveTileContent. If ExternalCache, use TileAdmin.requestCachedTileContent\r\n * @internal\r\n */\r\n public async generateTileContent(_rpcProps: IModelRpcProps, _treeId: string, _contentId: string, _guid: string | undefined): Promise<TileContentSource> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** Retrieves tile content from the backend once it's generated by generateTileContent.\r\n * @internal\r\n */\r\n public async retrieveTileContent(_rpcProps: IModelRpcProps, _key: TileContentIdentifier): Promise<Uint8Array> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** @internal */\r\n public async queryVersionInfo(): Promise<TileVersionInfo> {\r\n return this.forward(arguments);\r\n }\r\n\r\n /** This is a temporary workaround for folks developing authoring applications, to be removed when proper support for such applications is introduced.\r\n * Given a set of model Ids, it purges any associated tile tree state on the back-end so that the next request for the tile tree or content will recreate that state.\r\n * Invoked after a modification is made to the model(s).\r\n * If no array of model Ids is supplied, it purges *all* tile trees, which can be quite inefficient.\r\n * @internal\r\n */\r\n public async purgeTileTrees(_tokenProps: IModelRpcProps, _modelIds: Id64Array | undefined): Promise<void> { return this.forward(arguments); }\r\n\r\n /** Requests graphics for a single element in \"iMdl\" format.\r\n * @returns graphics in iMdl format, or `undefined` if the element's geometry produced no graphics or the request was canceled before completion.\r\n * @throws IModelError on bad request (nonexistent element, duplicate request Id, etc).\r\n * @internal\r\n */\r\n public async requestElementGraphics(_rpcProps: IModelRpcProps, _request: ElementGraphicsRequestProps): Promise<Uint8Array | undefined> {\r\n return this.forward(arguments);\r\n }\r\n}\r\n"]}
|
|
@@ -8,6 +8,7 @@ import { RpcInvocation } from "./RpcInvocation";
|
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
10
|
export declare abstract class RpcControlResponse {
|
|
11
|
+
message: string;
|
|
11
12
|
}
|
|
12
13
|
/** A pending RPC operation response.
|
|
13
14
|
* @public
|
|
@@ -22,6 +23,7 @@ export declare class RpcPendingResponse extends RpcControlResponse {
|
|
|
22
23
|
* @public
|
|
23
24
|
*/
|
|
24
25
|
export declare class RpcNotFoundResponse extends RpcControlResponse {
|
|
26
|
+
message: string;
|
|
25
27
|
}
|
|
26
28
|
/** Manages requests and responses for an RPC configuration.
|
|
27
29
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcControl.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcControl.ts"],"names":[],"mappings":"AAIA;;GAEG;AAOH,OAAO,EA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AO,CAAC,SAAS;IAajB,OAAO,CAAC,cAAc;IAkBtB,gBAAgB;IACT,UAAU;IAejB,gBAAgB;IACT,sBAAsB,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAY/E"}
|
|
@@ -20,6 +20,9 @@ const RpcRegistry_1 = require("./RpcRegistry");
|
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
22
22
|
class RpcControlResponse {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.message = "RpcControlResponse";
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
exports.RpcControlResponse = RpcControlResponse;
|
|
25
28
|
/** A pending RPC operation response.
|
|
@@ -37,6 +40,10 @@ exports.RpcPendingResponse = RpcPendingResponse;
|
|
|
37
40
|
* @public
|
|
38
41
|
*/
|
|
39
42
|
class RpcNotFoundResponse extends RpcControlResponse {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this.message = "Not found";
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
exports.RpcNotFoundResponse = RpcNotFoundResponse;
|
|
42
49
|
/** Manages requests and responses for an RPC configuration.
|
|
@@ -73,6 +80,9 @@ class RpcControlChannel {
|
|
|
73
80
|
/** @internal */
|
|
74
81
|
async describeEndpoints() {
|
|
75
82
|
this.activateClient();
|
|
83
|
+
if (!this._channelInterface.interfaceName) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
76
86
|
return this._describeEndpoints();
|
|
77
87
|
}
|
|
78
88
|
/** @internal */
|
|
@@ -125,7 +135,9 @@ class RpcControlChannel {
|
|
|
125
135
|
handleUnknownOperation(invocation, _error) {
|
|
126
136
|
const op = invocation.request.operation;
|
|
127
137
|
if (op.interfaceVersion === "CONTROL" && op.operationName === "describeEndpoints") {
|
|
128
|
-
|
|
138
|
+
if (this._channelInterface.interfaceName) {
|
|
139
|
+
op.interfaceDefinition = this._channelInterface.interfaceName;
|
|
140
|
+
}
|
|
129
141
|
return true;
|
|
130
142
|
}
|
|
131
143
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcControl.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcControl.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,mCAAgC;AAEhC,mDAAgD;AAChD,qDAAkD;AAClD,iDAAqE;AACrE,yDAAsD;AAEtD,iDAA8C;AAC9C,+CAA4C;AAE5C;;GAEG;AACH,MAAsB,kBAAkB;CACvC;AADD,gDACC;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,kBAAkB;IAIxD,qCAAqC;IACrC,YAAmB,UAAkB,EAAE;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AATD,gDASC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,kBAAkB;CAC1D;AADD,kDACC;AAED;;GAEG;AACH,MAAa,iBAAiB;IAS5B,YAAoB,aAA+B;;QAJ3C,iBAAY,GAAG,KAAK,CAAC;QACrB,kBAAa,GAAG,KAAK,CAAC;QACtB,uBAAkB,GAA2C,SAAgB,CAAC;QAyB9E,sBAAiB,SAAG,KAAM,SAAQ,2BAAY;gBAG7C,KAAK,CAAC,iBAAiB,KAAuC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aACvG;YAHwB,mBAAgB,GAAG,SAAU;YAC7B,gBAAa,GAAG,EAAG;gBAE1C;QAEM,iBAAY,GAAG,KAAM,SAAQ,2BAAY;YACxC,KAAK,CAAC,iBAAiB;gBAC5B,MAAM,SAAS,GAA4B,EAAE,CAAC;gBAE9C,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;oBACrD,IAAI,CAAC,yBAAW,CAAC,QAAQ,CAAC,yBAAyB,CAAC,UAAU,CAAC;wBA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------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { Buffer } from \"buffer\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { RpcInterfaceEndpoints, RpcManager } from \"../../RpcManager\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcInvocation } from \"./RpcInvocation\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcRegistry } from \"./RpcRegistry\";\r\n\r\n/** An RPC operation control response.\r\n * @public\r\n */\r\nexport abstract class RpcControlResponse {\r\n}\r\n\r\n/** A pending RPC operation response.\r\n * @public\r\n */\r\nexport class RpcPendingResponse extends RpcControlResponse {\r\n /** Extended status regarding the pending operation. */\r\n public message: string;\r\n\r\n /** Constructs a pending response. */\r\n public constructor(message: string = \"\") {\r\n super();\r\n this.message = message;\r\n }\r\n}\r\n\r\n/** A RPC operation response.\r\n * @public\r\n */\r\nexport class RpcNotFoundResponse extends RpcControlResponse {\r\n}\r\n\r\n/** Manages requests and responses for an RPC configuration.\r\n * @internal\r\n */\r\nexport class RpcControlChannel {\r\n /** @internal */\r\n public static channels: RpcControlChannel[] = [];\r\n private static _obtainLock = 0;\r\n private _configuration: RpcConfiguration;\r\n private _initialized = false;\r\n private _clientActive = false;\r\n private _describeEndpoints: () => Promise<RpcInterfaceEndpoints[]> = undefined as any;\r\n\r\n private constructor(configuration: RpcConfiguration) {\r\n this._configuration = configuration;\r\n RpcControlChannel.channels.push(this);\r\n }\r\n\r\n /** @internal */\r\n public async describeEndpoints() {\r\n this.activateClient();\r\n return this._describeEndpoints();\r\n }\r\n\r\n /** @internal */\r\n public static obtain(configuration: RpcConfiguration): RpcControlChannel {\r\n if (RpcControlChannel._obtainLock)\r\n return undefined as any;\r\n\r\n ++RpcControlChannel._obtainLock;\r\n const channel = new RpcControlChannel(configuration);\r\n --RpcControlChannel._obtainLock;\r\n\r\n return channel;\r\n }\r\n\r\n private _channelInterface = class extends RpcInterface {\r\n public static readonly interfaceVersion = \"CONTROL\";\r\n public static readonly interfaceName = \"\";\r\n public async describeEndpoints(): Promise<RpcInterfaceEndpoints[]> { return this.forward(arguments); }\r\n };\r\n\r\n private _channelImpl = class extends RpcInterface {\r\n public async describeEndpoints(): Promise<RpcInterfaceEndpoints[]> {\r\n const endpoints: RpcInterfaceEndpoints[] = [];\r\n\r\n this.configuration.interfaces().forEach((definition) => {\r\n if (!RpcRegistry.instance.isRpcInterfaceInitialized(definition))\r\n return;\r\n\r\n const description: RpcInterfaceEndpoints = { interfaceName: definition.interfaceName, interfaceVersion: definition.interfaceVersion, operationNames: [], compatible: true };\r\n RpcOperation.forEach(definition, (operation) => description.operationNames.push(operation.operationName));\r\n endpoints.push(description);\r\n });\r\n\r\n return endpoints;\r\n }\r\n };\r\n\r\n private computeId(): string {\r\n const interfaces: string[] = [];\r\n this._configuration.interfaces().forEach((definition) => interfaces.push(`${definition.interfaceName}@${definition.interfaceVersion}`));\r\n const id = interfaces.sort().join(\",\");\r\n\r\n if (typeof (btoa) !== \"undefined\") // eslint-disable-line deprecation/deprecation\r\n return btoa(id); // eslint-disable-line deprecation/deprecation\r\n else if (typeof (Buffer) !== \"undefined\")\r\n return Buffer.from(id, \"binary\").toString(\"base64\");\r\n else\r\n return id;\r\n }\r\n\r\n private activateClient() {\r\n if (this._clientActive)\r\n return;\r\n\r\n if (!this._initialized) {\r\n if (this._configuration.interfaces().length)\r\n throw new IModelError(BentleyStatus.ERROR, `Invalid state.`);\r\n\r\n this.initialize();\r\n }\r\n\r\n this._clientActive = true;\r\n const token: IModelRpcProps = { key: \"none\", iTwinId: \"none\", iModelId: \"none\", changeset: { id: \"none\" } };\r\n RpcOperation.forEach(this._channelInterface, (operation) => operation.policy.token = (_request) => RpcOperation.fallbackToken ?? token);\r\n const client = RpcManager.getClientForInterface(this._channelInterface);\r\n this._describeEndpoints = async () => client.describeEndpoints();\r\n }\r\n\r\n /** @internal */\r\n public initialize() {\r\n if (this._initialized)\r\n throw new IModelError(BentleyStatus.ERROR, `Already initialized.`);\r\n\r\n this._initialized = true;\r\n\r\n const id = this.computeId();\r\n Object.defineProperty(this._channelInterface, \"interfaceName\", { value: id });\r\n Object.defineProperty(this._channelImpl, \"interfaceName\", { value: id });\r\n\r\n RpcConfiguration.assign(this._channelInterface, () => this._configuration.constructor as any);\r\n RpcManager.registerImpl(this._channelInterface, this._channelImpl);\r\n RpcManager.initializeInterface(this._channelInterface);\r\n }\r\n\r\n /** @internal */\r\n public handleUnknownOperation(invocation: RpcInvocation, _error: any): boolean {\r\n const op = invocation.request.operation;\r\n if (op.interfaceVersion === \"CONTROL\" && op.operationName === \"describeEndpoints\") {\r\n op.interfaceDefinition = this._channelInterface.interfaceName;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"RpcControl.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcControl.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,mCAAgC;AAEhC,mDAAgD;AAChD,qDAAkD;AAClD,iDAAqE;AACrE,yDAAsD;AAEtD,iDAA8C;AAC9C,+CAA4C;AAE5C;;GAEG;AACH,MAAsB,kBAAkB;IAAxC;QACS,YAAO,GAAG,oBAAoB,CAAC;IACxC,CAAC;CAAA;AAFD,gDAEC;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,kBAAkB;IAIxD,qCAAqC;IACrC,YAAmB,UAAkB,EAAE;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AATD,gDASC;AAED;;GAEG;AACH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AC,YAAY,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzE,mCAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,WAAkB,CAAC,CAAC;QAC9F,uBAAU,CAAC,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACnE,uBAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACzD,CAAC;IAED,gBAAgB;IACT,sBAAsB,CAAC,UAAyB,EAAE,MAAW;QAClE,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC;QACxC,IAAI,EAAE,CAAC,gBAAgB,KAAK,SAAS,IAAI,EAAE,CAAC,aAAa,KAAK,mBAAmB,EAAE;YACjF,IAAI,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE;gBACxC,EAAE,CAAC,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;aAC/D;YAED,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;IACf,CAAC;;AAtHH,8CAuHC;AAtHC,gBAAgB;AACF,0BAAQ,GAAwB,EAAE,CAAC;AAClC,6BAAW,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 { BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { Buffer } from \"buffer\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { RpcInterfaceEndpoints, RpcManager } from \"../../RpcManager\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcInvocation } from \"./RpcInvocation\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcRegistry } from \"./RpcRegistry\";\r\n\r\n/** An RPC operation control response.\r\n * @public\r\n */\r\nexport abstract class RpcControlResponse {\r\n public message = \"RpcControlResponse\";\r\n}\r\n\r\n/** A pending RPC operation response.\r\n * @public\r\n */\r\nexport class RpcPendingResponse extends RpcControlResponse {\r\n /** Extended status regarding the pending operation. */\r\n public override message: string;\r\n\r\n /** Constructs a pending response. */\r\n public constructor(message: string = \"\") {\r\n super();\r\n this.message = message;\r\n }\r\n}\r\n\r\n/** A RPC operation response.\r\n * @public\r\n */\r\nexport class RpcNotFoundResponse extends RpcControlResponse {\r\n public override message = \"Not found\";\r\n}\r\n\r\n/** Manages requests and responses for an RPC configuration.\r\n * @internal\r\n */\r\nexport class RpcControlChannel {\r\n /** @internal */\r\n public static channels: RpcControlChannel[] = [];\r\n private static _obtainLock = 0;\r\n private _configuration: RpcConfiguration;\r\n private _initialized = false;\r\n private _clientActive = false;\r\n private _describeEndpoints: () => Promise<RpcInterfaceEndpoints[]> = undefined as any;\r\n\r\n private constructor(configuration: RpcConfiguration) {\r\n this._configuration = configuration;\r\n RpcControlChannel.channels.push(this);\r\n }\r\n\r\n /** @internal */\r\n public async describeEndpoints() {\r\n this.activateClient();\r\n if (!this._channelInterface.interfaceName) {\r\n return [];\r\n }\r\n\r\n return this._describeEndpoints();\r\n }\r\n\r\n /** @internal */\r\n public static obtain(configuration: RpcConfiguration): RpcControlChannel {\r\n if (RpcControlChannel._obtainLock)\r\n return undefined as any;\r\n\r\n ++RpcControlChannel._obtainLock;\r\n const channel = new RpcControlChannel(configuration);\r\n --RpcControlChannel._obtainLock;\r\n\r\n return channel;\r\n }\r\n\r\n private _channelInterface = class extends RpcInterface {\r\n public static readonly interfaceVersion = \"CONTROL\";\r\n public static readonly interfaceName = \"\";\r\n public async describeEndpoints(): Promise<RpcInterfaceEndpoints[]> { return this.forward(arguments); }\r\n };\r\n\r\n private _channelImpl = class extends RpcInterface {\r\n public async describeEndpoints(): Promise<RpcInterfaceEndpoints[]> {\r\n const endpoints: RpcInterfaceEndpoints[] = [];\r\n\r\n this.configuration.interfaces().forEach((definition) => {\r\n if (!RpcRegistry.instance.isRpcInterfaceInitialized(definition))\r\n return;\r\n\r\n const description: RpcInterfaceEndpoints = { interfaceName: definition.interfaceName, interfaceVersion: definition.interfaceVersion, operationNames: [], compatible: true };\r\n RpcOperation.forEach(definition, (operation) => description.operationNames.push(operation.operationName));\r\n endpoints.push(description);\r\n });\r\n\r\n return endpoints;\r\n }\r\n };\r\n\r\n private computeId(): string {\r\n const interfaces: string[] = [];\r\n this._configuration.interfaces().forEach((definition) => interfaces.push(`${definition.interfaceName}@${definition.interfaceVersion}`));\r\n const id = interfaces.sort().join(\",\");\r\n\r\n if (typeof (btoa) !== \"undefined\") // eslint-disable-line deprecation/deprecation\r\n return btoa(id); // eslint-disable-line deprecation/deprecation\r\n else if (typeof (Buffer) !== \"undefined\")\r\n return Buffer.from(id, \"binary\").toString(\"base64\");\r\n else\r\n return id;\r\n }\r\n\r\n private activateClient() {\r\n if (this._clientActive)\r\n return;\r\n\r\n if (!this._initialized) {\r\n if (this._configuration.interfaces().length)\r\n throw new IModelError(BentleyStatus.ERROR, `Invalid state.`);\r\n\r\n this.initialize();\r\n }\r\n\r\n this._clientActive = true;\r\n const token: IModelRpcProps = { key: \"none\", iTwinId: \"none\", iModelId: \"none\", changeset: { id: \"none\" } };\r\n RpcOperation.forEach(this._channelInterface, (operation) => operation.policy.token = (_request) => RpcOperation.fallbackToken ?? token);\r\n const client = RpcManager.getClientForInterface(this._channelInterface);\r\n this._describeEndpoints = async () => client.describeEndpoints();\r\n }\r\n\r\n /** @internal */\r\n public initialize() {\r\n if (this._initialized)\r\n throw new IModelError(BentleyStatus.ERROR, `Already initialized.`);\r\n\r\n this._initialized = true;\r\n\r\n const id = this.computeId();\r\n Object.defineProperty(this._channelInterface, \"interfaceName\", { value: id });\r\n Object.defineProperty(this._channelImpl, \"interfaceName\", { value: id });\r\n\r\n RpcConfiguration.assign(this._channelInterface, () => this._configuration.constructor as any);\r\n RpcManager.registerImpl(this._channelInterface, this._channelImpl);\r\n RpcManager.initializeInterface(this._channelInterface);\r\n }\r\n\r\n /** @internal */\r\n public handleUnknownOperation(invocation: RpcInvocation, _error: any): boolean {\r\n const op = invocation.request.operation;\r\n if (op.interfaceVersion === \"CONTROL\" && op.operationName === \"describeEndpoints\") {\r\n if (this._channelInterface.interfaceName) {\r\n op.interfaceDefinition = this._channelInterface.interfaceName;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n"]}
|
|
@@ -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,
|
|
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,EAAqE,MAAM,qBAAqB,CAAC;AAI9J,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,EAAoB,WAAW,EAAsB,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG/H;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,iFAAiF;IACjF,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC,sCAAsC;IACtC,QAAQ,CAAC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AO,CAAC,OAAO,EAAE,YAAY,GAAG,aAAa;IAI3D,gCAAgC;gBACb,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB;IA8BvE,OAAO,CAAC,sBAAsB;WAIhB,cAAc,CAAC,QAAQ,CAAC,EAAE,WAAW;;;;;;;YAQrC,OAAO;IAkCrB,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,MAAM,CAAC,aAAa;YAOd,MAAM;YAKN,eAAe;YAOf,eAAe;IA4B7B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,OAAO;IAsBf,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,uBAAuB;CA0BhC"}
|
|
@@ -102,15 +102,22 @@ class RpcInvocation {
|
|
|
102
102
|
};
|
|
103
103
|
try {
|
|
104
104
|
this.protocol.events.raiseEvent(RpcConstants_1.RpcProtocolEvent.RequestReceived, this);
|
|
105
|
-
const parameters = RpcMarshaling_1.RpcMarshaling.deserialize(this.protocol, request.parameters);
|
|
105
|
+
const parameters = request.parametersOverride || RpcMarshaling_1.RpcMarshaling.deserialize(this.protocol, request.parameters);
|
|
106
106
|
this.applyPolicies(parameters);
|
|
107
107
|
const impl = RpcRegistry_1.RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition);
|
|
108
108
|
impl[RpcRegistry_1.CURRENT_INVOCATION] = this;
|
|
109
109
|
const op = this.lookupOperationFunction(impl);
|
|
110
|
-
return await RpcInvocation.runActivity(activity, async () => op.call(impl, ...parameters)
|
|
110
|
+
return await RpcInvocation.runActivity(activity, async () => op.call(impl, ...parameters)
|
|
111
|
+
.catch(async (error) => {
|
|
112
|
+
// this catch block is intentionally placed inside `runActivity` to attach the right logging metadata and use the correct openTelemetry span.
|
|
113
|
+
if (!(error instanceof RpcControl_1.RpcPendingResponse)) {
|
|
114
|
+
core_bentley_1.Logger.logError(CommonLoggerCategory_1.CommonLoggerCategory.RpcInterfaceBackend, "Error in RPC operation", { error: core_bentley_1.BentleyError.getErrorProps(error) });
|
|
115
|
+
core_bentley_1.Tracing.setAttributes({ error: true });
|
|
116
|
+
}
|
|
117
|
+
throw error;
|
|
118
|
+
}));
|
|
111
119
|
}
|
|
112
120
|
catch (error) {
|
|
113
|
-
core_bentley_1.Logger.logError(CommonLoggerCategory_1.CommonLoggerCategory.RpcInterfaceBackend, "Error in RPC operation", { error: core_bentley_1.BentleyError.getErrorProps(error), ...RpcInvocation.sanitizeForLog(activity) });
|
|
114
121
|
return this.reject(error);
|
|
115
122
|
}
|
|
116
123
|
}
|
|
@@ -194,13 +201,14 @@ class RpcInvocation {
|
|
|
194
201
|
return RpcProtocol_1.RpcProtocol.protocolVersion >= RpcProtocol_1.RpcProtocolVersion.IntroducedStatusCategory && this.request.protocolVersion >= RpcProtocol_1.RpcProtocolVersion.IntroducedStatusCategory;
|
|
195
202
|
}
|
|
196
203
|
fulfill(result, rawResult) {
|
|
204
|
+
var _b;
|
|
197
205
|
const fulfillment = {
|
|
198
206
|
result,
|
|
199
207
|
rawResult,
|
|
200
208
|
status: this.protocol.getCode(this.status),
|
|
201
209
|
id: this.request.id,
|
|
202
210
|
interfaceName: (typeof (this.operation) === "undefined") ? "" : this.operation.interfaceDefinition.interfaceName,
|
|
203
|
-
allowCompression: this.operation.policy.allowResponseCompression,
|
|
211
|
+
allowCompression: ((_b = this.operation) === null || _b === void 0 ? void 0 : _b.policy.allowResponseCompression) || false,
|
|
204
212
|
};
|
|
205
213
|
this.transformResponseStatus(fulfillment, rawResult);
|
|
206
214
|
try {
|
|
@@ -229,10 +237,15 @@ class RpcInvocation {
|
|
|
229
237
|
else if (this._notFound) {
|
|
230
238
|
managedStatus = "notFound";
|
|
231
239
|
}
|
|
240
|
+
else if (this._noContent) {
|
|
241
|
+
managedStatus = "noContent";
|
|
242
|
+
}
|
|
232
243
|
if (managedStatus) {
|
|
233
244
|
const responseValue = fulfillment.result.objects;
|
|
234
245
|
const status = { iTwinRpcCoreResponse: true, managedStatus, responseValue };
|
|
235
246
|
fulfillment.result.objects = JSON.stringify(status);
|
|
247
|
+
status.responseValue = rawResult; // for ipc case
|
|
248
|
+
fulfillment.rawResult = status;
|
|
236
249
|
}
|
|
237
250
|
if (rawResult instanceof core_bentley_1.BentleyError) {
|
|
238
251
|
fulfillment.status = core_bentley_1.StatusCategory.for(rawResult).code;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcInvocation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcInvocation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH,sDAAqJ;AACrJ,qEAAkE;AAElE,mDAAgD;AAChD,qDAAkD;AAElD,yDAAsD;AACtD,iDAAoE;AACpE,6CAAuE;AACvE,mDAAoE;AACpE,iDAA8C;AAC9C,+CAA+H;AAC/H,+CAAgE;AAgChE;;GAEG;AACH,MAAa,aAAa;IA8CxB,gCAAgC;IAChC,YAAmB,QAAqB,EAAE,OAA6B;QA7C/D,WAAM,GAAY,KAAK,CAAC;QACxB,aAAQ,GAAY,KAAK,CAAC;QAC1B,cAAS,GAAY,KAAK,CAAC;QAC3B,eAAU,GAAY,KAAK,CAAC;QAC5B,YAAO,GAAW,CAAC,CAAC;QACpB,aAAQ,GAAW,CAAC,CAAC;QAQ7B,oCAAoC;QACpB,cAAS,GAAiB,SAAgB,CAAC;QAgCzD,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI;YACF,IAAI;gBACF,IAAI,CAAC,SAAS,GAAG,2BAAY,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;gBAEvH,MAAM,OAAO,GAA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C,sBAAsB,EAAE,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,2BAAY,EAAE;YACrC,WAAW,CAAC,MAAM,GAAG,6BAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;SACzD;IACH,CAAC;;AAhQH,sCAiQC;;AAhQe,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
|
+
{"version":3,"file":"RpcInvocation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcInvocation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH,sDAA8J;AAC9J,qEAAkE;AAElE,mDAAgD;AAChD,qDAAkD;AAElD,yDAAsD;AACtD,iDAAoE;AACpE,6CAAuE;AACvE,mDAAoE;AACpE,iDAA8C;AAC9C,+CAA+H;AAC/H,+CAAgE;AAgChE;;GAEG;AACH,MAAa,aAAa;IA8CxB,gCAAgC;IAChC,YAAmB,QAAqB,EAAE,OAA6B;QA7C/D,WAAM,GAAY,KAAK,CAAC;QACxB,aAAQ,GAAY,KAAK,CAAC;QAC1B,cAAS,GAAY,KAAK,CAAC;QAC3B,eAAU,GAAY,KAAK,CAAC;QAC5B,YAAO,GAAW,CAAC,CAAC;QACpB,aAAQ,GAAW,CAAC,CAAC;QAQ7B,oCAAoC;QACpB,cAAS,GAAiB,SAAgB,CAAC;QAgCzD,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI;YACF,IAAI;gBACF,IAAI,CAAC,SAAS,GAAG,2BAAY,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;gBAEvH,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC;gBAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,gBAA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AC,SAAS,CAAC,aAAa,IAAI,CAAC,CAAC;QAEzK,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,uBAAuB,CAAC,WAAkC,EAAE,SAAc;QAChF,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE;YAClC,OAAO;SACR;QAED,IAAI,aAA+D,CAAC;QACpE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,aAAa,GAAG,SAAS,CAAC;SAC3B;aAAM,IAAI,IAAI,CAAC,SAAS,EAAE;YACzB,aAAa,GAAG,UAAU,CAAC;SAC5B;aAAM,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,aAAa,GAAG,WAAW,CAAC;SAC7B;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;YACpD,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC,eAAe;YACjD,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC;SAChC;QAED,IAAI,SAAS,YAAY,2BAAY,EAAE;YACrC,WAAW,CAAC,MAAM,GAAG,6BAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;SACzD;IACH,CAAC;;AA3QH,sCA4QC;;AA3Qe,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, Tracing } 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 = request.parametersOverride || 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(async (error) => {\r\n // this catch block is intentionally placed inside `runActivity` to attach the right logging metadata and use the correct openTelemetry span.\r\n if (!(error instanceof RpcPendingResponse)) {\r\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, \"Error in RPC operation\", { error: BentleyError.getErrorProps(error) });\r\n Tracing.setAttributes({ error: true });\r\n }\r\n throw error;\r\n }));\r\n } catch (error: unknown) {\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 || false,\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\" | \"noContent\" | undefined;\r\n if (this._pending) {\r\n managedStatus = \"pending\";\r\n } else if (this._notFound) {\r\n managedStatus = \"notFound\";\r\n } else if (this._noContent) {\r\n managedStatus = \"noContent\";\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 status.responseValue = rawResult; // for ipc case\r\n fulfillment.rawResult = 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"]}
|
|
@@ -6,6 +6,7 @@ import { IModelRpcProps } from "../../IModel";
|
|
|
6
6
|
import { RpcInterface, RpcInterfaceDefinition } from "../../RpcInterface";
|
|
7
7
|
import { RpcConfiguration } from "./RpcConfiguration";
|
|
8
8
|
import { RpcProtocolEvent, RpcRequestStatus, RpcResponseCacheControl } from "./RpcConstants";
|
|
9
|
+
import { RpcNotFoundResponse } from "./RpcControl";
|
|
9
10
|
import { RpcInvocation, SerializedRpcActivity } from "./RpcInvocation";
|
|
10
11
|
import { RpcSerializedValue } from "./RpcMarshaling";
|
|
11
12
|
import { RpcOperation } from "./RpcOperation";
|
|
@@ -30,6 +31,7 @@ export interface SerializedRpcRequest extends SerializedRpcActivity {
|
|
|
30
31
|
caching: RpcResponseCacheControl;
|
|
31
32
|
ip?: string;
|
|
32
33
|
protocolVersion?: number;
|
|
34
|
+
parametersOverride?: any[];
|
|
33
35
|
}
|
|
34
36
|
/** An RPC operation request fulfillment.
|
|
35
37
|
* @internal
|
|
@@ -71,8 +73,10 @@ export declare enum RpcProtocolVersion {
|
|
|
71
73
|
*/
|
|
72
74
|
export interface RpcManagedStatus {
|
|
73
75
|
iTwinRpcCoreResponse: true;
|
|
74
|
-
managedStatus: "pending" | "notFound";
|
|
75
|
-
responseValue: string
|
|
76
|
+
managedStatus: "pending" | "notFound" | "noContent";
|
|
77
|
+
responseValue: string | {
|
|
78
|
+
message: string;
|
|
79
|
+
} | RpcNotFoundResponse;
|
|
76
80
|
}
|
|
77
81
|
/** An application protocol for an RPC interface.
|
|
78
82
|
* @internal
|
|
@@ -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,CAA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