@itwin/core-common 4.7.0-dev.0 → 4.7.0-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/lib/cjs/ChangesetProps.d.ts +3 -1
  3. package/lib/cjs/ChangesetProps.d.ts.map +1 -1
  4. package/lib/cjs/ChangesetProps.js +2 -0
  5. package/lib/cjs/ChangesetProps.js.map +1 -1
  6. package/lib/cjs/QPoint.d.ts +4 -3
  7. package/lib/cjs/QPoint.d.ts.map +1 -1
  8. package/lib/cjs/QPoint.js +2 -1
  9. package/lib/cjs/QPoint.js.map +1 -1
  10. package/lib/cjs/annotation/TextAnnotation.d.ts +41 -35
  11. package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -1
  12. package/lib/cjs/annotation/TextAnnotation.js +38 -17
  13. package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
  14. package/lib/cjs/annotation/TextBlock.d.ts +0 -38
  15. package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
  16. package/lib/cjs/annotation/TextBlock.js +0 -14
  17. package/lib/cjs/annotation/TextBlock.js.map +1 -1
  18. package/lib/cjs/annotation/TextBlockGeometryProps.d.ts +0 -4
  19. package/lib/cjs/annotation/TextBlockGeometryProps.d.ts.map +1 -1
  20. package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
  21. package/lib/cjs/annotation/TextStyle.d.ts +0 -12
  22. package/lib/cjs/annotation/TextStyle.d.ts.map +1 -1
  23. package/lib/cjs/annotation/TextStyle.js +0 -4
  24. package/lib/cjs/annotation/TextStyle.js.map +1 -1
  25. package/lib/cjs/geometry/ElementGeometry.d.ts +2 -4
  26. package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
  27. package/lib/cjs/geometry/ElementGeometry.js +2 -4
  28. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  29. package/lib/cjs/geometry/GeometryStream.d.ts +0 -2
  30. package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
  31. package/lib/cjs/geometry/GeometryStream.js +0 -2
  32. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  33. package/lib/cjs/rpc/core/RpcInvocation.js +1 -1
  34. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  35. package/lib/cjs/rpc/core/RpcMarshaling.d.ts.map +1 -1
  36. package/lib/cjs/rpc/core/RpcMarshaling.js +1 -2
  37. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  38. package/lib/cjs/rpc/core/RpcOperation.d.ts.map +1 -1
  39. package/lib/cjs/rpc/core/RpcOperation.js +1 -1
  40. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  41. package/lib/cjs/rpc/core/RpcProtocol.d.ts +1 -1
  42. package/lib/cjs/rpc/core/RpcProtocol.d.ts.map +1 -1
  43. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  44. package/lib/cjs/rpc/core/RpcRequest.d.ts +1 -1
  45. package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
  46. package/lib/cjs/rpc/core/RpcRequest.js +4 -2
  47. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  48. package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
  49. package/lib/cjs/tile/IModelTileIO.js +2 -2
  50. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  51. package/lib/cjs/tile/TileMetadata.d.ts +3 -1
  52. package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
  53. package/lib/cjs/tile/TileMetadata.js +9 -1
  54. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  55. package/lib/esm/ChangesetProps.d.ts +3 -1
  56. package/lib/esm/ChangesetProps.d.ts.map +1 -1
  57. package/lib/esm/ChangesetProps.js +2 -0
  58. package/lib/esm/ChangesetProps.js.map +1 -1
  59. package/lib/esm/QPoint.d.ts +4 -3
  60. package/lib/esm/QPoint.d.ts.map +1 -1
  61. package/lib/esm/QPoint.js +2 -1
  62. package/lib/esm/QPoint.js.map +1 -1
  63. package/lib/esm/annotation/TextAnnotation.d.ts +41 -35
  64. package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -1
  65. package/lib/esm/annotation/TextAnnotation.js +38 -17
  66. package/lib/esm/annotation/TextAnnotation.js.map +1 -1
  67. package/lib/esm/annotation/TextBlock.d.ts +0 -38
  68. package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
  69. package/lib/esm/annotation/TextBlock.js +0 -14
  70. package/lib/esm/annotation/TextBlock.js.map +1 -1
  71. package/lib/esm/annotation/TextBlockGeometryProps.d.ts +0 -4
  72. package/lib/esm/annotation/TextBlockGeometryProps.d.ts.map +1 -1
  73. package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
  74. package/lib/esm/annotation/TextStyle.d.ts +0 -12
  75. package/lib/esm/annotation/TextStyle.d.ts.map +1 -1
  76. package/lib/esm/annotation/TextStyle.js +0 -4
  77. package/lib/esm/annotation/TextStyle.js.map +1 -1
  78. package/lib/esm/geometry/ElementGeometry.d.ts +2 -4
  79. package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
  80. package/lib/esm/geometry/ElementGeometry.js +2 -4
  81. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  82. package/lib/esm/geometry/GeometryStream.d.ts +0 -2
  83. package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
  84. package/lib/esm/geometry/GeometryStream.js +0 -2
  85. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  86. package/lib/esm/rpc/core/RpcInvocation.js +1 -1
  87. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  88. package/lib/esm/rpc/core/RpcMarshaling.d.ts.map +1 -1
  89. package/lib/esm/rpc/core/RpcMarshaling.js +1 -2
  90. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  91. package/lib/esm/rpc/core/RpcOperation.d.ts.map +1 -1
  92. package/lib/esm/rpc/core/RpcOperation.js +1 -1
  93. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  94. package/lib/esm/rpc/core/RpcProtocol.d.ts +1 -1
  95. package/lib/esm/rpc/core/RpcProtocol.d.ts.map +1 -1
  96. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  97. package/lib/esm/rpc/core/RpcRequest.d.ts +1 -1
  98. package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
  99. package/lib/esm/rpc/core/RpcRequest.js +4 -2
  100. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  101. package/lib/esm/tile/IModelTileIO.d.ts +2 -2
  102. package/lib/esm/tile/IModelTileIO.js +2 -2
  103. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  104. package/lib/esm/tile/TileMetadata.d.ts +3 -1
  105. package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
  106. package/lib/esm/tile/TileMetadata.js +9 -1
  107. package/lib/esm/tile/TileMetadata.js.map +1 -1
  108. package/package.json +8 -8
@@ -215,8 +215,6 @@ export declare class GeometryStreamBuilder {
215
215
  appendTextString(textString: TextString): boolean;
216
216
  /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.
217
217
  * @beta
218
- * @extensions
219
- * @preview
220
218
  */
221
219
  appendTextBlock(block: TextBlockGeometryProps): boolean;
222
220
  /** Append an [[ImageGraphic]] supplied in either local or world coordinates. */
@@ -1 +1 @@
1
- {"version":3,"file":"GeometryStream.d.ts","sourceRoot":"","sources":["../../../src/geometry/GeometryStream.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EACL,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,IAAI,QAAQ,EAAiB,aAAa,EAAY,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAClJ,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,EAC1D,MAAM,sBAAsB,CAAC;AAC9B,OA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KAAK,KAAK,GAKhB;IAED;;;OAGG;WACW,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;IAW9G;;;OAGG;WACW,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;IAc9G;;;;;;OAMG;WACW,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,SAAS;IAOhI,+HAA+H;IACxH,WAAW,IAAI,SAAS,GAAG,SAAS;IAW3C;;OAEG;IACI,IAAI,IAAI,cAAc,CAAC,2BAA2B,CAAC;IAwGnD,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,2BAA2B,CAAC;IAIzE,gBAAgB;IAChB,IAAW,iBAAiB,IAAI,OAAO,CAA4F;CACpI"}
@@ -179,8 +179,6 @@ export class GeometryStreamBuilder {
179
179
  }
180
180
  /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.
181
181
  * @beta
182
- * @extensions
183
- * @preview
184
182
  */
185
183
  appendTextBlock(block) {
186
184
  for (const entry of block.entries) {
@@ -1 +1 @@
1
- {"version":3,"file":"GeometryStream.js","sourceRoot":"","sources":["../../../src/geometry/GeometryStream.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EACL,KAAK,EAAoB,aAAa,EAAE,UAAU,IAAI,QAAQ,EAAE,aAAa,EAAiB,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAC5I,QAAQ,EAAY,kBAAkB,GACvC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAiB,MAA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E,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,iBAAiB,KAAc,OAAO,mBAAmB,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CACpI","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 Geometry\n */\n\nimport { Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, AnyGeometryQuery, GeometryQuery, IModelJson as GeomJson, LineSegment3d, LowAndHighXYZ, Matrix3d, Point2d, Point3d, Range3d, Transform, TransformProps,\n Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\nimport { GeometricElement2dProps, GeometricElement3dProps, GeometryPartProps, isPlacement2dProps, PlacementProps } from \"../ElementProps\";\nimport { BackgroundFill, FillDisplay, GeometryClass, GeometryParams } from \"../GeometryParams\";\nimport { Gradient } from \"../Gradient\";\nimport { IModelError } from \"../IModelError\";\nimport { AreaPattern } from \"./AreaPattern\";\nimport { ImageGraphic, ImageGraphicProps } from \"./ImageGraphic\";\nimport { LineStyle } from \"./LineStyle\";\nimport { TextString, TextStringProps } from \"./TextString\";\nimport { Base64EncodedString } from \"../Base64EncodedString\";\nimport { Placement2d, Placement3d } from \"./Placement\";\nimport { TextBlockGeometryProps } from \"../annotation/TextBlockGeometryProps\";\n\n/** Establish a non-default [[SubCategory]] or to override [[SubCategoryAppearance]] for the geometry that follows.\n * A GeometryAppearanceProps always signifies a reset to the [[SubCategoryAppearance]] for subsequent [[GeometryStreamProps]] entries for undefined values.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryAppearanceProps {\n /** Optional [[SubCategory]] id for subsequent geometry. Use to create a GeometryStream with geometry that is not on the default [[SubCategory]] for the element's [[Category]] or is has geometry on multiple subCategories. */\n subCategory?: Id64String;\n /** Optional color to override [[SubCategoryAppearance.color]] for subsequent geometry. */\n color?: ColorDefProps;\n /** Optional weight to override [[SubCategoryAppearance.weight]] for subsequent geometry. */\n weight?: number;\n /** Optional style to override [[SubCategoryAppearance.styleId]] for subsequent geometry. */\n style?: Id64String;\n /** Optional transparency, 0.0 if undefined. Effective transparency is a combination of this value and [[SubCategoryAppearance.color]]. */\n transparency?: number;\n /** Optional display priority (2d only), 0 if undefined. Effective display priority is a combination of this value and [[SubCategoryAppearance.priority]]. */\n displayPriority?: number;\n /** Optional GeometryClass (for DGN compatibility, subCategories preferred), [[GeometryClass.Primary]] if undefined. */\n geometryClass?: GeometryClass;\n}\n\n/** Add a [[gradient]], [[backgroundFill]], or solid [[color]] fill to subsequent planar regions (or meshes).\n * Only one value among [[gradient]], [[backgroundFill]], and [[color]] should be set.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface AreaFillProps {\n /** Fill display type, must be set to something other than [[FillDisplay.Never]] to display fill */\n display: FillDisplay;\n /** Optional fill transparency, will be the same as outline transparency if undefined. Allows for different fill and outline transparencies */\n transparency?: number;\n /** Set fill color to view background color. Use [[BackgroundFill.Solid]] for an opaque fill and [[BackgroundFill.Outline]] to display an outline using the line color */\n backgroundFill?: BackgroundFill;\n /** Set fill color to a specific color. If the fill color the same as the line color, it is an opaque fill, otherwise it is an outline fill */\n color?: ColorDefProps;\n /** Set fill using gradient properties. */\n gradient?: Gradient.SymbProps;\n}\n\n/** Override [[SubCategoryAppearance.materialId]] for subsequent surface and solid geometry.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface MaterialProps {\n /** Material id to use, specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material. */\n materialId?: Id64String;\n /** @internal */\n origin?: XYZProps;\n /** @internal */\n size?: XYZProps;\n /** @internal */\n rotation?: YawPitchRollProps;\n}\n\n/** JSON representation of a brep GeometryStream entry.\n * @public\n */\nexport namespace BRepEntity {\n /** Enum for type of solid kernel entity this represents */\n export enum Type {\n /** Body consisting of at least one solid region */\n Solid = 0,\n /** Body consisting of connected sets of faces having edges that are shared by a maximum of two faces */\n Sheet = 1,\n /** Body consisting of connected sets of edges having vertices that are shared by a maximum of two edges */\n Wire = 2,\n }\n\n /** Optional symbology that can be assigned to individual faces of a solid or sheet body */\n export interface FaceSymbologyProps {\n /** Optional color override for face */\n color?: ColorDefProps;\n /** Optional transparency override for face */\n transparency?: number;\n /** Optional material override for face */\n materialId?: Id64String;\n }\n\n /** Geometry entry representing raw brep data.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface DataProps {\n /** data as Base64 encoded string. Must be specifically requested using [[ElementLoadProps.wantBRepData]]. */\n data?: Base64EncodedString;\n /** body type, default is Solid */\n type?: Type;\n /** body transform, default is identity */\n transform?: TransformProps;\n /** body face attachments */\n faceSymbology?: FaceSymbologyProps[];\n }\n}\n\n/** Add a reference to a [[GeometryPart]] from the GeometryStream of a [[GeometricElement]].\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryPartInstanceProps {\n /** GeometryPart id */\n part: Id64String;\n /** Optional translation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/translation, supply non-zero x and y only */\n origin?: XYZProps;\n /** Optional rotation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/rotation, supply a non-zero yaw angle only */\n rotation?: YawPitchRollProps;\n /** Optional scale to apply to part, 1.0 if undefined */\n scale?: number;\n}\n\n/** Flags applied to the entire contents of a [[GeometryStreamProps]].\n * @see GeometryStreamHeaderProps\n * @public\n * @extensions\n */\nexport enum GeometryStreamFlags {\n /** No flags. */\n None = 0,\n /** When the geometry is displayed, it is always oriented to face the viewer. The placement origin of the element associated with the geometry is used as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume.\n */\n ViewIndependent = 1 << 0,\n}\n\n/** An entry in a [[GeometryStreamProps]] containing [[GeometryStreamFlags]] that apply to the geometry stream as a whole.\n * If this entry exists in the [[GeometryStreamProps]] array, it will always be the *first* entry.\n * @public\n * @extensions\n */\nexport interface GeometryStreamHeaderProps {\n /** The flags applied to the geometry stream. */\n flags: GeometryStreamFlags;\n}\n\n/** Allowed GeometryStream entries - should only set one value.\n * @see [GeometryStream]($docs/learning/common/geometrystream.md)\n * @public\n * @extensions\n */\nexport interface GeometryStreamEntryProps extends GeomJson.GeometryProps {\n header?: GeometryStreamHeaderProps;\n appearance?: GeometryAppearanceProps;\n styleMod?: LineStyle.ModifierProps;\n fill?: AreaFillProps;\n pattern?: AreaPattern.ParamsProps;\n material?: MaterialProps;\n geomPart?: GeometryPartInstanceProps;\n textString?: TextStringProps;\n brep?: BRepEntity.DataProps;\n image?: ImageGraphicProps;\n subRange?: LowAndHighXYZ;\n}\n\n/** A [[GeometricElement]]'s GeometryStream is represented by an array of [[GeometryStreamEntryProps]].\n * @public\n * @extensions\n */\nexport type GeometryStreamProps = GeometryStreamEntryProps[];\n\n/** GeometryStreamBuilder is a helper class for populating the [[GeometryStreamProps]] array needed to create a [[GeometricElement]] or [[GeometryPart]].\n * @public\n */\nexport class GeometryStreamBuilder {\n /** Current inverse placement transform, used for converting world coordinate input to be placement relative */\n private _worldToLocal?: Transform;\n /** GeometryStream entries */\n public readonly geometryStream: GeometryStreamProps = [];\n\n /** Supply optional local to world transform. Used to transform world coordinate input relative to element placement.\n * For a [[GeometricElement]]'s placement to be meaningful, world coordinate geometry should never be appended to an element with an identity placement.\n * Can be called with undefined or identity transform to start appending geometry supplied in local coordinates again.\n */\n public setLocalToWorld(localToWorld?: Transform) {\n this._worldToLocal = (undefined === localToWorld || localToWorld.isIdentity ? undefined : localToWorld.inverse());\n }\n\n /** Supply local to world transform from a Point3d and optional YawPitchRollAngles.\n * @see [[Placement3d]]\n */\n public setLocalToWorld3d(origin: Point3d, angles: YawPitchRollAngles = YawPitchRollAngles.createDegrees(0.0, 0.0, 0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(origin, angles.toMatrix3d()));\n }\n\n /** Supply local to world transform from a Point2d and optional Angle.\n * @see [[Placement2d]]\n */\n public setLocalToWorld2d(origin: Point2d, angle: Angle = Angle.createDegrees(0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(Point3d.createFrom(origin), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), angle)));\n }\n\n /** Supply local to world transform from a PlacementProps2d or PlacementProps3d.\n * @see [[PlacementProps]]\n */\n public setLocalToWorldFromPlacement(props: PlacementProps) {\n const placement = isPlacement2dProps(props) ? Placement2d.fromJSON(props) : Placement3d.fromJSON(props);\n this.setLocalToWorld(placement.transform);\n }\n\n /** Store local ranges in GeometryStream for all subsequent geometry appended. Can improve performance of range testing for elements with a GeometryStream\n * containing more than one [[GeometryQuery]] differentiable by range. Not useful for a single [[GeometryQuery]] as its range and that of the [[GeometricElement]] are the same.\n * Ignored when defining a [[GeometryPart]] and not needed when only appending [[GeometryPart]] instances to a [[GeometricElement]] as these store their own range.\n */\n public appendGeometryRanges() {\n this.geometryStream.push({ subRange: Range3d.createNull() });\n }\n\n /** Change [[SubCategory]] or reset to [[SubCategoryAppearance]] for subsequent geometry.\n * An invalid sub-category id can be supplied to force a reset to the current [[SubCategoryAppearance]].\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherit the symbology of their instance for anything not explicitly overridden.\n */\n public appendSubCategoryChange(subCategoryId: Id64String): boolean {\n this.geometryStream.push({ appearance: { subCategory: subCategoryId } });\n return true;\n }\n\n /** Change [[GeometryParams]] for subsequent geometry.\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherits the symbology of their instance for anything not explicitly overridden.\n */\n public appendGeometryParamsChange(geomParams: GeometryParams): boolean {\n const appearance: GeometryAppearanceProps = {\n subCategory: geomParams.subCategoryId,\n color: geomParams.lineColor?.toJSON(),\n weight: geomParams.weight,\n style: geomParams.styleInfo?.styleId,\n transparency: geomParams.elmTransparency,\n displayPriority: geomParams.elmPriority,\n geometryClass: geomParams.geometryClass,\n };\n this.geometryStream.push({ appearance });\n\n if (undefined !== geomParams.materialId)\n this.geometryStream.push({ material: { materialId: geomParams.materialId } });\n\n if (undefined !== geomParams.fillDisplay && FillDisplay.Never !== geomParams.fillDisplay) {\n const fill: AreaFillProps = {\n display: geomParams.fillDisplay,\n transparency: geomParams.fillTransparency,\n };\n if (undefined !== geomParams.gradient && Gradient.Mode.None !== geomParams.gradient.mode)\n fill.gradient = geomParams.gradient?.toJSON();\n else if (undefined !== geomParams.backgroundFill && BackgroundFill.None !== geomParams.backgroundFill)\n fill.backgroundFill = geomParams.backgroundFill;\n else if (undefined !== geomParams.fillColor)\n fill.color = geomParams.fillColor.toJSON();\n this.geometryStream.push({ fill });\n }\n\n if (undefined !== geomParams.pattern) {\n const localPattern = this._worldToLocal ? geomParams.pattern.clone() : geomParams.pattern;\n if (undefined !== this._worldToLocal && !localPattern.applyTransform(this._worldToLocal))\n return false;\n\n this.geometryStream.push({ pattern: localPattern.toJSON() });\n }\n\n if (undefined !== geomParams.styleInfo && undefined !== geomParams.styleInfo.styleMod) {\n const localStyleMod = new LineStyle.Modifier(geomParams.styleInfo.styleMod);\n if (undefined !== this._worldToLocal && !localStyleMod.applyTransform(this._worldToLocal))\n return false;\n this.geometryStream.push({ styleMod: localStyleMod });\n }\n\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement3d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart3d(partId: Id64String, instanceOrigin?: Point3d, instanceRotation?: YawPitchRollAngles, instanceScale?: number): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ geomPart: { part: partId, origin: instanceOrigin, rotation: instanceRotation, scale: instanceScale } });\n return true;\n }\n const partTrans = Transform.createOriginAndMatrix(instanceOrigin, instanceRotation ? instanceRotation.toMatrix3d() : Matrix3d.createIdentity());\n if (undefined !== instanceScale)\n partTrans.matrix.scaleColumnsInPlace(instanceScale, instanceScale, instanceScale);\n const resultTrans = this._worldToLocal.multiplyTransformTransform(partTrans);\n const scales = new Vector3d();\n if (!resultTrans.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(resultTrans.matrix);\n if (undefined === newRotation)\n return false;\n this.geometryStream.push({ geomPart: { part: partId, origin: resultTrans.getOrigin(), rotation: newRotation, scale: scales.x } });\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement2d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart2d(partId: Id64String, instanceOrigin?: Point2d, instanceRotation?: Angle, instanceScale?: number): boolean {\n return this.appendGeometryPart3d(partId, instanceOrigin ? Point3d.createFrom(instanceOrigin) : undefined, instanceRotation ? new YawPitchRollAngles(instanceRotation) : undefined, instanceScale);\n }\n\n /** Append a [[TextString]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendTextString(textString: TextString): boolean {\n if (this._worldToLocal) {\n textString = new TextString(textString);\n if (!textString.transformInPlace(this._worldToLocal)) {\n return false;\n }\n }\n\n this.geometryStream.push({ textString: textString.toJSON() });\n return true;\n }\n\n /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.\n * @beta\n * @extensions\n * @preview\n */\n public appendTextBlock(block: TextBlockGeometryProps): boolean {\n for (const entry of block.entries) {\n let result: boolean;\n if (entry.text) {\n result = this.appendTextString(new TextString(entry.text));\n } else if (entry.color) {\n if (entry.color === \"subcategory\") {\n result = this.appendSubCategoryChange(Id64.invalid);\n } else {\n this.geometryStream.push({ appearance: { color: entry.color } });\n result = true;\n }\n } else {\n result = this.appendGeometry(LineSegment3d.fromJSON(entry.separator));\n }\n\n if (!result) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Append an [[ImageGraphic]] supplied in either local or world coordinates. */\n public appendImage(image: ImageGraphic): boolean {\n if (undefined !== this._worldToLocal)\n image = image.cloneTransformed(this._worldToLocal);\n\n this.geometryStream.push({ image: image.toJSON() });\n return true;\n }\n\n /** Append a [[GeometryQuery]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendGeometry(geometry: GeometryQuery): boolean {\n if (undefined === this._worldToLocal) {\n const geomData = GeomJson.Writer.toIModelJson(geometry);\n if (undefined === geomData)\n return false;\n this.geometryStream.push(geomData);\n return true;\n }\n const localGeometry = geometry.cloneTransformed(this._worldToLocal);\n if (undefined === localGeometry)\n return false;\n const localGeomData = GeomJson.Writer.toIModelJson(localGeometry);\n if (undefined === localGeomData)\n return false;\n this.geometryStream.push(localGeomData);\n return true;\n }\n\n /** Append [[BRepEntity.DataProps]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array\n * @beta\n */\n public appendBRepData(brep: BRepEntity.DataProps): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ brep });\n return true;\n }\n const entityTrans = Transform.fromJSON(brep.transform);\n const localTrans = entityTrans.multiplyTransformTransform(this._worldToLocal);\n const localBrep: BRepEntity.DataProps = {\n data: brep.data,\n type: brep.type,\n transform: localTrans.isIdentity ? undefined : localTrans.toJSON(),\n faceSymbology: brep.faceSymbology,\n };\n this.geometryStream.push({ brep: localBrep });\n return true;\n }\n\n /** @internal */\n public getHeader(): GeometryStreamHeaderProps | undefined {\n return 0 < this.geometryStream.length ? this.geometryStream[0].header : undefined;\n }\n\n /** @internal */\n public obtainHeader(): GeometryStreamHeaderProps {\n const hdr = this.getHeader();\n if (undefined !== hdr)\n return hdr;\n\n const entry = { header: { flags: GeometryStreamFlags.None } };\n this.geometryStream.unshift(entry);\n return entry.header;\n }\n\n /** Controls whether or not the geometry in the stream should be displayed as view-independent.\n * When view-independent geometry is displayed, it is always oriented to face the viewer, using the placement origin of the element as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume\n * @public\n */\n public get isViewIndependent(): boolean {\n const hdr = this.getHeader();\n return undefined !== hdr && GeometryStreamFlags.None !== (hdr.flags & GeometryStreamFlags.ViewIndependent);\n }\n public set isViewIndependent(viewIndependent: boolean) {\n if (viewIndependent === this.isViewIndependent)\n return;\n\n const hdr = this.obtainHeader();\n if (viewIndependent)\n hdr.flags |= GeometryStreamFlags.ViewIndependent;\n else\n hdr.flags &= ~GeometryStreamFlags.ViewIndependent;\n }\n}\n\n/** Represents a text string within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface TextStringPrimitive {\n type: \"textString\";\n readonly textString: TextString;\n}\n\n/** Represents an image within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface ImagePrimitive {\n type: \"image\";\n readonly image: ImageGraphic;\n}\n\n/** Represents a reference to a GeometryPart within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface PartReference {\n type: \"partReference\";\n part: {\n id: Id64String;\n readonly toLocal?: Transform;\n };\n}\n\n/** Represents a BRep within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface BRepPrimitive {\n type: \"brep\";\n /** @beta */\n readonly brep: BRepEntity.DataProps;\n}\n\n/** Represents one of a variety of GeometryQuery objects within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface GeometryPrimitive {\n type: \"geometryQuery\";\n readonly geometry: AnyGeometryQuery;\n}\n\n/** Union of all possible geometric primitive types that may appear within a GeometryStream.\n * @public\n * @extensions\n */\nexport type GeometryStreamPrimitive = TextStringPrimitive | PartReference | BRepPrimitive | GeometryPrimitive | ImagePrimitive;\n\n/** Holds current state information for [[GeometryStreamIterator]]. Each entry represents exactly one geometry primitive in the stream.\n * @public\n * @extensions\n */\nexport interface GeometryStreamIteratorEntry {\n /** A [[GeometryParams]] representing the appearance of the current geometric entry */\n readonly geomParams: GeometryParams;\n /** Placement transform, used for converting placement relative, local coordinate entries to world */\n readonly localToWorld?: Transform;\n /** Optional stored local range for the current geometric entry */\n readonly localRange?: Range3d;\n /** Returns the geometric primitive represented by this entry. */\n readonly primitive: GeometryStreamPrimitive;\n}\n\nclass IteratorEntry implements GeometryStreamIteratorEntry {\n private _primitive?: GeometryStreamPrimitive;\n public readonly geomParams: GeometryParams;\n public readonly localToWorld?: Transform;\n public localRange?: Range3d;\n\n public constructor(appearance: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geomParams = typeof appearance === \"string\" ? new GeometryParams(appearance) : appearance;\n this.localToWorld = localToWorld;\n }\n\n public get primitive() { return this._primitive!; }\n public set primitive(primitive: GeometryStreamPrimitive) { this._primitive = primitive; }\n\n public setGeometryQuery(geometry: AnyGeometryQuery) { this._primitive = { type: \"geometryQuery\", geometry }; }\n public setTextString(textString: TextString) { this._primitive = { type: \"textString\", textString }; }\n public setBRep(brep: BRepEntity.DataProps) { this._primitive = { type: \"brep\", brep }; }\n public setImage(image: ImageGraphic) { this._primitive = { type: \"image\", image }; }\n public setPartReference(id: Id64String, toLocal?: Transform) {\n this._primitive = {\n type: \"partReference\",\n part: { id, toLocal },\n };\n }\n}\n\n/** GeometryStreamIterator is a helper class for iterating a [[GeometryStreamProps]].\n * A [[GeometricElement]]'s GeometryStream must be specifically requested using [[ElementLoadProps.wantGeometry]].\n * Each [[GeometryStreamIteratorEntry]] returned by the iterator represents exactly one geometric primitive in the stream.\n * @public\n */\nexport class GeometryStreamIterator implements IterableIterator<GeometryStreamIteratorEntry> {\n /** GeometryStream entries */\n public geometryStream: GeometryStreamProps;\n /** Flags applied to the entire geometry stream. */\n public readonly flags: GeometryStreamFlags;\n /** Current entry position */\n private _index = 0;\n /** Allocated on first call to next() and reused thereafter. */\n private _entry?: IteratorEntry;\n /** Used to initialize this._entry. */\n private readonly _appearance: Id64String | GeometryParams;\n private readonly _localToWorld?: Transform;\n\n /** Construct a new GeometryStreamIterator given a [[GeometryStreamProps]] from either a [[GeometricElement3d]], [[GeometricElement2d]], or [[GeometryPart]].\n * Supply the [[GeometricElement]]'s category to initialize the appearance information for each geometric entry.\n */\n public constructor(geometryStream: GeometryStreamProps, categoryOrGeometryParams?: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geometryStream = geometryStream;\n this._appearance = categoryOrGeometryParams ?? Id64.invalid;\n this._localToWorld = localToWorld;\n if (0 < geometryStream.length && undefined !== geometryStream[0].header) {\n this.flags = geometryStream[0].header.flags;\n ++this._index;\n } else {\n this.flags = GeometryStreamFlags.None;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get entry() {\n if (undefined === this._entry)\n this._entry = new IteratorEntry(this._appearance, this._localToWorld);\n\n return this._entry;\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement3d]].\n * If [[GeometricElement3dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement3d(element: Pick<GeometricElement3dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined)\n transform = Transform.createOriginAndMatrix(Point3d.fromJSON(element.placement.origin), YawPitchRollAngles.fromJSON(element.placement.angles).toMatrix3d());\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement2d]].\n * If [[GeometricElement2dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement2d(element: Pick<GeometricElement2dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined) {\n const origin = Point3d.createFrom(Point2d.fromJSON(element.placement.origin));\n const matrix = Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.fromJSON(element.placement.angle))!;\n transform = Transform.createOriginAndMatrix(origin, matrix);\n }\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometryPart]].\n * To iterate a part's GeometryStream in the context of a part instance found for a [[GeometricElement]], provide the optional [[GeometryParams]] and Transform from the [[GeometricElement]]'s [[GeometryStreamIterator]].\n * Supply the [[GeometryParams]] to return appearance information as inherited from the [[GeometricElement]].\n * Supply the partToWorld transform to return the part geometry in world coordinates.\n * Supply the partToLocal transform to return the part geometry relative to the [[GeometricElement]]'s placement.\n * @throws [[IModelError]] if geomPart.geom is undefined.\n */\n public static fromGeometryPart(geomPart: Pick<GeometryPartProps, \"geom\">, geomParams?: GeometryParams, partTransform?: Transform) {\n if (geomPart.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometryPart has no geometry or geometry wasn't requested\");\n\n return new GeometryStreamIterator(geomPart.geom, geomParams?.clone(), partTransform);\n }\n\n /** Get the transform that if applied to a [[GeometryPart]]'s GeometryStream entries would return them in world coordinates. */\n public partToWorld(): Transform | undefined {\n if (undefined === this._entry)\n return this._localToWorld;\n\n const partToLocal = \"partReference\" === this._entry.primitive.type ? this._entry.primitive.part.toLocal : undefined;\n if (this._entry.localToWorld === undefined || partToLocal === undefined)\n return this._entry.localToWorld;\n\n return this._entry.localToWorld.multiplyTransformTransform(partToLocal);\n }\n\n /** Advance to next displayable geometric entry while updating the current [[GeometryParams]] from appearance related entries.\n * Geometric entries are [[TextString]], [[GeometryQuery]], [[GeometryPart]], [[ImageGraphic]], and [[BRepEntity.DataProps]].\n */\n public next(): IteratorResult<GeometryStreamIteratorEntry> {\n // NOTE: localRange remains valid until we encounter either a new subRange entry or a geometry part reference.\n while (this._index < this.geometryStream.length) {\n const entry = this.geometryStream[this._index++];\n if (entry.appearance) {\n this.entry.geomParams.resetAppearance();\n if (entry.appearance.subCategory)\n this.entry.geomParams.subCategoryId = Id64.fromJSON(entry.appearance.subCategory);\n if (undefined !== entry.appearance.color)\n this.entry.geomParams.lineColor = ColorDef.fromJSON(entry.appearance.color);\n if (undefined !== entry.appearance.weight)\n this.entry.geomParams.weight = entry.appearance.weight;\n if (undefined !== entry.appearance.style)\n this.entry.geomParams.styleInfo = new LineStyle.Info(Id64.fromJSON(entry.appearance.style));\n if (undefined !== entry.appearance.transparency)\n this.entry.geomParams.elmTransparency = entry.appearance.transparency;\n if (undefined !== entry.appearance.displayPriority)\n this.entry.geomParams.elmPriority = entry.appearance.displayPriority;\n if (undefined !== entry.appearance.geometryClass)\n this.entry.geomParams.geometryClass = entry.appearance.geometryClass;\n } else if (entry.styleMod) {\n if (this.entry.geomParams.styleInfo === undefined)\n continue;\n\n const styleMod = new LineStyle.Modifier(entry.styleMod);\n if (this.entry.localToWorld !== undefined)\n styleMod.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.styleInfo = new LineStyle.Info(this.entry.geomParams.styleInfo.styleId, styleMod);\n } else if (entry.fill) {\n if (entry.fill.display)\n this.entry.geomParams.fillDisplay = entry.fill.display;\n if (entry.fill.transparency)\n this.entry.geomParams.fillTransparency = entry.fill.transparency;\n if (entry.fill.gradient)\n this.entry.geomParams.gradient = Gradient.Symb.fromJSON(entry.fill.gradient);\n else if (entry.fill.backgroundFill)\n this.entry.geomParams.backgroundFill = entry.fill.backgroundFill;\n else if (entry.fill.color)\n this.entry.geomParams.fillColor = ColorDef.fromJSON(entry.fill.color);\n } else if (entry.pattern) {\n const params = AreaPattern.Params.fromJSON(entry.pattern);\n if (this.entry.localToWorld !== undefined)\n params.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.pattern = params;\n } else if (entry.material) {\n if (entry.material.materialId)\n this.entry.geomParams.materialId = Id64.fromJSON(entry.material.materialId);\n } else if (entry.subRange) {\n this.entry.localRange = Range3d.fromJSON(entry.subRange);\n } else if (entry.geomPart) {\n let transform;\n if (entry.geomPart.origin !== undefined || entry.geomPart.rotation !== undefined || entry.geomPart.scale !== undefined) {\n const origin = entry.geomPart.origin ? Point3d.fromJSON(entry.geomPart.origin) : Point3d.createZero();\n const rotation = entry.geomPart.rotation ? YawPitchRollAngles.fromJSON(entry.geomPart.rotation).toMatrix3d() : Matrix3d.createIdentity();\n transform = Transform.createRefs(origin, rotation);\n if (entry.geomPart.scale)\n transform.multiplyTransformTransform(Transform.createRefs(Point3d.createZero(), Matrix3d.createUniformScale(entry.geomPart.scale)), transform);\n }\n\n // Subgraphic range doesn't apply to parts. A sane geometry stream (i.e., any that has been through the native layers or GeometryStreamBuilder)\n // will have a new subgraphic range for any geometric primitive following the part.\n this.entry.localRange = undefined;\n this.entry.setPartReference(Id64.fromJSON(entry.geomPart.part), transform);\n return { value: this.entry, done: false };\n } else if (entry.textString) {\n const textString = new TextString(entry.textString);\n if (this.entry.localToWorld !== undefined)\n textString.transformInPlace(this.entry.localToWorld);\n\n this.entry.setTextString(textString);\n return { value: this.entry, done: false };\n } else if (entry.image) {\n const image = ImageGraphic.fromJSON(entry.image);\n if (undefined !== this.entry.localToWorld)\n image.transformInPlace(this.entry.localToWorld);\n\n this.entry.setImage(image);\n return { value: this.entry, done: false };\n } else if (entry.brep) {\n if (this.entry.localToWorld !== undefined) {\n const entityTrans = Transform.fromJSON(entry.brep.transform);\n entry.brep.transform = entityTrans.multiplyTransformTransform(this.entry.localToWorld).toJSON();\n }\n\n this.entry.setBRep(entry.brep);\n return { value: this.entry, done: false };\n } else {\n const geometryQuery = GeomJson.Reader.parse(entry);\n if (!(geometryQuery instanceof GeometryQuery))\n continue;\n\n if (this.entry.localToWorld !== undefined)\n geometryQuery.tryTransformInPlace(this.entry.localToWorld);\n\n this.entry.setGeometryQuery(geometryQuery);\n return { value: this.entry, done: false };\n }\n }\n\n return { value: this.entry, done: true };\n }\n\n public [Symbol.iterator](): IterableIterator<GeometryStreamIteratorEntry> {\n return this;\n }\n\n /** @internal */\n public get isViewIndependent(): boolean { return GeometryStreamFlags.None !== (this.flags & GeometryStreamFlags.ViewIndependent); }\n}\n"]}
1
+ {"version":3,"file":"GeometryStream.js","sourceRoot":"","sources":["../../../src/geometry/GeometryStream.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EACL,KAAK,EAAoB,aAAa,EAAE,UAAU,IAAI,QAAQ,EAAE,aAAa,EAAiB,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAC5I,QAAQ,EAAY,kBAAkB,GACvC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;AACtD,OAAO,EAAuE,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAC1I,OAAO,EAAE,cAAc,EAAE,WAAW,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA6DvD;;GAEG;AACH,MAAM,KAAW,UAAU,CAkC1B;AAlCD,WAAiB,UAAU;IACzB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I,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC;gBAClG,CAAC;gBAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC/B,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACN,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACnD,IAAI,CAAC,CAAC,aAAa,YAAY,aAAa,CAAC;oBAC3C,SAAS;gBAEX,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS;oBACvC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAE7D,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;gBAC3C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,iBAAiB,KAAc,OAAO,mBAAmB,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CACpI","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 Geometry\n */\n\nimport { Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, AnyGeometryQuery, GeometryQuery, IModelJson as GeomJson, LineSegment3d, LowAndHighXYZ, Matrix3d, Point2d, Point3d, Range3d, Transform, TransformProps,\n Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\nimport { GeometricElement2dProps, GeometricElement3dProps, GeometryPartProps, isPlacement2dProps, PlacementProps } from \"../ElementProps\";\nimport { BackgroundFill, FillDisplay, GeometryClass, GeometryParams } from \"../GeometryParams\";\nimport { Gradient } from \"../Gradient\";\nimport { IModelError } from \"../IModelError\";\nimport { AreaPattern } from \"./AreaPattern\";\nimport { ImageGraphic, ImageGraphicProps } from \"./ImageGraphic\";\nimport { LineStyle } from \"./LineStyle\";\nimport { TextString, TextStringProps } from \"./TextString\";\nimport { Base64EncodedString } from \"../Base64EncodedString\";\nimport { Placement2d, Placement3d } from \"./Placement\";\nimport { TextBlockGeometryProps } from \"../annotation/TextBlockGeometryProps\";\n\n/** Establish a non-default [[SubCategory]] or to override [[SubCategoryAppearance]] for the geometry that follows.\n * A GeometryAppearanceProps always signifies a reset to the [[SubCategoryAppearance]] for subsequent [[GeometryStreamProps]] entries for undefined values.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryAppearanceProps {\n /** Optional [[SubCategory]] id for subsequent geometry. Use to create a GeometryStream with geometry that is not on the default [[SubCategory]] for the element's [[Category]] or is has geometry on multiple subCategories. */\n subCategory?: Id64String;\n /** Optional color to override [[SubCategoryAppearance.color]] for subsequent geometry. */\n color?: ColorDefProps;\n /** Optional weight to override [[SubCategoryAppearance.weight]] for subsequent geometry. */\n weight?: number;\n /** Optional style to override [[SubCategoryAppearance.styleId]] for subsequent geometry. */\n style?: Id64String;\n /** Optional transparency, 0.0 if undefined. Effective transparency is a combination of this value and [[SubCategoryAppearance.color]]. */\n transparency?: number;\n /** Optional display priority (2d only), 0 if undefined. Effective display priority is a combination of this value and [[SubCategoryAppearance.priority]]. */\n displayPriority?: number;\n /** Optional GeometryClass (for DGN compatibility, subCategories preferred), [[GeometryClass.Primary]] if undefined. */\n geometryClass?: GeometryClass;\n}\n\n/** Add a [[gradient]], [[backgroundFill]], or solid [[color]] fill to subsequent planar regions (or meshes).\n * Only one value among [[gradient]], [[backgroundFill]], and [[color]] should be set.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface AreaFillProps {\n /** Fill display type, must be set to something other than [[FillDisplay.Never]] to display fill */\n display: FillDisplay;\n /** Optional fill transparency, will be the same as outline transparency if undefined. Allows for different fill and outline transparencies */\n transparency?: number;\n /** Set fill color to view background color. Use [[BackgroundFill.Solid]] for an opaque fill and [[BackgroundFill.Outline]] to display an outline using the line color */\n backgroundFill?: BackgroundFill;\n /** Set fill color to a specific color. If the fill color the same as the line color, it is an opaque fill, otherwise it is an outline fill */\n color?: ColorDefProps;\n /** Set fill using gradient properties. */\n gradient?: Gradient.SymbProps;\n}\n\n/** Override [[SubCategoryAppearance.materialId]] for subsequent surface and solid geometry.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface MaterialProps {\n /** Material id to use, specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material. */\n materialId?: Id64String;\n /** @internal */\n origin?: XYZProps;\n /** @internal */\n size?: XYZProps;\n /** @internal */\n rotation?: YawPitchRollProps;\n}\n\n/** JSON representation of a brep GeometryStream entry.\n * @public\n */\nexport namespace BRepEntity {\n /** Enum for type of solid kernel entity this represents */\n export enum Type {\n /** Body consisting of at least one solid region */\n Solid = 0,\n /** Body consisting of connected sets of faces having edges that are shared by a maximum of two faces */\n Sheet = 1,\n /** Body consisting of connected sets of edges having vertices that are shared by a maximum of two edges */\n Wire = 2,\n }\n\n /** Optional symbology that can be assigned to individual faces of a solid or sheet body */\n export interface FaceSymbologyProps {\n /** Optional color override for face */\n color?: ColorDefProps;\n /** Optional transparency override for face */\n transparency?: number;\n /** Optional material override for face */\n materialId?: Id64String;\n }\n\n /** Geometry entry representing raw brep data.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface DataProps {\n /** data as Base64 encoded string. Must be specifically requested using [[ElementLoadProps.wantBRepData]]. */\n data?: Base64EncodedString;\n /** body type, default is Solid */\n type?: Type;\n /** body transform, default is identity */\n transform?: TransformProps;\n /** body face attachments */\n faceSymbology?: FaceSymbologyProps[];\n }\n}\n\n/** Add a reference to a [[GeometryPart]] from the GeometryStream of a [[GeometricElement]].\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryPartInstanceProps {\n /** GeometryPart id */\n part: Id64String;\n /** Optional translation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/translation, supply non-zero x and y only */\n origin?: XYZProps;\n /** Optional rotation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/rotation, supply a non-zero yaw angle only */\n rotation?: YawPitchRollProps;\n /** Optional scale to apply to part, 1.0 if undefined */\n scale?: number;\n}\n\n/** Flags applied to the entire contents of a [[GeometryStreamProps]].\n * @see GeometryStreamHeaderProps\n * @public\n * @extensions\n */\nexport enum GeometryStreamFlags {\n /** No flags. */\n None = 0,\n /** When the geometry is displayed, it is always oriented to face the viewer. The placement origin of the element associated with the geometry is used as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume.\n */\n ViewIndependent = 1 << 0,\n}\n\n/** An entry in a [[GeometryStreamProps]] containing [[GeometryStreamFlags]] that apply to the geometry stream as a whole.\n * If this entry exists in the [[GeometryStreamProps]] array, it will always be the *first* entry.\n * @public\n * @extensions\n */\nexport interface GeometryStreamHeaderProps {\n /** The flags applied to the geometry stream. */\n flags: GeometryStreamFlags;\n}\n\n/** Allowed GeometryStream entries - should only set one value.\n * @see [GeometryStream]($docs/learning/common/geometrystream.md)\n * @public\n * @extensions\n */\nexport interface GeometryStreamEntryProps extends GeomJson.GeometryProps {\n header?: GeometryStreamHeaderProps;\n appearance?: GeometryAppearanceProps;\n styleMod?: LineStyle.ModifierProps;\n fill?: AreaFillProps;\n pattern?: AreaPattern.ParamsProps;\n material?: MaterialProps;\n geomPart?: GeometryPartInstanceProps;\n textString?: TextStringProps;\n brep?: BRepEntity.DataProps;\n image?: ImageGraphicProps;\n subRange?: LowAndHighXYZ;\n}\n\n/** A [[GeometricElement]]'s GeometryStream is represented by an array of [[GeometryStreamEntryProps]].\n * @public\n * @extensions\n */\nexport type GeometryStreamProps = GeometryStreamEntryProps[];\n\n/** GeometryStreamBuilder is a helper class for populating the [[GeometryStreamProps]] array needed to create a [[GeometricElement]] or [[GeometryPart]].\n * @public\n */\nexport class GeometryStreamBuilder {\n /** Current inverse placement transform, used for converting world coordinate input to be placement relative */\n private _worldToLocal?: Transform;\n /** GeometryStream entries */\n public readonly geometryStream: GeometryStreamProps = [];\n\n /** Supply optional local to world transform. Used to transform world coordinate input relative to element placement.\n * For a [[GeometricElement]]'s placement to be meaningful, world coordinate geometry should never be appended to an element with an identity placement.\n * Can be called with undefined or identity transform to start appending geometry supplied in local coordinates again.\n */\n public setLocalToWorld(localToWorld?: Transform) {\n this._worldToLocal = (undefined === localToWorld || localToWorld.isIdentity ? undefined : localToWorld.inverse());\n }\n\n /** Supply local to world transform from a Point3d and optional YawPitchRollAngles.\n * @see [[Placement3d]]\n */\n public setLocalToWorld3d(origin: Point3d, angles: YawPitchRollAngles = YawPitchRollAngles.createDegrees(0.0, 0.0, 0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(origin, angles.toMatrix3d()));\n }\n\n /** Supply local to world transform from a Point2d and optional Angle.\n * @see [[Placement2d]]\n */\n public setLocalToWorld2d(origin: Point2d, angle: Angle = Angle.createDegrees(0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(Point3d.createFrom(origin), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), angle)));\n }\n\n /** Supply local to world transform from a PlacementProps2d or PlacementProps3d.\n * @see [[PlacementProps]]\n */\n public setLocalToWorldFromPlacement(props: PlacementProps) {\n const placement = isPlacement2dProps(props) ? Placement2d.fromJSON(props) : Placement3d.fromJSON(props);\n this.setLocalToWorld(placement.transform);\n }\n\n /** Store local ranges in GeometryStream for all subsequent geometry appended. Can improve performance of range testing for elements with a GeometryStream\n * containing more than one [[GeometryQuery]] differentiable by range. Not useful for a single [[GeometryQuery]] as its range and that of the [[GeometricElement]] are the same.\n * Ignored when defining a [[GeometryPart]] and not needed when only appending [[GeometryPart]] instances to a [[GeometricElement]] as these store their own range.\n */\n public appendGeometryRanges() {\n this.geometryStream.push({ subRange: Range3d.createNull() });\n }\n\n /** Change [[SubCategory]] or reset to [[SubCategoryAppearance]] for subsequent geometry.\n * An invalid sub-category id can be supplied to force a reset to the current [[SubCategoryAppearance]].\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherit the symbology of their instance for anything not explicitly overridden.\n */\n public appendSubCategoryChange(subCategoryId: Id64String): boolean {\n this.geometryStream.push({ appearance: { subCategory: subCategoryId } });\n return true;\n }\n\n /** Change [[GeometryParams]] for subsequent geometry.\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherits the symbology of their instance for anything not explicitly overridden.\n */\n public appendGeometryParamsChange(geomParams: GeometryParams): boolean {\n const appearance: GeometryAppearanceProps = {\n subCategory: geomParams.subCategoryId,\n color: geomParams.lineColor?.toJSON(),\n weight: geomParams.weight,\n style: geomParams.styleInfo?.styleId,\n transparency: geomParams.elmTransparency,\n displayPriority: geomParams.elmPriority,\n geometryClass: geomParams.geometryClass,\n };\n this.geometryStream.push({ appearance });\n\n if (undefined !== geomParams.materialId)\n this.geometryStream.push({ material: { materialId: geomParams.materialId } });\n\n if (undefined !== geomParams.fillDisplay && FillDisplay.Never !== geomParams.fillDisplay) {\n const fill: AreaFillProps = {\n display: geomParams.fillDisplay,\n transparency: geomParams.fillTransparency,\n };\n if (undefined !== geomParams.gradient && Gradient.Mode.None !== geomParams.gradient.mode)\n fill.gradient = geomParams.gradient?.toJSON();\n else if (undefined !== geomParams.backgroundFill && BackgroundFill.None !== geomParams.backgroundFill)\n fill.backgroundFill = geomParams.backgroundFill;\n else if (undefined !== geomParams.fillColor)\n fill.color = geomParams.fillColor.toJSON();\n this.geometryStream.push({ fill });\n }\n\n if (undefined !== geomParams.pattern) {\n const localPattern = this._worldToLocal ? geomParams.pattern.clone() : geomParams.pattern;\n if (undefined !== this._worldToLocal && !localPattern.applyTransform(this._worldToLocal))\n return false;\n\n this.geometryStream.push({ pattern: localPattern.toJSON() });\n }\n\n if (undefined !== geomParams.styleInfo && undefined !== geomParams.styleInfo.styleMod) {\n const localStyleMod = new LineStyle.Modifier(geomParams.styleInfo.styleMod);\n if (undefined !== this._worldToLocal && !localStyleMod.applyTransform(this._worldToLocal))\n return false;\n this.geometryStream.push({ styleMod: localStyleMod });\n }\n\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement3d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart3d(partId: Id64String, instanceOrigin?: Point3d, instanceRotation?: YawPitchRollAngles, instanceScale?: number): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ geomPart: { part: partId, origin: instanceOrigin, rotation: instanceRotation, scale: instanceScale } });\n return true;\n }\n const partTrans = Transform.createOriginAndMatrix(instanceOrigin, instanceRotation ? instanceRotation.toMatrix3d() : Matrix3d.createIdentity());\n if (undefined !== instanceScale)\n partTrans.matrix.scaleColumnsInPlace(instanceScale, instanceScale, instanceScale);\n const resultTrans = this._worldToLocal.multiplyTransformTransform(partTrans);\n const scales = new Vector3d();\n if (!resultTrans.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(resultTrans.matrix);\n if (undefined === newRotation)\n return false;\n this.geometryStream.push({ geomPart: { part: partId, origin: resultTrans.getOrigin(), rotation: newRotation, scale: scales.x } });\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement2d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart2d(partId: Id64String, instanceOrigin?: Point2d, instanceRotation?: Angle, instanceScale?: number): boolean {\n return this.appendGeometryPart3d(partId, instanceOrigin ? Point3d.createFrom(instanceOrigin) : undefined, instanceRotation ? new YawPitchRollAngles(instanceRotation) : undefined, instanceScale);\n }\n\n /** Append a [[TextString]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendTextString(textString: TextString): boolean {\n if (this._worldToLocal) {\n textString = new TextString(textString);\n if (!textString.transformInPlace(this._worldToLocal)) {\n return false;\n }\n }\n\n this.geometryStream.push({ textString: textString.toJSON() });\n return true;\n }\n\n /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.\n * @beta\n */\n public appendTextBlock(block: TextBlockGeometryProps): boolean {\n for (const entry of block.entries) {\n let result: boolean;\n if (entry.text) {\n result = this.appendTextString(new TextString(entry.text));\n } else if (entry.color) {\n if (entry.color === \"subcategory\") {\n result = this.appendSubCategoryChange(Id64.invalid);\n } else {\n this.geometryStream.push({ appearance: { color: entry.color } });\n result = true;\n }\n } else {\n result = this.appendGeometry(LineSegment3d.fromJSON(entry.separator));\n }\n\n if (!result) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Append an [[ImageGraphic]] supplied in either local or world coordinates. */\n public appendImage(image: ImageGraphic): boolean {\n if (undefined !== this._worldToLocal)\n image = image.cloneTransformed(this._worldToLocal);\n\n this.geometryStream.push({ image: image.toJSON() });\n return true;\n }\n\n /** Append a [[GeometryQuery]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendGeometry(geometry: GeometryQuery): boolean {\n if (undefined === this._worldToLocal) {\n const geomData = GeomJson.Writer.toIModelJson(geometry);\n if (undefined === geomData)\n return false;\n this.geometryStream.push(geomData);\n return true;\n }\n const localGeometry = geometry.cloneTransformed(this._worldToLocal);\n if (undefined === localGeometry)\n return false;\n const localGeomData = GeomJson.Writer.toIModelJson(localGeometry);\n if (undefined === localGeomData)\n return false;\n this.geometryStream.push(localGeomData);\n return true;\n }\n\n /** Append [[BRepEntity.DataProps]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array\n * @beta\n */\n public appendBRepData(brep: BRepEntity.DataProps): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ brep });\n return true;\n }\n const entityTrans = Transform.fromJSON(brep.transform);\n const localTrans = entityTrans.multiplyTransformTransform(this._worldToLocal);\n const localBrep: BRepEntity.DataProps = {\n data: brep.data,\n type: brep.type,\n transform: localTrans.isIdentity ? undefined : localTrans.toJSON(),\n faceSymbology: brep.faceSymbology,\n };\n this.geometryStream.push({ brep: localBrep });\n return true;\n }\n\n /** @internal */\n public getHeader(): GeometryStreamHeaderProps | undefined {\n return 0 < this.geometryStream.length ? this.geometryStream[0].header : undefined;\n }\n\n /** @internal */\n public obtainHeader(): GeometryStreamHeaderProps {\n const hdr = this.getHeader();\n if (undefined !== hdr)\n return hdr;\n\n const entry = { header: { flags: GeometryStreamFlags.None } };\n this.geometryStream.unshift(entry);\n return entry.header;\n }\n\n /** Controls whether or not the geometry in the stream should be displayed as view-independent.\n * When view-independent geometry is displayed, it is always oriented to face the viewer, using the placement origin of the element as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume\n * @public\n */\n public get isViewIndependent(): boolean {\n const hdr = this.getHeader();\n return undefined !== hdr && GeometryStreamFlags.None !== (hdr.flags & GeometryStreamFlags.ViewIndependent);\n }\n public set isViewIndependent(viewIndependent: boolean) {\n if (viewIndependent === this.isViewIndependent)\n return;\n\n const hdr = this.obtainHeader();\n if (viewIndependent)\n hdr.flags |= GeometryStreamFlags.ViewIndependent;\n else\n hdr.flags &= ~GeometryStreamFlags.ViewIndependent;\n }\n}\n\n/** Represents a text string within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface TextStringPrimitive {\n type: \"textString\";\n readonly textString: TextString;\n}\n\n/** Represents an image within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface ImagePrimitive {\n type: \"image\";\n readonly image: ImageGraphic;\n}\n\n/** Represents a reference to a GeometryPart within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface PartReference {\n type: \"partReference\";\n part: {\n id: Id64String;\n readonly toLocal?: Transform;\n };\n}\n\n/** Represents a BRep within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface BRepPrimitive {\n type: \"brep\";\n /** @beta */\n readonly brep: BRepEntity.DataProps;\n}\n\n/** Represents one of a variety of GeometryQuery objects within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface GeometryPrimitive {\n type: \"geometryQuery\";\n readonly geometry: AnyGeometryQuery;\n}\n\n/** Union of all possible geometric primitive types that may appear within a GeometryStream.\n * @public\n * @extensions\n */\nexport type GeometryStreamPrimitive = TextStringPrimitive | PartReference | BRepPrimitive | GeometryPrimitive | ImagePrimitive;\n\n/** Holds current state information for [[GeometryStreamIterator]]. Each entry represents exactly one geometry primitive in the stream.\n * @public\n * @extensions\n */\nexport interface GeometryStreamIteratorEntry {\n /** A [[GeometryParams]] representing the appearance of the current geometric entry */\n readonly geomParams: GeometryParams;\n /** Placement transform, used for converting placement relative, local coordinate entries to world */\n readonly localToWorld?: Transform;\n /** Optional stored local range for the current geometric entry */\n readonly localRange?: Range3d;\n /** Returns the geometric primitive represented by this entry. */\n readonly primitive: GeometryStreamPrimitive;\n}\n\nclass IteratorEntry implements GeometryStreamIteratorEntry {\n private _primitive?: GeometryStreamPrimitive;\n public readonly geomParams: GeometryParams;\n public readonly localToWorld?: Transform;\n public localRange?: Range3d;\n\n public constructor(appearance: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geomParams = typeof appearance === \"string\" ? new GeometryParams(appearance) : appearance;\n this.localToWorld = localToWorld;\n }\n\n public get primitive() { return this._primitive!; }\n public set primitive(primitive: GeometryStreamPrimitive) { this._primitive = primitive; }\n\n public setGeometryQuery(geometry: AnyGeometryQuery) { this._primitive = { type: \"geometryQuery\", geometry }; }\n public setTextString(textString: TextString) { this._primitive = { type: \"textString\", textString }; }\n public setBRep(brep: BRepEntity.DataProps) { this._primitive = { type: \"brep\", brep }; }\n public setImage(image: ImageGraphic) { this._primitive = { type: \"image\", image }; }\n public setPartReference(id: Id64String, toLocal?: Transform) {\n this._primitive = {\n type: \"partReference\",\n part: { id, toLocal },\n };\n }\n}\n\n/** GeometryStreamIterator is a helper class for iterating a [[GeometryStreamProps]].\n * A [[GeometricElement]]'s GeometryStream must be specifically requested using [[ElementLoadProps.wantGeometry]].\n * Each [[GeometryStreamIteratorEntry]] returned by the iterator represents exactly one geometric primitive in the stream.\n * @public\n */\nexport class GeometryStreamIterator implements IterableIterator<GeometryStreamIteratorEntry> {\n /** GeometryStream entries */\n public geometryStream: GeometryStreamProps;\n /** Flags applied to the entire geometry stream. */\n public readonly flags: GeometryStreamFlags;\n /** Current entry position */\n private _index = 0;\n /** Allocated on first call to next() and reused thereafter. */\n private _entry?: IteratorEntry;\n /** Used to initialize this._entry. */\n private readonly _appearance: Id64String | GeometryParams;\n private readonly _localToWorld?: Transform;\n\n /** Construct a new GeometryStreamIterator given a [[GeometryStreamProps]] from either a [[GeometricElement3d]], [[GeometricElement2d]], or [[GeometryPart]].\n * Supply the [[GeometricElement]]'s category to initialize the appearance information for each geometric entry.\n */\n public constructor(geometryStream: GeometryStreamProps, categoryOrGeometryParams?: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geometryStream = geometryStream;\n this._appearance = categoryOrGeometryParams ?? Id64.invalid;\n this._localToWorld = localToWorld;\n if (0 < geometryStream.length && undefined !== geometryStream[0].header) {\n this.flags = geometryStream[0].header.flags;\n ++this._index;\n } else {\n this.flags = GeometryStreamFlags.None;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get entry() {\n if (undefined === this._entry)\n this._entry = new IteratorEntry(this._appearance, this._localToWorld);\n\n return this._entry;\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement3d]].\n * If [[GeometricElement3dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement3d(element: Pick<GeometricElement3dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined)\n transform = Transform.createOriginAndMatrix(Point3d.fromJSON(element.placement.origin), YawPitchRollAngles.fromJSON(element.placement.angles).toMatrix3d());\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement2d]].\n * If [[GeometricElement2dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement2d(element: Pick<GeometricElement2dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined) {\n const origin = Point3d.createFrom(Point2d.fromJSON(element.placement.origin));\n const matrix = Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.fromJSON(element.placement.angle))!;\n transform = Transform.createOriginAndMatrix(origin, matrix);\n }\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometryPart]].\n * To iterate a part's GeometryStream in the context of a part instance found for a [[GeometricElement]], provide the optional [[GeometryParams]] and Transform from the [[GeometricElement]]'s [[GeometryStreamIterator]].\n * Supply the [[GeometryParams]] to return appearance information as inherited from the [[GeometricElement]].\n * Supply the partToWorld transform to return the part geometry in world coordinates.\n * Supply the partToLocal transform to return the part geometry relative to the [[GeometricElement]]'s placement.\n * @throws [[IModelError]] if geomPart.geom is undefined.\n */\n public static fromGeometryPart(geomPart: Pick<GeometryPartProps, \"geom\">, geomParams?: GeometryParams, partTransform?: Transform) {\n if (geomPart.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometryPart has no geometry or geometry wasn't requested\");\n\n return new GeometryStreamIterator(geomPart.geom, geomParams?.clone(), partTransform);\n }\n\n /** Get the transform that if applied to a [[GeometryPart]]'s GeometryStream entries would return them in world coordinates. */\n public partToWorld(): Transform | undefined {\n if (undefined === this._entry)\n return this._localToWorld;\n\n const partToLocal = \"partReference\" === this._entry.primitive.type ? this._entry.primitive.part.toLocal : undefined;\n if (this._entry.localToWorld === undefined || partToLocal === undefined)\n return this._entry.localToWorld;\n\n return this._entry.localToWorld.multiplyTransformTransform(partToLocal);\n }\n\n /** Advance to next displayable geometric entry while updating the current [[GeometryParams]] from appearance related entries.\n * Geometric entries are [[TextString]], [[GeometryQuery]], [[GeometryPart]], [[ImageGraphic]], and [[BRepEntity.DataProps]].\n */\n public next(): IteratorResult<GeometryStreamIteratorEntry> {\n // NOTE: localRange remains valid until we encounter either a new subRange entry or a geometry part reference.\n while (this._index < this.geometryStream.length) {\n const entry = this.geometryStream[this._index++];\n if (entry.appearance) {\n this.entry.geomParams.resetAppearance();\n if (entry.appearance.subCategory)\n this.entry.geomParams.subCategoryId = Id64.fromJSON(entry.appearance.subCategory);\n if (undefined !== entry.appearance.color)\n this.entry.geomParams.lineColor = ColorDef.fromJSON(entry.appearance.color);\n if (undefined !== entry.appearance.weight)\n this.entry.geomParams.weight = entry.appearance.weight;\n if (undefined !== entry.appearance.style)\n this.entry.geomParams.styleInfo = new LineStyle.Info(Id64.fromJSON(entry.appearance.style));\n if (undefined !== entry.appearance.transparency)\n this.entry.geomParams.elmTransparency = entry.appearance.transparency;\n if (undefined !== entry.appearance.displayPriority)\n this.entry.geomParams.elmPriority = entry.appearance.displayPriority;\n if (undefined !== entry.appearance.geometryClass)\n this.entry.geomParams.geometryClass = entry.appearance.geometryClass;\n } else if (entry.styleMod) {\n if (this.entry.geomParams.styleInfo === undefined)\n continue;\n\n const styleMod = new LineStyle.Modifier(entry.styleMod);\n if (this.entry.localToWorld !== undefined)\n styleMod.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.styleInfo = new LineStyle.Info(this.entry.geomParams.styleInfo.styleId, styleMod);\n } else if (entry.fill) {\n if (entry.fill.display)\n this.entry.geomParams.fillDisplay = entry.fill.display;\n if (entry.fill.transparency)\n this.entry.geomParams.fillTransparency = entry.fill.transparency;\n if (entry.fill.gradient)\n this.entry.geomParams.gradient = Gradient.Symb.fromJSON(entry.fill.gradient);\n else if (entry.fill.backgroundFill)\n this.entry.geomParams.backgroundFill = entry.fill.backgroundFill;\n else if (entry.fill.color)\n this.entry.geomParams.fillColor = ColorDef.fromJSON(entry.fill.color);\n } else if (entry.pattern) {\n const params = AreaPattern.Params.fromJSON(entry.pattern);\n if (this.entry.localToWorld !== undefined)\n params.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.pattern = params;\n } else if (entry.material) {\n if (entry.material.materialId)\n this.entry.geomParams.materialId = Id64.fromJSON(entry.material.materialId);\n } else if (entry.subRange) {\n this.entry.localRange = Range3d.fromJSON(entry.subRange);\n } else if (entry.geomPart) {\n let transform;\n if (entry.geomPart.origin !== undefined || entry.geomPart.rotation !== undefined || entry.geomPart.scale !== undefined) {\n const origin = entry.geomPart.origin ? Point3d.fromJSON(entry.geomPart.origin) : Point3d.createZero();\n const rotation = entry.geomPart.rotation ? YawPitchRollAngles.fromJSON(entry.geomPart.rotation).toMatrix3d() : Matrix3d.createIdentity();\n transform = Transform.createRefs(origin, rotation);\n if (entry.geomPart.scale)\n transform.multiplyTransformTransform(Transform.createRefs(Point3d.createZero(), Matrix3d.createUniformScale(entry.geomPart.scale)), transform);\n }\n\n // Subgraphic range doesn't apply to parts. A sane geometry stream (i.e., any that has been through the native layers or GeometryStreamBuilder)\n // will have a new subgraphic range for any geometric primitive following the part.\n this.entry.localRange = undefined;\n this.entry.setPartReference(Id64.fromJSON(entry.geomPart.part), transform);\n return { value: this.entry, done: false };\n } else if (entry.textString) {\n const textString = new TextString(entry.textString);\n if (this.entry.localToWorld !== undefined)\n textString.transformInPlace(this.entry.localToWorld);\n\n this.entry.setTextString(textString);\n return { value: this.entry, done: false };\n } else if (entry.image) {\n const image = ImageGraphic.fromJSON(entry.image);\n if (undefined !== this.entry.localToWorld)\n image.transformInPlace(this.entry.localToWorld);\n\n this.entry.setImage(image);\n return { value: this.entry, done: false };\n } else if (entry.brep) {\n if (this.entry.localToWorld !== undefined) {\n const entityTrans = Transform.fromJSON(entry.brep.transform);\n entry.brep.transform = entityTrans.multiplyTransformTransform(this.entry.localToWorld).toJSON();\n }\n\n this.entry.setBRep(entry.brep);\n return { value: this.entry, done: false };\n } else {\n const geometryQuery = GeomJson.Reader.parse(entry);\n if (!(geometryQuery instanceof GeometryQuery))\n continue;\n\n if (this.entry.localToWorld !== undefined)\n geometryQuery.tryTransformInPlace(this.entry.localToWorld);\n\n this.entry.setGeometryQuery(geometryQuery);\n return { value: this.entry, done: false };\n }\n }\n\n return { value: this.entry, done: true };\n }\n\n public [Symbol.iterator](): IterableIterator<GeometryStreamIteratorEntry> {\n return this;\n }\n\n /** @internal */\n public get isViewIndependent(): boolean { return GeometryStreamFlags.None !== (this.flags & GeometryStreamFlags.ViewIndependent); }\n}\n"]}
@@ -205,7 +205,7 @@ export class RpcInvocation {
205
205
  status: this.protocol.getCode(this.status),
206
206
  id: this.request.id,
207
207
  interfaceName: (typeof (this.operation) === "undefined") ? "" : this.operation.interfaceDefinition.interfaceName,
208
- allowCompression: this.operation?.policy.allowResponseCompression || false,
208
+ allowCompression: this.operation ? this.operation.policy.allowResponseCompression : true,
209
209
  };
210
210
  this.transformResponseStatus(fulfillment, rawResult);
211
211
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"RpcInvocation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcInvocation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aAAa,EAAE,CAAC;YAC9F,WAAW,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACpD,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC,eAAe;YACjD,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC;QACjC,CAAC;QAED,IAAI,SAAS,YAAY,KAAK,EAAE,CAAC;YAC/B,WAAW,CAAC,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;QAC1D,CAAC;IACH,CAAC;;;AA5Qa,yBAAW,GAAmB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,AAAhD,CAAiD","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 { AccessToken, BentleyError, BentleyStatus, GuidString, IModelStatus, Logger, RpcInterfaceStatus, StatusCategory, Tracing } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcInterface } from \"../../RpcInterface\";\nimport { SessionProps } from \"../../SessionProps\";\nimport { RpcConfiguration } from \"./RpcConfiguration\";\nimport { RpcProtocolEvent, RpcRequestStatus } from \"./RpcConstants\";\nimport { RpcControlChannel, RpcNotFoundResponse, RpcPendingResponse } from \"./RpcControl\";\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\nimport { RpcOperation } from \"./RpcOperation\";\nimport { RpcManagedStatus, RpcProtocol, RpcProtocolVersion, RpcRequestFulfillment, SerializedRpcRequest } from \"./RpcProtocol\";\nimport { CURRENT_INVOCATION, RpcRegistry } from \"./RpcRegistry\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** The properties of an RpcActivity.\n * @public\n * @extensions\n */\nexport interface RpcActivity extends SessionProps {\n /** Used for logging to correlate an Rpc activity between frontend and backend */\n readonly activityId: GuidString;\n\n /** access token for authorization */\n readonly accessToken: AccessToken;\n\n /** the name of the current rpc method */\n readonly rpcMethod?: string;\n\n readonly user?: string;\n}\n\n/** Serialized format for sending the request across the RPC layer\n * @public\n */\nexport interface SerializedRpcActivity {\n id: string;\n applicationId: string;\n applicationVersion: string;\n sessionId: string;\n authorization: string;\n user?: string;\n csrfToken?: { headerName: string, headerValue: string };\n}\n\n/** @internal */\nexport type RpcActivityRun = (activity: RpcActivity, fn: () => Promise<any>) => Promise<any>;\n\n/** An RPC operation invocation in response to a request.\n * @internal\n */\nexport class RpcInvocation {\n public static runActivity: RpcActivityRun = async (_activity, fn) => fn();\n private _threw: boolean = false;\n private _pending: boolean = false;\n private _notFound: boolean = false;\n private _noContent: boolean = false;\n private _timeIn: number = 0;\n private _timeOut: number = 0;\n\n /** The protocol for this invocation. */\n public readonly protocol: RpcProtocol;\n\n /** The received request. */\n public readonly request: SerializedRpcRequest;\n\n /** The operation of the request. */\n public readonly operation: RpcOperation = undefined as any;\n\n /** The implementation response. */\n public readonly result: Promise<any>;\n\n /** The fulfillment for this request. */\n public readonly fulfillment: Promise<RpcRequestFulfillment>;\n\n /** The status for this request. */\n public get status(): RpcRequestStatus {\n return this._threw ? RpcRequestStatus.Rejected :\n this._pending ? RpcRequestStatus.Pending :\n this._notFound ? RpcRequestStatus.NotFound :\n this._noContent ? RpcRequestStatus.NoContent :\n RpcRequestStatus.Resolved;\n }\n\n /** The elapsed time for this invocation. */\n public get elapsed(): number {\n return this._timeOut - this._timeIn;\n }\n\n /**\n * The invocation for the current RPC operation.\n * @note The return value of this function is only reliable in an RPC impl class member function where program control was received from the RpcInvocation constructor function.\n */\n public static current(rpcImpl: RpcInterface): RpcInvocation {\n return (rpcImpl as any)[CURRENT_INVOCATION];\n }\n\n /** Constructs an invocation. */\n public constructor(protocol: RpcProtocol, request: SerializedRpcRequest) {\n this._timeIn = new Date().getTime();\n this.protocol = protocol;\n this.request = request;\n\n try {\n try {\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\n\n const backend = this.operation.interfaceVersion;\n const frontend = this.request.operation.interfaceVersion;\n if (!RpcInterface.isVersionCompatible(backend, frontend)) {\n throw new IModelError(RpcInterfaceStatus.IncompatibleVersion, `Backend version ${backend} does not match frontend version ${frontend} for RPC interface ${this.operation.operationName}.`);\n }\n } catch (error) {\n if (this.handleUnknownOperation(error)) {\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\n } else {\n throw error;\n }\n }\n\n this.result = this.resolve();\n } catch (error) {\n this.result = this.reject(error);\n }\n\n this.fulfillment = this.result.then(async (value) => this._threw ? this.fulfillRejected(value) : this.fulfillResolved(value), async (reason) => this.fulfillRejected(reason));\n }\n\n private handleUnknownOperation(error: any): boolean {\n RpcControlChannel.ensureInitialized();\n return this.protocol.configuration.controlChannel.handleUnknownOperation(this, error);\n }\n\n public static sanitizeForLog(activity?: RpcActivity) {\n /* eslint-disable @typescript-eslint/naming-convention */\n return activity ? {\n ActivityId: activity.activityId, SessionId: activity.sessionId, ApplicationId: activity.applicationId, ApplicationVersion: activity.applicationVersion, rpcMethod: activity.rpcMethod,\n } : undefined;\n /* eslint-enable @typescript-eslint/naming-convention */\n }\n\n private async resolve(): Promise<any> {\n const request = this.request;\n const activity: RpcActivity = {\n activityId: request.id,\n applicationId: request.applicationId,\n applicationVersion: request.applicationVersion,\n sessionId: request.sessionId,\n user: request.user,\n accessToken: request.authorization,\n rpcMethod: request.operation.operationName,\n };\n\n try {\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestReceived, this);\n\n const parameters = request.parametersOverride || RpcMarshaling.deserialize(this.protocol, request.parameters);\n this.applyPolicies(parameters);\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition);\n (impl as any)[CURRENT_INVOCATION] = this;\n const op = this.lookupOperationFunction(impl);\n\n return await RpcInvocation.runActivity(activity, async () => op.call(impl, ...parameters)\n .catch(async (error) => {\n // this catch block is intentionally placed inside `runActivity` to attach the right logging metadata and use the correct openTelemetry span.\n if (!(error instanceof RpcPendingResponse)) {\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, \"Error in RPC operation\", { error: BentleyError.getErrorProps(error) });\n Tracing.recordException(error);\n }\n throw error;\n }));\n } catch (error: unknown) {\n return this.reject(error);\n }\n }\n\n private applyPolicies(parameters: any) {\n if (!parameters || !Array.isArray(parameters))\n return;\n\n for (let i = 0; i !== parameters.length; ++i) {\n const parameter = parameters[i];\n const isToken = typeof (parameter) === \"object\" && parameter !== null && parameter.hasOwnProperty(\"iModelId\") && parameter.hasOwnProperty(\"iTwinId\");\n if (isToken && this.protocol.checkToken && !this.operation.policy.allowTokenMismatch) {\n const inflated = this.protocol.inflateToken(parameter, this.request);\n parameters[i] = inflated;\n\n if (!RpcInvocation.compareTokens(parameter, inflated)) {\n if (RpcConfiguration.throwOnTokenMismatch) {\n throw new IModelError(BentleyStatus.ERROR, \"IModelRpcProps mismatch detected for this request.\");\n } else {\n Logger.logWarning(CommonLoggerCategory.RpcInterfaceBackend, \"IModelRpcProps mismatch detected for this request.\");\n }\n }\n }\n }\n }\n\n private static compareTokens(a: IModelRpcProps, b: IModelRpcProps): boolean {\n return a.key === b.key &&\n a.iTwinId === b.iTwinId &&\n a.iModelId === b.iModelId &&\n (undefined === a.changeset || (a.changeset.id === b.changeset?.id));\n }\n\n private async reject(error: any): Promise<any> {\n this._threw = true;\n return error;\n }\n\n private async fulfillResolved(value: any): Promise<RpcRequestFulfillment> {\n this._timeOut = new Date().getTime();\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendResponseCreated, this);\n const result = RpcMarshaling.serialize(this.protocol, value);\n return this.fulfill(result, value);\n }\n\n private async fulfillRejected(reason: any): Promise<RpcRequestFulfillment> {\n this._timeOut = new Date().getTime();\n if (!RpcConfiguration.developmentMode)\n reason.stack = undefined;\n\n const result = RpcMarshaling.serialize(this.protocol, reason);\n\n if (reason instanceof RpcPendingResponse) {\n this._pending = true;\n this._threw = false;\n result.objects = reason.message;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedPending, this);\n } else if (this.supportsNoContent() && reason?.errorNumber === IModelStatus.NoContent) {\n this._noContent = true;\n this._threw = false;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNoContent, this);\n } else if (reason instanceof RpcNotFoundResponse) {\n this._notFound = true;\n this._threw = false;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNotFound, this);\n } else {\n this._threw = true;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorOccurred, this);\n }\n\n return this.fulfill(result, reason);\n }\n\n private supportsNoContent() {\n if (!this.request.protocolVersion) {\n return false;\n }\n\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedNoContent && this.request.protocolVersion >= RpcProtocolVersion.IntroducedNoContent;\n }\n\n private supportsStatusCategory() {\n if (!this.request.protocolVersion) {\n return false;\n }\n\n if (!this.protocol.supportsStatusCategory) {\n return false;\n }\n\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.request.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;\n }\n\n private fulfill(result: RpcSerializedValue, rawResult: any): RpcRequestFulfillment {\n const fulfillment: RpcRequestFulfillment = {\n result,\n rawResult,\n status: this.protocol.getCode(this.status),\n id: this.request.id,\n interfaceName: (typeof (this.operation) === \"undefined\") ? \"\" : this.operation.interfaceDefinition.interfaceName,\n allowCompression: this.operation?.policy.allowResponseCompression || false,\n };\n\n this.transformResponseStatus(fulfillment, rawResult);\n\n try {\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition) as any;\n if (impl[CURRENT_INVOCATION] === this) {\n impl[CURRENT_INVOCATION] = undefined;\n }\n } catch (_err) { }\n\n return fulfillment;\n }\n\n private lookupOperationFunction(implementation: RpcInterface): (...args: any[]) => Promise<any> {\n const func = (implementation as any)[this.operation.operationName];\n if (!func || typeof (func) !== \"function\")\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${implementation.constructor.name}\" does not implement operation \"${this.operation.operationName}\".`);\n\n return func;\n }\n\n private transformResponseStatus(fulfillment: RpcRequestFulfillment, rawResult: any) {\n if (!this.supportsStatusCategory()) {\n return;\n }\n\n let managedStatus: \"notFound\" | \"pending\" | \"noContent\" | undefined;\n if (this._pending) {\n managedStatus = \"pending\";\n } else if (this._notFound) {\n managedStatus = \"notFound\";\n } else if (this._noContent) {\n managedStatus = \"noContent\";\n }\n\n if (managedStatus) {\n const responseValue = fulfillment.result.objects;\n const status: RpcManagedStatus = { iTwinRpcCoreResponse: true, managedStatus, responseValue };\n fulfillment.result.objects = JSON.stringify(status);\n status.responseValue = rawResult; // for ipc case\n fulfillment.rawResult = status;\n }\n\n if (rawResult instanceof Error) {\n fulfillment.status = StatusCategory.for(rawResult).code;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"RpcInvocation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcInvocation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH,OAAO,EAAe,YAAY,EAAE,aAAa,EAAc,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9J,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAk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iD","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 { AccessToken, BentleyError, BentleyStatus, GuidString, IModelStatus, Logger, RpcInterfaceStatus, StatusCategory, Tracing } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcInterface } from \"../../RpcInterface\";\nimport { SessionProps } from \"../../SessionProps\";\nimport { RpcConfiguration } from \"./RpcConfiguration\";\nimport { RpcProtocolEvent, RpcRequestStatus } from \"./RpcConstants\";\nimport { RpcControlChannel, RpcNotFoundResponse, RpcPendingResponse } from \"./RpcControl\";\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\nimport { RpcOperation } from \"./RpcOperation\";\nimport { RpcManagedStatus, RpcProtocol, RpcProtocolVersion, RpcRequestFulfillment, SerializedRpcRequest } from \"./RpcProtocol\";\nimport { CURRENT_INVOCATION, RpcRegistry } from \"./RpcRegistry\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** The properties of an RpcActivity.\n * @public\n * @extensions\n */\nexport interface RpcActivity extends SessionProps {\n /** Used for logging to correlate an Rpc activity between frontend and backend */\n readonly activityId: GuidString;\n\n /** access token for authorization */\n readonly accessToken: AccessToken;\n\n /** the name of the current rpc method */\n readonly rpcMethod?: string;\n\n readonly user?: string;\n}\n\n/** Serialized format for sending the request across the RPC layer\n * @public\n */\nexport interface SerializedRpcActivity {\n id: string;\n applicationId: string;\n applicationVersion: string;\n sessionId: string;\n authorization: string;\n user?: string;\n csrfToken?: { headerName: string, headerValue: string };\n}\n\n/** @internal */\nexport type RpcActivityRun = (activity: RpcActivity, fn: () => Promise<any>) => Promise<any>;\n\n/** An RPC operation invocation in response to a request.\n * @internal\n */\nexport class RpcInvocation {\n public static runActivity: RpcActivityRun = async (_activity, fn) => fn();\n private _threw: boolean = false;\n private _pending: boolean = false;\n private _notFound: boolean = false;\n private _noContent: boolean = false;\n private _timeIn: number = 0;\n private _timeOut: number = 0;\n\n /** The protocol for this invocation. */\n public readonly protocol: RpcProtocol;\n\n /** The received request. */\n public readonly request: SerializedRpcRequest;\n\n /** The operation of the request. */\n public readonly operation: RpcOperation = undefined as any;\n\n /** The implementation response. */\n public readonly result: Promise<any>;\n\n /** The fulfillment for this request. */\n public readonly fulfillment: Promise<RpcRequestFulfillment>;\n\n /** The status for this request. */\n public get status(): RpcRequestStatus {\n return this._threw ? RpcRequestStatus.Rejected :\n this._pending ? RpcRequestStatus.Pending :\n this._notFound ? RpcRequestStatus.NotFound :\n this._noContent ? RpcRequestStatus.NoContent :\n RpcRequestStatus.Resolved;\n }\n\n /** The elapsed time for this invocation. */\n public get elapsed(): number {\n return this._timeOut - this._timeIn;\n }\n\n /**\n * The invocation for the current RPC operation.\n * @note The return value of this function is only reliable in an RPC impl class member function where program control was received from the RpcInvocation constructor function.\n */\n public static current(rpcImpl: RpcInterface): RpcInvocation {\n return (rpcImpl as any)[CURRENT_INVOCATION];\n }\n\n /** Constructs an invocation. */\n public constructor(protocol: RpcProtocol, request: SerializedRpcRequest) {\n this._timeIn = new Date().getTime();\n this.protocol = protocol;\n this.request = request;\n\n try {\n try {\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\n\n const backend = this.operation.interfaceVersion;\n const frontend = this.request.operation.interfaceVersion;\n if (!RpcInterface.isVersionCompatible(backend, frontend)) {\n throw new IModelError(RpcInterfaceStatus.IncompatibleVersion, `Backend version ${backend} does not match frontend version ${frontend} for RPC interface ${this.operation.operationName}.`);\n }\n } catch (error) {\n if (this.handleUnknownOperation(error)) {\n this.operation = RpcOperation.lookup(this.request.operation.interfaceDefinition, this.request.operation.operationName);\n } else {\n throw error;\n }\n }\n\n this.result = this.resolve();\n } catch (error) {\n this.result = this.reject(error);\n }\n\n this.fulfillment = this.result.then(async (value) => this._threw ? this.fulfillRejected(value) : this.fulfillResolved(value), async (reason) => this.fulfillRejected(reason));\n }\n\n private handleUnknownOperation(error: any): boolean {\n RpcControlChannel.ensureInitialized();\n return this.protocol.configuration.controlChannel.handleUnknownOperation(this, error);\n }\n\n public static sanitizeForLog(activity?: RpcActivity) {\n /* eslint-disable @typescript-eslint/naming-convention */\n return activity ? {\n ActivityId: activity.activityId, SessionId: activity.sessionId, ApplicationId: activity.applicationId, ApplicationVersion: activity.applicationVersion, rpcMethod: activity.rpcMethod,\n } : undefined;\n /* eslint-enable @typescript-eslint/naming-convention */\n }\n\n private async resolve(): Promise<any> {\n const request = this.request;\n const activity: RpcActivity = {\n activityId: request.id,\n applicationId: request.applicationId,\n applicationVersion: request.applicationVersion,\n sessionId: request.sessionId,\n user: request.user,\n accessToken: request.authorization,\n rpcMethod: request.operation.operationName,\n };\n\n try {\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestReceived, this);\n\n const parameters = request.parametersOverride || RpcMarshaling.deserialize(this.protocol, request.parameters);\n this.applyPolicies(parameters);\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition);\n (impl as any)[CURRENT_INVOCATION] = this;\n const op = this.lookupOperationFunction(impl);\n\n return await RpcInvocation.runActivity(activity, async () => op.call(impl, ...parameters)\n .catch(async (error) => {\n // this catch block is intentionally placed inside `runActivity` to attach the right logging metadata and use the correct openTelemetry span.\n if (!(error instanceof RpcPendingResponse)) {\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, \"Error in RPC operation\", { error: BentleyError.getErrorProps(error) });\n Tracing.recordException(error);\n }\n throw error;\n }));\n } catch (error: unknown) {\n return this.reject(error);\n }\n }\n\n private applyPolicies(parameters: any) {\n if (!parameters || !Array.isArray(parameters))\n return;\n\n for (let i = 0; i !== parameters.length; ++i) {\n const parameter = parameters[i];\n const isToken = typeof (parameter) === \"object\" && parameter !== null && parameter.hasOwnProperty(\"iModelId\") && parameter.hasOwnProperty(\"iTwinId\");\n if (isToken && this.protocol.checkToken && !this.operation.policy.allowTokenMismatch) {\n const inflated = this.protocol.inflateToken(parameter, this.request);\n parameters[i] = inflated;\n\n if (!RpcInvocation.compareTokens(parameter, inflated)) {\n if (RpcConfiguration.throwOnTokenMismatch) {\n throw new IModelError(BentleyStatus.ERROR, \"IModelRpcProps mismatch detected for this request.\");\n } else {\n Logger.logWarning(CommonLoggerCategory.RpcInterfaceBackend, \"IModelRpcProps mismatch detected for this request.\");\n }\n }\n }\n }\n }\n\n private static compareTokens(a: IModelRpcProps, b: IModelRpcProps): boolean {\n return a.key === b.key &&\n a.iTwinId === b.iTwinId &&\n a.iModelId === b.iModelId &&\n (undefined === a.changeset || (a.changeset.id === b.changeset?.id));\n }\n\n private async reject(error: any): Promise<any> {\n this._threw = true;\n return error;\n }\n\n private async fulfillResolved(value: any): Promise<RpcRequestFulfillment> {\n this._timeOut = new Date().getTime();\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendResponseCreated, this);\n const result = RpcMarshaling.serialize(this.protocol, value);\n return this.fulfill(result, value);\n }\n\n private async fulfillRejected(reason: any): Promise<RpcRequestFulfillment> {\n this._timeOut = new Date().getTime();\n if (!RpcConfiguration.developmentMode)\n reason.stack = undefined;\n\n const result = RpcMarshaling.serialize(this.protocol, reason);\n\n if (reason instanceof RpcPendingResponse) {\n this._pending = true;\n this._threw = false;\n result.objects = reason.message;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedPending, this);\n } else if (this.supportsNoContent() && reason?.errorNumber === IModelStatus.NoContent) {\n this._noContent = true;\n this._threw = false;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNoContent, this);\n } else if (reason instanceof RpcNotFoundResponse) {\n this._notFound = true;\n this._threw = false;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendReportedNotFound, this);\n } else {\n this._threw = true;\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorOccurred, this);\n }\n\n return this.fulfill(result, reason);\n }\n\n private supportsNoContent() {\n if (!this.request.protocolVersion) {\n return false;\n }\n\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedNoContent && this.request.protocolVersion >= RpcProtocolVersion.IntroducedNoContent;\n }\n\n private supportsStatusCategory() {\n if (!this.request.protocolVersion) {\n return false;\n }\n\n if (!this.protocol.supportsStatusCategory) {\n return false;\n }\n\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.request.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;\n }\n\n private fulfill(result: RpcSerializedValue, rawResult: any): RpcRequestFulfillment {\n const fulfillment: RpcRequestFulfillment = {\n result,\n rawResult,\n status: this.protocol.getCode(this.status),\n id: this.request.id,\n interfaceName: (typeof (this.operation) === \"undefined\") ? \"\" : this.operation.interfaceDefinition.interfaceName,\n allowCompression: this.operation ? this.operation.policy.allowResponseCompression : true,\n };\n\n this.transformResponseStatus(fulfillment, rawResult);\n\n try {\n const impl = RpcRegistry.instance.getImplForInterface(this.operation.interfaceDefinition) as any;\n if (impl[CURRENT_INVOCATION] === this) {\n impl[CURRENT_INVOCATION] = undefined;\n }\n } catch (_err) { }\n\n return fulfillment;\n }\n\n private lookupOperationFunction(implementation: RpcInterface): (...args: any[]) => Promise<any> {\n const func = (implementation as any)[this.operation.operationName];\n if (!func || typeof (func) !== \"function\")\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${implementation.constructor.name}\" does not implement operation \"${this.operation.operationName}\".`);\n\n return func;\n }\n\n private transformResponseStatus(fulfillment: RpcRequestFulfillment, rawResult: any) {\n if (!this.supportsStatusCategory()) {\n return;\n }\n\n let managedStatus: \"notFound\" | \"pending\" | \"noContent\" | undefined;\n if (this._pending) {\n managedStatus = \"pending\";\n } else if (this._notFound) {\n managedStatus = \"notFound\";\n } else if (this._noContent) {\n managedStatus = \"noContent\";\n }\n\n if (managedStatus) {\n const responseValue = fulfillment.result.objects;\n const status: RpcManagedStatus = { iTwinRpcCoreResponse: true, managedStatus, responseValue };\n fulfillment.result.objects = JSON.stringify(status);\n status.responseValue = rawResult; // for ipc case\n fulfillment.rawResult = status;\n }\n\n if (rawResult instanceof Error) {\n fulfillment.status = StatusCategory.for(rawResult).code;\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,yBAAiB,sBAAsB,CAAC;IACtC,SAAgB,aAAa,IAAI,sBAAsB,CAEtD;CACF;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACZ,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,kBAAkB;IAgB1F,4BAA4B;WACd,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,GAAG;CAoB7F"}
1
+ {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,yBAAiB,sBAAsB,CAAC;IACtC,SAAgB,aAAa,IAAI,sBAAsB,CAEtD;CACF;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACZ,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,kBAAkB;IAe1F,4BAA4B;WACd,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,GAAG;CAoB7F"}
@@ -35,9 +35,8 @@ export class RpcMarshaling {
35
35
  /** Serializes a value. */
36
36
  static serialize(protocol, value) {
37
37
  const serialized = RpcSerializedValue.create();
38
- if (typeof (value) === "undefined") {
38
+ if (value === undefined)
39
39
  return serialized;
40
- }
41
40
  marshalingTarget = serialized;
42
41
  chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;
43
42
  serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAI/D,0BAA0B;AAC1B,4CAA4C;AAE5C,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,UAAU,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9I,CAAC;AAED,IAAI,gBAAoC,CAAC;AACzC,IAAI,cAAc,GAAG,CAAC,CAAC;AAUvB,gBAAgB;AAChB,MAAM,KAAW,sBAAsB,CAItC;AAJD,WAAiB,sBAAsB;IACrC,SAAgB,aAAa;QAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC;IAFe,oCAAa,gBAE5B,CAAA;AACH,CAAC,EAJgB,sBAAsB,KAAtB,sBAAsB,QAItC;AAUD,gBAAgB;AAChB,MAAM,KAAW,kBAAkB,CAIlC;AAJD,WAAiB,kBAAkB;IACjC,SAAgB,MAAM,CAAC,OAAO,GAAG,EAAE,EAAE,OAAqB,EAAE;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAFe,yBAAM,SAErB,CAAA;AACH,CAAC,EAJgB,kBAAkB,KAAlB,kBAAkB,QAIlC;A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CAAC;YACzF,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/F,KAAK,CAAC,KAAK,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,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 { BentleyStatus, IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable deprecation/deprecation */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (typeof (value) === \"undefined\") {\n return serialized;\n }\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: any): any {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): any {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: any) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAI/D,0BAA0B;AAC1B,4CAA4C;AAE5C,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,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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, IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable deprecation/deprecation */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (value === undefined)\n return serialized;\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: Uint8Array): MarshalingBinaryMarker | undefined {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): Uint8Array {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: unknown) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RpcOperation.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcOperation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EACL,oBAAoB,EAAE,wCAAwC,EAAE,yBAAyB,EAAE,4BAA4B,EACxH,MAAM,cAAc,CAAC;AAItB;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,4DAA4D;IACrD,KAAK,EAAE,yBAAyB,CAAkD;IAEzF,oEAAoE;IAC7D,aAAa,EAAE,wCAAwC,CAAkE;IAEhI,qEAAqE;IAC9D,eAAe,EAAE,oBAAoB,CAAqB;IAEjE,oEAAoE;IAC7D,YAAY,EAAE,oBAAoB,CAAqB;IAE9D;;;OAGG;IACI,oBAAoB,EAAE,4BAA4B,CAA8C;IAEvG,6DAA6D;IACtD,eAAe,EAAE,OAAO,CAAS;IAExC,yHAAyH;IAClH,kBAAkB,EAAE,OAAO,CAAS;IAE3C,+FAA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E,MAAM,CAAC;IAEtC,qCAAqC;IACrC,IAAW,gBAAgB,IAAI,MAAM,CAAsD;IAE3F,qCAAqC;IAC9B,MAAM,EAAE,kBAAkB,CAAC;IAElC,gBAAgB;gBACG,UAAU,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB;IAMpG,gBAAgB;WACF,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAO/D;AAED,gBAAgB;AAChB,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAElE,gBAAgB;AAChB,yBAAiB,YAAY,CAAC;IAW5B,sEAAsE;IACtE,SAAgB,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,uBAAuB,oDACpB,MAAM,cAAc,kBAAkB,UAG/F;IAED,8FAA8F;IAC9F,SAAgB,oBAAoB,CAAC,OAAO,GAAE,uBAA2D,oDAC/C,MAAM,cAAc,kBAAkB,UAK/F;IAED,mHAAmH;IACnH,SAAgB,eAAe,CAAC,OAAO,EAAE,yBAAyB,oDACR,MAAM,cAAc,kBAAkB,UAK/F;IAED,sFAAsF;IACtF,SAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,uBAAuB,2EAIpF;CACF"}
@@ -33,7 +33,7 @@ export class RpcOperationPolicy {
33
33
  /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */
34
34
  this.allowTokenMismatch = false;
35
35
  /** Whether to compress the operation response with one of the client's supported encodings. */
36
- this.allowResponseCompression = false;
36
+ this.allowResponseCompression = true;
37
37
  }
38
38
  }
39
39
  /** An RPC operation descriptor.
@@ -1 +1 @@
1
- {"version":3,"file":"RpcOperation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcOperation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,WAAW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,IAAI,YAAY,CAAC,MAAM,CAAC,WAAkB,EAAE,WAAW,EAAE,IAAI,KAAM,SAAQ,kBAAkB;gBAAhC;;oBACzE,UAAK,GAAG,OAAO,CAAC;gBAClC,CAAC;aAAA,EAAE,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC;IANe,4BAAe,kBAM9B,CAAA;IAED,sFAAsF;IACtF,SAAgB,gBAAgB,CAAC,MAAoD;QACnF,OAAO,CAAyB,UAAqC,EAAE,EAAE;YACtE,UAAkB,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC;IAJe,6BAAgB,mBAI/B,CAAA;AACH,CAAC,EA1CgB,YAAY,KAAZ,YAAY,QA0C5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcResponseCacheControl } from \"./RpcConstants\";\nimport { OPERATION, POLICY, RpcRegistry } from \"./RpcRegistry\";\nimport {\n RpcRequestCallback_T, RpcRequestInitialRetryIntervalSupplier_T, RpcRequestTokenSupplier_T, RpcResponseCachingCallback_T,\n} from \"./RpcRequest\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** The policy for an RPC operation.\n * @internal\n */\nexport class RpcOperationPolicy {\n /** Supplies the IModelRpcProps for an operation request. */\n public token: RpcRequestTokenSupplier_T = (request) => request.findTokenPropsParameter();\n\n /** Supplies the initial retry interval for an operation request. */\n public retryInterval: RpcRequestInitialRetryIntervalSupplier_T = (configuration) => configuration.pendingOperationRetryInterval;\n\n /** Called before every operation request on the frontend is sent. */\n public requestCallback: RpcRequestCallback_T = (_request) => { };\n\n /** Called after every operation request on the frontend is sent. */\n public sentCallback: RpcRequestCallback_T = (_request) => { };\n\n /**\n * Determines if caching is permitted for an operation response.\n * @note Not all RPC protocols support caching.\n */\n public allowResponseCaching: RpcResponseCachingCallback_T = (_request) => RpcResponseCacheControl.None;\n\n /** Forces RpcConfiguration.strictMode for this operation. */\n public forceStrictMode: boolean = false;\n\n /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */\n public allowTokenMismatch: boolean = false;\n\n /** Whether to compress the operation response with one of the client's supported encodings. */\n public allowResponseCompression: boolean = false;\n}\n\n/** An RPC operation descriptor.\n * @internal\n */\nexport class RpcOperation {\n /** A fallback token to use for RPC requests that do not semantically depend on an iModel. */\n public static fallbackToken: IModelRpcProps | undefined = undefined;\n\n /** Looks up an RPC operation by name. */\n public static lookup(target: string | RpcInterfaceDefinition, operationName: string): RpcOperation {\n const definition = typeof (target) === \"string\" ? RpcRegistry.instance.lookupInterfaceDefinition(target) : target;\n const propertyName: string | symbol = RpcOperation.computeOperationName(operationName);\n\n const proto = (definition.prototype as any);\n if (!proto.hasOwnProperty(propertyName))\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${definition.interfaceName}\" does not does not declare operation \"${operationName}\"`);\n\n return proto[propertyName][OPERATION];\n }\n\n /** Iterates the operations of an RPC interface definition. */\n public static forEach(definition: RpcInterfaceDefinition, callback: (operation: RpcOperation) => void): void {\n Object.getOwnPropertyNames(definition.prototype).forEach((operationName) => {\n if (operationName === \"constructor\" || operationName === \"configurationSupplier\")\n return;\n\n const propertyName = RpcOperation.computeOperationName(operationName);\n callback((definition.prototype as any)[propertyName][OPERATION]);\n });\n }\n\n /** The RPC interface definition for this operation. */\n public readonly interfaceDefinition: RpcInterfaceDefinition;\n\n /** The name of this operation. */\n public readonly operationName: string;\n\n /** The version of this operation. */\n public get interfaceVersion(): string { return this.interfaceDefinition.interfaceVersion; }\n\n /** The policy for this operation. */\n public policy: RpcOperationPolicy;\n\n /** @internal */\n public constructor(definition: RpcInterfaceDefinition, operation: string, policy: RpcOperationPolicy) {\n this.interfaceDefinition = definition;\n this.operationName = operation;\n this.policy = policy;\n }\n\n /** @internal */\n public static computeOperationName(identifier: string): string {\n const c = identifier.indexOf(\":\");\n if (c === -1)\n return identifier;\n\n return identifier.substring(0, c + 1);\n }\n}\n\n/** @internal */\nexport type RpcOperationPolicyProps = Partial<RpcOperationPolicy>;\n\n/** @internal */\nexport namespace RpcOperation { // eslint-disable-line no-redeclare\n function obtainInstance(obj: RpcOperationPolicy | RpcOperationPolicyProps) {\n if (obj instanceof RpcOperationPolicy) {\n return obj;\n } else {\n const instance = new RpcOperationPolicy();\n Object.assign(instance, obj);\n return instance;\n }\n }\n\n /** Decorator for setting the policy for an RPC operation function. */\n export function setPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, obtainInstance(policy));\n };\n }\n\n /** Convenience decorator for setting an RPC operation policy that allows response caching. */\n export function allowResponseCaching(control: RpcResponseCacheControl = RpcResponseCacheControl.Immutable) {\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\n public override allowResponseCaching = () => control;\n }());\n };\n }\n\n /** Convenience decorator for setting an RPC operation policy that supplies the IModelRpcProps for an operation. */\n export function setRoutingProps(handler: RpcRequestTokenSupplier_T) {\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\n public override token = handler;\n }());\n };\n }\n\n /** Decorator for setting the default policy for an RPC interface definition class. */\n export function setDefaultPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\n return <T extends RpcInterface>(definition: RpcInterfaceDefinition<T>) => {\n (definition as any)[POLICY] = obtainInstance(policy);\n };\n }\n}\n"]}
1
+ {"version":3,"file":"RpcOperation.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcOperation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK/D,4CAA4C;AAE5C;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACE,4DAA4D;QACrD,UAAK,GAA8B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC;QAEzF,oEAAoE;QAC7D,kBAAa,GAA6C,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,6BAA6B,CAAC;QAEhI,qEAAqE;QAC9D,oBAAe,GAAyB,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC;QAEjE,oEAAoE;QAC7D,iBAAY,GAAyB,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC;QAE9D;;;WAGG;QACI,yBAAoB,GAAiC,CAAC,QAAQ,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC;QAEvG,6DAA6D;QACtD,oBAAe,GAAY,KAAK,CAAC;QAExC,yHAAyH;QAClH,uBAAkB,GAAY,KAAK,CAAC;QAE3C,+FAA+F;QACxF,6BAAwB,GAAY,IAAI,CAAC;IAClD,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,OAAO,YAAY;IAIvB,yCAAyC;IAClC,MAAM,CAAC,MAAM,CAAC,MAAuC,EAAE,aAAqB;QACjF,MAAM,UAAU,GAAG,OAAO,CA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AG,EAAE,CAAC,OAAO,CAAC;gBACvD,CAAC;aAAA,EAAE,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC;IANe,iCAAoB,uBAMnC,CAAA;IAED,mHAAmH;IACnH,SAAgB,eAAe,CAAC,OAAkC;QAChE,OAAO,CAAyB,MAAS,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;YAChG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,WAAkB,EAAE,WAAW,EAAE,IAAI,KAAM,SAAQ,kBAAkB;gBAAhC;;oBACzE,UAAK,GAAG,OAAO,CAAC;gBAClC,CAAC;aAAA,EAAE,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC;IANe,4BAAe,kBAM9B,CAAA;IAED,sFAAsF;IACtF,SAAgB,gBAAgB,CAAC,MAAoD;QACnF,OAAO,CAAyB,UAAqC,EAAE,EAAE;YACtE,UAAkB,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC;IAJe,6BAAgB,mBAI/B,CAAA;AACH,CAAC,EA1CgB,YAAY,KAAZ,YAAY,QA0C5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcResponseCacheControl } from \"./RpcConstants\";\nimport { OPERATION, POLICY, RpcRegistry } from \"./RpcRegistry\";\nimport {\n RpcRequestCallback_T, RpcRequestInitialRetryIntervalSupplier_T, RpcRequestTokenSupplier_T, RpcResponseCachingCallback_T,\n} from \"./RpcRequest\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** The policy for an RPC operation.\n * @internal\n */\nexport class RpcOperationPolicy {\n /** Supplies the IModelRpcProps for an operation request. */\n public token: RpcRequestTokenSupplier_T = (request) => request.findTokenPropsParameter();\n\n /** Supplies the initial retry interval for an operation request. */\n public retryInterval: RpcRequestInitialRetryIntervalSupplier_T = (configuration) => configuration.pendingOperationRetryInterval;\n\n /** Called before every operation request on the frontend is sent. */\n public requestCallback: RpcRequestCallback_T = (_request) => { };\n\n /** Called after every operation request on the frontend is sent. */\n public sentCallback: RpcRequestCallback_T = (_request) => { };\n\n /**\n * Determines if caching is permitted for an operation response.\n * @note Not all RPC protocols support caching.\n */\n public allowResponseCaching: RpcResponseCachingCallback_T = (_request) => RpcResponseCacheControl.None;\n\n /** Forces RpcConfiguration.strictMode for this operation. */\n public forceStrictMode: boolean = false;\n\n /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */\n public allowTokenMismatch: boolean = false;\n\n /** Whether to compress the operation response with one of the client's supported encodings. */\n public allowResponseCompression: boolean = true;\n}\n\n/** An RPC operation descriptor.\n * @internal\n */\nexport class RpcOperation {\n /** A fallback token to use for RPC requests that do not semantically depend on an iModel. */\n public static fallbackToken: IModelRpcProps | undefined = undefined;\n\n /** Looks up an RPC operation by name. */\n public static lookup(target: string | RpcInterfaceDefinition, operationName: string): RpcOperation {\n const definition = typeof (target) === \"string\" ? RpcRegistry.instance.lookupInterfaceDefinition(target) : target;\n const propertyName: string | symbol = RpcOperation.computeOperationName(operationName);\n\n const proto = (definition.prototype as any);\n if (!proto.hasOwnProperty(propertyName))\n throw new IModelError(BentleyStatus.ERROR, `RPC interface class \"${definition.interfaceName}\" does not does not declare operation \"${operationName}\"`);\n\n return proto[propertyName][OPERATION];\n }\n\n /** Iterates the operations of an RPC interface definition. */\n public static forEach(definition: RpcInterfaceDefinition, callback: (operation: RpcOperation) => void): void {\n Object.getOwnPropertyNames(definition.prototype).forEach((operationName) => {\n if (operationName === \"constructor\" || operationName === \"configurationSupplier\")\n return;\n\n const propertyName = RpcOperation.computeOperationName(operationName);\n callback((definition.prototype as any)[propertyName][OPERATION]);\n });\n }\n\n /** The RPC interface definition for this operation. */\n public readonly interfaceDefinition: RpcInterfaceDefinition;\n\n /** The name of this operation. */\n public readonly operationName: string;\n\n /** The version of this operation. */\n public get interfaceVersion(): string { return this.interfaceDefinition.interfaceVersion; }\n\n /** The policy for this operation. */\n public policy: RpcOperationPolicy;\n\n /** @internal */\n public constructor(definition: RpcInterfaceDefinition, operation: string, policy: RpcOperationPolicy) {\n this.interfaceDefinition = definition;\n this.operationName = operation;\n this.policy = policy;\n }\n\n /** @internal */\n public static computeOperationName(identifier: string): string {\n const c = identifier.indexOf(\":\");\n if (c === -1)\n return identifier;\n\n return identifier.substring(0, c + 1);\n }\n}\n\n/** @internal */\nexport type RpcOperationPolicyProps = Partial<RpcOperationPolicy>;\n\n/** @internal */\nexport namespace RpcOperation { // eslint-disable-line no-redeclare\n function obtainInstance(obj: RpcOperationPolicy | RpcOperationPolicyProps) {\n if (obj instanceof RpcOperationPolicy) {\n return obj;\n } else {\n const instance = new RpcOperationPolicy();\n Object.assign(instance, obj);\n return instance;\n }\n }\n\n /** Decorator for setting the policy for an RPC operation function. */\n export function setPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, obtainInstance(policy));\n };\n }\n\n /** Convenience decorator for setting an RPC operation policy that allows response caching. */\n export function allowResponseCaching(control: RpcResponseCacheControl = RpcResponseCacheControl.Immutable) {\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\n public override allowResponseCaching = () => control;\n }());\n };\n }\n\n /** Convenience decorator for setting an RPC operation policy that supplies the IModelRpcProps for an operation. */\n export function setRoutingProps(handler: RpcRequestTokenSupplier_T) {\n return <T extends RpcInterface>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n descriptor.value[OPERATION] = new RpcOperation(target.constructor as any, propertyKey, new class extends RpcOperationPolicy {\n public override token = handler;\n }());\n };\n }\n\n /** Decorator for setting the default policy for an RPC interface definition class. */\n export function setDefaultPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps) {\n return <T extends RpcInterface>(definition: RpcInterfaceDefinition<T>) => {\n (definition as any)[POLICY] = obtainInstance(policy);\n };\n }\n}\n"]}