@itwin/core-common 5.1.0-dev.9 → 5.2.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 +91 -1
- package/lib/cjs/BackgroundMapSettings.d.ts +2 -2
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/ChangesetProps.d.ts +28 -0
- package/lib/cjs/ChangesetProps.d.ts.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.d.ts +1 -1
- package/lib/cjs/ClipStyle.d.ts.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.d.ts +2 -0
- package/lib/cjs/CommonLoggerCategory.d.ts.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js +2 -0
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +8 -23
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +1 -11
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.d.ts +8 -8
- package/lib/cjs/ContextRealityModel.js +8 -8
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +64 -54
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js +6 -6
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EntityProps.d.ts +10 -10
- package/lib/cjs/EntityProps.d.ts.map +1 -1
- package/lib/cjs/EntityProps.js +4 -2
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/Fonts.d.ts +2 -2
- package/lib/cjs/Fonts.js +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.d.ts +1 -1
- package/lib/cjs/GeoCoordinateServices.js +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryParams.d.ts +3 -1
- package/lib/cjs/GeometryParams.d.ts.map +1 -1
- package/lib/cjs/GeometryParams.js +3 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GraphicParams.d.ts +1 -0
- package/lib/cjs/GraphicParams.d.ts.map +1 -1
- package/lib/cjs/GraphicParams.js +1 -0
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/IModel.d.ts +3 -3
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/ITwinCoreErrors.d.ts +1 -1
- package/lib/cjs/ITwinCoreErrors.d.ts.map +1 -1
- package/lib/cjs/ITwinCoreErrors.js.map +1 -1
- package/lib/cjs/MassProperties.d.ts +2 -2
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.d.ts +6 -3
- package/lib/cjs/MaterialProps.d.ts.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/RenderSchedule.d.ts +14 -0
- package/lib/cjs/RenderSchedule.d.ts.map +1 -1
- package/lib/cjs/RenderSchedule.js +4 -0
- package/lib/cjs/RenderSchedule.js.map +1 -1
- package/lib/cjs/RenderTexture.d.ts +1 -1
- package/lib/cjs/RenderTexture.d.ts.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/TerrainSettings.d.ts +1 -1
- package/lib/cjs/TerrainSettings.d.ts.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts +78 -2
- package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +63 -10
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.d.ts +179 -44
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +210 -57
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.d.ts +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.d.ts +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.d.ts +115 -34
- package/lib/cjs/annotation/TextStyle.d.ts.map +1 -1
- package/lib/cjs/annotation/TextStyle.js +118 -37
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.d.ts +4 -0
- package/lib/cjs/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js +9 -0
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.d.ts +1 -1
- package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js +2 -2
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/internal/BackendTypes.d.ts +3 -3
- package/lib/cjs/internal/BackendTypes.d.ts.map +1 -1
- package/lib/cjs/internal/BackendTypes.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.d.ts +19 -5
- package/lib/cjs/internal/RenderMesh.d.ts.map +1 -1
- package/lib/cjs/internal/RenderMesh.js +11 -8
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/internal/cross-package.d.ts +1 -1
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.d.ts +4 -4
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +4 -4
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.d.ts +6 -6
- package/lib/cjs/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js +6 -6
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.d.ts +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +2 -2
- package/lib/cjs/rpc/web/WebAppRpcProtocol.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/cjs/tile/TileMetadata.d.ts +6 -2
- package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +10 -4
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.d.ts +2 -2
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/ChangesetProps.d.ts +28 -0
- package/lib/esm/ChangesetProps.d.ts.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.d.ts +1 -1
- package/lib/esm/ClipStyle.d.ts.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.d.ts +2 -0
- package/lib/esm/CommonLoggerCategory.d.ts.map +1 -1
- package/lib/esm/CommonLoggerCategory.js +2 -0
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +8 -23
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js +1 -11
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.d.ts +8 -8
- package/lib/esm/ContextRealityModel.js +8 -8
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +64 -54
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js +6 -6
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EntityProps.d.ts +10 -10
- package/lib/esm/EntityProps.d.ts.map +1 -1
- package/lib/esm/EntityProps.js +4 -2
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/Fonts.d.ts +2 -2
- package/lib/esm/Fonts.js +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.d.ts +1 -1
- package/lib/esm/GeoCoordinateServices.js +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryParams.d.ts +3 -1
- package/lib/esm/GeometryParams.d.ts.map +1 -1
- package/lib/esm/GeometryParams.js +3 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GraphicParams.d.ts +1 -0
- package/lib/esm/GraphicParams.d.ts.map +1 -1
- package/lib/esm/GraphicParams.js +1 -0
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/IModel.d.ts +3 -3
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/ITwinCoreErrors.d.ts +1 -1
- package/lib/esm/ITwinCoreErrors.d.ts.map +1 -1
- package/lib/esm/ITwinCoreErrors.js.map +1 -1
- package/lib/esm/MassProperties.d.ts +2 -2
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.d.ts +6 -3
- package/lib/esm/MaterialProps.d.ts.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/RenderSchedule.d.ts +14 -0
- package/lib/esm/RenderSchedule.d.ts.map +1 -1
- package/lib/esm/RenderSchedule.js +4 -0
- package/lib/esm/RenderSchedule.js.map +1 -1
- package/lib/esm/RenderTexture.d.ts +1 -1
- package/lib/esm/RenderTexture.d.ts.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/TerrainSettings.d.ts +1 -1
- package/lib/esm/TerrainSettings.d.ts.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts +78 -2
- package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +63 -10
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.d.ts +179 -44
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlock.js +207 -56
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.d.ts +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.d.ts +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextStyle.d.ts +115 -34
- package/lib/esm/annotation/TextStyle.d.ts.map +1 -1
- package/lib/esm/annotation/TextStyle.js +116 -34
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.d.ts +4 -0
- package/lib/esm/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js +10 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js +2 -2
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/internal/BackendTypes.d.ts +3 -3
- package/lib/esm/internal/BackendTypes.d.ts.map +1 -1
- package/lib/esm/internal/BackendTypes.js.map +1 -1
- package/lib/esm/internal/RenderMesh.d.ts +19 -5
- package/lib/esm/internal/RenderMesh.d.ts.map +1 -1
- package/lib/esm/internal/RenderMesh.js +11 -8
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/internal/cross-package.d.ts +1 -1
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.d.ts +4 -4
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js +4 -4
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.d.ts +6 -6
- package/lib/esm/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js +6 -6
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.d.ts +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +2 -2
- package/lib/esm/rpc/web/WebAppRpcProtocol.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/lib/esm/tile/TileMetadata.d.ts +6 -2
- package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
- package/lib/esm/tile/TileMetadata.js +10 -4
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAppRpcLogging.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppR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,WAAW,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,gCAAgC,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3L,KAAK,gBAAgB,CAAC,uBAAuB,CAAC,CAAC,OAAO,IAAI,CAAC,gBAAgB,CAAC,uCAAuC,EAAE,MAAM,CAAC,CAAC;YAC7H,KAAK,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,OAAO,IAAI,CAAC,gBAAgB,CAAC,yCAAyC,EAAE,MAAM,CAAC,CAAC;QAC3H,CAAC;IACH,CAAC;IAEkB,WAAW;QAC5B,OAAO,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,iBAAiB,CAAC;IAChE,CAAC;IAEO,gBAAgB,CAAC,OAAe,EAAE,OAAyB;QACjE,MAAM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE/C,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,GAAG,OAAO,IAAI,mBAAmB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YACpG,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,uGAAuG;YACvG,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,2DAA2D;YACnF,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,2DAA2D;YAC5F,GAAG,OAAO;SACX,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAED,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcProtocolEvent } from \"../core/RpcConstants\";\nimport { RpcInvocation } from \"../core/RpcInvocation\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { RpcRequest } from \"../core/RpcRequest\";\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nconst BACKEND = Symbol.for(\"@itwin.WebAppRpcLogging.Backend\");\nconst FRONTEND = Symbol.for(\"@itwin.WebAppRpcLogging.Frontend\");\n\n/** @internal */\nexport abstract class WebAppRpcLogging {\n public static initializeBackend(instance: WebAppRpcLogging) {\n (globalThis as any)[BACKEND] = instance;\n }\n\n public static initializeFrontend(instance: WebAppRpcLogging) {\n (globalThis as any)[FRONTEND] = instance;\n }\n\n private static get backend(): WebAppRpcLogging {\n const instance = (globalThis as any)[BACKEND];\n if (typeof (instance) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Backend logging is not initialized.\");\n }\n\n return instance;\n }\n\n private static get frontend(): WebAppRpcLogging {\n const instance = (globalThis as any)[FRONTEND];\n if (typeof (instance) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Frontend logging is not initialized.\");\n }\n\n return instance;\n }\n\n public static async logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void> {\n if (object instanceof WebAppRpcRequest) {\n await WebAppRpcLogging.frontend.logProtocolEvent(event, object);\n } else if (object instanceof RpcInvocation) {\n await WebAppRpcLogging.backend.logProtocolEvent(event, object);\n }\n }\n\n protected abstract logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void>;\n\n protected abstract getHostname(): string;\n\n protected getRpcInterfaceName(g: string | RpcInterfaceDefinition): string {\n return (typeof g === \"string\") ? g : g.interfaceName;\n }\n\n protected findPathIds(path: string) {\n let iTwinId = \"\";\n let iModelId = \"\";\n\n const tokens = path.split(\"/\");\n for (let i = 0; i !== tokens.length; ++i) {\n // For backwards compatibility, find old \"context\" or current \"iTwin\" terminology\n if ((/^context$/i).test(tokens[i]) || (/^itwin$/i).test(tokens[i])) {\n iTwinId = tokens[i + 1] || \"\";\n }\n\n if ((/^imodel$/i).test(tokens[i])) {\n iModelId = tokens[i + 1] || \"\";\n }\n }\n\n return { iTwinId, iModelId };\n }\n\n protected buildOperationDescriptor(operation: RpcOperation | SerializedRpcOperation): string {\n if (!operation) {\n return \"unknown.unknown\";\n }\n\n const interfaceName = typeof (operation.interfaceDefinition) === \"string\" ? operation.interfaceDefinition : operation.interfaceDefinition.interfaceName;\n const operationName = operation.operationName;\n return `${interfaceName}.${operationName}`;\n }\n\n protected logRequest(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest): void {\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\n const pathIds = this.findPathIds(object.path);\n\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\n method: object.method,\n path: object.path,\n operation: object.operation.operationName,\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\n TimeElapsed: (\"elapsed\" in object) ? object.elapsed : 0, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n }));\n }\n\n protected logResponse(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest, status: number, elapsed: number): void {\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\n const pathIds = this.findPathIds(object.path);\n\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\n method: object.method,\n path: object.path,\n operation: object.operation.operationName,\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\n status,\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\n TimeElapsed: elapsed, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n }));\n }\n}\n\ndeclare global {\n // eslint-disable-next-line no-var\n var window: any;\n}\n\nclass WebAppRpcLoggingFrontend extends WebAppRpcLogging {\n protected override async logProtocolEvent(event: RpcProtocolEvent, object: WebAppRpcRequest): Promise<void> {\n switch (event) {\n case RpcProtocolEvent.RequestCreated: return this.logRequest(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.request\", object);\n case RpcProtocolEvent.ResponseLoaded: return this.logResponse(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.response\", object, object.metadata.status, object.elapsed);\n case RpcProtocolEvent.ConnectionErrorReceived: return this.logErrorFrontend(\"RpcInterface.frontend.connectionError\", object);\n case RpcProtocolEvent.ConnectionAborted: return this.logErrorFrontend(\"RpcInterface.frontend.connectionAborted\", object);\n }\n }\n\n protected override getHostname(): string {\n return globalThis.window?.location?.host ?? \"imodeljs-mobile\";\n }\n\n private logErrorFrontend(message: string, request: WebAppRpcRequest): void {\n const operationDescriptor = this.buildOperationDescriptor(request.operation);\n const pathIds = this.findPathIds(request.path);\n\n Logger.logInfo(CommonLoggerCategory.RpcInterfaceFrontend, `${message}.${operationDescriptor}`, () => ({\n method: request.method,\n path: request.path,\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: request.id, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n }));\n }\n}\n\nWebAppRpcLogging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,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus, Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcProtocolEvent } from \"../core/RpcConstants\";\nimport { RpcInvocation } from \"../core/RpcInvocation\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { RpcRequest } from \"../core/RpcRequest\";\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nconst BACKEND = Symbol.for(\"@itwin.WebAppRpcLogging.Backend\");\nconst FRONTEND = Symbol.for(\"@itwin.WebAppRpcLogging.Frontend\");\n\n/** @internal */\nexport abstract class WebAppRpcLogging {\n public static initializeBackend(instance: WebAppRpcLogging) {\n (globalThis as any)[BACKEND] = instance;\n }\n\n public static initializeFrontend(instance: WebAppRpcLogging) {\n (globalThis as any)[FRONTEND] = instance;\n }\n\n private static get backend(): WebAppRpcLogging {\n const instance = (globalThis as any)[BACKEND];\n if (typeof (instance) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Backend logging is not initialized.\");\n }\n\n return instance;\n }\n\n private static get frontend(): WebAppRpcLogging {\n const instance = (globalThis as any)[FRONTEND];\n if (typeof (instance) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Frontend logging is not initialized.\");\n }\n\n return instance;\n }\n\n public static async logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void> {\n if (object instanceof WebAppRpcRequest) {\n await WebAppRpcLogging.frontend.logProtocolEvent(event, object);\n } else if (object instanceof RpcInvocation) {\n await WebAppRpcLogging.backend.logProtocolEvent(event, object);\n }\n }\n\n protected abstract logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void>;\n\n protected abstract getHostname(): string;\n\n protected getRpcInterfaceName(g: string | RpcInterfaceDefinition): string {\n return (typeof g === \"string\") ? g : g.interfaceName;\n }\n\n protected findPathIds(path: string) {\n let iTwinId = \"\";\n let iModelId = \"\";\n\n const tokens = path.split(\"/\");\n for (let i = 0; i !== tokens.length; ++i) {\n // For backwards compatibility, find old \"context\" or current \"iTwin\" terminology\n if ((/^context$/i).test(tokens[i]) || (/^itwin$/i).test(tokens[i])) {\n iTwinId = tokens[i + 1] || \"\";\n }\n\n if ((/^imodel$/i).test(tokens[i])) {\n iModelId = tokens[i + 1] || \"\";\n }\n }\n\n return { iTwinId, iModelId };\n }\n\n protected buildOperationDescriptor(operation: RpcOperation | SerializedRpcOperation): string {\n if (!operation) {\n return \"unknown.unknown\";\n }\n\n const interfaceName = typeof (operation.interfaceDefinition) === \"string\" ? operation.interfaceDefinition : operation.interfaceDefinition.interfaceName;\n const operationName = operation.operationName;\n return `${interfaceName}.${operationName}`;\n }\n\n protected logRequest(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest): void {\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\n const pathIds = this.findPathIds(object.path);\n\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\n method: object.method,\n path: object.path,\n operation: object.operation.operationName,\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\n TimeElapsed: (\"elapsed\" in object) ? object.elapsed : 0, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n }));\n }\n\n protected logResponse(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest, status: number, elapsed: number): void {\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\n const pathIds = this.findPathIds(object.path);\n\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\n method: object.method,\n path: object.path,\n operation: object.operation.operationName,\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\n status,\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\n TimeElapsed: elapsed, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n }));\n }\n}\n\ndeclare global {\n \n var window: any;\n}\n\nclass WebAppRpcLoggingFrontend extends WebAppRpcLogging {\n protected override async logProtocolEvent(event: RpcProtocolEvent, object: WebAppRpcRequest): Promise<void> {\n switch (event) {\n case RpcProtocolEvent.RequestCreated: return this.logRequest(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.request\", object);\n case RpcProtocolEvent.ResponseLoaded: return this.logResponse(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.response\", object, object.metadata.status, object.elapsed);\n case RpcProtocolEvent.ConnectionErrorReceived: return this.logErrorFrontend(\"RpcInterface.frontend.connectionError\", object);\n case RpcProtocolEvent.ConnectionAborted: return this.logErrorFrontend(\"RpcInterface.frontend.connectionAborted\", object);\n }\n }\n\n protected override getHostname(): string {\n return globalThis.window?.location?.host ?? \"imodeljs-mobile\";\n }\n\n private logErrorFrontend(message: string, request: WebAppRpcRequest): void {\n const operationDescriptor = this.buildOperationDescriptor(request.operation);\n const pathIds = this.findPathIds(request.path);\n\n Logger.logInfo(CommonLoggerCategory.RpcInterfaceFrontend, `${message}.${operationDescriptor}`, () => ({\n method: request.method,\n path: request.path,\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: request.id, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n }));\n }\n}\n\nWebAppRpcLogging.initializeFrontend(new WebAppRpcLoggingFrontend());\n"]}
|
|
@@ -10,7 +10,7 @@ import { OpenAPIInfo, OpenAPIParameter, RpcOpenAPIDescription } from "./OpenAPI"
|
|
|
10
10
|
import { WebAppRpcRequest } from "./WebAppRpcRequest";
|
|
11
11
|
/** An HTTP server request object.
|
|
12
12
|
* @public
|
|
13
|
-
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
|
|
13
|
+
* @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.
|
|
14
14
|
*/
|
|
15
15
|
export interface HttpServerRequest extends BackendReadable {
|
|
16
16
|
aborted: boolean;
|
|
@@ -44,7 +44,7 @@ export interface HttpServerRequest extends BackendReadable {
|
|
|
44
44
|
}
|
|
45
45
|
/** An HTTP server response object.
|
|
46
46
|
* @public
|
|
47
|
-
* @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
|
|
47
|
+
* @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.
|
|
48
48
|
*/
|
|
49
49
|
export interface HttpServerResponse extends BackendWritable {
|
|
50
50
|
send(body?: any): HttpServerResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAppRpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcProtocol.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAC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AA+D;IACxD,SAAS,CAAC,IAAY;QAC3B,OAAO,IAAI,KAAK,GAAG,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB,KAAK,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAO3E,mCAAmC;IACnC,YAAmB,aAA+B;QAChD,KAAK,CAAC,aAAa,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACrG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { BackendReadable, BackendWritable } from \"../../internal/BackendTypes\";\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\nimport { RpcContentType, RpcRequestStatus, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { RpcProtocol, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { OpenAPIInfo, OpenAPIParameter, RpcOpenAPIDescription } from \"./OpenAPI\";\nimport { WebAppRpcLogging } from \"./WebAppRpcLogging\";\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** An HTTP server request object.\n * @public\n * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerRequest extends BackendReadable {\n aborted: boolean;\n httpVersion: string;\n httpVersionMajor: number;\n httpVersionMinor: number;\n complete: boolean;\n connection: any;\n headers: { [header: string]: string | string[] | undefined };\n rawHeaders: string[];\n trailers: { [key: string]: string | undefined };\n trailersDistinct: NodeJS.Dict<string[]>;\n rawTrailers: string[];\n setTimeout(msecs: number, callback: () => void): void;\n setTimeout(msecs: number, callback: () => void): this;\n url?: string;\n statusCode?: number;\n statusMessage?: string;\n socket: any;\n destroy(error?: Error): this;\n body: string | Buffer;\n path: string;\n method: string;\n ip?: string;\n header: (field: string) => string | undefined;\n headersDistinct: NodeJS.Dict<string[]>;\n}\n\n/** An HTTP server response object.\n * @public\n * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerResponse extends BackendWritable {\n send(body?: any): HttpServerResponse;\n status(code: number): HttpServerResponse;\n set(field: string, value: string): void;\n}\n\n/** The HTTP application protocol.\n * @internal\n */\nexport abstract class WebAppRpcProtocol extends RpcProtocol {\n public override preserveStreams = true;\n\n /** Convenience handler for an RPC operation get request for an HTTP server. */\n public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) {\n return this.handleOperationPostRequest(req, res);\n }\n\n /** Convenience handler for an RPC operation post request for an HTTP server. */\n public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) {\n let request: SerializedRpcRequest;\n try {\n request = await WebAppRpcRequest.parseRequest(this, req);\n } catch (error) {\n const message = BentleyError.getErrorMessage(error);\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, `Failed to parse request: ${message}`, BentleyError.getErrorMetadata(error));\n res.status(400);\n res.send(JSON.stringify({ message, isError: true }));\n return;\n }\n const fulfillment = await this.fulfill(request);\n await WebAppRpcRequest.sendResponse(this, request, fulfillment, req, res);\n }\n\n /** Convenience handler for an OpenAPI description request for an HTTP server. */\n public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) {\n const description = JSON.stringify(this.openAPIDescription);\n res.send(description);\n }\n\n /** Converts an HTTP content type value to an RPC content type value. */\n public static computeContentType(httpType: string | null | undefined): RpcContentType {\n if (!httpType)\n return RpcContentType.Unknown;\n\n if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) {\n return RpcContentType.Text;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) {\n return RpcContentType.Binary;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) {\n return RpcContentType.Multipart;\n } else {\n return RpcContentType.Unknown;\n }\n }\n\n /** The OpenAPI-compatible info object for this protocol. */\n public abstract info: OpenAPIInfo;\n\n /** An optional prefix for RPC operation URI paths. */\n public pathPrefix: string = \"\";\n\n /** The RPC request class for this protocol. */\n public readonly requestType = WebAppRpcRequest;\n\n /** Supplies the status corresponding to a protocol-specific code value. */\n public override getStatus(code: number): RpcRequestStatus {\n switch (code) {\n case 404: return RpcRequestStatus.NotFound;\n case 202: return RpcRequestStatus.Pending;\n case 200: return RpcRequestStatus.Resolved;\n case 500: return RpcRequestStatus.Rejected;\n case 204: return RpcRequestStatus.NoContent;\n case 502: return RpcRequestStatus.BadGateway;\n case 503: return RpcRequestStatus.ServiceUnavailable;\n case 504: return RpcRequestStatus.GatewayTimeout;\n case 408: return RpcRequestStatus.RequestTimeout;\n case 429: return RpcRequestStatus.TooManyRequests;\n default: return RpcRequestStatus.Unknown;\n }\n }\n\n /** Supplies the protocol-specific code corresponding to a status value. */\n public override getCode(status: RpcRequestStatus): number {\n switch (status) {\n case RpcRequestStatus.NotFound: return 404;\n case RpcRequestStatus.Pending: return 202;\n case RpcRequestStatus.Resolved: return 200;\n case RpcRequestStatus.Rejected: return 500;\n case RpcRequestStatus.NoContent: return 204;\n case RpcRequestStatus.BadGateway: return 502;\n case RpcRequestStatus.ServiceUnavailable: return 503;\n case RpcRequestStatus.GatewayTimeout: return 504;\n case RpcRequestStatus.RequestTimeout: return 408;\n case RpcRequestStatus.TooManyRequests: return 429;\n default: return 501;\n }\n }\n\n public override supportsStatusCategory = true;\n\n /** Whether an HTTP status code indicates a request timeout. */\n public isTimeout(code: number): boolean {\n return code === 504;\n }\n\n /** An OpenAPI-compatible description of this protocol.\n * @internal\n */\n public get openAPIDescription() { return new RpcOpenAPIDescription(this); }\n\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\n * @internal\n */\n public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[];\n\n /** Constructs an HTTP protocol. */\n public constructor(configuration: RpcConfiguration) {\n super(configuration);\n this.events.addListener(async (event, object) => WebAppRpcLogging.logProtocolEvent(event, object));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"WebAppRpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcProtocol.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAiC,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA6CtD;;GAEG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,WAAW;IACzC,eAAe,GAAG,IAAI,CAAC;IAEvC,+EAA+E;IACxE,KAAK,CAAC,yBAAyB,CAAC,GAAsB,EAAE,GAAuB;QACpF,OAAO,IAAI,CAAC,0BAA0B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,gFAAgF;IACzE,KAAK,CAAC,0BAA0B,CAAC,GAAsB,EAAE,GAAuB;QACrF,IAAI,OAA6B,CAAC;QAClC,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,gBAAgB,CAAC,YAAY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G,CAAC;YAC3C,KAAK,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC;YAC1C,KAAK,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,GAAG,CAAC;YAC3C,KAAK,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,GAAG,CAAC;YAC3C,KAAK,gBAAgB,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC;YAC5C,KAAK,gBAAgB,CAAC,UAAU,CAAC,CAAC,OAAO,GAAG,CAAC;YAC7C,KAAK,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,OAAO,GAAG,CAAC;YACrD,KAAK,gBAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,GAAG,CAAC;YACjD,KAAK,gBAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,GAAG,CAAC;YACjD,KAAK,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,GAAG,CAAC;YAClD,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC;QACtB,CAAC;IACH,CAAC;IAEe,sBAAsB,GAAG,IAAI,CAAC;IAE9C,+DAA+D;IACxD,SAAS,CAAC,IAAY;QAC3B,OAAO,IAAI,KAAK,GAAG,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB,KAAK,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAO3E,mCAAmC;IACnC,YAAmB,aAA+B;QAChD,KAAK,CAAC,aAAa,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACrG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { BackendReadable, BackendWritable } from \"../../internal/BackendTypes\";\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\nimport { RpcContentType, RpcRequestStatus, WEB_RPC_CONSTANTS } from \"../core/RpcConstants\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { RpcProtocol, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { OpenAPIInfo, OpenAPIParameter, RpcOpenAPIDescription } from \"./OpenAPI\";\nimport { WebAppRpcLogging } from \"./WebAppRpcLogging\";\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** An HTTP server request object.\n * @public\n * @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerRequest extends BackendReadable {\n aborted: boolean;\n httpVersion: string;\n httpVersionMajor: number;\n httpVersionMinor: number;\n complete: boolean;\n connection: any;\n headers: { [header: string]: string | string[] | undefined };\n rawHeaders: string[];\n trailers: { [key: string]: string | undefined };\n trailersDistinct: NodeJS.Dict<string[]>;\n rawTrailers: string[];\n setTimeout(msecs: number, callback: () => void): void;\n setTimeout(msecs: number, callback: () => void): this;\n url?: string;\n statusCode?: number;\n statusMessage?: string;\n socket: any;\n destroy(error?: Error): this;\n body: string | Buffer;\n path: string;\n method: string;\n ip?: string;\n header: (field: string) => string | undefined;\n headersDistinct: NodeJS.Dict<string[]>;\n}\n\n/** An HTTP server response object.\n * @public\n * @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.\n */\nexport interface HttpServerResponse extends BackendWritable {\n send(body?: any): HttpServerResponse;\n status(code: number): HttpServerResponse;\n set(field: string, value: string): void;\n}\n\n/** The HTTP application protocol.\n * @internal\n */\nexport abstract class WebAppRpcProtocol extends RpcProtocol {\n public override preserveStreams = true;\n\n /** Convenience handler for an RPC operation get request for an HTTP server. */\n public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) {\n return this.handleOperationPostRequest(req, res);\n }\n\n /** Convenience handler for an RPC operation post request for an HTTP server. */\n public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) {\n let request: SerializedRpcRequest;\n try {\n request = await WebAppRpcRequest.parseRequest(this, req);\n } catch (error) {\n const message = BentleyError.getErrorMessage(error);\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, `Failed to parse request: ${message}`, BentleyError.getErrorMetadata(error));\n res.status(400);\n res.send(JSON.stringify({ message, isError: true }));\n return;\n }\n const fulfillment = await this.fulfill(request);\n await WebAppRpcRequest.sendResponse(this, request, fulfillment, req, res);\n }\n\n /** Convenience handler for an OpenAPI description request for an HTTP server. */\n public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) {\n const description = JSON.stringify(this.openAPIDescription);\n res.send(description);\n }\n\n /** Converts an HTTP content type value to an RPC content type value. */\n public static computeContentType(httpType: string | null | undefined): RpcContentType {\n if (!httpType)\n return RpcContentType.Unknown;\n\n if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) {\n return RpcContentType.Text;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) {\n return RpcContentType.Binary;\n } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) {\n return RpcContentType.Multipart;\n } else {\n return RpcContentType.Unknown;\n }\n }\n\n /** The OpenAPI-compatible info object for this protocol. */\n public abstract info: OpenAPIInfo;\n\n /** An optional prefix for RPC operation URI paths. */\n public pathPrefix: string = \"\";\n\n /** The RPC request class for this protocol. */\n public readonly requestType = WebAppRpcRequest;\n\n /** Supplies the status corresponding to a protocol-specific code value. */\n public override getStatus(code: number): RpcRequestStatus {\n switch (code) {\n case 404: return RpcRequestStatus.NotFound;\n case 202: return RpcRequestStatus.Pending;\n case 200: return RpcRequestStatus.Resolved;\n case 500: return RpcRequestStatus.Rejected;\n case 204: return RpcRequestStatus.NoContent;\n case 502: return RpcRequestStatus.BadGateway;\n case 503: return RpcRequestStatus.ServiceUnavailable;\n case 504: return RpcRequestStatus.GatewayTimeout;\n case 408: return RpcRequestStatus.RequestTimeout;\n case 429: return RpcRequestStatus.TooManyRequests;\n default: return RpcRequestStatus.Unknown;\n }\n }\n\n /** Supplies the protocol-specific code corresponding to a status value. */\n public override getCode(status: RpcRequestStatus): number {\n switch (status) {\n case RpcRequestStatus.NotFound: return 404;\n case RpcRequestStatus.Pending: return 202;\n case RpcRequestStatus.Resolved: return 200;\n case RpcRequestStatus.Rejected: return 500;\n case RpcRequestStatus.NoContent: return 204;\n case RpcRequestStatus.BadGateway: return 502;\n case RpcRequestStatus.ServiceUnavailable: return 503;\n case RpcRequestStatus.GatewayTimeout: return 504;\n case RpcRequestStatus.RequestTimeout: return 408;\n case RpcRequestStatus.TooManyRequests: return 429;\n default: return 501;\n }\n }\n\n public override supportsStatusCategory = true;\n\n /** Whether an HTTP status code indicates a request timeout. */\n public isTimeout(code: number): boolean {\n return code === 504;\n }\n\n /** An OpenAPI-compatible description of this protocol.\n * @internal\n */\n public get openAPIDescription() { return new RpcOpenAPIDescription(this); }\n\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\n * @internal\n */\n public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[];\n\n /** Constructs an HTTP protocol. */\n public constructor(configuration: RpcConfiguration) {\n super(configuration);\n this.events.addListener(async (event, object) => WebAppRpcLogging.logProtocolEvent(event, object));\n }\n}\n"]}
|
|
@@ -27,13 +27,13 @@ export declare enum CurrentImdlVersion {
|
|
|
27
27
|
* 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
|
|
28
28
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
29
29
|
*/
|
|
30
|
-
Major =
|
|
30
|
+
Major = 37,
|
|
31
31
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
32
32
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
33
33
|
*/
|
|
34
34
|
Minor = 0,
|
|
35
35
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
36
|
-
Combined =
|
|
36
|
+
Combined = 2424832
|
|
37
37
|
}
|
|
38
38
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
39
39
|
* @internal
|
|
@@ -33,13 +33,13 @@ export var CurrentImdlVersion;
|
|
|
33
33
|
* 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
|
|
34
34
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
35
35
|
*/
|
|
36
|
-
CurrentImdlVersion[CurrentImdlVersion["Major"] =
|
|
36
|
+
CurrentImdlVersion[CurrentImdlVersion["Major"] = 37] = "Major";
|
|
37
37
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
38
38
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
39
39
|
*/
|
|
40
40
|
CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
|
|
41
41
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
42
|
-
CurrentImdlVersion[CurrentImdlVersion["Combined"] =
|
|
42
|
+
CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2424832] = "Combined";
|
|
43
43
|
})(CurrentImdlVersion || (CurrentImdlVersion = {}));
|
|
44
44
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
45
45
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTileIO.js","sourceRoot":"","sources":["../../../src/tile/IModelTileIO.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EA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AAS;IAC/B,4CAA4C;IAC5C,wIAAwI;IACxH,gBAAgB,CAAS;IACzC,uCAAuC;IACvB,KAAK,CAAS;IAEvB,MAAM,CAAC,QAAQ,CAAC,MAAkB;QACvC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,WAAW,GAAG,EAAE,CAAC;IAE/B,YAAoB,MAAc,EAAE,gBAAwB,EAAE,KAAa;QACzE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tile\n */\n\nimport { assert, ByteStream } from \"@itwin/core-bentley\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d } from \"../geometry/Placement\";\nimport { nextPoint3d64FromByteStream, TileFormat, TileHeader } from \"./TileIO\";\n\n/** Flags describing the geometry contained within a tile in iMdl format.\n * @internal\n */\nexport enum ImdlFlags {\n /** No special flags */\n None = 0,\n /** The tile contains some curved geometry */\n ContainsCurves = 1 << 0,\n /** Some geometry within the tile range was omitted based on its size */\n Incomplete = 1 << 2,\n /** The tile must be refined by sub-division, not magnification. */\n DisallowMagnification = 1 << 3,\n /** The tile's feature table contains features from multiple models. */\n MultiModelFeatureTable = 1 << 4,\n}\n\n/** Describes the maximum major and minor version of the iMdl tile format supported by this version of this package.\n * @internal\n */\nexport enum CurrentImdlVersion {\n /** The unsigned 16-bit major version number. If the major version specified in the tile header is greater than this value, then this\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\n * greater minor version than CurrentVersion.Minor, although some data may be skipped.\n */\n Major =
|
|
1
|
+
{"version":3,"file":"IModelTileIO.js","sourceRoot":"","sources":["../../../src/tile/IModelTileIO.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAN,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,uBAAuB;IACvB,yCAAQ,CAAA;IACR,6CAA6C;IAC7C,6DAAuB,CAAA;IACvB,wEAAwE;IACxE,qDAAmB,CAAA;IACnB,mEAAmE;IACnE,2EAA8B,CAAA;IAC9B,uEAAuE;IACvE,8EAA+B,CAAA;AACjC,CAAC,EAXW,SAAS,KAAT,SAAS,QAWpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B;;;OAGG;IACH,8DAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT,kGAAkG;IAClG,yEAAkC,CAAA;AACpC,CAAC,EAZW,kBAAkB,KAAlB,kBAAkB,QAY7B;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IACxC,wCAAwC;IACxB,YAAY,CAAS;IACrC,8DAA8D;IAC9C,KAAK,CAAY;IACjC,kIAAkI;IAClH,YAAY,CAAsB;IAClD,6EAA6E;IAC7D,SAAS,CAAS;IAClC,0FAA0F;IAC1E,mBAAmB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AU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvE,uCAAuC;QACvC,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/D,MAAM,CAAC,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;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC7B,iDAAiD;IACjC,MAAM,CAAS;IAC/B,4CAA4C;IAC5C,wIAAwI;IACxH,gBAAgB,CAAS;IACzC,uCAAuC;IACvB,KAAK,CAAS;IAEvB,MAAM,CAAC,QAAQ,CAAC,MAAkB;QACvC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,WAAW,GAAG,EAAE,CAAC;IAE/B,YAAoB,MAAc,EAAE,gBAAwB,EAAE,KAAa;QACzE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tile\n */\n\nimport { assert, ByteStream } from \"@itwin/core-bentley\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d } from \"../geometry/Placement\";\nimport { nextPoint3d64FromByteStream, TileFormat, TileHeader } from \"./TileIO\";\n\n/** Flags describing the geometry contained within a tile in iMdl format.\n * @internal\n */\nexport enum ImdlFlags {\n /** No special flags */\n None = 0,\n /** The tile contains some curved geometry */\n ContainsCurves = 1 << 0,\n /** Some geometry within the tile range was omitted based on its size */\n Incomplete = 1 << 2,\n /** The tile must be refined by sub-division, not magnification. */\n DisallowMagnification = 1 << 3,\n /** The tile's feature table contains features from multiple models. */\n MultiModelFeatureTable = 1 << 4,\n}\n\n/** Describes the maximum major and minor version of the iMdl tile format supported by this version of this package.\n * @internal\n */\nexport enum CurrentImdlVersion {\n /** The unsigned 16-bit major version number. If the major version specified in the tile header is greater than this value, then this\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\n * greater minor version than CurrentVersion.Minor, although some data may be skipped.\n */\n Major = 37,\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\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.\n */\n Minor = 0,\n /** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */\n Combined = (Major << 0x10) | Minor,\n}\n\n/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.\n * @internal\n */\nexport class ImdlHeader extends TileHeader {\n /** The size of this header in bytes. */\n public readonly headerLength: number;\n /** Flags describing the geometry contained within the tile */\n public readonly flags: ImdlFlags;\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 */\n public readonly contentRange: ElementAlignedBox3d;\n /** The chord tolerance in meters at which the tile's geometry was faceted */\n public readonly tolerance: number;\n /** The number of elements which contributed at least some geometry to the tile content */\n public readonly numElementsIncluded: number;\n /** The number of elements within the tile range which contributed no geometry to the tile content */\n public readonly numElementsExcluded: number;\n /** The total number of bytes in the binary tile data, including this header */\n public readonly tileLength: number;\n /** A bitfield wherein each set bit indicates an empty sub-volume. */\n public readonly emptySubRanges: number;\n\n public get versionMajor(): number { return this.version >>> 0x10; }\n public get versionMinor(): number { return (this.version & 0xffff) >>> 0; }\n\n public get isValid(): boolean { return TileFormat.IModel === this.format; }\n public get isReadableVersion(): boolean { return this.versionMajor <= CurrentImdlVersion.Major; }\n\n /** Deserialize a header from the binary data at the stream's current position.\n * If the binary data does not contain a valid header, the Header will be marked 'invalid'.\n */\n public constructor(stream: ByteStream) {\n super(stream);\n this.headerLength = stream.readUint32();\n this.flags = stream.readUint32();\n\n this.contentRange = new Range3d();\n nextPoint3d64FromByteStream(stream, this.contentRange.low);\n nextPoint3d64FromByteStream(stream, this.contentRange.high);\n\n this.tolerance = stream.readFloat64();\n this.numElementsIncluded = stream.readUint32();\n this.numElementsExcluded = stream.readUint32();\n this.tileLength = stream.readUint32();\n\n // empty sub-volume bit field introduced in format v02.00\n this.emptySubRanges = this.versionMajor >= 2 ? stream.readUint32() : 0;\n\n // Skip any unprocessed bytes in header\n const remainingHeaderBytes = this.headerLength - stream.curPos;\n assert(remainingHeaderBytes >= 0);\n stream.advance(remainingHeaderBytes);\n\n if (stream.isPastTheEnd)\n this.invalidate();\n }\n}\n\n/** Header preceding the feature table embedded in an iMdl tile's content.\n * @internal\n */\nexport class FeatureTableHeader {\n // The number of bytes the entire table occupies.\n public readonly length: number;\n // The number of subcategories in the table.\n // NOTE: This used to be \"max features\" which was useless and unused. It is only accurate if ImdlFlags.HasMultiModelFeatureTable is set.\n public readonly numSubCategories: number;\n // The number of features in the table.\n public readonly count: number;\n\n public static readFrom(stream: ByteStream) {\n const length = stream.readUint32();\n const maxFeatures = stream.readUint32();\n const count = stream.readUint32();\n return stream.isPastTheEnd ? undefined : new FeatureTableHeader(length, maxFeatures, count);\n }\n\n public static sizeInBytes = 12;\n\n private constructor(length: number, numSubCategories: number, count: number) {\n this.length = length;\n this.numSubCategories = numSubCategories;\n this.count = count;\n }\n}\n"]}
|
|
@@ -57,6 +57,7 @@ export interface TileOptions {
|
|
|
57
57
|
readonly disableMagnification: boolean;
|
|
58
58
|
readonly alwaysSubdivideIncompleteTiles: boolean;
|
|
59
59
|
readonly edgeOptions: EdgeOptions;
|
|
60
|
+
readonly disablePolyfaceDecimation: boolean;
|
|
60
61
|
}
|
|
61
62
|
/** @internal */
|
|
62
63
|
export declare namespace TileOptions {
|
|
@@ -92,7 +93,8 @@ export declare enum TreeFlags {
|
|
|
92
93
|
EnforceDisplayPriority = 2,// For 3d plan projection models, group graphics into layers based on subcategory.
|
|
93
94
|
OptimizeBRepProcessing = 4,// Use an optimized pipeline for producing facets from BRep entities.
|
|
94
95
|
UseLargerTiles = 8,// Produce tiles of larger size in screen pixels.
|
|
95
|
-
ExpandProjectExtents = 16
|
|
96
|
+
ExpandProjectExtents = 16,// If UseProjectExtents, round them up/down to nearest powers of ten.
|
|
97
|
+
DisablePolyfaceDecimation = 32
|
|
96
98
|
}
|
|
97
99
|
/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.
|
|
98
100
|
* @internal
|
|
@@ -113,6 +115,7 @@ export interface PrimaryTileTreeId {
|
|
|
113
115
|
* @see [ClipVector.toCompactString[($core-geometry).
|
|
114
116
|
*/
|
|
115
117
|
sectionCut?: string;
|
|
118
|
+
disablePolyfaceDecimation?: boolean;
|
|
116
119
|
}
|
|
117
120
|
/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.
|
|
118
121
|
* @internal
|
|
@@ -121,6 +124,7 @@ export interface ClassifierTileTreeId {
|
|
|
121
124
|
type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;
|
|
122
125
|
expansion: number;
|
|
123
126
|
animationId?: Id64String;
|
|
127
|
+
disablePolyfaceDecimation?: boolean;
|
|
124
128
|
}
|
|
125
129
|
/** Describes the Id of an iModel tile tree.
|
|
126
130
|
* @internal
|
|
@@ -209,7 +213,7 @@ export interface TileContentDescription extends TileContentMetadata {
|
|
|
209
213
|
/** Deserializes tile content metadata.
|
|
210
214
|
* @throws [[TileReadError]]
|
|
211
215
|
* @internal
|
|
212
|
-
* @deprecated in 4.0. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.
|
|
216
|
+
* @deprecated in 4.0 - will not be removed until after 2026-06-13. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.
|
|
213
217
|
*/
|
|
214
218
|
export declare function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription;
|
|
215
219
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileMetadata.d.ts","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACG,UAAU,EAAgH,UAAU,EAC7I,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ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BAAmB;IACjE,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,GAAG,sBAAsB,CAE3L;AAED,gBAAgB;AAChB,MAAM,WAAW,gCAAgC;IAC/C,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,WAAW,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,gBAAgB;AAChB,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,gCAAgC,GAAG,sBAAsB,CA4D3G;AAID;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAS3G;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;gBAEpB,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW;IAMvE;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,YAAY;CAkBhE"}
|
|
@@ -55,6 +55,7 @@ export var TileOptions;
|
|
|
55
55
|
disableMagnification: false,
|
|
56
56
|
alwaysSubdivideIncompleteTiles: false,
|
|
57
57
|
edgeOptions,
|
|
58
|
+
disablePolyfaceDecimation: 0 !== (tree.flags & TreeFlags.DisablePolyfaceDecimation),
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
TileOptions.fromTreeIdAndContentId = fromTreeIdAndContentId;
|
|
@@ -89,14 +90,15 @@ class Parser {
|
|
|
89
90
|
}
|
|
90
91
|
if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key] === "number" && !Number.isFinite(parsedContentId[key])))
|
|
91
92
|
throw new Error("Invalid content Id");
|
|
93
|
+
const disablePolyfaceDecimation = options.disablePolyfaceDecimation;
|
|
92
94
|
let treeId;
|
|
93
95
|
if (classifier) {
|
|
94
|
-
treeId = { ...classifier, animationId };
|
|
96
|
+
treeId = { ...classifier, animationId, disablePolyfaceDecimation };
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
97
99
|
assert(undefined !== primary);
|
|
98
100
|
const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;
|
|
99
|
-
treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority };
|
|
101
|
+
treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority, disablePolyfaceDecimation };
|
|
100
102
|
}
|
|
101
103
|
return {
|
|
102
104
|
contentId: parsedContentId,
|
|
@@ -199,6 +201,7 @@ export const defaultTileOptions = Object.freeze({
|
|
|
199
201
|
useLargerTiles: true,
|
|
200
202
|
disableMagnification: false,
|
|
201
203
|
alwaysSubdivideIncompleteTiles: false,
|
|
204
|
+
disablePolyfaceDecimation: false,
|
|
202
205
|
edgeOptions: {
|
|
203
206
|
type: "compact",
|
|
204
207
|
smooth: true,
|
|
@@ -294,7 +297,8 @@ export var TreeFlags;
|
|
|
294
297
|
TreeFlags[TreeFlags["EnforceDisplayPriority"] = 2] = "EnforceDisplayPriority";
|
|
295
298
|
TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
|
|
296
299
|
TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
|
|
297
|
-
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents";
|
|
300
|
+
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents";
|
|
301
|
+
TreeFlags[TreeFlags["DisablePolyfaceDecimation"] = 32] = "DisablePolyfaceDecimation";
|
|
298
302
|
})(TreeFlags || (TreeFlags = {}));
|
|
299
303
|
function animationIdToString(animationId) {
|
|
300
304
|
return `A:${animationId}_`;
|
|
@@ -307,6 +311,8 @@ export function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
307
311
|
let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;
|
|
308
312
|
if (options.optimizeBRepProcessing)
|
|
309
313
|
flags |= TreeFlags.OptimizeBRepProcessing;
|
|
314
|
+
if (options.disablePolyfaceDecimation)
|
|
315
|
+
flags |= TreeFlags.DisablePolyfaceDecimation;
|
|
310
316
|
if (options.useLargerTiles)
|
|
311
317
|
flags |= TreeFlags.UseLargerTiles;
|
|
312
318
|
if (options.expandProjectExtents)
|
|
@@ -597,7 +603,7 @@ export function computeChildTileProps(parent, idProvider, root) {
|
|
|
597
603
|
/** Deserializes tile content metadata.
|
|
598
604
|
* @throws [[TileReadError]]
|
|
599
605
|
* @internal
|
|
600
|
-
* @deprecated in 4.0. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.
|
|
606
|
+
* @deprecated in 4.0 - will not be removed until after 2026-06-13. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.
|
|
601
607
|
*/
|
|
602
608
|
export function readTileContentDescription(stream, sizeMultiplier, is2d, options, isVolumeClassifier) {
|
|
603
609
|
return decodeTileContentDescription({ stream, sizeMultiplier, is2d, options, isVolumeClassifier });
|