@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAppRpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2D;AAE3D,+DAA4D;AAC5D,uDAA2F;AAE3F,qDAAkD;AAClD,uCAAiF;AACjF,yDAAsD;AACtD,yDAAsD;AACtD,qEAAkE;AAClE,qDAAkD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Y5E;AA5HD,8CA4HC","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 { BentleyError, Logger } from \"@itwin/core-bentley\";\r\nimport { Readable, Writable } from \"stream\";\r\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\r\nimport { RpcContentType, RpcRequestStatus, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\r\nimport { RpcOperation } from \"../core/RpcOperation\";\r\nimport { RpcProtocol } from \"../core/RpcProtocol\";\r\nimport { OpenAPIInfo, OpenAPIParameter, RpcOpenAPIDescription } from \"./OpenAPI\";\r\nimport { WebAppRpcLogging } from \"./WebAppRpcLogging\";\r\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\r\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { RpcManager } from \"../../RpcManager\";\r\nimport { RpcRoutingToken } from \"../core/RpcRoutingToken\";\r\n\r\nclass InitializeInterface extends RpcInterface {\r\n public static readonly interfaceName = \"InitializeInterface\";\r\n public static readonly interfaceVersion = \"1.0.0\";\r\n public async initialize() { return this.forward(arguments); }\r\n\r\n public static createRequest(protocol: WebAppRpcProtocol) {\r\n const routing = RpcRoutingToken.generate();\r\n\r\n const config = class extends RpcConfiguration {\r\n public interfaces = () => [InitializeInterface];\r\n public protocol = protocol;\r\n };\r\n\r\n RpcConfiguration.assignWithRouting(InitializeInterface, routing, config);\r\n\r\n const instance = RpcConfiguration.obtain(config);\r\n RpcConfiguration.initializeInterfaces(instance);\r\n\r\n const client = RpcManager.getClientForInterface(InitializeInterface, routing);\r\n return new (protocol.requestType)(client, \"initialize\", []);\r\n }\r\n}\r\n\r\n/** An HTTP server request object.\r\n * @public\r\n */\r\nexport interface HttpServerRequest extends Readable {\r\n aborted: boolean;\r\n httpVersion: string;\r\n httpVersionMajor: number;\r\n httpVersionMinor: number;\r\n complete: boolean;\r\n connection: any;\r\n headers: { [header: string]: string | string[] | undefined };\r\n rawHeaders: string[];\r\n trailers: { [key: string]: string | undefined };\r\n rawTrailers: string[];\r\n setTimeout(msecs: number, callback: () => void): this;\r\n url?: string;\r\n statusCode?: number;\r\n statusMessage?: string;\r\n socket: any;\r\n destroy(error?: Error): void;\r\n body: string | Buffer;\r\n path: string;\r\n method: string;\r\n ip?: string;\r\n header: (field: string) => string | undefined;\r\n}\r\n\r\n/** An HTTP server response object.\r\n * @public\r\n */\r\nexport interface HttpServerResponse extends Writable {\r\n send(body?: any): HttpServerResponse;\r\n status(code: number): HttpServerResponse;\r\n set(field: string, value: string): void;\r\n}\r\n\r\n/** The HTTP application protocol.\r\n * @internal\r\n */\r\nexport abstract class WebAppRpcProtocol extends RpcProtocol {\r\n public override preserveStreams = true;\r\n\r\n private _initialized: Promise<void> | undefined;\r\n\r\n /** @internal */\r\n public allowedHeaders: Set<string> = new Set();\r\n\r\n /** @internal */\r\n public async initialize() {\r\n if (this._initialized) {\r\n return this._initialized;\r\n }\r\n\r\n return this._initialized = new Promise(async (resolve) => {\r\n try {\r\n const request = InitializeInterface.createRequest(this);\r\n const response = await request.preflight();\r\n if (response && response.ok) {\r\n (response.headers.get(\"Access-Control-Allow-Headers\") || \"\").split(\",\").forEach((v) => this.allowedHeaders.add(v.trim()));\r\n }\r\n } catch (err) {\r\n Logger.logWarning(CommonLoggerCategory.RpcInterfaceFrontend, \"Unable to discover backend capabilities.\", BentleyError.getErrorProps(err));\r\n }\r\n\r\n resolve();\r\n });\r\n }\r\n\r\n /** Convenience handler for an RPC operation get request for an HTTP server. */\r\n public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) {\r\n return this.handleOperationPostRequest(req, res);\r\n }\r\n\r\n /** Convenience handler for an RPC operation post request for an HTTP server. */\r\n public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) {\r\n const request = await WebAppRpcRequest.parseRequest(this, req);\r\n const fulfillment = await this.fulfill(request);\r\n await WebAppRpcRequest.sendResponse(this, request, fulfillment, req, res);\r\n }\r\n\r\n /** Convenience handler for an OpenAPI description request for an HTTP server. */\r\n public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) {\r\n const description = JSON.stringify(this.openAPIDescription);\r\n res.send(description);\r\n }\r\n\r\n /** Converts an HTTP content type value to an RPC content type value. */\r\n public static computeContentType(httpType: string | null | undefined): RpcContentType {\r\n if (!httpType)\r\n return RpcContentType.Unknown;\r\n\r\n if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) {\r\n return RpcContentType.Text;\r\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) {\r\n return RpcContentType.Binary;\r\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) {\r\n return RpcContentType.Multipart;\r\n } else {\r\n return RpcContentType.Unknown;\r\n }\r\n }\r\n\r\n /** The OpenAPI-compatible info object for this protocol. */\r\n public abstract info: OpenAPIInfo;\r\n\r\n /** An optional prefix for RPC operation URI paths. */\r\n public pathPrefix: string = \"\";\r\n\r\n /** The RPC request class for this protocol. */\r\n public readonly requestType = WebAppRpcRequest;\r\n\r\n /** Supplies the status corresponding to a protocol-specific code value. */\r\n public override getStatus(code: number): RpcRequestStatus {\r\n switch (code) {\r\n case 404: return RpcRequestStatus.NotFound;\r\n case 202: return RpcRequestStatus.Pending;\r\n case 200: return RpcRequestStatus.Resolved;\r\n case 500: return RpcRequestStatus.Rejected;\r\n case 204: return RpcRequestStatus.NoContent;\r\n case 502: return RpcRequestStatus.BadGateway;\r\n case 503: return RpcRequestStatus.ServiceUnavailable;\r\n case 504: return RpcRequestStatus.GatewayTimeout;\r\n default: return RpcRequestStatus.Unknown;\r\n }\r\n }\r\n\r\n /** Supplies the protocol-specific code corresponding to a status value. */\r\n public override getCode(status: RpcRequestStatus): number {\r\n switch (status) {\r\n case RpcRequestStatus.NotFound: return 404;\r\n case RpcRequestStatus.Pending: return 202;\r\n case RpcRequestStatus.Resolved: return 200;\r\n case RpcRequestStatus.Rejected: return 500;\r\n case RpcRequestStatus.NoContent: return 204;\r\n case RpcRequestStatus.BadGateway: return 502;\r\n case RpcRequestStatus.ServiceUnavailable: return 503;\r\n case RpcRequestStatus.GatewayTimeout: return 504;\r\n default: return 501;\r\n }\r\n }\r\n\r\n public override supportsStatusCategory = true;\r\n\r\n /** Whether an HTTP status code indicates a request timeout. */\r\n public isTimeout(code: number): boolean {\r\n return code === 504;\r\n }\r\n\r\n /** An OpenAPI-compatible description of this protocol.\r\n * @internal\r\n */\r\n public get openAPIDescription() { return new RpcOpenAPIDescription(this); }\r\n\r\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\r\n * @internal\r\n */\r\n public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[];\r\n\r\n /** Constructs an HTTP protocol. */\r\n public constructor(configuration: RpcConfiguration) {\r\n super(configuration);\r\n this.events.addListener(WebAppRpcLogging.logProtocolEvent);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"WebAppRpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,uDAA2F;AAE3F,qDAAkD;AAClD,uCAAiF;AACjF,yDAAsD;AACtD,yDAAsD;AAsCtD;;GAEG;AACH,MAAsB,iBAAkB,SAAQ,yBAAW;IA6FzD,mCAAmC;IACnC,YAAmB,aAA+B;QAChD,KAAK,CAAC,aAAa,CAAC,CAAC;QA9FP,oBAAe,GAAG,IAAI,CAAC;QAuCvC,sDAAsD;QAC/C,eAAU,GAAW,EAAE,CAAC;QAE/B,+CAA+C;QAC/B,gBAAW,GAAG,mCAAgB,CAAC;QAgC/B,2BAAsB,GAAG,IAAI,CAAC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B,CAAC,kBAAkB,CAAC,CAAC,OAAO,GAAG,CAAC;YACrD,KAAK,+BAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,GAAG,CAAC;YACjD,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC;SACrB;IACH,CAAC;IAID,+DAA+D;IACxD,SAAS,CAAC,IAAY;QAC3B,OAAO,IAAI,KAAK,GAAG,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB,KAAK,OAAO,IAAI,+BAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CAY5E;AAlGD,8CAkGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { Readable, Writable } from \"stream\";\r\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\r\nimport { RpcContentType, RpcRequestStatus, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\r\nimport { RpcOperation } from \"../core/RpcOperation\";\r\nimport { RpcProtocol } from \"../core/RpcProtocol\";\r\nimport { OpenAPIInfo, OpenAPIParameter, RpcOpenAPIDescription } from \"./OpenAPI\";\r\nimport { WebAppRpcLogging } from \"./WebAppRpcLogging\";\r\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\r\n\r\n/** An HTTP server request object.\r\n * @public\r\n */\r\nexport interface HttpServerRequest extends Readable {\r\n aborted: boolean;\r\n httpVersion: string;\r\n httpVersionMajor: number;\r\n httpVersionMinor: number;\r\n complete: boolean;\r\n connection: any;\r\n headers: { [header: string]: string | string[] | undefined };\r\n rawHeaders: string[];\r\n trailers: { [key: string]: string | undefined };\r\n rawTrailers: string[];\r\n setTimeout(msecs: number, callback: () => void): this;\r\n url?: string;\r\n statusCode?: number;\r\n statusMessage?: string;\r\n socket: any;\r\n destroy(error?: Error): void;\r\n body: string | Buffer;\r\n path: string;\r\n method: string;\r\n ip?: string;\r\n header: (field: string) => string | undefined;\r\n}\r\n\r\n/** An HTTP server response object.\r\n * @public\r\n */\r\nexport interface HttpServerResponse extends Writable {\r\n send(body?: any): HttpServerResponse;\r\n status(code: number): HttpServerResponse;\r\n set(field: string, value: string): void;\r\n}\r\n\r\n/** The HTTP application protocol.\r\n * @internal\r\n */\r\nexport abstract class WebAppRpcProtocol extends RpcProtocol {\r\n public override preserveStreams = true;\r\n\r\n /** Convenience handler for an RPC operation get request for an HTTP server. */\r\n public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) {\r\n return this.handleOperationPostRequest(req, res);\r\n }\r\n\r\n /** Convenience handler for an RPC operation post request for an HTTP server. */\r\n public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) {\r\n const request = await WebAppRpcRequest.parseRequest(this, req);\r\n const fulfillment = await this.fulfill(request);\r\n await WebAppRpcRequest.sendResponse(this, request, fulfillment, req, res);\r\n }\r\n\r\n /** Convenience handler for an OpenAPI description request for an HTTP server. */\r\n public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) {\r\n const description = JSON.stringify(this.openAPIDescription);\r\n res.send(description);\r\n }\r\n\r\n /** Converts an HTTP content type value to an RPC content type value. */\r\n public static computeContentType(httpType: string | null | undefined): RpcContentType {\r\n if (!httpType)\r\n return RpcContentType.Unknown;\r\n\r\n if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) {\r\n return RpcContentType.Text;\r\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) {\r\n return RpcContentType.Binary;\r\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) {\r\n return RpcContentType.Multipart;\r\n } else {\r\n return RpcContentType.Unknown;\r\n }\r\n }\r\n\r\n /** The OpenAPI-compatible info object for this protocol. */\r\n public abstract info: OpenAPIInfo;\r\n\r\n /** An optional prefix for RPC operation URI paths. */\r\n public pathPrefix: string = \"\";\r\n\r\n /** The RPC request class for this protocol. */\r\n public readonly requestType = WebAppRpcRequest;\r\n\r\n /** Supplies the status corresponding to a protocol-specific code value. */\r\n public override getStatus(code: number): RpcRequestStatus {\r\n switch (code) {\r\n case 404: return RpcRequestStatus.NotFound;\r\n case 202: return RpcRequestStatus.Pending;\r\n case 200: return RpcRequestStatus.Resolved;\r\n case 500: return RpcRequestStatus.Rejected;\r\n case 204: return RpcRequestStatus.NoContent;\r\n case 502: return RpcRequestStatus.BadGateway;\r\n case 503: return RpcRequestStatus.ServiceUnavailable;\r\n case 504: return RpcRequestStatus.GatewayTimeout;\r\n default: return RpcRequestStatus.Unknown;\r\n }\r\n }\r\n\r\n /** Supplies the protocol-specific code corresponding to a status value. */\r\n public override getCode(status: RpcRequestStatus): number {\r\n switch (status) {\r\n case RpcRequestStatus.NotFound: return 404;\r\n case RpcRequestStatus.Pending: return 202;\r\n case RpcRequestStatus.Resolved: return 200;\r\n case RpcRequestStatus.Rejected: return 500;\r\n case RpcRequestStatus.NoContent: return 204;\r\n case RpcRequestStatus.BadGateway: return 502;\r\n case RpcRequestStatus.ServiceUnavailable: return 503;\r\n case RpcRequestStatus.GatewayTimeout: return 504;\r\n default: return 501;\r\n }\r\n }\r\n\r\n public override supportsStatusCategory = true;\r\n\r\n /** Whether an HTTP status code indicates a request timeout. */\r\n public isTimeout(code: number): boolean {\r\n return code === 504;\r\n }\r\n\r\n /** An OpenAPI-compatible description of this protocol.\r\n * @internal\r\n */\r\n public get openAPIDescription() { return new RpcOpenAPIDescription(this); }\r\n\r\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\r\n * @internal\r\n */\r\n public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[];\r\n\r\n /** Constructs an HTTP protocol. */\r\n public constructor(configuration: RpcConfiguration) {\r\n super(configuration);\r\n this.events.addListener(WebAppRpcLogging.logProtocolEvent);\r\n }\r\n}\r\n"]}
|
|
@@ -18,6 +18,8 @@ export declare class WebAppRpcRequest extends RpcRequest {
|
|
|
18
18
|
private _pathSuffix;
|
|
19
19
|
private get _headers();
|
|
20
20
|
/** The maximum size permitted for an encoded component in a URL.
|
|
21
|
+
* Note that some backends limit the total cumulative request size. Our current node backends accept requests with a max size of 16 kb.
|
|
22
|
+
* In addition to the url size, an authorization header may also add considerably to the request size.
|
|
21
23
|
* @note This is used for features like encoding the payload of a cacheable request in the URL.
|
|
22
24
|
*/
|
|
23
25
|
static maxUrlComponentSize: number;
|
|
@@ -40,9 +42,6 @@ export declare class WebAppRpcRequest extends RpcRequest {
|
|
|
40
42
|
protected static computeTransportType(value: RpcSerializedValue, source: any): RpcContentType;
|
|
41
43
|
/** Constructs a web application request. */
|
|
42
44
|
constructor(client: RpcInterface, operation: string, parameters: any[]);
|
|
43
|
-
/** @internal */
|
|
44
|
-
preflight(): Promise<Response | undefined>;
|
|
45
|
-
protected isHeaderAvailable(name: string): boolean;
|
|
46
45
|
/** Sets request header values. */
|
|
47
46
|
protected setHeader(name: string, value: string): void;
|
|
48
47
|
/** Sends the request. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAppRpcRequest.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcRequest.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAkF,MAAM,sBAAsB,CAAC;AAEtI,OAAO,EAA0B,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAe,qBAAqB,EAA0B,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACvH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE/F,gBAAgB;AAChB,oBAAY,YAAY,GAAG,KAAK,GAAG,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,aAAa;YAapB,YAAY;YAkBZ,QAAQ;YAMR,UAAU;YAMV,aAAa;YAMb,cAAc;IAa5B,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,kBAAkB;CAiB3B"}
|
|
@@ -134,27 +134,12 @@ class WebAppRpcRequest extends RpcRequest_1.RpcRequest {
|
|
|
134
134
|
return RpcConstants_1.RpcContentType.Text;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
/** @internal */
|
|
138
|
-
async preflight() {
|
|
139
|
-
this.method = "options";
|
|
140
|
-
this._request.method = "options";
|
|
141
|
-
await this.setHeaders();
|
|
142
|
-
await this.send();
|
|
143
|
-
return this._response;
|
|
144
|
-
}
|
|
145
|
-
isHeaderAvailable(name) {
|
|
146
|
-
const allowed = this.protocol.allowedHeaders;
|
|
147
|
-
return allowed.has("*") || allowed.has(name);
|
|
148
|
-
}
|
|
149
137
|
/** Sets request header values. */
|
|
150
138
|
setHeader(name, value) {
|
|
151
139
|
this._headers[name] = value;
|
|
152
140
|
}
|
|
153
141
|
/** Sends the request. */
|
|
154
142
|
async send() {
|
|
155
|
-
if (this.method !== "options") {
|
|
156
|
-
await this.protocol.initialize();
|
|
157
|
-
}
|
|
158
143
|
this._loading = true;
|
|
159
144
|
await this.setupTransport();
|
|
160
145
|
return new Promise(async (resolve, reject) => {
|
|
@@ -241,8 +226,29 @@ class WebAppRpcRequest extends RpcRequest_1.RpcRequest {
|
|
|
241
226
|
}
|
|
242
227
|
static configureResponse(protocol, request, fulfillment, res) {
|
|
243
228
|
const success = protocol.getStatus(fulfillment.status) === RpcConstants_1.RpcRequestStatus.Resolved;
|
|
229
|
+
// TODO: Use stale-while-revalidate in cache headers. This needs to be tested, and does not currently have support in the router/caching-service.
|
|
230
|
+
// This will allow browsers to use stale cached responses while also revalidating with the router, allowing us to start up a backend if necessary.
|
|
231
|
+
// RPC Caching Service uses the s-maxage header to determine the TTL for the redis cache.
|
|
232
|
+
const oneHourInSeconds = 3600;
|
|
244
233
|
if (success && request.caching === RpcConstants_1.RpcResponseCacheControl.Immutable) {
|
|
245
|
-
|
|
234
|
+
// If response size is > 50 MB, do not cache it.
|
|
235
|
+
if (fulfillment.result.objects.length > (50 * 10 ** 7)) {
|
|
236
|
+
res.set("Cache-Control", "no-store");
|
|
237
|
+
}
|
|
238
|
+
else if (request.operation.operationName === "generateTileContent") {
|
|
239
|
+
res.set("Cache-Control", "no-store");
|
|
240
|
+
}
|
|
241
|
+
else if (request.operation.operationName === "getConnectionProps") {
|
|
242
|
+
// GetConnectionprops can't be cached on the browser longer than the lifespan of the backend. The lifespan of backend may shrink too. Keep it at 1 second to be safe.
|
|
243
|
+
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 24}, max-age=1, immutable`);
|
|
244
|
+
}
|
|
245
|
+
else if (request.operation.operationName === "getTileCacheContainerUrl") {
|
|
246
|
+
// getTileCacheContainerUrl returns a SAS with an expiry of 23:59:59. We can't exceed that time when setting the max-age.
|
|
247
|
+
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 23}, max-age=${oneHourInSeconds * 23}, immutable`);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 24}, max-age=${oneHourInSeconds * 48}, immutable`);
|
|
251
|
+
}
|
|
246
252
|
}
|
|
247
253
|
if (fulfillment.retry) {
|
|
248
254
|
res.set("Retry-After", fulfillment.retry);
|
|
@@ -319,9 +325,6 @@ class WebAppRpcRequest extends RpcRequest_1.RpcRequest {
|
|
|
319
325
|
return value;
|
|
320
326
|
}
|
|
321
327
|
async setupTransport() {
|
|
322
|
-
if (this.method === "options") {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
328
|
const parameters = (await this.protocol.serialize(this)).parameters;
|
|
326
329
|
const transportType = WebAppRpcRequest.computeTransportType(parameters, this.parameters);
|
|
327
330
|
if (transportType === RpcConstants_1.RpcContentType.Binary) {
|
|
@@ -364,7 +367,9 @@ class WebAppRpcRequest extends RpcRequest_1.RpcRequest {
|
|
|
364
367
|
}
|
|
365
368
|
exports.WebAppRpcRequest = WebAppRpcRequest;
|
|
366
369
|
/** The maximum size permitted for an encoded component in a URL.
|
|
370
|
+
* Note that some backends limit the total cumulative request size. Our current node backends accept requests with a max size of 16 kb.
|
|
371
|
+
* In addition to the url size, an authorization header may also add considerably to the request size.
|
|
367
372
|
* @note This is used for features like encoding the payload of a cacheable request in the URL.
|
|
368
373
|
*/
|
|
369
|
-
WebAppRpcRequest.maxUrlComponentSize =
|
|
374
|
+
WebAppRpcRequest.maxUrlComponentSize = 1024 * 8;
|
|
370
375
|
//# sourceMappingURL=WebAppRpcRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAppRpcRequest.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcRequest.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,mCAAgC;AAChC,mDAAiF;AAEjF,uDAAsI;AAEtI,yDAAmF;AACnF,qDAAuH;AACvH,mDAAgD;AAChD,uEAAoE;AACpE,iDAAgE;AAChE,2DAA+F;AAK/F;;GAEG;AACH,MAAa,gBAAiB,SAAQ,uBAAU;IAiI9C,4CAA4C;IAC5C,YAAmB,MAAoB,EAAE,SAAiB,EAAE,UAAiB;QAC3E,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAlI/B,aAAQ,GAAY,KAAK,CAAC;QAC1B,aAAQ,GAAgB,EAAE,CAAC;QAC3B,gBAAW,GAAW,EAAE,CAAC;QAWjC,0DAA0D;QACjC,aAAQ,GAAsB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAe,CAAC;QAEjG,+FAA+F;QACxF,aAAQ,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAkH3C,IAAI,CAAC,IAAI,GAA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right (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 { IModelError, ServerError, ServerTimeoutError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { RpcContentType, RpcProtocolEvent, RpcRequestStatus, RpcResponseCacheControl, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\r\nimport { SerializedRpcActivity } from \"../core/RpcInvocation\";\r\nimport { MarshalingBinaryMarker, RpcSerializedValue } from \"../core/RpcMarshaling\";\r\nimport { RpcProtocol, RpcRequestFulfillment, SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\r\nimport { RpcRequest } from \"../core/RpcRequest\";\r\nimport { RpcMultipartParser } from \"./multipart/RpcMultipartParser\";\r\nimport { ReadableFormData, RpcMultipart } from \"./RpcMultipart\";\r\nimport { HttpServerRequest, HttpServerResponse, WebAppRpcProtocol } from \"./WebAppRpcProtocol\";\r\n\r\n/** @internal */\r\nexport type HttpMethod_T = \"get\" | \"put\" | \"post\" | \"delete\" | \"options\" | \"head\" | \"patch\" | \"trace\"; // eslint-disable-line @typescript-eslint/naming-convention\r\n\r\n/** A web application RPC request.\r\n * @internal\r\n */\r\nexport class WebAppRpcRequest extends RpcRequest {\r\n private _loading: boolean = false;\r\n private _request: RequestInit = {};\r\n private _pathSuffix: string = \"\";\r\n private get _headers() { return this._request.headers as { [key: string]: string }; }\r\n\r\n /** The maximum size permitted for an encoded component in a URL.\r\n * @note This is used for features like encoding the payload of a cacheable request in the URL.\r\n */\r\n public static maxUrlComponentSize = 4096;\r\n\r\n /** The HTTP method for this request. */\r\n public override method: HttpMethod_T;\r\n\r\n /** Convenience access to the protocol of this request. */\r\n public override readonly protocol: WebAppRpcProtocol = this.client.configuration.protocol as any;\r\n\r\n /** Standardized access to metadata about the request (useful for purposes such as logging). */\r\n public metadata = { status: 0, message: \"\" };\r\n\r\n /** Parse headers */\r\n private static parseHeaders(protocol: WebAppRpcProtocol, req: HttpServerRequest): SerializedRpcActivity {\r\n const headerNames: SerializedRpcActivity = protocol.serializedClientRequestContextHeaderNames;\r\n const parsedHeaders: SerializedRpcActivity = {\r\n id: req.header(headerNames.id) || \"\",\r\n applicationId: req.header(headerNames.applicationId) || \"\",\r\n applicationVersion: req.header(headerNames.applicationVersion) || \"\",\r\n sessionId: req.header(headerNames.sessionId) || \"\",\r\n authorization: (headerNames.authorization ? req.header(headerNames.authorization) : \"\") ?? \"\",\r\n };\r\n return parsedHeaders;\r\n }\r\n\r\n /** Parses a request. */\r\n public static async parseRequest(protocol: WebAppRpcProtocol, req: HttpServerRequest): Promise<SerializedRpcRequest> {\r\n const operation = protocol.getOperationFromPath(req.url!);\r\n\r\n const parsedHeaders = this.parseHeaders(protocol, req);\r\n\r\n const request: SerializedRpcRequest = {\r\n ...parsedHeaders,\r\n operation: {\r\n interfaceDefinition: operation.interfaceDefinition,\r\n operationName: operation.operationName,\r\n interfaceVersion: operation.interfaceVersion,\r\n },\r\n method: req.method,\r\n path: req.url!,\r\n parameters: operation.encodedRequest ? WebAppRpcRequest.parseFromPath(operation) : await WebAppRpcRequest.parseFromBody(req),\r\n caching: operation.encodedRequest ? RpcResponseCacheControl.Immutable : RpcResponseCacheControl.None,\r\n };\r\n\r\n request.ip = req.ip;\r\n\r\n request.protocolVersion = 0;\r\n\r\n if (protocol.protocolVersionHeaderName) {\r\n const version = req.header(protocol.protocolVersionHeaderName);\r\n if (version) {\r\n request.protocolVersion = parseInt(version, 10);\r\n }\r\n }\r\n\r\n if (!request.id) {\r\n throw new IModelError(BentleyStatus.ERROR, `Invalid request.`);\r\n }\r\n\r\n return request;\r\n }\r\n\r\n /** Sends the response for a web request. */\r\n public static async sendResponse(\r\n protocol: WebAppRpcProtocol,\r\n request: SerializedRpcRequest,\r\n fulfillment: RpcRequestFulfillment,\r\n req: HttpServerRequest,\r\n res: HttpServerResponse,\r\n ): Promise<void> {\r\n const versionHeader = protocol.protocolVersionHeaderName;\r\n if (versionHeader && RpcProtocol.protocolVersion) {\r\n res.set(versionHeader, RpcProtocol.protocolVersion.toString());\r\n }\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const { Readable, Stream } = await import(/* webpackIgnore: true */ \"stream\");\r\n const { createGzip } = await import(/* webpackIgnore: true */ \"zlib\");\r\n\r\n const transportType = WebAppRpcRequest.computeTransportType(fulfillment.result, fulfillment.rawResult);\r\n let responseBody;\r\n if (transportType === RpcContentType.Binary) {\r\n responseBody = WebAppRpcRequest.configureBinary(fulfillment, res);\r\n } else if (transportType === RpcContentType.Multipart) {\r\n responseBody = WebAppRpcRequest.configureMultipart(fulfillment, res);\r\n } else if (transportType === RpcContentType.Stream) {\r\n responseBody = WebAppRpcRequest.configureStream(fulfillment);\r\n } else {\r\n responseBody = WebAppRpcRequest.configureText(fulfillment, res);\r\n }\r\n\r\n WebAppRpcRequest.configureResponse(protocol, request, fulfillment, res);\r\n res.status(fulfillment.status);\r\n\r\n if (fulfillment.allowCompression && req.header(\"Accept-Encoding\")?.includes(\"gzip\")) {\r\n res.set(\"Content-Encoding\", \"gzip\");\r\n const readableResponseBody = (responseBody instanceof Stream) ? responseBody : Readable.from(responseBody);\r\n responseBody = readableResponseBody.pipe(createGzip());\r\n }\r\n\r\n // This check should in theory look for instances of Readable, but that would break backend implementation at\r\n // core/backend/src/RpcBackend.ts\r\n if (responseBody instanceof Stream) {\r\n responseBody.pipe(res);\r\n } else {\r\n res.send(responseBody);\r\n }\r\n }\r\n\r\n /** Determines the most efficient transport type for an RPC value. */\r\n protected static computeTransportType(value: RpcSerializedValue, source: any): RpcContentType {\r\n if (source instanceof Uint8Array || (Array.isArray(source) && source[0] instanceof Uint8Array)) {\r\n return RpcContentType.Binary;\r\n } else if (value.data.length > 0) {\r\n return RpcContentType.Multipart;\r\n } else if (value.stream) {\r\n return RpcContentType.Stream;\r\n } else {\r\n return RpcContentType.Text;\r\n }\r\n }\r\n\r\n /** Constructs a web application request. */\r\n public constructor(client: RpcInterface, operation: string, parameters: any[]) {\r\n super(client, operation, parameters);\r\n this.path = this.protocol.supplyPathForOperation(this.operation, this);\r\n this.method = \"head\";\r\n this._request.headers = {};\r\n }\r\n\r\n /** @internal */\r\n public async preflight(): Promise<Response | undefined> {\r\n this.method = \"options\";\r\n this._request.method = \"options\";\r\n await this.setHeaders();\r\n await this.send();\r\n return this._response;\r\n }\r\n\r\n protected override isHeaderAvailable(name: string): boolean {\r\n const allowed = this.protocol.allowedHeaders;\r\n return allowed.has(\"*\") || allowed.has(name);\r\n }\r\n\r\n /** Sets request header values. */\r\n protected setHeader(name: string, value: string): void {\r\n this._headers[name] = value;\r\n }\r\n\r\n /** Sends the request. */\r\n protected async send(): Promise<number> {\r\n if (this.method !== \"options\") {\r\n await this.protocol.initialize();\r\n }\r\n\r\n this._loading = true;\r\n await this.setupTransport();\r\n\r\n return new Promise<number>(async (resolve, reject) => {\r\n try {\r\n resolve(await this.performFetch());\r\n } catch (reason) {\r\n reject(new ServerError(-1, typeof (reason) === \"string\" ? reason : \"Server connection error.\"));\r\n }\r\n });\r\n }\r\n\r\n protected override computeRetryAfter(attempts: number): number {\r\n const retryAfter = this._response && this._response.headers.get(\"Retry-After\");\r\n if (retryAfter) {\r\n this.resetTransientFaultCount();\r\n\r\n const r = Number(retryAfter);\r\n if (Number.isFinite(r)) {\r\n return r * 1000;\r\n }\r\n\r\n const d = Date.parse(retryAfter);\r\n if (!Number.isNaN(d)) {\r\n return d - Date.now();\r\n }\r\n } else {\r\n this.recordTransientFault();\r\n }\r\n\r\n return super.computeRetryAfter(attempts);\r\n }\r\n\r\n protected override handleUnknownResponse(code: number) {\r\n if (this.protocol.isTimeout(code)) {\r\n this.reject(new ServerTimeoutError(\"Request timeout.\"));\r\n } else {\r\n this.reject(new ServerError(code, \"Unknown server response code.\"));\r\n }\r\n }\r\n\r\n protected async load(): Promise<RpcSerializedValue> {\r\n return new Promise<RpcSerializedValue>(async (resolve, reject) => {\r\n try {\r\n if (!this._loading)\r\n return;\r\n\r\n const response = this._response;\r\n if (!response) {\r\n reject(new IModelError(BentleyStatus.ERROR, \"Invalid state.\"));\r\n return;\r\n }\r\n\r\n if (this.protocol.protocolVersionHeaderName) {\r\n const version = response.headers.get(this.protocol.protocolVersionHeaderName);\r\n if (version) {\r\n this.responseProtocolVersion = parseInt(version, 10);\r\n }\r\n }\r\n\r\n const contentType = response.headers.get(WEB_RPC_CONSTANTS.CONTENT);\r\n const responseType = WebAppRpcProtocol.computeContentType(contentType);\r\n\r\n if (responseType === RpcContentType.Binary) {\r\n resolve(await this.loadBinary(response));\r\n } else if (responseType === RpcContentType.Multipart) {\r\n resolve(await this.loadMultipart(response, contentType!));\r\n } else {\r\n resolve(await this.loadText(response));\r\n }\r\n\r\n this._loading = false;\r\n this.setLastUpdatedTime();\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoaded, this);\r\n } catch (reason) {\r\n if (!this._loading)\r\n return;\r\n\r\n this._loading = false;\r\n reject(new ServerError(this.metadata.status, typeof (reason) === \"string\" ? reason : \"Unknown server response error.\"));\r\n }\r\n });\r\n }\r\n\r\n /** Override to supply an alternate fetch function. */\r\n protected supplyFetch(): typeof fetch {\r\n return fetch;\r\n }\r\n\r\n /** Override to supply an alternate Request function. */\r\n protected supplyRequest(): typeof Request {\r\n return Request;\r\n }\r\n\r\n private static configureResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, res: HttpServerResponse) {\r\n const success = protocol.getStatus(fulfillment.status) === RpcRequestStatus.Resolved;\r\n\r\n if (success && request.caching === RpcResponseCacheControl.Immutable) {\r\n res.set(\"Cache-Control\", \"private, max-age=31536000, immutable\");\r\n }\r\n\r\n if (fulfillment.retry) {\r\n res.set(\"Retry-After\", fulfillment.retry);\r\n }\r\n }\r\n\r\n private static configureText(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): string {\r\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.TEXT);\r\n return (fulfillment.status === 204) ? \"\" : fulfillment.result.objects;\r\n }\r\n\r\n private static configureBinary(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): Buffer {\r\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.BINARY);\r\n const data = fulfillment.result.data[0];\r\n return Buffer.isBuffer(data) ? data : Buffer.from(data);\r\n }\r\n\r\n private static configureMultipart(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): ReadableFormData {\r\n const response = RpcMultipart.createStream(fulfillment.result);\r\n const headers = response.getHeaders();\r\n for (const header in headers) {\r\n if (headers.hasOwnProperty(header)) {\r\n res.set(header, headers[header]);\r\n }\r\n }\r\n\r\n return response;\r\n }\r\n\r\n private static configureStream(fulfillment: RpcRequestFulfillment) {\r\n return fulfillment.result.stream!;\r\n }\r\n\r\n private static parseFromPath(operation: SerializedRpcOperation): RpcSerializedValue {\r\n const decoded = operation.encodedRequest ? Buffer.from(operation.encodedRequest, \"base64\").toString(\"binary\") : \"\";\r\n return RpcSerializedValue.create(decoded);\r\n }\r\n\r\n private static async parseFromBody(req: HttpServerRequest): Promise<RpcSerializedValue> {\r\n const contentType = WebAppRpcProtocol.computeContentType(req.header(WEB_RPC_CONSTANTS.CONTENT));\r\n if (contentType === RpcContentType.Binary) {\r\n const objects = JSON.stringify([MarshalingBinaryMarker.createDefault()]);\r\n const data = [req.body as Buffer];\r\n return RpcSerializedValue.create(objects, data);\r\n } else if (contentType === RpcContentType.Multipart) {\r\n return RpcMultipart.parseRequest(req);\r\n } else {\r\n return RpcSerializedValue.create(req.body as string);\r\n }\r\n }\r\n\r\n private async performFetch(): Promise<number> {\r\n const requestClass = this.supplyRequest();\r\n const fetchFunction = this.supplyFetch();\r\n\r\n const path = new URL(this.path, typeof (location) !== \"undefined\" ? location.origin : undefined);\r\n if (this._pathSuffix) {\r\n const params = new URLSearchParams();\r\n params.set(\"parameters\", this._pathSuffix);\r\n path.search = `?${params.toString()}`;\r\n }\r\n\r\n const request = new requestClass(path.toString(), this._request);\r\n const response = await fetchFunction(request);\r\n this._response = response;\r\n this.metadata.status = response.status;\r\n return response.status;\r\n }\r\n\r\n private async loadText(response: Response) {\r\n const value = await response.text();\r\n this.metadata.message = value;\r\n return RpcSerializedValue.create(value);\r\n }\r\n\r\n private async loadBinary(response: Response) {\r\n const value = new Uint8Array(await response.arrayBuffer());\r\n const objects = JSON.stringify(MarshalingBinaryMarker.createDefault());\r\n return RpcSerializedValue.create(objects, [value]);\r\n }\r\n\r\n private async loadMultipart(response: Response, contentType: string) {\r\n const data = await response.arrayBuffer();\r\n const value = new RpcMultipartParser(contentType, Buffer.from(data)).parse();\r\n return value;\r\n }\r\n\r\n private async setupTransport(): Promise<void> {\r\n if (this.method === \"options\") {\r\n return;\r\n }\r\n\r\n const parameters = (await this.protocol.serialize(this)).parameters;\r\n const transportType = WebAppRpcRequest.computeTransportType(parameters, this.parameters);\r\n\r\n if (transportType === RpcContentType.Binary) {\r\n this.setupBinaryTransport(parameters);\r\n } else if (transportType === RpcContentType.Multipart) {\r\n this.setupMultipartTransport(parameters);\r\n } else {\r\n this.setupTextTransport(parameters);\r\n }\r\n }\r\n\r\n private setupBinaryTransport(parameters: RpcSerializedValue) {\r\n this._headers[WEB_RPC_CONSTANTS.CONTENT] = WEB_RPC_CONSTANTS.BINARY;\r\n this._request.method = \"post\";\r\n this._request.body = parameters.data[0];\r\n }\r\n\r\n private setupMultipartTransport(parameters: RpcSerializedValue) {\r\n // IMPORTANT: do not set a multipart Content-Type header value. The browser does this automatically!\r\n delete this._headers[WEB_RPC_CONSTANTS.CONTENT];\r\n this._request.method = \"post\";\r\n this._request.body = RpcMultipart.createForm(parameters);\r\n }\r\n\r\n private setupTextTransport(parameters: RpcSerializedValue) {\r\n if (this.operation.policy.allowResponseCaching(this)) {\r\n const encodedBody = btoa(parameters.objects); // eslint-disable-line deprecation/deprecation\r\n if (encodedBody.length <= WebAppRpcRequest.maxUrlComponentSize) {\r\n this._request.method = \"get\";\r\n this._request.body = undefined;\r\n delete this._headers[WEB_RPC_CONSTANTS.CONTENT];\r\n this._pathSuffix = encodedBody;\r\n return;\r\n }\r\n }\r\n\r\n this._pathSuffix = \"\";\r\n this._headers[WEB_RPC_CONSTANTS.CONTENT] = WEB_RPC_CONSTANTS.TEXT;\r\n this._request.method = \"post\";\r\n this._request.body = parameters.objects;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"WebAppRpcRequest.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcRequest.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,mCAAgC;AAChC,mDAAiF;AAEjF,uDAAsI;AAEtI,yDAAmF;AACnF,qDAAuH;AACvH,mDAAgD;AAChD,uEAAoE;AACpE,iDAAgE;AAChE,2DAA+F;AAK/F;;GAEG;AACH,MAAa,gBAAiB,SAAQ,uBAAU;IAmI9C,4CAA4C;IAC5C,YAAmB,MAAoB,EAAE,SAAiB,EAAE,UAAiB;QAC3E,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QApI/B,aAAQ,GAAY,KAAK,CAAC;QAC1B,aAAQ,GAAgB,EAAE,CAAC;QAC3B,gBAAW,GAAW,EAAE,CAAC;QAajC,0DAA0D;QACjC,aAAQ,GAAsB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAe,CAAC;QAEjG,+FAA+F;QACxF,aAAQ,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAkH3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,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,CAAC;;AAxYH,4CAyYC;AAnYC;;;;GAIG;AACW,oCAAmB,GAAG,IAAI,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 { IModelError, ServerError, ServerTimeoutError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { RpcContentType, RpcProtocolEvent, RpcRequestStatus, RpcResponseCacheControl, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\r\nimport { SerializedRpcActivity } from \"../core/RpcInvocation\";\r\nimport { MarshalingBinaryMarker, RpcSerializedValue } from \"../core/RpcMarshaling\";\r\nimport { RpcProtocol, RpcRequestFulfillment, SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\r\nimport { RpcRequest } from \"../core/RpcRequest\";\r\nimport { RpcMultipartParser } from \"./multipart/RpcMultipartParser\";\r\nimport { ReadableFormData, RpcMultipart } from \"./RpcMultipart\";\r\nimport { HttpServerRequest, HttpServerResponse, WebAppRpcProtocol } from \"./WebAppRpcProtocol\";\r\n\r\n/** @internal */\r\nexport type HttpMethod_T = \"get\" | \"put\" | \"post\" | \"delete\" | \"options\" | \"head\" | \"patch\" | \"trace\"; // eslint-disable-line @typescript-eslint/naming-convention\r\n\r\n/** A web application RPC request.\r\n * @internal\r\n */\r\nexport class WebAppRpcRequest extends RpcRequest {\r\n private _loading: boolean = false;\r\n private _request: RequestInit = {};\r\n private _pathSuffix: string = \"\";\r\n private get _headers() { return this._request.headers as { [key: string]: string }; }\r\n\r\n /** The maximum size permitted for an encoded component in a URL.\r\n * Note that some backends limit the total cumulative request size. Our current node backends accept requests with a max size of 16 kb.\r\n * In addition to the url size, an authorization header may also add considerably to the request size.\r\n * @note This is used for features like encoding the payload of a cacheable request in the URL.\r\n */\r\n public static maxUrlComponentSize = 1024 * 8;\r\n\r\n /** The HTTP method for this request. */\r\n public override method: HttpMethod_T;\r\n\r\n /** Convenience access to the protocol of this request. */\r\n public override readonly protocol: WebAppRpcProtocol = this.client.configuration.protocol as any;\r\n\r\n /** Standardized access to metadata about the request (useful for purposes such as logging). */\r\n public metadata = { status: 0, message: \"\" };\r\n\r\n /** Parse headers */\r\n private static parseHeaders(protocol: WebAppRpcProtocol, req: HttpServerRequest): SerializedRpcActivity {\r\n const headerNames: SerializedRpcActivity = protocol.serializedClientRequestContextHeaderNames;\r\n const parsedHeaders: SerializedRpcActivity = {\r\n id: req.header(headerNames.id) || \"\",\r\n applicationId: req.header(headerNames.applicationId) || \"\",\r\n applicationVersion: req.header(headerNames.applicationVersion) || \"\",\r\n sessionId: req.header(headerNames.sessionId) || \"\",\r\n authorization: (headerNames.authorization ? req.header(headerNames.authorization) : \"\") ?? \"\",\r\n };\r\n return parsedHeaders;\r\n }\r\n\r\n /** Parses a request. */\r\n public static async parseRequest(protocol: WebAppRpcProtocol, req: HttpServerRequest): Promise<SerializedRpcRequest> {\r\n const operation = protocol.getOperationFromPath(req.url!);\r\n\r\n const parsedHeaders = this.parseHeaders(protocol, req);\r\n\r\n const request: SerializedRpcRequest = {\r\n ...parsedHeaders,\r\n operation: {\r\n interfaceDefinition: operation.interfaceDefinition,\r\n operationName: operation.operationName,\r\n interfaceVersion: operation.interfaceVersion,\r\n },\r\n method: req.method,\r\n path: req.url!,\r\n parameters: operation.encodedRequest ? WebAppRpcRequest.parseFromPath(operation) : await WebAppRpcRequest.parseFromBody(req),\r\n caching: operation.encodedRequest ? RpcResponseCacheControl.Immutable : RpcResponseCacheControl.None,\r\n };\r\n\r\n request.ip = req.ip;\r\n\r\n request.protocolVersion = 0;\r\n\r\n if (protocol.protocolVersionHeaderName) {\r\n const version = req.header(protocol.protocolVersionHeaderName);\r\n if (version) {\r\n request.protocolVersion = parseInt(version, 10);\r\n }\r\n }\r\n\r\n if (!request.id) {\r\n throw new IModelError(BentleyStatus.ERROR, `Invalid request.`);\r\n }\r\n\r\n return request;\r\n }\r\n\r\n /** Sends the response for a web request. */\r\n public static async sendResponse(\r\n protocol: WebAppRpcProtocol,\r\n request: SerializedRpcRequest,\r\n fulfillment: RpcRequestFulfillment,\r\n req: HttpServerRequest,\r\n res: HttpServerResponse,\r\n ): Promise<void> {\r\n const versionHeader = protocol.protocolVersionHeaderName;\r\n if (versionHeader && RpcProtocol.protocolVersion) {\r\n res.set(versionHeader, RpcProtocol.protocolVersion.toString());\r\n }\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const { Readable, Stream } = await import(/* webpackIgnore: true */ \"stream\");\r\n const { createGzip } = await import(/* webpackIgnore: true */ \"zlib\");\r\n\r\n const transportType = WebAppRpcRequest.computeTransportType(fulfillment.result, fulfillment.rawResult);\r\n let responseBody;\r\n if (transportType === RpcContentType.Binary) {\r\n responseBody = WebAppRpcRequest.configureBinary(fulfillment, res);\r\n } else if (transportType === RpcContentType.Multipart) {\r\n responseBody = WebAppRpcRequest.configureMultipart(fulfillment, res);\r\n } else if (transportType === RpcContentType.Stream) {\r\n responseBody = WebAppRpcRequest.configureStream(fulfillment);\r\n } else {\r\n responseBody = WebAppRpcRequest.configureText(fulfillment, res);\r\n }\r\n\r\n WebAppRpcRequest.configureResponse(protocol, request, fulfillment, res);\r\n res.status(fulfillment.status);\r\n\r\n if (fulfillment.allowCompression && req.header(\"Accept-Encoding\")?.includes(\"gzip\")) {\r\n res.set(\"Content-Encoding\", \"gzip\");\r\n const readableResponseBody = (responseBody instanceof Stream) ? responseBody : Readable.from(responseBody);\r\n responseBody = readableResponseBody.pipe(createGzip());\r\n }\r\n\r\n // This check should in theory look for instances of Readable, but that would break backend implementation at\r\n // core/backend/src/RpcBackend.ts\r\n if (responseBody instanceof Stream) {\r\n responseBody.pipe(res);\r\n } else {\r\n res.send(responseBody);\r\n }\r\n }\r\n\r\n /** Determines the most efficient transport type for an RPC value. */\r\n protected static computeTransportType(value: RpcSerializedValue, source: any): RpcContentType {\r\n if (source instanceof Uint8Array || (Array.isArray(source) && source[0] instanceof Uint8Array)) {\r\n return RpcContentType.Binary;\r\n } else if (value.data.length > 0) {\r\n return RpcContentType.Multipart;\r\n } else if (value.stream) {\r\n return RpcContentType.Stream;\r\n } else {\r\n return RpcContentType.Text;\r\n }\r\n }\r\n\r\n /** Constructs a web application request. */\r\n public constructor(client: RpcInterface, operation: string, parameters: any[]) {\r\n super(client, operation, parameters);\r\n this.path = this.protocol.supplyPathForOperation(this.operation, this);\r\n this.method = \"head\";\r\n this._request.headers = {};\r\n }\r\n\r\n /** Sets request header values. */\r\n protected setHeader(name: string, value: string): void {\r\n this._headers[name] = value;\r\n }\r\n\r\n /** Sends the request. */\r\n protected async send(): Promise<number> {\r\n this._loading = true;\r\n await this.setupTransport();\r\n\r\n return new Promise<number>(async (resolve, reject) => {\r\n try {\r\n resolve(await this.performFetch());\r\n } catch (reason) {\r\n reject(new ServerError(-1, typeof (reason) === \"string\" ? reason : \"Server connection error.\"));\r\n }\r\n });\r\n }\r\n\r\n protected override computeRetryAfter(attempts: number): number {\r\n const retryAfter = this._response && this._response.headers.get(\"Retry-After\");\r\n if (retryAfter) {\r\n this.resetTransientFaultCount();\r\n\r\n const r = Number(retryAfter);\r\n if (Number.isFinite(r)) {\r\n return r * 1000;\r\n }\r\n\r\n const d = Date.parse(retryAfter);\r\n if (!Number.isNaN(d)) {\r\n return d - Date.now();\r\n }\r\n } else {\r\n this.recordTransientFault();\r\n }\r\n\r\n return super.computeRetryAfter(attempts);\r\n }\r\n\r\n protected override handleUnknownResponse(code: number) {\r\n if (this.protocol.isTimeout(code)) {\r\n this.reject(new ServerTimeoutError(\"Request timeout.\"));\r\n } else {\r\n this.reject(new ServerError(code, \"Unknown server response code.\"));\r\n }\r\n }\r\n\r\n protected async load(): Promise<RpcSerializedValue> {\r\n return new Promise<RpcSerializedValue>(async (resolve, reject) => {\r\n try {\r\n if (!this._loading)\r\n return;\r\n\r\n const response = this._response;\r\n if (!response) {\r\n reject(new IModelError(BentleyStatus.ERROR, \"Invalid state.\"));\r\n return;\r\n }\r\n\r\n if (this.protocol.protocolVersionHeaderName) {\r\n const version = response.headers.get(this.protocol.protocolVersionHeaderName);\r\n if (version) {\r\n this.responseProtocolVersion = parseInt(version, 10);\r\n }\r\n }\r\n\r\n const contentType = response.headers.get(WEB_RPC_CONSTANTS.CONTENT);\r\n const responseType = WebAppRpcProtocol.computeContentType(contentType);\r\n\r\n if (responseType === RpcContentType.Binary) {\r\n resolve(await this.loadBinary(response));\r\n } else if (responseType === RpcContentType.Multipart) {\r\n resolve(await this.loadMultipart(response, contentType!));\r\n } else {\r\n resolve(await this.loadText(response));\r\n }\r\n\r\n this._loading = false;\r\n this.setLastUpdatedTime();\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoaded, this);\r\n } catch (reason) {\r\n if (!this._loading)\r\n return;\r\n\r\n this._loading = false;\r\n reject(new ServerError(this.metadata.status, typeof (reason) === \"string\" ? reason : \"Unknown server response error.\"));\r\n }\r\n });\r\n }\r\n\r\n /** Override to supply an alternate fetch function. */\r\n protected supplyFetch(): typeof fetch {\r\n return fetch;\r\n }\r\n\r\n /** Override to supply an alternate Request function. */\r\n protected supplyRequest(): typeof Request {\r\n return Request;\r\n }\r\n\r\n private static configureResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, res: HttpServerResponse) {\r\n const success = protocol.getStatus(fulfillment.status) === RpcRequestStatus.Resolved;\r\n // TODO: Use stale-while-revalidate in cache headers. This needs to be tested, and does not currently have support in the router/caching-service.\r\n // This will allow browsers to use stale cached responses while also revalidating with the router, allowing us to start up a backend if necessary.\r\n\r\n // RPC Caching Service uses the s-maxage header to determine the TTL for the redis cache.\r\n const oneHourInSeconds = 3600;\r\n if (success && request.caching === RpcResponseCacheControl.Immutable) {\r\n // If response size is > 50 MB, do not cache it.\r\n if (fulfillment.result.objects.length > (50 * 10**7)) {\r\n res.set(\"Cache-Control\", \"no-store\");\r\n } else if (request.operation.operationName === \"generateTileContent\") {\r\n res.set(\"Cache-Control\", \"no-store\");\r\n } else if (request.operation.operationName === \"getConnectionProps\") {\r\n // GetConnectionprops can't be cached on the browser longer than the lifespan of the backend. The lifespan of backend may shrink too. Keep it at 1 second to be safe.\r\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=1, immutable`);\r\n } else if (request.operation.operationName === \"getTileCacheContainerUrl\") {\r\n // getTileCacheContainerUrl returns a SAS with an expiry of 23:59:59. We can't exceed that time when setting the max-age.\r\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 23}, max-age=${oneHourInSeconds * 23}, immutable`);\r\n } else {\r\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=${oneHourInSeconds * 48}, immutable`);\r\n }\r\n }\r\n\r\n if (fulfillment.retry) {\r\n res.set(\"Retry-After\", fulfillment.retry);\r\n }\r\n }\r\n\r\n private static configureText(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): string {\r\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.TEXT);\r\n return (fulfillment.status === 204) ? \"\" : fulfillment.result.objects;\r\n }\r\n\r\n private static configureBinary(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): Buffer {\r\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.BINARY);\r\n const data = fulfillment.result.data[0];\r\n return Buffer.isBuffer(data) ? data : Buffer.from(data);\r\n }\r\n\r\n private static configureMultipart(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): ReadableFormData {\r\n const response = RpcMultipart.createStream(fulfillment.result);\r\n const headers = response.getHeaders();\r\n for (const header in headers) {\r\n if (headers.hasOwnProperty(header)) {\r\n res.set(header, headers[header]);\r\n }\r\n }\r\n\r\n return response;\r\n }\r\n\r\n private static configureStream(fulfillment: RpcRequestFulfillment) {\r\n return fulfillment.result.stream!;\r\n }\r\n\r\n private static parseFromPath(operation: SerializedRpcOperation): RpcSerializedValue {\r\n const decoded = operation.encodedRequest ? Buffer.from(operation.encodedRequest, \"base64\").toString(\"binary\") : \"\";\r\n return RpcSerializedValue.create(decoded);\r\n }\r\n\r\n private static async parseFromBody(req: HttpServerRequest): Promise<RpcSerializedValue> {\r\n const contentType = WebAppRpcProtocol.computeContentType(req.header(WEB_RPC_CONSTANTS.CONTENT));\r\n if (contentType === RpcContentType.Binary) {\r\n const objects = JSON.stringify([MarshalingBinaryMarker.createDefault()]);\r\n const data = [req.body as Buffer];\r\n return RpcSerializedValue.create(objects, data);\r\n } else if (contentType === RpcContentType.Multipart) {\r\n return RpcMultipart.parseRequest(req);\r\n } else {\r\n return RpcSerializedValue.create(req.body as string);\r\n }\r\n }\r\n\r\n private async performFetch(): Promise<number> {\r\n const requestClass = this.supplyRequest();\r\n const fetchFunction = this.supplyFetch();\r\n\r\n const path = new URL(this.path, typeof (location) !== \"undefined\" ? location.origin : undefined);\r\n if (this._pathSuffix) {\r\n const params = new URLSearchParams();\r\n params.set(\"parameters\", this._pathSuffix);\r\n path.search = `?${params.toString()}`;\r\n }\r\n\r\n const request = new requestClass(path.toString(), this._request);\r\n const response = await fetchFunction(request);\r\n this._response = response;\r\n this.metadata.status = response.status;\r\n return response.status;\r\n }\r\n\r\n private async loadText(response: Response) {\r\n const value = await response.text();\r\n this.metadata.message = value;\r\n return RpcSerializedValue.create(value);\r\n }\r\n\r\n private async loadBinary(response: Response) {\r\n const value = new Uint8Array(await response.arrayBuffer());\r\n const objects = JSON.stringify(MarshalingBinaryMarker.createDefault());\r\n return RpcSerializedValue.create(objects, [value]);\r\n }\r\n\r\n private async loadMultipart(response: Response, contentType: string) {\r\n const data = await response.arrayBuffer();\r\n const value = new RpcMultipartParser(contentType, Buffer.from(data)).parse();\r\n return value;\r\n }\r\n\r\n private async setupTransport(): Promise<void> {\r\n const parameters = (await this.protocol.serialize(this)).parameters;\r\n const transportType = WebAppRpcRequest.computeTransportType(parameters, this.parameters);\r\n\r\n if (transportType === RpcContentType.Binary) {\r\n this.setupBinaryTransport(parameters);\r\n } else if (transportType === RpcContentType.Multipart) {\r\n this.setupMultipartTransport(parameters);\r\n } else {\r\n this.setupTextTransport(parameters);\r\n }\r\n }\r\n\r\n private setupBinaryTransport(parameters: RpcSerializedValue) {\r\n this._headers[WEB_RPC_CONSTANTS.CONTENT] = WEB_RPC_CONSTANTS.BINARY;\r\n this._request.method = \"post\";\r\n this._request.body = parameters.data[0];\r\n }\r\n\r\n private setupMultipartTransport(parameters: RpcSerializedValue) {\r\n // IMPORTANT: do not set a multipart Content-Type header value. The browser does this automatically!\r\n delete this._headers[WEB_RPC_CONSTANTS.CONTENT];\r\n this._request.method = \"post\";\r\n this._request.body = RpcMultipart.createForm(parameters);\r\n }\r\n\r\n private setupTextTransport(parameters: RpcSerializedValue) {\r\n if (this.operation.policy.allowResponseCaching(this)) {\r\n const encodedBody = btoa(parameters.objects); // eslint-disable-line deprecation/deprecation\r\n if (encodedBody.length <= WebAppRpcRequest.maxUrlComponentSize) {\r\n this._request.method = \"get\";\r\n this._request.body = undefined;\r\n delete this._headers[WEB_RPC_CONSTANTS.CONTENT];\r\n this._pathSuffix = encodedBody;\r\n return;\r\n }\r\n }\r\n\r\n this._pathSuffix = \"\";\r\n this._headers[WEB_RPC_CONSTANTS.CONTENT] = WEB_RPC_CONSTANTS.TEXT;\r\n this._request.method = \"post\";\r\n this._request.body = parameters.objects;\r\n }\r\n}\r\n"]}
|
|
@@ -47,6 +47,10 @@ export interface GraphicsRequestProps {
|
|
|
47
47
|
* @see [ClipVector.toCompactString]($core-geometry) to produce the string representation.
|
|
48
48
|
*/
|
|
49
49
|
readonly sectionCut?: string;
|
|
50
|
+
/** If true, vertex positions will be quantized to [[QPoint3d]]s to conserve space at the expense of accuracy. Quantization may produce
|
|
51
|
+
* perceptible inaccuracies when producing graphics for large and/or highly-detailed elements.
|
|
52
|
+
*/
|
|
53
|
+
quantizePositions?: boolean;
|
|
50
54
|
}
|
|
51
55
|
/** Wire format describing a request to produce graphics in "iMdl" format for a single element.
|
|
52
56
|
* @see [[ElementGraphicsRequestProps]] for more details.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementGraphics.d.ts","sourceRoot":"","sources":["../../../src/tile/ElementGraphics.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,yGAAyG;IACzG,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+IAA+I;IAC/I,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,yIAAyI;IACzI,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC1B;;;OA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I,EAAE,IAAI,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;CACpD;AAED;;;;;;GAMG;AACH,oBAAY,2BAA2B,GAAG,8BAA8B,GAAG,6BAA6B,GAAG,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../../src/tile/ElementGraphics.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { TransformProps } from \"@itwin/core-geometry\";\r\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\r\nimport { ElementGeometryDataEntry } from \"../geometry/ElementGeometry\";\r\nimport { GeometryStreamProps } from \"../geometry/GeometryStream\";\r\nimport { ContentFlags, TreeFlags } from \"../tile/TileMetadata\";\r\n\r\n/** Wire format describing properties common to [[PersistentGraphicsRequestProps]] and [[DynamicGraphicsRequestProps]].\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GraphicsRequestProps {\r\n /** Uniquely identifies this request among all [[ElementGraphicsRequestProps]] for a given [[IModel]]. */\r\n readonly id: string;\r\n /** Log10 of the chord tolerance with which to stroke the element's geometry. e.g., for a chord tolerance of 0.01 (10^-2) meters, supply -2. */\r\n readonly toleranceLog10: number;\r\n /** The major version of the \"iMdl\" format to use when producing the iMdl representation of the element's geometry.\r\n * If omitted, the most recent version known to the backend will be used.\r\n * @alpha\r\n */\r\n readonly formatVersion?: number;\r\n /** Optional flags. [[TreeFlags.UseProjectExtents]] has no effect. [[TreeFlags.EnforceDisplayPriority]] is not yet implemented. @alpha */\r\n readonly treeFlags?: TreeFlags;\r\n /** Optional flags. [[ContentFlags.ImprovedElision]] has no effect. @alpha */\r\n readonly contentFlags?: ContentFlags;\r\n /** Transform from element graphics to world coordinates. Defaults to identity. */\r\n readonly location?: TransformProps;\r\n /** If true, surface edges will be omitted from the graphics. */\r\n readonly omitEdges?: boolean;\r\n /** If omitEdges is false, specifies the type of edges to produce. Generally determined by TileAdmin.requestElementGraphics.\r\n * @note This uses the deleted EdgeType enum where 1 indicates non-indexed edges and 2 indicates indexed edges, to avoid breaking the RPC API.\r\n * @internal\r\n */\r\n readonly edgeType?: 1 | 2;\r\n /** If true, and omitEdges is false, a polyface with no edge visibility info will display edges for all faces;\r\n * if false, edges will be inferred from the polyface's topology.\r\n * @internal\r\n */\r\n readonly smoothPolyfaceEdges?: boolean;\r\n /** If true, the element's graphics will be clipped against the iModel's project extents. */\r\n readonly clipToProjectExtents?: boolean;\r\n /** If defined, the compact string representation of a [ClipVector]($core-geometry) to be applied to the geometry to produce section-cut\r\n * geometry at the intersections with the clip planes. Any geometry *not* intersecting the clip planes is omitted from the tiles.\r\n * @see [ClipVector.toCompactString]($core-geometry) to produce the string representation.\r\n */\r\n readonly sectionCut?: string;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single element.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PersistentGraphicsRequestProps extends GraphicsRequestProps {\r\n /** The element whose geometry is to be used to generate the graphics. */\r\n readonly elementId: Id64String;\r\n}\r\n\r\n/** As part of a [[DynamicGraphicsRequestProps]], specifies the geometry from which to generate the graphics in JSON format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface JsonGeometryStream {\r\n /** Discriminator for [[DynamicGraphicsRequestProps.geometry]]. */\r\n format: \"json\";\r\n /** The geometry stream in JSON format. */\r\n data: GeometryStreamProps;\r\n}\r\n\r\n/** As part of a [[DynamicGraphicsRequestProps]], specifies the geometry from which to generate the graphics in binary flatbuffer-encoded format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FlatBufferGeometryStream {\r\n /** Discriminator for [[DynamicGraphicsRequestProps.geometry]]. */\r\n format: \"flatbuffer\";\r\n /** The geometry stream in flatbuffer format. */\r\n data: ElementGeometryDataEntry[];\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single geometry stream.\r\n * @see [[DynamicGraphicsRequest2dProps]] and [[DynamicGraphicsRequest3dProps]].\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequestProps extends GraphicsRequestProps {\r\n /** The geometry from which to generate the graphics. */\r\n readonly geometry: JsonGeometryStream | FlatBufferGeometryStream;\r\n /** The category to which the geometry belongs. This is required to identify a persistent [SpatialCategory]($backend) for 3d geometry or\r\n * [DrawingCategory]($backend) for 2d geometry.\r\n */\r\n readonly categoryId: Id64String;\r\n /** If specified, tools will recognize the generated graphics as being associated with this element. */\r\n readonly elementId?: Id64String;\r\n /** If specified, tools will recognize the generated graphics as being associated with this model.\r\n * It should identify a 3d model for 3d geometry or a 2d model for 2d geometry.\r\n * It needn't identify a persistent model - it can be a transient Id.\r\n */\r\n readonly modelId?: Id64String;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a 2d geometry stream.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequest2dProps extends DynamicGraphicsRequestProps {\r\n /** Specifies the geometry is 2d. */\r\n readonly type: \"2d\";\r\n /** The origin and rotation of the geometry. */\r\n readonly placement: Omit<Placement2dProps, \"bbox\">;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a 3d geometry stream.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequest3dProps extends DynamicGraphicsRequestProps {\r\n /** Specifies the geometry is 3d. */\r\n readonly type: \"3d\";\r\n /** The origin and rotation of the geometry. */\r\n readonly placement: Omit<Placement3dProps, \"bbox\">;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single element or geometry stream.\r\n * @note Every request must have an `id` that is unique amongst all extant requests for a given [[IModel]].\r\n * @see [TileAdmin.requestElementGraphics]($frontend) and [IModelDb.generateElementGraphics]($backend) to fulfill such a request.\r\n * @see [readElementGraphics]($frontend) to convert the result of a request to a [RenderGraphic]($frontend) for display.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ElementGraphicsRequestProps = PersistentGraphicsRequestProps | DynamicGraphicsRequest2dProps | DynamicGraphicsRequest3dProps;\r\n"]}
|
|
1
|
+
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../../src/tile/ElementGraphics.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { TransformProps } from \"@itwin/core-geometry\";\r\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\r\nimport { ElementGeometryDataEntry } from \"../geometry/ElementGeometry\";\r\nimport { GeometryStreamProps } from \"../geometry/GeometryStream\";\r\nimport { ContentFlags, TreeFlags } from \"../tile/TileMetadata\";\r\n\r\n/** Wire format describing properties common to [[PersistentGraphicsRequestProps]] and [[DynamicGraphicsRequestProps]].\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GraphicsRequestProps {\r\n /** Uniquely identifies this request among all [[ElementGraphicsRequestProps]] for a given [[IModel]]. */\r\n readonly id: string;\r\n /** Log10 of the chord tolerance with which to stroke the element's geometry. e.g., for a chord tolerance of 0.01 (10^-2) meters, supply -2. */\r\n readonly toleranceLog10: number;\r\n /** The major version of the \"iMdl\" format to use when producing the iMdl representation of the element's geometry.\r\n * If omitted, the most recent version known to the backend will be used.\r\n * @alpha\r\n */\r\n readonly formatVersion?: number;\r\n /** Optional flags. [[TreeFlags.UseProjectExtents]] has no effect. [[TreeFlags.EnforceDisplayPriority]] is not yet implemented. @alpha */\r\n readonly treeFlags?: TreeFlags;\r\n /** Optional flags. [[ContentFlags.ImprovedElision]] has no effect. @alpha */\r\n readonly contentFlags?: ContentFlags;\r\n /** Transform from element graphics to world coordinates. Defaults to identity. */\r\n readonly location?: TransformProps;\r\n /** If true, surface edges will be omitted from the graphics. */\r\n readonly omitEdges?: boolean;\r\n /** If omitEdges is false, specifies the type of edges to produce. Generally determined by TileAdmin.requestElementGraphics.\r\n * @note This uses the deleted EdgeType enum where 1 indicates non-indexed edges and 2 indicates indexed edges, to avoid breaking the RPC API.\r\n * @internal\r\n */\r\n readonly edgeType?: 1 | 2;\r\n /** If true, and omitEdges is false, a polyface with no edge visibility info will display edges for all faces;\r\n * if false, edges will be inferred from the polyface's topology.\r\n * @internal\r\n */\r\n readonly smoothPolyfaceEdges?: boolean;\r\n /** If true, the element's graphics will be clipped against the iModel's project extents. */\r\n readonly clipToProjectExtents?: boolean;\r\n /** If defined, the compact string representation of a [ClipVector]($core-geometry) to be applied to the geometry to produce section-cut\r\n * geometry at the intersections with the clip planes. Any geometry *not* intersecting the clip planes is omitted from the tiles.\r\n * @see [ClipVector.toCompactString]($core-geometry) to produce the string representation.\r\n */\r\n readonly sectionCut?: string;\r\n /** If true, vertex positions will be quantized to [[QPoint3d]]s to conserve space at the expense of accuracy. Quantization may produce\r\n * perceptible inaccuracies when producing graphics for large and/or highly-detailed elements.\r\n */\r\n quantizePositions?: boolean;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single element.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PersistentGraphicsRequestProps extends GraphicsRequestProps {\r\n /** The element whose geometry is to be used to generate the graphics. */\r\n readonly elementId: Id64String;\r\n}\r\n\r\n/** As part of a [[DynamicGraphicsRequestProps]], specifies the geometry from which to generate the graphics in JSON format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface JsonGeometryStream {\r\n /** Discriminator for [[DynamicGraphicsRequestProps.geometry]]. */\r\n format: \"json\";\r\n /** The geometry stream in JSON format. */\r\n data: GeometryStreamProps;\r\n}\r\n\r\n/** As part of a [[DynamicGraphicsRequestProps]], specifies the geometry from which to generate the graphics in binary flatbuffer-encoded format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FlatBufferGeometryStream {\r\n /** Discriminator for [[DynamicGraphicsRequestProps.geometry]]. */\r\n format: \"flatbuffer\";\r\n /** The geometry stream in flatbuffer format. */\r\n data: ElementGeometryDataEntry[];\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single geometry stream.\r\n * @see [[DynamicGraphicsRequest2dProps]] and [[DynamicGraphicsRequest3dProps]].\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequestProps extends GraphicsRequestProps {\r\n /** The geometry from which to generate the graphics. */\r\n readonly geometry: JsonGeometryStream | FlatBufferGeometryStream;\r\n /** The category to which the geometry belongs. This is required to identify a persistent [SpatialCategory]($backend) for 3d geometry or\r\n * [DrawingCategory]($backend) for 2d geometry.\r\n */\r\n readonly categoryId: Id64String;\r\n /** If specified, tools will recognize the generated graphics as being associated with this element. */\r\n readonly elementId?: Id64String;\r\n /** If specified, tools will recognize the generated graphics as being associated with this model.\r\n * It should identify a 3d model for 3d geometry or a 2d model for 2d geometry.\r\n * It needn't identify a persistent model - it can be a transient Id.\r\n */\r\n readonly modelId?: Id64String;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a 2d geometry stream.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequest2dProps extends DynamicGraphicsRequestProps {\r\n /** Specifies the geometry is 2d. */\r\n readonly type: \"2d\";\r\n /** The origin and rotation of the geometry. */\r\n readonly placement: Omit<Placement2dProps, \"bbox\">;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a 3d geometry stream.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequest3dProps extends DynamicGraphicsRequestProps {\r\n /** Specifies the geometry is 3d. */\r\n readonly type: \"3d\";\r\n /** The origin and rotation of the geometry. */\r\n readonly placement: Omit<Placement3dProps, \"bbox\">;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single element or geometry stream.\r\n * @note Every request must have an `id` that is unique amongst all extant requests for a given [[IModel]].\r\n * @see [TileAdmin.requestElementGraphics]($frontend) and [IModelDb.generateElementGraphics]($backend) to fulfill such a request.\r\n * @see [readElementGraphics]($frontend) to convert the result of a request to a [RenderGraphic]($frontend) for display.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ElementGraphicsRequestProps = PersistentGraphicsRequestProps | DynamicGraphicsRequest2dProps | DynamicGraphicsRequest3dProps;\r\n"]}
|
|
@@ -25,13 +25,13 @@ export declare enum CurrentImdlVersion {
|
|
|
25
25
|
* front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a
|
|
26
26
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
27
27
|
*/
|
|
28
|
-
Major =
|
|
28
|
+
Major = 29,
|
|
29
29
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
30
30
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
31
31
|
*/
|
|
32
32
|
Minor = 0,
|
|
33
33
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
34
|
-
Combined =
|
|
34
|
+
Combined = 1900544
|
|
35
35
|
}
|
|
36
36
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
37
37
|
* @internal
|
|
@@ -34,13 +34,13 @@ var CurrentImdlVersion;
|
|
|
34
34
|
* front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a
|
|
35
35
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
36
36
|
*/
|
|
37
|
-
CurrentImdlVersion[CurrentImdlVersion["Major"] =
|
|
37
|
+
CurrentImdlVersion[CurrentImdlVersion["Major"] = 29] = "Major";
|
|
38
38
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
39
39
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
40
40
|
*/
|
|
41
41
|
CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
|
|
42
42
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
43
|
-
CurrentImdlVersion[CurrentImdlVersion["Combined"] =
|
|
43
|
+
CurrentImdlVersion[CurrentImdlVersion["Combined"] = 1900544] = "Combined";
|
|
44
44
|
})(CurrentImdlVersion = exports.CurrentImdlVersion || (exports.CurrentImdlVersion = {}));
|
|
45
45
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
46
46
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTileIO.js","sourceRoot":"","sources":["../../../src/tile/IModelTileIO.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACzD,wDAA+C;AAE/C,qCAA+E;AAE/E;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uBAAuB;IACvB,yCAAQ,CAAA;IACR,6CAA6C;IAC7C,6DAAuB,CAAA;IACvB,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/D,IAAA,qBAAM,EAAC,oBAAoB,IAAI,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAErC,IAAI,MAAM,CAAC,YAAY;YACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAjCD,IAAW,YAAY,KAAa,OAAO,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;IACnE,IAAW,YAAY,KAAa,OAAO,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3E,IAAW,OAAO,KAAc,OAAO,mBAAU,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3E,IAAW,iBAAiB,KAAc,OAAO,IAAI,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;CA8BlG;AApDD,gCAoDC;AAED;;GAEG;AACH,MAAa,kBAAkB;IAU7B,YAAoC,MAAc,EAChC,WAAmB,EACnB,KAAa;QAFK,WAAM,GAAN,MAAM,CAAQ;QAChC,gBAAW,GAAX,WAAW,CAAQ;QACnB,UAAK,GAAL,KAAK,CAAQ;IAAI,CAAC;IAX7B,MAAM,CAAC,QAAQ,CAAC,MAAkB;QACvC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;QACjC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QACtC,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;QAChC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;;AANH,gDAaC;AALe,8BAAW,GAAG,EAAE,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 Tile\r\n */\r\n\r\nimport { assert, ByteStream } from \"@itwin/core-bentley\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { ElementAlignedBox3d } from \"../geometry/Placement\";\r\nimport { nextPoint3d64FromByteStream, TileFormat, TileHeader } from \"./TileIO\";\r\n\r\n/** Flags describing the geometry contained within a tile in iMdl format.\r\n * @internal\r\n */\r\nexport enum ImdlFlags {\r\n /** No special flags */\r\n None = 0,\r\n /** The tile contains some curved geometry */\r\n ContainsCurves = 1 << 0,\r\n /** Some geometry within the tile range was omitted based on its size */\r\n Incomplete = 1 << 2,\r\n /** The tile must be refined by sub-division, not magnification. */\r\n DisallowMagnification = 1 << 3,\r\n}\r\n\r\n/** Describes the maximum major and minor version of the iMdl tile format supported by this version of this package.\r\n * @internal\r\n */\r\nexport enum CurrentImdlVersion {\r\n /** The unsigned 16-bit major version number. If the major version specified in the tile header is greater than this value, then this\r\n * front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a\r\n * greater minor version than CurrentVersion.Minor, although some data may be skipped.\r\n */\r\n Major =
|
|
1
|
+
{"version":3,"file":"IModelTileIO.js","sourceRoot":"","sources":["../../../src/tile/IModelTileIO.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACzD,wDAA+C;AAE/C,qCAA+E;AAE/E;;GAEG;AACH,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uBAAuB;IACvB,yCAAQ,CAAA;IACR,6CAA6C;IAC7C,6DAAuB,CAAA;IACvB,wEAAwE;IACxE,qDAAmB,CAAA;IACnB,mEAAmE;IACnE,2EAA8B,CAAA;AAChC,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB;AAED;;GAEG;AACH,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B;;;OAGG;IACH,8DAAU,CAAA;IACV;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,OAAO,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;IACnE,IAAW,YAAY,KAAa,OAAO,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3E,IAAW,OAAO,KAAc,OAAO,mBAAU,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3E,IAAW,iBAAiB,KAAc,OAAO,IAAI,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;CA8BlG;AApDD,gCAoDC;AAED;;GAEG;AACH,MAAa,kBAAkB;IAU7B,YAAoC,MAAc,EAChC,WAAmB,EACnB,KAAa;QAFK,WAAM,GAAN,MAAM,CAAQ;QAChC,gBAAW,GAAX,WAAW,CAAQ;QACnB,UAAK,GAAL,KAAK,CAAQ;IAAI,CAAC;IAX7B,MAAM,CAAC,QAAQ,CAAC,MAAkB;QACvC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;QACjC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QACtC,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;QAChC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;;AANH,gDAaC;AALe,8BAAW,GAAG,EAAE,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 Tile\r\n */\r\n\r\nimport { assert, ByteStream } from \"@itwin/core-bentley\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { ElementAlignedBox3d } from \"../geometry/Placement\";\r\nimport { nextPoint3d64FromByteStream, TileFormat, TileHeader } from \"./TileIO\";\r\n\r\n/** Flags describing the geometry contained within a tile in iMdl format.\r\n * @internal\r\n */\r\nexport enum ImdlFlags {\r\n /** No special flags */\r\n None = 0,\r\n /** The tile contains some curved geometry */\r\n ContainsCurves = 1 << 0,\r\n /** Some geometry within the tile range was omitted based on its size */\r\n Incomplete = 1 << 2,\r\n /** The tile must be refined by sub-division, not magnification. */\r\n DisallowMagnification = 1 << 3,\r\n}\r\n\r\n/** Describes the maximum major and minor version of the iMdl tile format supported by this version of this package.\r\n * @internal\r\n */\r\nexport enum CurrentImdlVersion {\r\n /** The unsigned 16-bit major version number. If the major version specified in the tile header is greater than this value, then this\r\n * front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a\r\n * greater minor version than CurrentVersion.Minor, although some data may be skipped.\r\n */\r\n Major = 29,\r\n /** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can\r\n * read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.\r\n */\r\n Minor = 0,\r\n /** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */\r\n Combined = (Major << 0x10) | Minor,\r\n}\r\n\r\n/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.\r\n * @internal\r\n */\r\nexport class ImdlHeader extends TileHeader {\r\n /** The size of this header in bytes. */\r\n public readonly headerLength: number;\r\n /** Flags describing the geometry contained within the tile */\r\n public readonly flags: ImdlFlags;\r\n /** A bounding box no larger than the tile's range, tightly enclosing the tile's geometry; or a null range if the tile is empty */\r\n public readonly contentRange: ElementAlignedBox3d;\r\n /** The chord tolerance in meters at which the tile's geometry was faceted */\r\n public readonly tolerance: number;\r\n /** The number of elements which contributed at least some geometry to the tile content */\r\n public readonly numElementsIncluded: number;\r\n /** The number of elements within the tile range which contributed no geometry to the tile content */\r\n public readonly numElementsExcluded: number;\r\n /** The total number of bytes in the binary tile data, including this header */\r\n public readonly tileLength: number;\r\n /** A bitfield wherein each set bit indicates an empty sub-volume. */\r\n public readonly emptySubRanges: number;\r\n\r\n public get versionMajor(): number { return this.version >>> 0x10; }\r\n public get versionMinor(): number { return (this.version & 0xffff) >>> 0; }\r\n\r\n public get isValid(): boolean { return TileFormat.IModel === this.format; }\r\n public get isReadableVersion(): boolean { return this.versionMajor <= CurrentImdlVersion.Major; }\r\n\r\n /** Deserialize a header from the binary data at the stream's current position.\r\n * If the binary data does not contain a valid header, the Header will be marked 'invalid'.\r\n */\r\n public constructor(stream: ByteStream) {\r\n super(stream);\r\n this.headerLength = stream.nextUint32;\r\n this.flags = stream.nextUint32;\r\n\r\n this.contentRange = new Range3d();\r\n nextPoint3d64FromByteStream(stream, this.contentRange.low);\r\n nextPoint3d64FromByteStream(stream, this.contentRange.high);\r\n\r\n this.tolerance = stream.nextFloat64;\r\n this.numElementsIncluded = stream.nextUint32;\r\n this.numElementsExcluded = stream.nextUint32;\r\n this.tileLength = stream.nextUint32;\r\n\r\n // empty sub-volume bit field introduced in format v02.00\r\n this.emptySubRanges = this.versionMajor >= 2 ? stream.nextUint32 : 0;\r\n\r\n // Skip any unprocessed bytes in header\r\n const remainingHeaderBytes = this.headerLength - stream.curPos;\r\n assert(remainingHeaderBytes >= 0);\r\n stream.advance(remainingHeaderBytes);\r\n\r\n if (stream.isPastTheEnd)\r\n this.invalidate();\r\n }\r\n}\r\n\r\n/** Header preceding the feature table embedded in an iMdl tile's content.\r\n * @internal\r\n */\r\nexport class FeatureTableHeader {\r\n public static readFrom(stream: ByteStream) {\r\n const length = stream.nextUint32;\r\n const maxFeatures = stream.nextUint32;\r\n const count = stream.nextUint32;\r\n return stream.isPastTheEnd ? undefined : new FeatureTableHeader(length, maxFeatures, count);\r\n }\r\n\r\n public static sizeInBytes = 12;\r\n\r\n private constructor(public readonly length: number,\r\n public readonly maxFeatures: number,\r\n public readonly count: number) { }\r\n}\r\n"]}
|
|
@@ -10,9 +10,9 @@ import { Gradient } from "./Gradient";
|
|
|
10
10
|
* @extensions
|
|
11
11
|
*/
|
|
12
12
|
export interface AnalysisStyleDisplacementProps {
|
|
13
|
-
/**
|
|
13
|
+
/** See [[AnalysisStyleDisplacement.channelName]]. */
|
|
14
14
|
channelName: string;
|
|
15
|
-
/**
|
|
15
|
+
/** See [[AnalysisStyleDisplacement.scale]].
|
|
16
16
|
* Default value: 1.
|
|
17
17
|
*/
|
|
18
18
|
scale?: number;
|
|
@@ -43,11 +43,11 @@ export declare class AnalysisStyleDisplacement {
|
|
|
43
43
|
* @extensions
|
|
44
44
|
*/
|
|
45
45
|
export interface AnalysisStyleThematicProps {
|
|
46
|
-
/**
|
|
46
|
+
/** See [[AnalysisStyleThematic.channelName]]. */
|
|
47
47
|
channelName: string;
|
|
48
|
-
/**
|
|
48
|
+
/** See [[AnalysisStyleThematic.range]]. */
|
|
49
49
|
range: Range1dProps;
|
|
50
|
-
/**
|
|
50
|
+
/** See [[AnalysisStyleThematic.thematicSettings]].
|
|
51
51
|
* Default value: [[ThematicGradientSettings.defaults]].
|
|
52
52
|
*/
|
|
53
53
|
thematicSettings?: ThematicGradientSettingsProps;
|
|
@@ -84,13 +84,13 @@ export declare class AnalysisStyleThematic {
|
|
|
84
84
|
* @extensions
|
|
85
85
|
*/
|
|
86
86
|
export interface AnalysisStyleProps {
|
|
87
|
-
/**
|
|
87
|
+
/** See [[AnalysisStyle.displacement]]. */
|
|
88
88
|
displacement?: AnalysisStyleDisplacementProps;
|
|
89
89
|
/** JSON representation of [[AnalysisStyle.thematic]].
|
|
90
90
|
* @note The name "scalar" is used instead of "thematic" for backwards compatibility.
|
|
91
91
|
*/
|
|
92
92
|
scalar?: AnalysisStyleThematicProps;
|
|
93
|
-
/**
|
|
93
|
+
/** See [[AnalysisStyle.normalChannelName]]. */
|
|
94
94
|
normalChannelName?: string;
|
|
95
95
|
}
|
|
96
96
|
/** At time of writing, the only iModel in existence that uses AnalysisStyle is the one created by the analysis-importer test app.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalysisStyle.d.ts","sourceRoot":"","sources":["../../src/AnalysisStyle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C,
|
|
1
|
+
{"version":3,"file":"AnalysisStyle.d.ts","sourceRoot":"","sources":["../../src/AnalysisStyle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,qBAAa,yBAAyB;IACpC,8GAA8G;IAC9G,SAAgB,WAAW,EAAE,MAAM,CAAC;IACpC;;OAEG;IACH,SAAgB,KAAK,EAAE,MAAM,CAAC;IAE9B,gBAAgB;IAChB,OAAO;IAKP,uCAAuC;WACzB,QAAQ,CAAC,KAAK,EAAE,8BAA8B,GAAG,yBAAyB;IAIxF,sCAAsC;IAC/B,MAAM,IAAI,8BAA8B;IAQ/C,sDAAsD;IAC/C,MAAM,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO;CAGzD;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,KAAK,EAAE,YAAY,CAAC;IACpB;;OAEG;IACH,g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,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,YAAY,CAAC;YAC1E,OAAO,KAAK,CAAC;aACV,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,YAAa,CAAC;YAC1E,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,QAAQ,CAAC;YAClE,OAAO,KAAK,CAAC;QAEf,OAAO,SAAS,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC;IAC9E,CAAC;;AAEsB,sBAAQ,GAAG,IAAI,aAAa,CAAC,EAAE,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 DisplayStyles\r\n */\r\n\r\nimport { Range1d, Range1dProps } from \"@itwin/core-geometry\";\r\nimport { ThematicGradientSettings, ThematicGradientSettingsProps } from \"./ThematicDisplay\";\r\nimport { Gradient } from \"./Gradient\";\r\n\r\n/** JSON representation of an [[AnalysisStyleDisplacement]].\r\n * @see [[AnalysisStyleProps.displacement]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AnalysisStyleDisplacementProps {\r\n /** @see [[AnalysisStyleDisplacement.channelName]]. */\r\n channelName: string;\r\n /** @see [[AnalysisStyleDisplacement.scale]].\r\n * Default value: 1.\r\n */\r\n scale?: number;\r\n}\r\n\r\n/** Describes how an [[AnalysisStyle]] deforms a [Polyface]($core-geometry) by applying translation to its vertices.\r\n * @see [[AnalysisStyle.displacement]].\r\n * @public\r\n */\r\nexport class AnalysisStyleDisplacement {\r\n /** The name of the [AuxChannel]($core-geometry) supplying the displacements to be applied to the vertices. */\r\n public readonly channelName: string;\r\n /** A scale applied to the displacements to adjust the magnitude of the effect.\r\n * Default value: 1.\r\n */\r\n public readonly scale: number;\r\n\r\n /** @internal */\r\n private constructor(channelName: string, scale = 1) {\r\n this.channelName = channelName;\r\n this.scale = scale;\r\n }\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props: AnalysisStyleDisplacementProps): AnalysisStyleDisplacement {\r\n return new this(props.channelName, props.scale);\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): AnalysisStyleDisplacementProps {\r\n const props: AnalysisStyleDisplacementProps = { channelName: this.channelName };\r\n if (this.scale !== 1)\r\n props.scale = this.scale;\r\n\r\n return props;\r\n }\r\n\r\n /** Return true if `this` is equivalent to `other`. */\r\n public equals(other: AnalysisStyleDisplacement): boolean {\r\n return this.channelName === other.channelName && this.scale === other.scale;\r\n }\r\n}\r\n\r\n/** JSON representation of an [[AnalysisStyleThematic]].\r\n * @see [[AnalysisStyleProps.scalar]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AnalysisStyleThematicProps {\r\n /** @see [[AnalysisStyleThematic.channelName]]. */\r\n channelName: string;\r\n /** @see [[AnalysisStyleThematic.range]]. */\r\n range: Range1dProps;\r\n /** @see [[AnalysisStyleThematic.thematicSettings]].\r\n * Default value: [[ThematicGradientSettings.defaults]].\r\n */\r\n thematicSettings?: ThematicGradientSettingsProps;\r\n}\r\n\r\n/** Describes how an [[AnalysisStyle]] recolors [Polyface]($core-geometry) vertices by mapping values of type\r\n * [AuxChannelDataType.Scalar]($core-geometry) or [AuxChannelDataType.Distance]($core-geometry) supplied\r\n * by an [AuxChannel]($core-geometry) to colors supplied by a [[Gradient]] image.\r\n * @see [[AnalysisStyle.thematic]].\r\n * @public\r\n */\r\nexport class AnalysisStyleThematic {\r\n /** The name of the [AuxChannel]($core-geometry) supplying the values from which the vertex colors are computed. */\r\n public readonly channelName: string;\r\n /** The minimum and maximum values that map to colors in the [[Gradient]] image. Vertices with values outside of\r\n * this range are displayed with the gradient's margin color.\r\n */\r\n public readonly range: Readonly<Range1d>;\r\n /** Settings used to produce the [[Gradient]] image. */\r\n public readonly thematicSettings: ThematicGradientSettings;\r\n private _gradient?: Gradient.Symb;\r\n\r\n /** @internal */\r\n private constructor(props: AnalysisStyleThematicProps) {\r\n this.channelName = props.channelName;\r\n this.range = Range1d.fromJSON(props.range);\r\n this.thematicSettings = ThematicGradientSettings.fromJSON(props.thematicSettings);\r\n }\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props: AnalysisStyleThematicProps): AnalysisStyleThematic {\r\n return new this(props);\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): AnalysisStyleThematicProps {\r\n const props: AnalysisStyleThematicProps = {\r\n channelName: this.channelName,\r\n range: this.range.toJSON(),\r\n };\r\n\r\n if (!this.thematicSettings.equals(ThematicGradientSettings.defaults))\r\n props.thematicSettings = this.thematicSettings.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** The gradient computed from [[thematicSettings]]. */\r\n public get gradient(): Gradient.Symb {\r\n if (!this._gradient)\r\n this._gradient = Gradient.Symb.createThematic(this.thematicSettings);\r\n\r\n return this._gradient;\r\n }\r\n\r\n /** Return true if `this` is equivalent to `other`. */\r\n public equals(other: AnalysisStyleThematic): boolean {\r\n return this.channelName === other.channelName && this.range.isAlmostEqual(other.range) && this.thematicSettings.equals(other.thematicSettings);\r\n }\r\n}\r\n\r\n/** JSON representation of an [[AnalysisStyle]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AnalysisStyleProps {\r\n /** @see [[AnalysisStyle.displacement]]. */\r\n displacement?: AnalysisStyleDisplacementProps;\r\n /** JSON representation of [[AnalysisStyle.thematic]].\r\n * @note The name \"scalar\" is used instead of \"thematic\" for backwards compatibility.\r\n */\r\n scalar?: AnalysisStyleThematicProps;\r\n /** @see [[AnalysisStyle.normalChannelName]]. */\r\n normalChannelName?: string;\r\n}\r\n\r\n/** At time of writing, the only iModel in existence that uses AnalysisStyle is the one created by the analysis-importer test app.\r\n * To avoid breaking existing saved views of that iModel, AnalysisStyle.fromJSON() continues to accept the old JSON representation -\r\n * but that representation is not part of the public API.\r\n * @internal exported strictly for tests.\r\n */\r\nexport interface LegacyAnalysisStyleProps {\r\n displacementChannelName?: string;\r\n scalarChannelName?: string;\r\n normalChannelName?: string;\r\n displacementScale?: number;\r\n scalarRange?: Range1dProps;\r\n scalarThematicSettings?: ThematicGradientSettingsProps;\r\n}\r\n\r\nfunction tryConvertLegacyProps(input: AnalysisStyleProps): AnalysisStyleProps {\r\n if (input.displacement || input.scalar)\r\n return input;\r\n\r\n const legacy = input as LegacyAnalysisStyleProps;\r\n if (undefined === legacy.displacementChannelName && undefined === legacy.scalarChannelName)\r\n return input;\r\n\r\n const output: AnalysisStyleProps = {\r\n normalChannelName: input.normalChannelName,\r\n };\r\n\r\n if (undefined !== legacy.displacementChannelName) {\r\n output.displacement = {\r\n channelName: legacy.displacementChannelName,\r\n scale: legacy.displacementScale,\r\n };\r\n }\r\n\r\n if (undefined !== legacy.scalarChannelName && undefined !== legacy.scalarRange) {\r\n output.scalar = {\r\n channelName: legacy.scalarChannelName,\r\n range: legacy.scalarRange,\r\n thematicSettings: legacy.scalarThematicSettings,\r\n };\r\n }\r\n\r\n return output;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], describes how to animate meshes in the view that have been augmented with\r\n * [PolyfaceAuxData]($core-geometry). The style specifies which channels to use, and can deform the meshes by\r\n * translating vertices and/or recolor vertices using [[ThematicDisplay]].\r\n * @see [[DisplayStyleSettings.analysisStyle]] to define the analysis style for a [DisplayStyle]($backend).\r\n * @see [[DisplayStyleSettings.analysisFraction]] to control playback of the animation.\r\n * @public\r\n */\r\nexport class AnalysisStyle {\r\n public readonly displacement?: AnalysisStyleDisplacement;\r\n public readonly thematic?: AnalysisStyleThematic;\r\n /** If defined, the name of the [AuxChannel]($core-geometry) from which to obtain normal vectors for the vertices. */\r\n public readonly normalChannelName?: string;\r\n\r\n /** Create an analysis style from its JSON representation.\r\n * @note AnalysisStyle is an immutable type - use [[clone]] to produce a modified copy.\r\n */\r\n public static fromJSON(props?: AnalysisStyleProps): AnalysisStyle {\r\n if (!props)\r\n return this.defaults;\r\n\r\n props = tryConvertLegacyProps(props);\r\n if (!props.displacement && !props.scalar && undefined === props.normalChannelName)\r\n return this.defaults;\r\n\r\n return new AnalysisStyle(props);\r\n }\r\n\r\n /** @internal */\r\n private constructor(props: AnalysisStyleProps) {\r\n this.normalChannelName = props.normalChannelName;\r\n if (props.displacement)\r\n this.displacement = AnalysisStyleDisplacement.fromJSON(props.displacement);\r\n\r\n if (props.scalar)\r\n this.thematic = AnalysisStyleThematic.fromJSON(props.scalar);\r\n }\r\n\r\n /** Convert this style to its JSON representation. */\r\n public toJSON(): AnalysisStyleProps {\r\n const props: AnalysisStyleProps = {};\r\n if (this === AnalysisStyle.defaults)\r\n return props;\r\n\r\n if (this.displacement)\r\n props.displacement = this.displacement.toJSON();\r\n\r\n if (this.thematic)\r\n props.scalar = this.thematic.toJSON();\r\n\r\n if (undefined !== this.normalChannelName)\r\n props.normalChannelName = this.normalChannelName;\r\n\r\n return props;\r\n }\r\n\r\n /** Produce a copy of this style identical except for properties explicitly specified by `changedProps`. */\r\n public clone(changedProps: AnalysisStyleProps): AnalysisStyle {\r\n return AnalysisStyle.fromJSON({\r\n ...this.toJSON(),\r\n ...changedProps,\r\n });\r\n }\r\n\r\n /** Return true if this style is equivalent to `other`. */\r\n public equals(other: AnalysisStyle): boolean {\r\n if (this.normalChannelName !== other.normalChannelName)\r\n return false;\r\n\r\n if ((undefined === this.displacement) !== (undefined === other.displacement))\r\n return false;\r\n else if (this.displacement && !this.displacement.equals(other.displacement!))\r\n return false;\r\n\r\n if ((undefined === this.thematic) !== (undefined === other.thematic))\r\n return false;\r\n\r\n return undefined === this.thematic || this.thematic.equals(other.thematic!);\r\n }\r\n\r\n public static readonly defaults = new AnalysisStyle({});\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"AnalysisStyle.js","sourceRoot":"","sources":["../../src/AnalysisStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAgB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAiC,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgBtC;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IAQpC,gBAAgB;IAChB,YAAoB,WAAmB,EAAE,KAAK,GAAG,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAqC;QAC1D,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,sCAAsC;IAC/B,MAAM;QACX,MAAM,KAAK,GAAmC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;QAChF,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;YAClB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,sDAAsD;IAC/C,MAAM,CAAC,KAAgC;QAC5C,OAAO,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;IAC9E,CAAC;CACF;AAkBD;;;;;GAKG;AACH,MAAM,OAAO,qBAAqB;IAWhC,gBAAgB;IAChB,YAAoB,KAAiC;QACnD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC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AI,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,QAAQ,CAAC;YAClE,OAAO,KAAK,CAAC;QAEf,OAAO,SAAS,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC;IAC9E,CAAC;;AAEsB,sBAAQ,GAAG,IAAI,aAAa,CAAC,EAAE,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 DisplayStyles\r\n */\r\n\r\nimport { Range1d, Range1dProps } from \"@itwin/core-geometry\";\r\nimport { ThematicGradientSettings, ThematicGradientSettingsProps } from \"./ThematicDisplay\";\r\nimport { Gradient } from \"./Gradient\";\r\n\r\n/** JSON representation of an [[AnalysisStyleDisplacement]].\r\n * @see [[AnalysisStyleProps.displacement]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AnalysisStyleDisplacementProps {\r\n /** See [[AnalysisStyleDisplacement.channelName]]. */\r\n channelName: string;\r\n /** See [[AnalysisStyleDisplacement.scale]].\r\n * Default value: 1.\r\n */\r\n scale?: number;\r\n}\r\n\r\n/** Describes how an [[AnalysisStyle]] deforms a [Polyface]($core-geometry) by applying translation to its vertices.\r\n * @see [[AnalysisStyle.displacement]].\r\n * @public\r\n */\r\nexport class AnalysisStyleDisplacement {\r\n /** The name of the [AuxChannel]($core-geometry) supplying the displacements to be applied to the vertices. */\r\n public readonly channelName: string;\r\n /** A scale applied to the displacements to adjust the magnitude of the effect.\r\n * Default value: 1.\r\n */\r\n public readonly scale: number;\r\n\r\n /** @internal */\r\n private constructor(channelName: string, scale = 1) {\r\n this.channelName = channelName;\r\n this.scale = scale;\r\n }\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props: AnalysisStyleDisplacementProps): AnalysisStyleDisplacement {\r\n return new this(props.channelName, props.scale);\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): AnalysisStyleDisplacementProps {\r\n const props: AnalysisStyleDisplacementProps = { channelName: this.channelName };\r\n if (this.scale !== 1)\r\n props.scale = this.scale;\r\n\r\n return props;\r\n }\r\n\r\n /** Return true if `this` is equivalent to `other`. */\r\n public equals(other: AnalysisStyleDisplacement): boolean {\r\n return this.channelName === other.channelName && this.scale === other.scale;\r\n }\r\n}\r\n\r\n/** JSON representation of an [[AnalysisStyleThematic]].\r\n * @see [[AnalysisStyleProps.scalar]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AnalysisStyleThematicProps {\r\n /** See [[AnalysisStyleThematic.channelName]]. */\r\n channelName: string;\r\n /** See [[AnalysisStyleThematic.range]]. */\r\n range: Range1dProps;\r\n /** See [[AnalysisStyleThematic.thematicSettings]].\r\n * Default value: [[ThematicGradientSettings.defaults]].\r\n */\r\n thematicSettings?: ThematicGradientSettingsProps;\r\n}\r\n\r\n/** Describes how an [[AnalysisStyle]] recolors [Polyface]($core-geometry) vertices by mapping values of type\r\n * [AuxChannelDataType.Scalar]($core-geometry) or [AuxChannelDataType.Distance]($core-geometry) supplied\r\n * by an [AuxChannel]($core-geometry) to colors supplied by a [[Gradient]] image.\r\n * @see [[AnalysisStyle.thematic]].\r\n * @public\r\n */\r\nexport class AnalysisStyleThematic {\r\n /** The name of the [AuxChannel]($core-geometry) supplying the values from which the vertex colors are computed. */\r\n public readonly channelName: string;\r\n /** The minimum and maximum values that map to colors in the [[Gradient]] image. Vertices with values outside of\r\n * this range are displayed with the gradient's margin color.\r\n */\r\n public readonly range: Readonly<Range1d>;\r\n /** Settings used to produce the [[Gradient]] image. */\r\n public readonly thematicSettings: ThematicGradientSettings;\r\n private _gradient?: Gradient.Symb;\r\n\r\n /** @internal */\r\n private constructor(props: AnalysisStyleThematicProps) {\r\n this.channelName = props.channelName;\r\n this.range = Range1d.fromJSON(props.range);\r\n this.thematicSettings = ThematicGradientSettings.fromJSON(props.thematicSettings);\r\n }\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props: AnalysisStyleThematicProps): AnalysisStyleThematic {\r\n return new this(props);\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): AnalysisStyleThematicProps {\r\n const props: AnalysisStyleThematicProps = {\r\n channelName: this.channelName,\r\n range: this.range.toJSON(),\r\n };\r\n\r\n if (!this.thematicSettings.equals(ThematicGradientSettings.defaults))\r\n props.thematicSettings = this.thematicSettings.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** The gradient computed from [[thematicSettings]]. */\r\n public get gradient(): Gradient.Symb {\r\n if (!this._gradient)\r\n this._gradient = Gradient.Symb.createThematic(this.thematicSettings);\r\n\r\n return this._gradient;\r\n }\r\n\r\n /** Return true if `this` is equivalent to `other`. */\r\n public equals(other: AnalysisStyleThematic): boolean {\r\n return this.channelName === other.channelName && this.range.isAlmostEqual(other.range) && this.thematicSettings.equals(other.thematicSettings);\r\n }\r\n}\r\n\r\n/** JSON representation of an [[AnalysisStyle]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AnalysisStyleProps {\r\n /** See [[AnalysisStyle.displacement]]. */\r\n displacement?: AnalysisStyleDisplacementProps;\r\n /** JSON representation of [[AnalysisStyle.thematic]].\r\n * @note The name \"scalar\" is used instead of \"thematic\" for backwards compatibility.\r\n */\r\n scalar?: AnalysisStyleThematicProps;\r\n /** See [[AnalysisStyle.normalChannelName]]. */\r\n normalChannelName?: string;\r\n}\r\n\r\n/** At time of writing, the only iModel in existence that uses AnalysisStyle is the one created by the analysis-importer test app.\r\n * To avoid breaking existing saved views of that iModel, AnalysisStyle.fromJSON() continues to accept the old JSON representation -\r\n * but that representation is not part of the public API.\r\n * @internal exported strictly for tests.\r\n */\r\nexport interface LegacyAnalysisStyleProps {\r\n displacementChannelName?: string;\r\n scalarChannelName?: string;\r\n normalChannelName?: string;\r\n displacementScale?: number;\r\n scalarRange?: Range1dProps;\r\n scalarThematicSettings?: ThematicGradientSettingsProps;\r\n}\r\n\r\nfunction tryConvertLegacyProps(input: AnalysisStyleProps): AnalysisStyleProps {\r\n if (input.displacement || input.scalar)\r\n return input;\r\n\r\n const legacy = input as LegacyAnalysisStyleProps;\r\n if (undefined === legacy.displacementChannelName && undefined === legacy.scalarChannelName)\r\n return input;\r\n\r\n const output: AnalysisStyleProps = {\r\n normalChannelName: input.normalChannelName,\r\n };\r\n\r\n if (undefined !== legacy.displacementChannelName) {\r\n output.displacement = {\r\n channelName: legacy.displacementChannelName,\r\n scale: legacy.displacementScale,\r\n };\r\n }\r\n\r\n if (undefined !== legacy.scalarChannelName && undefined !== legacy.scalarRange) {\r\n output.scalar = {\r\n channelName: legacy.scalarChannelName,\r\n range: legacy.scalarRange,\r\n thematicSettings: legacy.scalarThematicSettings,\r\n };\r\n }\r\n\r\n return output;\r\n}\r\n\r\n/** As part of a [[DisplayStyleSettings]], describes how to animate meshes in the view that have been augmented with\r\n * [PolyfaceAuxData]($core-geometry). The style specifies which channels to use, and can deform the meshes by\r\n * translating vertices and/or recolor vertices using [[ThematicDisplay]].\r\n * @see [[DisplayStyleSettings.analysisStyle]] to define the analysis style for a [DisplayStyle]($backend).\r\n * @see [[DisplayStyleSettings.analysisFraction]] to control playback of the animation.\r\n * @public\r\n */\r\nexport class AnalysisStyle {\r\n public readonly displacement?: AnalysisStyleDisplacement;\r\n public readonly thematic?: AnalysisStyleThematic;\r\n /** If defined, the name of the [AuxChannel]($core-geometry) from which to obtain normal vectors for the vertices. */\r\n public readonly normalChannelName?: string;\r\n\r\n /** Create an analysis style from its JSON representation.\r\n * @note AnalysisStyle is an immutable type - use [[clone]] to produce a modified copy.\r\n */\r\n public static fromJSON(props?: AnalysisStyleProps): AnalysisStyle {\r\n if (!props)\r\n return this.defaults;\r\n\r\n props = tryConvertLegacyProps(props);\r\n if (!props.displacement && !props.scalar && undefined === props.normalChannelName)\r\n return this.defaults;\r\n\r\n return new AnalysisStyle(props);\r\n }\r\n\r\n /** @internal */\r\n private constructor(props: AnalysisStyleProps) {\r\n this.normalChannelName = props.normalChannelName;\r\n if (props.displacement)\r\n this.displacement = AnalysisStyleDisplacement.fromJSON(props.displacement);\r\n\r\n if (props.scalar)\r\n this.thematic = AnalysisStyleThematic.fromJSON(props.scalar);\r\n }\r\n\r\n /** Convert this style to its JSON representation. */\r\n public toJSON(): AnalysisStyleProps {\r\n const props: AnalysisStyleProps = {};\r\n if (this === AnalysisStyle.defaults)\r\n return props;\r\n\r\n if (this.displacement)\r\n props.displacement = this.displacement.toJSON();\r\n\r\n if (this.thematic)\r\n props.scalar = this.thematic.toJSON();\r\n\r\n if (undefined !== this.normalChannelName)\r\n props.normalChannelName = this.normalChannelName;\r\n\r\n return props;\r\n }\r\n\r\n /** Produce a copy of this style identical except for properties explicitly specified by `changedProps`. */\r\n public clone(changedProps: AnalysisStyleProps): AnalysisStyle {\r\n return AnalysisStyle.fromJSON({\r\n ...this.toJSON(),\r\n ...changedProps,\r\n });\r\n }\r\n\r\n /** Return true if this style is equivalent to `other`. */\r\n public equals(other: AnalysisStyle): boolean {\r\n if (this.normalChannelName !== other.normalChannelName)\r\n return false;\r\n\r\n if ((undefined === this.displacement) !== (undefined === other.displacement))\r\n return false;\r\n else if (this.displacement && !this.displacement.equals(other.displacement!))\r\n return false;\r\n\r\n if ((undefined === this.thematic) !== (undefined === other.thematic))\r\n return false;\r\n\r\n return undefined === this.thematic || this.thematic.equals(other.thematic!);\r\n }\r\n\r\n public static readonly defaults = new AnalysisStyle({});\r\n}\r\n"]}
|