@itwin/core-backend 4.6.0-dev.9 → 4.6.0

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 (181) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/lib/cjs/BackendHubAccess.js +1 -1
  3. package/lib/cjs/BackendHubAccess.js.map +1 -1
  4. package/lib/cjs/BackendLoggerCategory.d.ts +0 -5
  5. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  6. package/lib/cjs/BackendLoggerCategory.js +1 -6
  7. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  8. package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
  9. package/lib/cjs/BisCoreSchema.js +2 -0
  10. package/lib/cjs/BisCoreSchema.js.map +1 -1
  11. package/lib/cjs/BlobContainerService.js +1 -1
  12. package/lib/cjs/BlobContainerService.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.js +2 -2
  14. package/lib/cjs/BriefcaseManager.js.map +1 -1
  15. package/lib/cjs/Category.d.ts +1 -1
  16. package/lib/cjs/Category.js +1 -1
  17. package/lib/cjs/Category.js.map +1 -1
  18. package/lib/cjs/ChangeSummaryManager.js +3 -3
  19. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  20. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  21. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  22. package/lib/cjs/ChangesetECAdaptor.js +239 -239
  23. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  24. package/lib/cjs/ChannelControl.js +2 -2
  25. package/lib/cjs/ChannelControl.js.map +1 -1
  26. package/lib/cjs/CheckpointManager.js +4 -4
  27. package/lib/cjs/CheckpointManager.js.map +1 -1
  28. package/lib/cjs/ClassRegistry.d.ts +3 -0
  29. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  30. package/lib/cjs/ClassRegistry.js +24 -13
  31. package/lib/cjs/ClassRegistry.js.map +1 -1
  32. package/lib/cjs/CloudSqlite.js +1 -1
  33. package/lib/cjs/CloudSqlite.js.map +1 -1
  34. package/lib/cjs/CodeService.js +1 -1
  35. package/lib/cjs/CodeService.js.map +1 -1
  36. package/lib/cjs/CodeSpecs.js +1 -1
  37. package/lib/cjs/CodeSpecs.js.map +1 -1
  38. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  39. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  40. package/lib/cjs/DevTools.js +2 -2
  41. package/lib/cjs/DevTools.js.map +1 -1
  42. package/lib/cjs/DisplayStyle.js.map +1 -1
  43. package/lib/cjs/ECDb.js +1 -1
  44. package/lib/cjs/ECDb.js.map +1 -1
  45. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  46. package/lib/cjs/ECSqlStatement.js.map +1 -1
  47. package/lib/cjs/Element.d.ts +0 -16
  48. package/lib/cjs/Element.d.ts.map +1 -1
  49. package/lib/cjs/Element.js +7 -23
  50. package/lib/cjs/Element.js.map +1 -1
  51. package/lib/cjs/ElementAspect.js +1 -1
  52. package/lib/cjs/ElementAspect.js.map +1 -1
  53. package/lib/cjs/ElementGraphics.d.ts +0 -3
  54. package/lib/cjs/ElementGraphics.d.ts.map +1 -1
  55. package/lib/cjs/ElementGraphics.js +2 -5
  56. package/lib/cjs/ElementGraphics.js.map +1 -1
  57. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  58. package/lib/cjs/ElementTreeWalker.js +5 -0
  59. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  60. package/lib/cjs/Entity.js.map +1 -1
  61. package/lib/cjs/EntityReferences.js +1 -1
  62. package/lib/cjs/EntityReferences.js.map +1 -1
  63. package/lib/cjs/ExportGraphics.d.ts +1 -1
  64. package/lib/cjs/ExportGraphics.js +2 -2
  65. package/lib/cjs/ExportGraphics.js.map +1 -1
  66. package/lib/cjs/ExternalSource.js.map +1 -1
  67. package/lib/cjs/GeoCoordConfig.js +1 -1
  68. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  69. package/lib/cjs/GeometrySummary.js +47 -47
  70. package/lib/cjs/GeometrySummary.js.map +1 -1
  71. package/lib/cjs/HubMock.js +1 -1
  72. package/lib/cjs/HubMock.js.map +1 -1
  73. package/lib/cjs/IModelCloneContext.js.map +1 -1
  74. package/lib/cjs/IModelDb.d.ts +8 -2
  75. package/lib/cjs/IModelDb.d.ts.map +1 -1
  76. package/lib/cjs/IModelDb.js +70 -29
  77. package/lib/cjs/IModelDb.js.map +1 -1
  78. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  79. package/lib/cjs/IModelHost.js +2 -2
  80. package/lib/cjs/IModelHost.js.map +1 -1
  81. package/lib/cjs/IModelJsFs.js.map +1 -1
  82. package/lib/cjs/IpcHost.js +1 -1
  83. package/lib/cjs/IpcHost.js.map +1 -1
  84. package/lib/cjs/LineStyle.d.ts +1 -1
  85. package/lib/cjs/LineStyle.js +2 -2
  86. package/lib/cjs/LineStyle.js.map +1 -1
  87. package/lib/cjs/LocalHub.js +1 -1
  88. package/lib/cjs/LocalHub.js.map +1 -1
  89. package/lib/cjs/LocalhostIpcHost.js +1 -1
  90. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  91. package/lib/cjs/Material.js +1 -1
  92. package/lib/cjs/Material.js.map +1 -1
  93. package/lib/cjs/Model.js.map +1 -1
  94. package/lib/cjs/NativeAppStorage.js +1 -1
  95. package/lib/cjs/NativeAppStorage.js.map +1 -1
  96. package/lib/cjs/NativeHost.js +1 -1
  97. package/lib/cjs/NativeHost.js.map +1 -1
  98. package/lib/cjs/NavigationRelationship.js +21 -21
  99. package/lib/cjs/NavigationRelationship.js.map +1 -1
  100. package/lib/cjs/PromiseMemoizer.d.ts +0 -3
  101. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  102. package/lib/cjs/PromiseMemoizer.js +2 -5
  103. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  104. package/lib/cjs/PropertyStore.js +1 -1
  105. package/lib/cjs/PropertyStore.js.map +1 -1
  106. package/lib/cjs/Relationship.js.map +1 -1
  107. package/lib/cjs/RpcBackend.js.map +1 -1
  108. package/lib/cjs/SQLiteDb.js +2 -2
  109. package/lib/cjs/SQLiteDb.js.map +1 -1
  110. package/lib/cjs/Schema.js +1 -1
  111. package/lib/cjs/Schema.js.map +1 -1
  112. package/lib/cjs/SchemaSync.js +1 -1
  113. package/lib/cjs/SchemaSync.js.map +1 -1
  114. package/lib/cjs/SchemaUtils.js.map +1 -1
  115. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  116. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  117. package/lib/cjs/SqliteStatement.js +2 -2
  118. package/lib/cjs/SqliteStatement.js.map +1 -1
  119. package/lib/cjs/TextAnnotationElement.d.ts +54 -0
  120. package/lib/cjs/TextAnnotationElement.d.ts.map +1 -0
  121. package/lib/cjs/TextAnnotationElement.js +94 -0
  122. package/lib/cjs/TextAnnotationElement.js.map +1 -0
  123. package/lib/cjs/TextAnnotationGeometry.d.ts +28 -0
  124. package/lib/cjs/TextAnnotationGeometry.d.ts.map +1 -0
  125. package/lib/cjs/TextAnnotationGeometry.js +154 -0
  126. package/lib/cjs/TextAnnotationGeometry.js.map +1 -0
  127. package/lib/cjs/TextAnnotationLayout.d.ts +124 -0
  128. package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -0
  129. package/lib/cjs/TextAnnotationLayout.js +399 -0
  130. package/lib/cjs/TextAnnotationLayout.js.map +1 -0
  131. package/lib/cjs/Texture.js.map +1 -1
  132. package/lib/cjs/TileStorage.js.map +1 -1
  133. package/lib/cjs/TxnManager.d.ts.map +1 -1
  134. package/lib/cjs/TxnManager.js +53 -1
  135. package/lib/cjs/TxnManager.js.map +1 -1
  136. package/lib/cjs/ViewDefinition.js +4 -4
  137. package/lib/cjs/ViewDefinition.js.map +1 -1
  138. package/lib/cjs/ViewStateHydrator.d.ts +1 -0
  139. package/lib/cjs/ViewStateHydrator.d.ts.map +1 -1
  140. package/lib/cjs/ViewStateHydrator.js +1 -0
  141. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  142. package/lib/cjs/ViewStore.js +1 -1
  143. package/lib/cjs/ViewStore.js.map +1 -1
  144. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  145. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +44 -44
  146. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  147. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  148. package/lib/cjs/assets/Settings/backend.setting.json5 +132 -132
  149. package/lib/cjs/core-backend.d.ts +46 -61
  150. package/lib/cjs/core-backend.d.ts.map +1 -1
  151. package/lib/cjs/core-backend.js +46 -61
  152. package/lib/cjs/core-backend.js.map +1 -1
  153. package/lib/cjs/domains/FunctionalElements.js +1 -1
  154. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  155. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  156. package/lib/cjs/domains/GenericElements.js.map +1 -1
  157. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  158. package/lib/cjs/rpc/multipart.js.map +1 -1
  159. package/lib/cjs/rpc/tracing.js +2 -2
  160. package/lib/cjs/rpc/tracing.js.map +1 -1
  161. package/lib/cjs/rpc/web/logging.js +2 -2
  162. package/lib/cjs/rpc/web/logging.js.map +1 -1
  163. package/lib/cjs/rpc/web/request.js.map +1 -1
  164. package/lib/cjs/rpc/web/response.js +1 -1
  165. package/lib/cjs/rpc/web/response.js.map +1 -1
  166. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  167. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  168. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  169. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +1 -1
  170. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  171. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  172. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  173. package/lib/cjs/workspace/Settings.js +1 -1
  174. package/lib/cjs/workspace/Settings.js.map +1 -1
  175. package/lib/cjs/workspace/SettingsSchemas.d.ts +0 -5
  176. package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
  177. package/lib/cjs/workspace/SettingsSchemas.js +1 -10
  178. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  179. package/lib/cjs/workspace/Workspace.js +4 -4
  180. package/lib/cjs/workspace/Workspace.js.map +1 -1
  181. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,4DAAmG;AAA1F,iHAAA,cAAc,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAAE,uHAAA,oBAAoB,OAAA;AAEhE,qDAAmC;AACnC,0DAAwC;AACxC,kDAAgC;AAChC,yDAAuC;AACvC,qDAAmC;AACnC,6CAA2B;AAC3B,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,gDAA8B;AAC9B,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,iDAA+B;AAC/B,+DAA6C;AAC7C,6DAA2C;AAC3C,4DAA0C;AAC1C,0DAAwC;AACxC,yCAAuB;AACvB,uDAAqC;AACrC,mDAAiC;AACjC,4CAA0B;AAC1B,kDAAgC;AAChC,oDAAkC;AAClC,sDAAoC;AACpC,2CAAyB;AACzB,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AACjC,mDAAiC;AACjC,4CAA0B;AAC1B,uDAAqC;AACrC,6CAA2B;AAC3B,8DAA4C;AAC5C,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,0CAAwB;AACxB,qDAAmC;AACnC,+CAA6B;AAC7B,2DAAyC;AACzC,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,gDAA8B;AAC9B,6CAA2B;AAC3B,oDAAkC;AAClC,4CAA0B;AAC1B,gDAA8B;AAC9B,+CAA6B;AAC7B,mDAAiC;AACjC,8CAA4B;AAC5B,uDAAqC;AACrC,8DAA4C;AAC5C,wDAAsC;AACtC,0DAAwC;AACxC,uDAAqC;AAErC;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport { IModelJsNative, NativeCloudSqlite, NativeLoggerCategory } from \"@bentley/imodeljs-native\";\r\n\r\nexport * from \"./BackendHubAccess\";\r\nexport * from \"./BackendLoggerCategory\";\r\nexport * from \"./BisCoreSchema\";\r\nexport * from \"./BlobContainerService\";\r\nexport * from \"./BriefcaseManager\";\r\nexport * from \"./Category\";\r\nexport * from \"./ChangedElementsDb\";\r\nexport * from \"./ChangeSummaryManager\";\r\nexport * from \"./ChannelControl\";\r\nexport * from \"./CheckpointManager\";\r\nexport * from \"./ClassRegistry\";\r\nexport * from \"./CloudSqlite\";\r\nexport * from \"./CodeService\";\r\nexport * from \"./CodeSpecs\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyle\";\r\nexport * from \"./domains/FunctionalElements\";\r\nexport * from \"./domains/FunctionalSchema\";\r\nexport * from \"./domains/GenericElements\";\r\nexport * from \"./domains/GenericSchema\";\r\nexport * from \"./ECDb\";\r\nexport * from \"./ECSchemaXmlContext\";\r\nexport * from \"./ECSqlStatement\";\r\nexport * from \"./Element\";\r\nexport * from \"./ElementAspect\";\r\nexport * from \"./ElementGraphics\";\r\nexport * from \"./ElementTreeWalker\";\r\nexport * from \"./Entity\";\r\nexport * from \"./EntityReferences\";\r\nexport * from \"./ExportGraphics\";\r\nexport * from \"./ExternalSource\";\r\nexport * from \"./GeoCoordConfig\";\r\nexport * from \"./HubMock\";\r\nexport * from \"./IModelCloneContext\";\r\nexport * from \"./IModelDb\";\r\nexport * from \"./IModelElementCloneContext\";\r\nexport * from \"./IModelHost\";\r\nexport * from \"./IModelJsFs\";\r\nexport * from \"./SchemaSync\";\r\nexport * from \"./IpcHost\";\r\nexport * from \"./LineStyle\";\r\nexport * from \"./LocalhostIpcHost\";\r\nexport * from \"./LocalHub\";\r\nexport * from \"./Material\";\r\nexport * from \"./Model\";\r\nexport * from \"./NativeAppStorage\";\r\nexport * from \"./NativeHost\";\r\nexport * from \"./NavigationRelationship\";\r\nexport * from \"./PropertyStore\";\r\nexport * from \"./Relationship\";\r\nexport * from \"./rpc/tracing\";\r\nexport * from \"./Schema\";\r\nexport * from \"./SchemaUtils\";\r\nexport * from \"./SQLiteDb\";\r\nexport * from \"./SqliteStatement\";\r\nexport * from \"./Texture\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TxnManager\";\r\nexport * from \"./ViewDefinition\";\r\nexport * from \"./ViewStore\";\r\nexport * from \"./workspace/Settings\";\r\nexport * from \"./workspace/SettingsSchemas\";\r\nexport * from \"./workspace/Workspace\";\r\nexport * from \"./SqliteChangesetReader\";\r\nexport * from \"./ChangesetECAdaptor\";\r\n\r\n/** @docs-package-description\r\n * The core-backend package always runs on the computer with a local Briefcase.\r\n *\r\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\r\n */\r\n/**\r\n * @docs-group-description IModelHost\r\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\r\n * See [the learning article]($docs/learning/backend/IModelHost.md).\r\n */\r\n/**\r\n * @docs-group-description iModels\r\n * Classes for working with [iModels]($docs/learning/iModels.md).\r\n * See [the learning article]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Schema\r\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n */\r\n/**\r\n * @docs-group-description Models\r\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Elements\r\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Codes\r\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ViewDefinitions\r\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\r\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\r\n */\r\n/**\r\n * @docs-group-description Relationships\r\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\r\n */\r\n/**\r\n * @docs-group-description ElementAspects\r\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Categories\r\n * Classes for [Categories]($docs/bis/guide/fundamentals/categories.md).\r\n */\r\n/**\r\n * @docs-group-description Symbology\r\n * Classes for defining the appearance of element geometry\r\n */\r\n/**\r\n * @docs-group-description ECDb\r\n * Classes for working with ECDb.\r\n */\r\n/**\r\n * @docs-group-description SQLiteDb\r\n * Classes for working with SQLiteDb.\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Mobile/Desktop Application.\r\n */\r\n/**\r\n * @docs-group-description ECSQL\r\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n/**\r\n * @docs-group-description SQLite\r\n * Classes for working directly with SQLite\r\n */\r\n/**\r\n * @docs-group-description Portability\r\n * Classes to help write [portable apps]($docs/learning/Portability.md) and libraries that will run on any platform, including web apps, node services, Electron desktops apps, and mobile apps.\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package.\r\n */\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\r\n */\r\n/**\r\n * @docs-group-description BlobContainers\r\n * Classes for working with cloud-based blob containers.\r\n */\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n */\r\n/**\r\n * @docs-group-description Authentication\r\n * Classes for working with Authentication.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * APIs for working with tile graphics.\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description Workspace\r\n * APIs for loading and using Settings and Workspace resources\r\n */\r\n/**\r\n * @docs-group-description ViewStateHydrator\r\n * Class responsible for loading ViewStates.\r\n */\r\n"]}
1
+ {"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,4DAAmG;AAA1F,iHAAA,cAAc,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAAE,uHAAA,oBAAoB,OAAA;AAEhE,qDAAmC;AACnC,0DAAwC;AACxC,k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GG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG","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\nexport { IModelJsNative, NativeCloudSqlite, NativeLoggerCategory } from \"@bentley/imodeljs-native\";\n\nexport * from \"./BackendHubAccess\";\nexport * from \"./BackendLoggerCategory\";\nexport * from \"./BisCoreSchema\";\nexport * from \"./BlobContainerService\";\nexport * from \"./BriefcaseManager\";\nexport * from \"./Category\";\nexport * from \"./ChangedElementsDb\";\nexport * from \"./ChangeSummaryManager\";\nexport * from \"./ChannelControl\";\nexport * from \"./CheckpointManager\";\nexport * from \"./ClassRegistry\";\nexport * from \"./CloudSqlite\";\nexport * from \"./CodeService\";\nexport * from \"./CodeSpecs\";\nexport * from \"./DevTools\";\nexport * from \"./DisplayStyle\";\nexport * from \"./domains/FunctionalElements\";\nexport * from \"./domains/FunctionalSchema\";\nexport * from \"./domains/GenericElements\";\nexport * from \"./domains/GenericSchema\";\nexport * from \"./ECDb\";\nexport * from \"./ECSchemaXmlContext\";\nexport * from \"./ECSqlStatement\";\nexport * from \"./Element\";\nexport * from \"./ElementAspect\";\nexport * from \"./ElementGraphics\";\nexport * from \"./ElementTreeWalker\";\nexport * from \"./Entity\";\nexport * from \"./EntityReferences\";\nexport * from \"./ExportGraphics\";\nexport * from \"./ExternalSource\";\nexport * from \"./GeoCoordConfig\";\nexport * from \"./HubMock\";\nexport * from \"./IModelCloneContext\";\nexport * from \"./IModelDb\";\nexport * from \"./IModelElementCloneContext\";\nexport * from \"./IModelHost\";\nexport * from \"./IModelJsFs\";\nexport * from \"./SchemaSync\";\nexport * from \"./IpcHost\";\nexport * from \"./LineStyle\";\nexport * from \"./LocalhostIpcHost\";\nexport * from \"./LocalHub\";\nexport * from \"./Material\";\nexport * from \"./Model\";\nexport * from \"./NativeAppStorage\";\nexport * from \"./NativeHost\";\nexport * from \"./NavigationRelationship\";\nexport * from \"./PropertyStore\";\nexport * from \"./Relationship\";\nexport * from \"./rpc/tracing\";\nexport * from \"./Schema\";\nexport * from \"./SchemaUtils\";\nexport * from \"./SQLiteDb\";\nexport * from \"./SqliteStatement\";\nexport * from \"./TextAnnotationElement\";\nexport * from \"./TextAnnotationGeometry\";\nexport * from \"./Texture\";\nexport * from \"./TileStorage\";\nexport * from \"./TxnManager\";\nexport * from \"./ViewDefinition\";\nexport * from \"./ViewStore\";\nexport * from \"./workspace/Settings\";\nexport * from \"./workspace/SettingsSchemas\";\nexport * from \"./workspace/Workspace\";\nexport * from \"./SqliteChangesetReader\";\nexport * from \"./ChangesetECAdaptor\";\n\n/** @docs-package-description\n * The core-backend package always runs on the computer with a local Briefcase.\n *\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\n */\n\n/**\n * @docs-group-description BlobContainers\n * Classes for working with cloud-based blob containers.\n */\n\n/**\n * @docs-group-description Codes\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\n * See [the learning articles]($docs/learning/backend/index.md).\n */\n\n/**\n * @docs-group-description ECDb\n * Classes for working with ECDb.\n */\n\n/**\n * @docs-group-description ECSQL\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\n */\n\n/**\n * @docs-group-description ElementAspects\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\n * See [the learning articles]($docs/learning/backend/index.md).\n */\n\n/**\n * @docs-group-description ElementGeometry\n * Classes for defining the symbology and geometry of geometric elements\n */\n\n/**\n * @docs-group-description Elements\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\n * See [the learning articles]($docs/learning/backend/index.md).\n */\n\n/**\n * @docs-group-description ExportGraphics\n * APIs for producing low-level graphics primitives from element geometry.\n */\n\n/**\n * @docs-group-description HubAccess\n * APIs for working with IModelHub\n */\n\n/**\n * @docs-group-description IModelHost\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\n * See [the learning article]($docs/learning/backend/IModelHost.md).\n */\n\n/**\n * @docs-group-description iModels\n * Classes for working with [iModels]($docs/learning/iModels.md).\n * See [the learning article]($docs/learning/backend/index.md).\n */\n\n/**\n * @docs-group-description Logging\n * Logger categories used by this package.\n */\n\n/**\n * @docs-group-description Models\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\n * See [the learning articles]($docs/learning/backend/index.md).\n */\n\n/**\n * @docs-group-description NativeApp\n * Classes for working with Mobile/Desktop Application.\n */\n\n/**\n * @docs-group-description Portability\n */\n\n/**\n * @docs-group-description Relationships\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\n */\n\n/**\n * @docs-group-description RpcInterface\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\n */\n\n/**\n * @docs-group-description Schema\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\n */\n\n/**\n * @docs-group-description SQLite\n * Classes for working directly with SQLite\n */\n\n/**\n * @docs-group-description SQLiteDb\n * Classes for working with SQLiteDb.\n */\n\n/**\n * @docs-group-description TileStorage\n * Class for working with cloud storage using iTwin/object-storage cloud providers\n */\n\n/**\n * @docs-group-description ViewDefinitions\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\n */\n\n/**\n * @docs-group-description Workspace\n * APIs for loading and using Settings and Workspace resources\n */\n"]}
@@ -119,8 +119,8 @@ class FunctionalElementIsOfType extends core_common_1.RelatedElement {
119
119
  super({ id, relClassName });
120
120
  }
121
121
  }
122
- FunctionalElementIsOfType.classFullName = "Functional:FunctionalElementIsOfType";
123
122
  exports.FunctionalElementIsOfType = FunctionalElementIsOfType;
123
+ FunctionalElementIsOfType.classFullName = "Functional:FunctionalElementIsOfType";
124
124
  /** Relates a [[PhysicalElement]] to the [[FunctionalElement]] elements that it fulfills.
125
125
  * @public
126
126
  */
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionalElements.js","sourceRoot":"","sources":["../../../src/domains/FunctionalElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAE4B;AAC5B,wCAA6F;AAE7F,oCAAqC;AACrC,sEAAyE;AACzE,kDAA2F;AAE3F;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,qCAA2B;IAClE,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAEhF,YAAsB,KAAuC,EAAE,MAAgB;QAC7E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,kDAOC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,iBAAS;IAC5C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAE5E,YAAmB,KAAiB,EAAE,MAAgB;QACpD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,QAAkB,EAAE,eAA2B,EAAE,IAAY;QAChF,MAAM,cAAc,GAAqC;YACvD,aAAa,EAAE,mBAAmB,CAAC,aAAa;YAChD,KAAK,EAAE,oBAAM,CAAC,iBAAiB;YAC/B,MAAM,EAAE,IAAI,qDAA4B,CAAC,eAAe,CAAC;YACzD,IAAI,EAAE,mBAAmB,CAAC,UAAU,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC;SACtE,CAAC;QACF,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QACpE,OAAO,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;YACjC,aAAa,EAAE,IAAI,CAAC,aAAa;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M,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,wCAOC;AAED;;GAEG;AACH,MAAa,yBAA0B,SAAQ,4BAAc;IAC3D,gBAAgB;IACT,MAAM,KAAK,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAE7E,YAAmB,EAAc,EAAE,eAAuB,yBAAyB,CAAC,aAAa;QAC/F,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;IAC9B,CAAC;;AAHa,uCAAa,GAAG,sCAAsC,CAAC;AAH1D,8DAAyB;AAStC;;GAEG;AACH,MAAa,+BAAgC,SAAQ,sCAAuB;IAC1E,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iCAAiC,CAAC,CAAC,CAAC;CAC7F;AAHD,0EAGC;AAED;;GAEG;AACH,MAAa,yCAA0C,SAAQ,8CAA+B;IAC5F,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2CAA2C,CAAC,CAAC,CAAC;CACvG;AAHD,8FAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n FunctionalElementProps, IModel, InformationPartitionElementProps, ModelProps, RelatedElement, TypeDefinitionElementProps,\r\n} from \"@itwin/core-common\";\r\nimport { InformationPartitionElement, RoleElement, TypeDefinitionElement } from \"../Element\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { RoleModel } from \"../Model\";\r\nimport { SubjectOwnsPartitionElements } from \"../NavigationRelationship\";\r\nimport { DrawingGraphicRepresentsElement, ElementRefersToElements } from \"../Relationship\";\r\n\r\n/** A FunctionalPartition element is a key part of the iModel information hierarchy and is always parented\r\n * to a Subject and broken down by a FunctionalModel.\r\n * @public\r\n */\r\nexport class FunctionalPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"FunctionalPartition\"; }\r\n\r\n protected constructor(props: InformationPartitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A container for persisting FunctionalElements.\r\n * @public\r\n */\r\nexport class FunctionalModel extends RoleModel {\r\n /** @internal */\r\n public static override get className(): string { return \"FunctionalModel\"; }\r\n\r\n public constructor(props: ModelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Insert a FunctionalPartition and a FunctionalModel that breaks it down.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The FunctionalPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the FunctionalPartition that the new FunctionalModel will break down.\r\n * @returns The Id of the newly inserted FunctionalPartition and FunctionalModel (same value).\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: FunctionalPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: FunctionalPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n return iModelDb.models.insertModel({\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n });\r\n }\r\n}\r\n\r\n/** A FunctionalElement captures functional requirements that will ultimately be fulfilled by a PhysicalElement.\r\n * @public\r\n */\r\nexport abstract class FunctionalElement extends RoleElement {\r\n /** @internal */\r\n public static override get className(): string { return \"FunctionalElement\"; }\r\n\r\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A FunctionalBreakdownElement is a *folder* node in the functional hierarchy.\r\n * @public\r\n */\r\nexport abstract class FunctionalBreakdownElement extends FunctionalElement {\r\n /** @internal */\r\n public static override get className(): string { return \"FunctionalBreakdownElement\"; }\r\n\r\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport class FunctionalComposite extends FunctionalBreakdownElement {\r\n /** @internal */\r\n public static override get className(): string { return \"FunctionalComposite\"; }\r\n\r\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A FunctionalComponentElement is a *leaf* node in the functional hierarchy.\r\n * @public\r\n */\r\nexport abstract class FunctionalComponentElement extends FunctionalElement {\r\n /** @internal */\r\n public static override get className(): string { return \"FunctionalComponentElement\"; }\r\n\r\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** Defines a set of properties (the 'type') that can be associated with a Functional Element.\r\n * @public\r\n */\r\nexport abstract class FunctionalType extends TypeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"FunctionalType\"; }\r\n\r\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** Relates a [[FunctionalElement]] to its [[FunctionalType]]\r\n * @public\r\n */\r\nexport class FunctionalElementIsOfType extends RelatedElement {\r\n /** @internal */\r\n public static get className(): string { return \"FunctionalElementIsOfType\"; }\r\n public static classFullName = \"Functional:FunctionalElementIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = FunctionalElementIsOfType.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to the [[FunctionalElement]] elements that it fulfills.\r\n * @public\r\n */\r\nexport class PhysicalElementFulfillsFunction extends ElementRefersToElements {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalElementFulfillsFunction\"; }\r\n}\r\n\r\n/** Relates a [[DrawingGraphic]] to the [[FunctionalElement]] that it represents\r\n * @public\r\n */\r\nexport class DrawingGraphicRepresentsFunctionalElement extends DrawingGraphicRepresentsElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DrawingGraphicRepresentsFunctionalElement\"; }\r\n}\r\n"]}
1
+ {"version":3,"file":"FunctionalElements.js","sourceRoot":"","sources":["../../../src/domains/FunctionalElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAE4B;AAC5B,wCAA6F;AAE7F,oCAAqC;AACrC,sEAAyE;AACzE,kDAA2F;AAE3F;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,qCAA2B;IAClE,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAEhF,YAAsB,KAAuC,EAAE,MAAgB;QAC7E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,kDAOC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,iBAAS;IAC5C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAE5E,YAAmB,KAAiB,EAAE,MAAgB;QACpD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,QAAkB,EAAE,eAA2B,EAAE,IAAY;QAChF,MAAM,cAAc,GAAqC;YACvD,aAAa,EAAE,mBAAmB,CAAC,aAAa;YAChD,KAAK,EAAE,oBAAM,CAAC,iBAAiB;YAC/B,MAAM,EAAE,IAAI,qDAA4B,CAAC,eAAe,CAAC;YACzD,IAAI,EAAE,mBAAmB,CAAC,UAAU,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC;SACtE,CAAC;QACF,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QACpE,OAAO,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;YACjC,aAAa,EAAE,IAAI,CAAC,aAAa;Y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,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,wCAOC;AAED;;GAEG;AACH,MAAa,yBAA0B,SAAQ,4BAAc;IAC3D,gBAAgB;IACT,MAAM,KAAK,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAE7E,YAAmB,EAAc,EAAE,eAAuB,yBAAyB,CAAC,aAAa;QAC/F,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;IAC9B,CAAC;;AANH,8DAOC;AAJe,uCAAa,GAAG,sCAAsC,CAAC;AAMvE;;GAEG;AACH,MAAa,+BAAgC,SAAQ,sCAAuB;IAC1E,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iCAAiC,CAAC,CAAC,CAAC;CAC7F;AAHD,0EAGC;AAED;;GAEG;AACH,MAAa,yCAA0C,SAAQ,8CAA+B;IAC5F,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2CAA2C,CAAC,CAAC,CAAC;CACvG;AAHD,8FAGC","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 Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport {\n FunctionalElementProps, IModel, InformationPartitionElementProps, ModelProps, RelatedElement, TypeDefinitionElementProps,\n} from \"@itwin/core-common\";\nimport { InformationPartitionElement, RoleElement, TypeDefinitionElement } from \"../Element\";\nimport { IModelDb } from \"../IModelDb\";\nimport { RoleModel } from \"../Model\";\nimport { SubjectOwnsPartitionElements } from \"../NavigationRelationship\";\nimport { DrawingGraphicRepresentsElement, ElementRefersToElements } from \"../Relationship\";\n\n/** A FunctionalPartition element is a key part of the iModel information hierarchy and is always parented\n * to a Subject and broken down by a FunctionalModel.\n * @public\n */\nexport class FunctionalPartition extends InformationPartitionElement {\n /** @internal */\n public static override get className(): string { return \"FunctionalPartition\"; }\n\n protected constructor(props: InformationPartitionElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A container for persisting FunctionalElements.\n * @public\n */\nexport class FunctionalModel extends RoleModel {\n /** @internal */\n public static override get className(): string { return \"FunctionalModel\"; }\n\n public constructor(props: ModelProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n /** Insert a FunctionalPartition and a FunctionalModel that breaks it down.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The FunctionalPartition will be inserted as a child of this Subject element.\n * @param name The name of the FunctionalPartition that the new FunctionalModel will break down.\n * @returns The Id of the newly inserted FunctionalPartition and FunctionalModel (same value).\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: FunctionalPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: FunctionalPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n return iModelDb.models.insertModel({\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n });\n }\n}\n\n/** A FunctionalElement captures functional requirements that will ultimately be fulfilled by a PhysicalElement.\n * @public\n */\nexport abstract class FunctionalElement extends RoleElement {\n /** @internal */\n public static override get className(): string { return \"FunctionalElement\"; }\n\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A FunctionalBreakdownElement is a *folder* node in the functional hierarchy.\n * @public\n */\nexport abstract class FunctionalBreakdownElement extends FunctionalElement {\n /** @internal */\n public static override get className(): string { return \"FunctionalBreakdownElement\"; }\n\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** @public */\nexport class FunctionalComposite extends FunctionalBreakdownElement {\n /** @internal */\n public static override get className(): string { return \"FunctionalComposite\"; }\n\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A FunctionalComponentElement is a *leaf* node in the functional hierarchy.\n * @public\n */\nexport abstract class FunctionalComponentElement extends FunctionalElement {\n /** @internal */\n public static override get className(): string { return \"FunctionalComponentElement\"; }\n\n protected constructor(props: FunctionalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Defines a set of properties (the 'type') that can be associated with a Functional Element.\n * @public\n */\nexport abstract class FunctionalType extends TypeDefinitionElement {\n /** @internal */\n public static override get className(): string { return \"FunctionalType\"; }\n\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Relates a [[FunctionalElement]] to its [[FunctionalType]]\n * @public\n */\nexport class FunctionalElementIsOfType extends RelatedElement {\n /** @internal */\n public static get className(): string { return \"FunctionalElementIsOfType\"; }\n public static classFullName = \"Functional:FunctionalElementIsOfType\";\n public constructor(id: Id64String, relClassName: string = FunctionalElementIsOfType.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[PhysicalElement]] to the [[FunctionalElement]] elements that it fulfills.\n * @public\n */\nexport class PhysicalElementFulfillsFunction extends ElementRefersToElements {\n /** @internal */\n public static override get className(): string { return \"PhysicalElementFulfillsFunction\"; }\n}\n\n/** Relates a [[DrawingGraphic]] to the [[FunctionalElement]] that it represents\n * @public\n */\nexport class DrawingGraphicRepresentsFunctionalElement extends DrawingGraphicRepresentsElement {\n /** @internal */\n public static override get className(): string { return \"DrawingGraphicRepresentsFunctionalElement\"; }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionalSchema.js","sourceRoot":"","sources":["../../../src/domains/FunctionalSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,sDAA+C;AAC/C,oDAAiD;AACjD,oDAAiD;AAEjD,8CAA+C;AAC/C,sCAA4C;AAC5C,uDAAuD;AAEvD,cAAc;AACd,MAAa,gBAAiB,SAAQ,eAAM;IACnC,MAAM,KAAc,UAAU,KAAa,OAAO,YAAY,CAAC,CAAC,CAAC;IACjE,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IAC/J,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACzD,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,6BAAa,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SACpD;IACH,CAAC;IAED,cAAc;IACP,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,QAAkB;QACjD,IAAI,QAAQ,CAAC,aAAa,EAAE;YAC1B,MAAM,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAErC,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,CAAC;QACxD,IAAI,uBAAQ,CAAC,YAAY,KAAK,IAAI,EAAE;YAClC,MAAM,IAAI,yBAAW,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC;SAClE;IACH,CAAC;CACF;AArBD,4CAqBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Schema\r\n */\r\n\r\nimport * as path from \"path\";\r\nimport { DbResult } from \"@itwin/core-bentley\";\r\nimport { IModelError } from \"@itwin/core-common\";\r\nimport { ClassRegistry } from \"../ClassRegistry\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { KnownLocations } from \"../IModelHost\";\r\nimport { Schema, Schemas } from \"../Schema\";\r\nimport * as elementsModule from \"./FunctionalElements\";\r\n\r\n/** @public */\r\nexport class FunctionalSchema extends Schema {\r\n public static override get schemaName(): string { return \"Functional\"; }\r\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Domain\", `${FunctionalSchema.schemaName}.ecschema.xml`); }\r\n public static registerSchema() {\r\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n ClassRegistry.registerModule(elementsModule, this);\r\n }\r\n }\r\n\r\n /** @public */\r\n public static async importSchema(iModelDb: IModelDb) {\r\n if (iModelDb.isBriefcaseDb())\r\n await iModelDb.acquireSchemaLock();\r\n\r\n const stat = iModelDb.nativeDb.importFunctionalSchema();\r\n if (DbResult.BE_SQLITE_OK !== stat) {\r\n throw new IModelError(stat, \"Error importing Functional schema\");\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"FunctionalSchema.js","sourceRoot":"","sources":["../../../src/domains/FunctionalSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,sDAA+C;AAC/C,oDAAiD;AACjD,oDAAiD;AAEjD,8CAA+C;AAC/C,sCAA4C;AAC5C,uDAAuD;AAEvD,cAAc;AACd,MAAa,gBAAiB,SAAQ,eAAM;IACnC,MAAM,KAAc,UAAU,KAAa,OAAO,YAAY,CAAC,CAAC,CAAC;IACjE,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IAC/J,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1D,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,6BAAa,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,cAAc;IACP,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,QAAkB;QACjD,IAAI,QAAQ,CAAC,aAAa,EAAE;YAC1B,MAAM,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAErC,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,CAAC;QACxD,IAAI,uBAAQ,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YACnC,MAAM,IAAI,yBAAW,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;CACF;AArBD,4CAqBC","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 Schema\n */\n\nimport * as path from \"path\";\nimport { DbResult } from \"@itwin/core-bentley\";\nimport { IModelError } from \"@itwin/core-common\";\nimport { ClassRegistry } from \"../ClassRegistry\";\nimport { IModelDb } from \"../IModelDb\";\nimport { KnownLocations } from \"../IModelHost\";\nimport { Schema, Schemas } from \"../Schema\";\nimport * as elementsModule from \"./FunctionalElements\";\n\n/** @public */\nexport class FunctionalSchema extends Schema {\n public static override get schemaName(): string { return \"Functional\"; }\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Domain\", `${FunctionalSchema.schemaName}.ecschema.xml`); }\n public static registerSchema() {\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\n Schemas.unregisterSchema(this.schemaName);\n Schemas.registerSchema(this);\n ClassRegistry.registerModule(elementsModule, this);\n }\n }\n\n /** @public */\n public static async importSchema(iModelDb: IModelDb) {\n if (iModelDb.isBriefcaseDb())\n await iModelDb.acquireSchemaLock();\n\n const stat = iModelDb.nativeDb.importFunctionalSchema();\n if (DbResult.BE_SQLITE_OK !== stat) {\n throw new IModelError(stat, \"Error importing Functional schema\");\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GenericElements.js","sourceRoot":"","sources":["../../../src/domains/GenericElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAG4B;AAC5B,wCAGoB;AAEpB,0CAA+C;AAC/C,oCAAmE;AACnE,sEAAyE;AAEzE;;GAEG;AACH,MAAsB,eAAgB,SAAQ,4BAAkB;IAC9D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5E,YAAmB,KAA8B,EAAE,MAAgB;QACjE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0CAMC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,eAAe;IAC5C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,WAAW,CAAC,CAAC,CAAC;IACtE,YAAmB,KAA8B,EAAE,MAAgB;QACjE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,8BAMC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,eAAe;IACtD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAChF,YAAmB,KAA+B,EAAE,MAAgB;QAClE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,kDAMC;AAED;;GAEG;AACH,MAAsB,OAAQ,SAAQ,eAAe;IACnD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,SAAS,CAAC,CA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3C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,UAAU,CAAC,CAAC,CAAC;IACrE,YAAmB,KAAmB,EAAE,MAAgB;QACtD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0CAMC;AAED;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,2BAAgB;IAC3D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;IAC7E,YAAmB,KAA6B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0DAMC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,sBAAY;IACnD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IACzE,YAAmB,KAAwB,EAAE,MAAgB;QAC3D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,kDAMC;AAED;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,yBAAe;IACzD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5E,YAAmB,KAAiC,EAAE,MAAgB;QACpE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,wDAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n CalloutProps, DefinitionElementProps, ElementProps, GeometricElement2dProps, GeometricElement3dProps, GeometricModel3dProps, IModel,\r\n InformationPartitionElementProps, ModelProps, PhysicalElementProps, PhysicalTypeProps, TypeDefinitionElementProps, ViewAttachmentLabelProps,\r\n} from \"@itwin/core-common\";\r\nimport {\r\n Document, GraphicalElement2d, GraphicalElement3d, GraphicalPartition3d, GraphicalType2d, GroupInformationElement, GroupInformationPartition,\r\n PhysicalElement, PhysicalType, SpatialLocationElement,\r\n} from \"../Element\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { PhysicalMaterial } from \"../Material\";\r\nimport { GraphicalModel3d, GroupInformationModel } from \"../Model\";\r\nimport { SubjectOwnsPartitionElements } from \"../NavigationRelationship\";\r\n\r\n/** A graphical detailing symbol that is placed on a [[Drawing]] or [[Sheet]].\r\n * @public\r\n */\r\nexport abstract class DetailingSymbol extends GraphicalElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"DetailingSymbol\"; }\r\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical DetailingSymbol that contains title text.\r\n * @public\r\n */\r\nexport class TitleText extends DetailingSymbol {\r\n /** @internal */\r\n public static override get className(): string { return \"TitleText\"; }\r\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical DetailingSymbol that contains a view attachment label.\r\n * @public\r\n */\r\nexport class ViewAttachmentLabel extends DetailingSymbol {\r\n /** @internal */\r\n public static override get className(): string { return \"ViewAttachmentLabel\"; }\r\n public constructor(props: ViewAttachmentLabelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical DetailingSymbol that calls out a reference to another drawing.\r\n * @public\r\n */\r\nexport abstract class Callout extends DetailingSymbol {\r\n /** @internal */\r\n public static override get className(): string { return \"Callout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references a section drawing.\r\n * @public\r\n */\r\nexport class SectionCallout extends Callout {\r\n /** @internal */\r\n public static override get className(): string { return \"SectionCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references an elevation drawing.\r\n * @public\r\n */\r\nexport class ElevationCallout extends Callout {\r\n /** @internal */\r\n public static override get className(): string { return \"ElevationCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references a plan drawing.\r\n * @public\r\n */\r\nexport class PlanCallout extends Callout {\r\n /** @internal */\r\n public static override get className(): string { return \"PlanCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A graphical Callout that references a detail drawing.\r\n * @public\r\n */\r\nexport class DetailCallout extends Callout {\r\n /** @internal */\r\n public static override get className(): string { return \"DetailCallout\"; }\r\n public constructor(props: CalloutProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A generic container for persisting BisCore:GraphicalElement3d instances.\r\n * @public\r\n */\r\nexport class GenericGraphicalModel3d extends GraphicalModel3d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalModel3d\"; }\r\n public constructor(props: GeometricModel3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n /** Insert a BisCore:GraphicalPartition3d and a Generic:GraphicalModel3d that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The GraphicalPartition3d will be inserted as a child of this Subject element.\r\n * @param name The name of the GraphicalPartition3d that the new Generic:GraphicalModel3d will sub-model.\r\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\r\n * @returns The Id of the newly inserted GraphicalPartition3d and GraphicalModel3d (same value).\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: GraphicalPartition3d.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: GraphicalPartition3d.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n const modelProps: GeometricModel3dProps = {\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n isPlanProjection,\r\n };\r\n return iModelDb.models.insertModel(modelProps);\r\n }\r\n}\r\n\r\n/** The Generic:Graphic3d class is used when 3D graphics cannot be further classified.\r\n * @note More-specific BisCore:GraphicalElement3d subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class Graphic3d extends GraphicalElement3d {\r\n /** @internal */\r\n public static override get className(): string { return \"Graphic3d\"; }\r\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:PhysicalObject class is used when physical elements cannot be further classified.\r\n * @note More-specific BisCore:PhysicalElement subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class PhysicalObject extends PhysicalElement {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalObject\"; }\r\n public constructor(props: PhysicalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:SpatialLocation class is used when spatial locations cannot be further classified.\r\n * @note More-specific BisCore:SpatialLocationElement subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class SpatialLocation extends SpatialLocationElement {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocation\"; }\r\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** A generic container for BisCore:GroupInformationElement instances.\r\n * @public\r\n */\r\nexport class GroupModel extends GroupInformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupModel\"; }\r\n public constructor(props: ModelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n /** Insert a GroupInformationPartition and a GroupModel that breaks it down.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The GroupInformationPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the GroupInformationPartition that the new GroupModel will break down.\r\n * @returns The Id of the newly inserted GroupModel.\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: GroupInformationPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: GroupInformationPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n return iModelDb.models.insertModel({\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n });\r\n }\r\n}\r\n\r\n/** The Generic:Group class is used when the group cannot be further classified.\r\n * @public\r\n */\r\nexport class Group extends GroupInformationElement {\r\n /** @internal */\r\n public static override get className(): string { return \"Group\"; }\r\n public constructor(props: ElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:Document class is used when a document cannot be further classified.\r\n * @note More-specific BisCore:Document subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericDocument extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"Document\"; }\r\n public constructor(props: ElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:PhysicalMaterial class is used when the physical material cannot be further classified.\r\n * @note More-specific BisCore:PhysicalMaterial subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericPhysicalMaterial extends PhysicalMaterial {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalMaterial\"; }\r\n public constructor(props: DefinitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:PhysicalType class is used when the physical type cannot be further classified.\r\n * @note More-specific BisCore:PhysicalType subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericPhysicalType extends PhysicalType {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalType\"; }\r\n public constructor(props: PhysicalTypeProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** The Generic:GraphicalType2d class is used when graphical types cannot be further classified.\r\n * @note More-specific BisCore:GraphicalType2d subclasses should be used wherever possible.\r\n * @public\r\n */\r\nexport class GenericGraphicalType2d extends GraphicalType2d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalType2d\"; }\r\n public constructor(props: TypeDefinitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"GenericElements.js","sourceRoot":"","sources":["../../../src/domains/GenericElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAG4B;AAC5B,wCAGoB;AAEpB,0CAA+C;AAC/C,oCAAmE;AACnE,sEAAyE;AAEzE;;GAEG;AACH,MAAsB,eAAgB,SAAQ,4BAAkB;IAC9D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5E,YAAmB,KAA8B,EAAE,MAAgB;QACjE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0CAMC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,eAAe;IAC5C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,WAAW,CAAC,CAAC,CAAC;IACtE,YAAmB,KAA8B,EAAE,MAAgB;QACjE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,8BAMC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,eAAe;IACtD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAChF,YAAmB,KAA+B,EAAE,MAAgB;QACl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O,CAAC,CAAC,CAAC;IAClE,YAAmB,KAAmB,EAAE,MAAgB;QACtD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,sBAMC;AAED;;;GAGG;AACH,MAAa,eAAgB,SAAQ,kBAAQ;IAC3C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,UAAU,CAAC,CAAC,CAAC;IACrE,YAAmB,KAAmB,EAAE,MAAgB;QACtD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0CAMC;AAED;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,2BAAgB;IAC3D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;IAC7E,YAAmB,KAA6B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,0DAMC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,sBAAY;IACnD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IACzE,YAAmB,KAAwB,EAAE,MAAgB;QAC3D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,kDAMC;AAED;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,yBAAe;IACzD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5E,YAAmB,KAAiC,EAAE,MAAgB;QACpE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAND,wDAMC","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 Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport {\n CalloutProps, DefinitionElementProps, ElementProps, GeometricElement2dProps, GeometricElement3dProps, GeometricModel3dProps, IModel,\n InformationPartitionElementProps, ModelProps, PhysicalElementProps, PhysicalTypeProps, TypeDefinitionElementProps, ViewAttachmentLabelProps,\n} from \"@itwin/core-common\";\nimport {\n Document, GraphicalElement2d, GraphicalElement3d, GraphicalPartition3d, GraphicalType2d, GroupInformationElement, GroupInformationPartition,\n PhysicalElement, PhysicalType, SpatialLocationElement,\n} from \"../Element\";\nimport { IModelDb } from \"../IModelDb\";\nimport { PhysicalMaterial } from \"../Material\";\nimport { GraphicalModel3d, GroupInformationModel } from \"../Model\";\nimport { SubjectOwnsPartitionElements } from \"../NavigationRelationship\";\n\n/** A graphical detailing symbol that is placed on a [[Drawing]] or [[Sheet]].\n * @public\n */\nexport abstract class DetailingSymbol extends GraphicalElement2d {\n /** @internal */\n public static override get className(): string { return \"DetailingSymbol\"; }\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical DetailingSymbol that contains title text.\n * @public\n */\nexport class TitleText extends DetailingSymbol {\n /** @internal */\n public static override get className(): string { return \"TitleText\"; }\n public constructor(props: GeometricElement2dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical DetailingSymbol that contains a view attachment label.\n * @public\n */\nexport class ViewAttachmentLabel extends DetailingSymbol {\n /** @internal */\n public static override get className(): string { return \"ViewAttachmentLabel\"; }\n public constructor(props: ViewAttachmentLabelProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical DetailingSymbol that calls out a reference to another drawing.\n * @public\n */\nexport abstract class Callout extends DetailingSymbol {\n /** @internal */\n public static override get className(): string { return \"Callout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references a section drawing.\n * @public\n */\nexport class SectionCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"SectionCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references an elevation drawing.\n * @public\n */\nexport class ElevationCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"ElevationCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references a plan drawing.\n * @public\n */\nexport class PlanCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"PlanCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A graphical Callout that references a detail drawing.\n * @public\n */\nexport class DetailCallout extends Callout {\n /** @internal */\n public static override get className(): string { return \"DetailCallout\"; }\n public constructor(props: CalloutProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A generic container for persisting BisCore:GraphicalElement3d instances.\n * @public\n */\nexport class GenericGraphicalModel3d extends GraphicalModel3d {\n /** @internal */\n public static override get className(): string { return \"GraphicalModel3d\"; }\n public constructor(props: GeometricModel3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n /** Insert a BisCore:GraphicalPartition3d and a Generic:GraphicalModel3d that sub-models it.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The GraphicalPartition3d will be inserted as a child of this Subject element.\n * @param name The name of the GraphicalPartition3d that the new Generic:GraphicalModel3d will sub-model.\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\n * @returns The Id of the newly inserted GraphicalPartition3d and GraphicalModel3d (same value).\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: GraphicalPartition3d.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: GraphicalPartition3d.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n const modelProps: GeometricModel3dProps = {\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n isPlanProjection,\n };\n return iModelDb.models.insertModel(modelProps);\n }\n}\n\n/** The Generic:Graphic3d class is used when 3D graphics cannot be further classified.\n * @note More-specific BisCore:GraphicalElement3d subclasses should be used wherever possible.\n * @public\n */\nexport class Graphic3d extends GraphicalElement3d {\n /** @internal */\n public static override get className(): string { return \"Graphic3d\"; }\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:PhysicalObject class is used when physical elements cannot be further classified.\n * @note More-specific BisCore:PhysicalElement subclasses should be used wherever possible.\n * @public\n */\nexport class PhysicalObject extends PhysicalElement {\n /** @internal */\n public static override get className(): string { return \"PhysicalObject\"; }\n public constructor(props: PhysicalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:SpatialLocation class is used when spatial locations cannot be further classified.\n * @note More-specific BisCore:SpatialLocationElement subclasses should be used wherever possible.\n * @public\n */\nexport class SpatialLocation extends SpatialLocationElement {\n /** @internal */\n public static override get className(): string { return \"SpatialLocation\"; }\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** A generic container for BisCore:GroupInformationElement instances.\n * @public\n */\nexport class GroupModel extends GroupInformationModel {\n /** @internal */\n public static override get className(): string { return \"GroupModel\"; }\n public constructor(props: ModelProps, iModel: IModelDb) {\n super(props, iModel);\n }\n /** Insert a GroupInformationPartition and a GroupModel that breaks it down.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The GroupInformationPartition will be inserted as a child of this Subject element.\n * @param name The name of the GroupInformationPartition that the new GroupModel will break down.\n * @returns The Id of the newly inserted GroupModel.\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: GroupInformationPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: GroupInformationPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n return iModelDb.models.insertModel({\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n });\n }\n}\n\n/** The Generic:Group class is used when the group cannot be further classified.\n * @public\n */\nexport class Group extends GroupInformationElement {\n /** @internal */\n public static override get className(): string { return \"Group\"; }\n public constructor(props: ElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:Document class is used when a document cannot be further classified.\n * @note More-specific BisCore:Document subclasses should be used wherever possible.\n * @public\n */\nexport class GenericDocument extends Document {\n /** @internal */\n public static override get className(): string { return \"Document\"; }\n public constructor(props: ElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:PhysicalMaterial class is used when the physical material cannot be further classified.\n * @note More-specific BisCore:PhysicalMaterial subclasses should be used wherever possible.\n * @public\n */\nexport class GenericPhysicalMaterial extends PhysicalMaterial {\n /** @internal */\n public static override get className(): string { return \"PhysicalMaterial\"; }\n public constructor(props: DefinitionElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:PhysicalType class is used when the physical type cannot be further classified.\n * @note More-specific BisCore:PhysicalType subclasses should be used wherever possible.\n * @public\n */\nexport class GenericPhysicalType extends PhysicalType {\n /** @internal */\n public static override get className(): string { return \"PhysicalType\"; }\n public constructor(props: PhysicalTypeProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** The Generic:GraphicalType2d class is used when graphical types cannot be further classified.\n * @note More-specific BisCore:GraphicalType2d subclasses should be used wherever possible.\n * @public\n */\nexport class GenericGraphicalType2d extends GraphicalType2d {\n /** @internal */\n public static override get className(): string { return \"GraphicalType2d\"; }\n public constructor(props: TypeDefinitionElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GenericSchema.js","sourceRoot":"","sources":["../../../src/domains/GenericSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,oDAAiD;AACjD,8CAA+C;AAC/C,sCAA4C;AAC5C,oDAAoD;AAEpD,cAAc;AACd,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,UAAU,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IACzJ,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACzD,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,6BAAa,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SACpD;IACH,CAAC;CACF;AAVD,sCAUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Schema\r\n */\r\n\r\nimport * as path from \"path\";\r\nimport { ClassRegistry } from \"../ClassRegistry\";\r\nimport { KnownLocations } from \"../IModelHost\";\r\nimport { Schema, Schemas } from \"../Schema\";\r\nimport * as elementsModule from \"./GenericElements\";\r\n\r\n/** @public */\r\nexport class GenericSchema extends Schema {\r\n public static override get schemaName(): string { return \"Generic\"; }\r\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Dgn\", `${GenericSchema.schemaName}.ecschema.xml`); }\r\n public static registerSchema() {\r\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n ClassRegistry.registerModule(elementsModule, this);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"GenericSchema.js","sourceRoot":"","sources":["../../../src/domains/GenericSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,oDAAiD;AACjD,8CAA+C;AAC/C,sCAA4C;AAC5C,oDAAoD;AAEpD,cAAc;AACd,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,UAAU,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IACzJ,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1D,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,6BAAa,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;CACF;AAVD,sCAUC","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 Schema\n */\n\nimport * as path from \"path\";\nimport { ClassRegistry } from \"../ClassRegistry\";\nimport { KnownLocations } from \"../IModelHost\";\nimport { Schema, Schemas } from \"../Schema\";\nimport * as elementsModule from \"./GenericElements\";\n\n/** @public */\nexport class GenericSchema extends Schema {\n public static override get schemaName(): string { return \"Generic\"; }\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Dgn\", `${GenericSchema.schemaName}.ecschema.xml`); }\n public static registerSchema() {\n if (this !== Schemas.getRegisteredSchema(this.schemaName)) {\n Schemas.unregisterSchema(this.schemaName);\n Schemas.registerSchema(this);\n ClassRegistry.registerModule(elementsModule, this);\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../../src/rpc/multipart.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAqI;AACrI,sCAAsC;AACtC,yCAAyC;AAEzC,4CAA4C;AAE5C,gBAAgB;AAChB,SAAgB,qBAAqB,CAAC,KAAyB;IAC7D,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC5B,0BAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3C,mHAAmH;IACnH,gBAAgB;IAChB,OAAO,IAAI,CAAC;AACd,CAAC;AAND,sDAMC;AAED,gBAAgB;AACT,KAAK,UAAU,qBAAqB,CAAC,GAAsB;IAChE,OAAO,IAAI,OAAO,CAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACzD,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACvB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,gCAAkB,CAAC,MAAM,EAAE,CAAC;QAC1C,MAAM,IAAI,GAA4D,EAAE,CAAC;QAEzE,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAqB,EAAE,EAAE;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,CAAC,CAAC,CAAC;AACL,CAAC;AA5CD,sDA4CC;AAED,gBAAgB;AAChB,SAAgB,qBAAqB,CAAC,CAAS,EAAE,IAAoB,EAAE,KAAyB;IAC9F,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AACpF,CAAC;AAHD,sDAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { BentleyStatus, FormDataCommon, HttpServerRequest, IModelError, RpcMultipart, RpcSerializedValue } from \"@itwin/core-common\";\r\nimport * as FormData from \"form-data\";\r\nimport * as multiparty from \"multiparty\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/** @internal */\r\nexport function createMultipartStream(value: RpcSerializedValue) {\r\n const form = new FormData();\r\n RpcMultipart.writeValueToForm(form, value);\r\n // Type information for FormData is lying. It actually extends Stream but not Readable, although it appears to work\r\n // fine for now.\r\n return form;\r\n}\r\n\r\n/** @internal */\r\nexport async function parseMultipartRequest(req: HttpServerRequest) {\r\n return new Promise<RpcSerializedValue>((resolve, reject) => {\r\n const form = new multiparty.Form({ maxFieldsSize: Infinity });\r\n form.on(\"error\", (err) => {\r\n reject(err);\r\n });\r\n\r\n const value = RpcSerializedValue.create();\r\n const data: { [index: string]: { size: number, chunks: Buffer[] } } = {};\r\n\r\n form.on(\"part\", (part: multiparty.Part) => {\r\n part.on(\"data\", (chunk: string | Buffer) => {\r\n if (part.name === \"objects\") {\r\n value.objects += chunk.toString();\r\n } else if (Buffer.isBuffer(chunk)) {\r\n if (!data[part.name]) {\r\n data[part.name] = { size: 0, chunks: [] };\r\n }\r\n\r\n data[part.name].size += chunk.byteLength;\r\n data[part.name].chunks.push(chunk);\r\n } else {\r\n throw new IModelError(BentleyStatus.ERROR, \"Unknown input.\");\r\n }\r\n });\r\n });\r\n\r\n form.on(\"close\", () => {\r\n let i = 0;\r\n for (; ;) {\r\n const part = data[`data-${i}`];\r\n if (!part) {\r\n break;\r\n }\r\n\r\n value.data.push(Buffer.concat(part.chunks, part.size));\r\n ++i;\r\n }\r\n\r\n resolve(value);\r\n });\r\n\r\n form.parse(req);\r\n });\r\n}\r\n\r\n/** @internal */\r\nexport function appendToMultipartForm(i: number, form: FormDataCommon, value: RpcSerializedValue) {\r\n const buf = value.data[i];\r\n form.append(`data-${i}`, Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength));\r\n}\r\n"]}
1
+ {"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../../src/rpc/multipart.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAqI;AACrI,sCAAsC;AACtC,yCAAyC;AAEzC,4CAA4C;AAE5C,gBAAgB;AAChB,SAAgB,qBAAqB,CAAC,KAAyB;IAC7D,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC5B,0BAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3C,mHAAmH;IACnH,gBAAgB;IAChB,OAAO,IAAI,CAAC;AACd,CAAC;AAND,sDAMC;AAED,gBAAgB;AACT,KAAK,UAAU,qBAAqB,CAAC,GAAsB;IAChE,OAAO,IAAI,OAAO,CAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACzD,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GA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EAAE,CAAC;oBACV,MAAM;gBACR,CAAC;gBAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvD,EAAE,CAAC,CAAC;YACN,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AA5CD,sDA4CC;AAED,gBAAgB;AAChB,SAAgB,qBAAqB,CAAC,CAAS,EAAE,IAAoB,EAAE,KAAyB;IAC9F,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AACpF,CAAC;AAHD,sDAGC","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, FormDataCommon, HttpServerRequest, IModelError, RpcMultipart, RpcSerializedValue } from \"@itwin/core-common\";\nimport * as FormData from \"form-data\";\nimport * as multiparty from \"multiparty\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** @internal */\nexport function createMultipartStream(value: RpcSerializedValue) {\n const form = new FormData();\n RpcMultipart.writeValueToForm(form, value);\n // Type information for FormData is lying. It actually extends Stream but not Readable, although it appears to work\n // fine for now.\n return form;\n}\n\n/** @internal */\nexport async function parseMultipartRequest(req: HttpServerRequest) {\n return new Promise<RpcSerializedValue>((resolve, reject) => {\n const form = new multiparty.Form({ maxFieldsSize: Infinity });\n form.on(\"error\", (err) => {\n reject(err);\n });\n\n const value = RpcSerializedValue.create();\n const data: { [index: string]: { size: number, chunks: Buffer[] } } = {};\n\n form.on(\"part\", (part: multiparty.Part) => {\n part.on(\"data\", (chunk: string | Buffer) => {\n if (part.name === \"objects\") {\n value.objects += chunk.toString();\n } else if (Buffer.isBuffer(chunk)) {\n if (!data[part.name]) {\n data[part.name] = { size: 0, chunks: [] };\n }\n\n data[part.name].size += chunk.byteLength;\n data[part.name].chunks.push(chunk);\n } else {\n throw new IModelError(BentleyStatus.ERROR, \"Unknown input.\");\n }\n });\n });\n\n form.on(\"close\", () => {\n let i = 0;\n for (; ;) {\n const part = data[`data-${i}`];\n if (!part) {\n break;\n }\n\n value.data.push(Buffer.concat(part.chunks, part.size));\n ++i;\n }\n\n resolve(value);\n });\n\n form.parse(req);\n });\n}\n\n/** @internal */\nexport function appendToMultipartForm(i: number, form: FormDataCommon, value: RpcSerializedValue) {\n const buf = value.data[i];\n form.append(`data-${i}`, Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength));\n}\n"]}
@@ -44,12 +44,12 @@ class RpcTrace {
44
44
  static async runWithSpan(activity, fn) {
45
45
  return core_bentley_1.Tracing.withSpan(activity.rpcMethod ?? "unknown RPC method", async () => RpcTrace.run(activity, fn), {
46
46
  attributes: { ...core_common_1.RpcInvocation.sanitizeForLog(activity) },
47
- kind: core_bentley_1.SpanKind.SERVER,
47
+ kind: core_bentley_1.SpanKind.INTERNAL,
48
48
  });
49
49
  }
50
50
  }
51
- RpcTrace._storage = new async_hooks_1.AsyncLocalStorage();
52
51
  exports.RpcTrace = RpcTrace;
52
+ RpcTrace._storage = new async_hooks_1.AsyncLocalStorage();
53
53
  /** @internal */
54
54
  function initializeTracing(enableOpenTelemetry = false) {
55
55
  core_common_1.RpcInvocation.runActivity = async (activity, fn) => RpcTrace.run(activity, fn); // redirect the invocation processing to the tracer
@@ -1 +1 @@
1
- {"version":3,"file":"tracing.js","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EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,mDAAmD;IAEnI,IAAI,mBAAmB,EAAE;QACvB,IAAI;YACF,8DAA8D;YAC9D,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;YAC1C,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,qBAAqB,EAAE,uBAAU,CAAC,cAAc,CAAC,CAAC;YACrF,sBAAO,CAAC,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACzC,2BAAa,CAAC,WAAW,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,mEAAmE;SAC5J;QAAC,OAAO,CAAC,EAAE;YACV,gEAAgE;YAChE,qBAAM,CAAC,QAAQ,CAAC,6CAAqB,CAAC,UAAU,EAAE,oCAAoC,CAAC,CAAC;YACxF,qBAAM,CAAC,YAAY,CAAC,6CAAqB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;SAC1D;KACF;IAED,0GAA0G;IAC1G,qBAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,2BAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;AACjG,CAAC;AAnBD,8CAmBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\n// cspell:ignore calltrace\r\n\r\nimport { assert, Logger, SpanKind, Tracing } from \"@itwin/core-bentley\";\r\nimport { RpcActivity, RpcInvocation } from \"@itwin/core-common\";\r\nimport { AsyncLocalStorage } from \"async_hooks\";\r\nimport { BackendLoggerCategory } from \"../BackendLoggerCategory\";\r\nimport { IModelHost } from \"../IModelHost\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/**\r\n * Utility for tracing Rpc activity processing. When multiple Rpc requests are being processed asynchronously, this\r\n * class can be used to correlate the current calltrace with the originating RpcActivity. This is used for automatic appending\r\n * of RpcActivity to log messages emitted during Rpc processing. It may also be used to retrieve the user accessToken\r\n * from the RpcActivity.\r\n * @public\r\n */\r\nexport class RpcTrace {\r\n private static _storage = new AsyncLocalStorage();\r\n\r\n /** Get the [RpcActivity]($common) for the currently executing async, or `undefined` if there is no\r\n * RpcActivity in the current call stack.\r\n * */\r\n public static get currentActivity(): RpcActivity | undefined {\r\n return RpcTrace._storage.getStore() as RpcActivity | undefined;\r\n }\r\n\r\n /** Get the [RpcActivity]($common) for the currently executing async. Asserts that the RpcActivity\r\n * exists in the current call stack.\r\n * */\r\n public static get expectCurrentActivity(): RpcActivity {\r\n assert(undefined !== RpcTrace.currentActivity);\r\n return RpcTrace.currentActivity;\r\n }\r\n\r\n /** Start the processing of an RpcActivity. */\r\n public static async run<T>(activity: RpcActivity, fn: () => Promise<T>): Promise<T> {\r\n return RpcTrace._storage.run(activity, fn);\r\n }\r\n\r\n /** Start the processing of an RpcActivity inside an OpenTelemetry span */\r\n public static async runWithSpan<T>(activity: RpcActivity, fn: () => Promise<T>): Promise<T> {\r\n return Tracing.withSpan(activity.rpcMethod ?? \"unknown RPC method\", async () => RpcTrace.run(activity, fn), {\r\n attributes: { ...RpcInvocation.sanitizeForLog(activity) },\r\n kind: SpanKind.SERVER,\r\n });\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function initializeTracing(enableOpenTelemetry: boolean = false) {\r\n RpcInvocation.runActivity = async (activity, fn) => RpcTrace.run(activity, fn); // redirect the invocation processing to the tracer\r\n\r\n if (enableOpenTelemetry) {\r\n try {\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n const api = require(\"@opentelemetry/api\");\r\n const tracer = api.trace.getTracer(\"@itwin/core-backend\", IModelHost.backendVersion);\r\n Tracing.enableOpenTelemetry(tracer, api);\r\n RpcInvocation.runActivity = async (activity, fn) => RpcTrace.runWithSpan(activity, fn); // wrap invocation in an OpenTelemetry span in addition to RpcTrace\r\n } catch (e) {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n Logger.logError(BackendLoggerCategory.IModelHost, \"Failed to initialize OpenTelemetry\");\r\n Logger.logException(BackendLoggerCategory.IModelHost, e);\r\n }\r\n }\r\n\r\n // set up static logger metadata to include current RpcActivity information for logs during rpc processing\r\n Logger.staticMetaData.set(\"rpc\", () => RpcInvocation.sanitizeForLog(RpcTrace.currentActivity));\r\n}\r\n"]}
1
+ {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../src/rpc/tracing.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0BAA0B;AAE1B,sDAAwE;AACxE,oDAAgE;AAChE,6CAAgD;AAChD,oEAAiE;AACjE,8CAA2C;AAE3C,4CAA4C;AAE5C;;;;;;GAMG;AACH,MAAa,QAAQ;IAGnB;;SAEK;IACE,MAAM,KAAK,eAAe;QAC/B,OAAO,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAA6B,CAAC;IACjE,CAAC;IAED;;SAEK;IACE,MAAM,KAAK,qBAAqB;QACrC,IAAA,qBAAM,EAAC,SAAS,KAAK,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC/C,OAAO,QAAQ,CAAC,eAAe,CAAC;IAClC,CAAC;IAED,8CAA8C;IACvC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAI,QAAqB,EAAE,EAAoB;QACpE,OAAO,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,0EAA0E;IACnE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAI,QAAqB,EAAE,EAAoB;QAC5E,OAAO,sBAAO,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ACH,CAAC;IAED,0GAA0G;IAC1G,qBAAM,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,2BAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;AACjG,CAAC;AAnBD,8CAmBC","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\n// cspell:ignore calltrace\n\nimport { assert, Logger, SpanKind, Tracing } from \"@itwin/core-bentley\";\nimport { RpcActivity, RpcInvocation } from \"@itwin/core-common\";\nimport { AsyncLocalStorage } from \"async_hooks\";\nimport { BackendLoggerCategory } from \"../BackendLoggerCategory\";\nimport { IModelHost } from \"../IModelHost\";\n\n/* eslint-disable deprecation/deprecation */\n\n/**\n * Utility for tracing Rpc activity processing. When multiple Rpc requests are being processed asynchronously, this\n * class can be used to correlate the current calltrace with the originating RpcActivity. This is used for automatic appending\n * of RpcActivity to log messages emitted during Rpc processing. It may also be used to retrieve the user accessToken\n * from the RpcActivity.\n * @public\n */\nexport class RpcTrace {\n private static _storage = new AsyncLocalStorage();\n\n /** Get the [RpcActivity]($common) for the currently executing async, or `undefined` if there is no\n * RpcActivity in the current call stack.\n * */\n public static get currentActivity(): RpcActivity | undefined {\n return RpcTrace._storage.getStore() as RpcActivity | undefined;\n }\n\n /** Get the [RpcActivity]($common) for the currently executing async. Asserts that the RpcActivity\n * exists in the current call stack.\n * */\n public static get expectCurrentActivity(): RpcActivity {\n assert(undefined !== RpcTrace.currentActivity);\n return RpcTrace.currentActivity;\n }\n\n /** Start the processing of an RpcActivity. */\n public static async run<T>(activity: RpcActivity, fn: () => Promise<T>): Promise<T> {\n return RpcTrace._storage.run(activity, fn);\n }\n\n /** Start the processing of an RpcActivity inside an OpenTelemetry span */\n public static async runWithSpan<T>(activity: RpcActivity, fn: () => Promise<T>): Promise<T> {\n return Tracing.withSpan(activity.rpcMethod ?? \"unknown RPC method\", async () => RpcTrace.run(activity, fn), {\n attributes: { ...RpcInvocation.sanitizeForLog(activity) },\n kind: SpanKind.INTERNAL,\n });\n }\n}\n\n/** @internal */\nexport function initializeTracing(enableOpenTelemetry: boolean = false) {\n RpcInvocation.runActivity = async (activity, fn) => RpcTrace.run(activity, fn); // redirect the invocation processing to the tracer\n\n if (enableOpenTelemetry) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const api = require(\"@opentelemetry/api\");\n const tracer = api.trace.getTracer(\"@itwin/core-backend\", IModelHost.backendVersion);\n Tracing.enableOpenTelemetry(tracer, api);\n RpcInvocation.runActivity = async (activity, fn) => RpcTrace.runWithSpan(activity, fn); // wrap invocation in an OpenTelemetry span in addition to RpcTrace\n } catch (e) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Logger.logError(BackendLoggerCategory.IModelHost, \"Failed to initialize OpenTelemetry\");\n Logger.logException(BackendLoggerCategory.IModelHost, e);\n }\n }\n\n // set up static logger metadata to include current RpcActivity information for logs during rpc processing\n Logger.staticMetaData.set(\"rpc\", () => RpcInvocation.sanitizeForLog(RpcTrace.currentActivity));\n}\n"]}
@@ -34,8 +34,8 @@ class WebAppRpcLoggingBackend extends core_common_1.WebAppRpcLogging {
34
34
  status: invocation.status,
35
35
  errorMessage,
36
36
  // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!
37
- ActivityId: invocation.request.id,
38
- MachineName: this.getHostname(),
37
+ ActivityId: invocation.request.id, // eslint-disable-line @typescript-eslint/naming-convention
38
+ MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention
39
39
  ...pathIds,
40
40
  };
41
41
  core_bentley_1.Logger.logError(core_common_1.CommonLoggerCategory.RpcInterfaceBackend, `${message}.${operationDescriptor}`, metadata);
@@ -1 +1 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../src/rpc/web/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AAU,CAAC,OAAO,CAAC,MAAM;YACjC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;YAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,YAAY;YACZ,uGAAuG;YACvG,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,GAAG,OAAO;SACX,CAAC;QAEF,qBAAM,CAAC,QAAQ,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,GAAG,OAAO,IAAI,mBAAmB,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC3G,CAAC;CACF;AAhCD,0DAgCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { CommonLoggerCategory, RpcInvocation, RpcProtocolEvent, WebAppRpcLogging } from \"@itwin/core-common\";\r\nimport * as os from \"os\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nexport class WebAppRpcLoggingBackend extends WebAppRpcLogging {\r\n protected override async logProtocolEvent(event: RpcProtocolEvent, object: RpcInvocation): Promise<void> {\r\n switch (event) {\r\n case RpcProtocolEvent.RequestReceived: return this.logRequest(CommonLoggerCategory.RpcInterfaceBackend, \"RpcInterface.backend.request\", object.request);\r\n case RpcProtocolEvent.BackendErrorOccurred: return this.logErrorBackend(\"RpcInterface.backend.error\", object);\r\n case RpcProtocolEvent.BackendResponseCreated: return this.logResponse(CommonLoggerCategory.RpcInterfaceBackend, \"RpcInterface.backend.response\", object.request, object.status, object.elapsed);\r\n }\r\n }\r\n\r\n protected override getHostname(): string {\r\n return os.hostname();\r\n }\r\n\r\n private async logErrorBackend(message: string, invocation: RpcInvocation): Promise<void> {\r\n const operationDescriptor = this.buildOperationDescriptor(invocation.operation);\r\n const pathIds = this.findPathIds(invocation.request.path);\r\n const result = await invocation.result;\r\n const errorMessage = result.message ? result.message : result.objects; // Can be an error or an RpcSerializedValue\r\n\r\n const metadata = {\r\n method: invocation.request.method,\r\n path: invocation.request.path,\r\n status: invocation.status,\r\n errorMessage,\r\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\r\n ActivityId: invocation.request.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\r\n ...pathIds,\r\n };\r\n\r\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, `${message}.${operationDescriptor}`, metadata);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../src/rpc/web/logging.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,oDAA6G;AAC7G,yBAAyB;AAEzB,4CAA4C;AAE5C,MAAa,uBAAwB,SAAQ,8BAAgB;IACxC,KAAK,CAAC,gBAAgB,CAAC,KAAuB,EAAE,MAAqB;QACtF,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,8BAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YACxJ,KAAK,8BAAgB,CAAC,oBAAoB,CAAC,CAAC,OAAO,IAAI,CAAC,eAAe,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;YAC9G,KAAK,8BAAgB,CAAC,sBAAsB,CAAC,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,+BAA+B,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAClM,CAAC;IACH,CAAC;IAEkB,WAAW;QAC5B,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,OAAe,EAAE,UAAyB;QACtE,MAAM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAChF,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,2CAA2C;QAElH,MAAM,QAAQ,GAAG;YACf,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM;YACjC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;YAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,YAAY;YACZ,uGAAuG;YACvG,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,2DAA2D;YAC9F,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,2DAA2D;YAC5F,GAAG,OAAO;SACX,CAAC;QAEF,qBAAM,CAAC,QAAQ,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,GAAG,OAAO,IAAI,mBAAmB,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC3G,CAAC;CACF;AAhCD,0DAgCC","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 { Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory, RpcInvocation, RpcProtocolEvent, WebAppRpcLogging } from \"@itwin/core-common\";\nimport * as os from \"os\";\n\n/* eslint-disable deprecation/deprecation */\n\nexport class WebAppRpcLoggingBackend extends WebAppRpcLogging {\n protected override async logProtocolEvent(event: RpcProtocolEvent, object: RpcInvocation): Promise<void> {\n switch (event) {\n case RpcProtocolEvent.RequestReceived: return this.logRequest(CommonLoggerCategory.RpcInterfaceBackend, \"RpcInterface.backend.request\", object.request);\n case RpcProtocolEvent.BackendErrorOccurred: return this.logErrorBackend(\"RpcInterface.backend.error\", object);\n case RpcProtocolEvent.BackendResponseCreated: return this.logResponse(CommonLoggerCategory.RpcInterfaceBackend, \"RpcInterface.backend.response\", object.request, object.status, object.elapsed);\n }\n }\n\n protected override getHostname(): string {\n return os.hostname();\n }\n\n private async logErrorBackend(message: string, invocation: RpcInvocation): Promise<void> {\n const operationDescriptor = this.buildOperationDescriptor(invocation.operation);\n const pathIds = this.findPathIds(invocation.request.path);\n const result = await invocation.result;\n const errorMessage = result.message ? result.message : result.objects; // Can be an error or an RpcSerializedValue\n\n const metadata = {\n method: invocation.request.method,\n path: invocation.request.path,\n status: invocation.status,\n errorMessage,\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: invocation.request.id, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n };\n\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, `${message}.${operationDescriptor}`, metadata);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/rpc/web/request.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAc4B;AAE5B,4CAA4C;AAE5C,SAAS,YAAY,CAAC,QAA2B,EAAE,GAAsB;IACvE,MAAM,WAAW,GAA0B,QAAQ,CAAC,yCAAyC,CAAC;IAC9F,MAAM,aAAa,GAA0B;QAC3C,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,I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OAAO,CAAC,EAAE,EAAE;QACf,MAAM,IAAI,yBAAW,CAAC,2BAAa,CAAC,KAAK,EAAE,gDAAgD,CAAC,CAAC;KAC9F;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AApCD,oCAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport {\r\n BentleyStatus,\r\n HttpServerRequest,\r\n IModelError,\r\n MarshalingBinaryMarker,\r\n RpcContentType,\r\n RpcMultipart,\r\n RpcResponseCacheControl,\r\n RpcSerializedValue,\r\n SerializedRpcActivity,\r\n SerializedRpcOperation,\r\n SerializedRpcRequest,\r\n WEB_RPC_CONSTANTS,\r\n WebAppRpcProtocol,\r\n} from \"@itwin/core-common\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nfunction parseHeaders(protocol: WebAppRpcProtocol, req: HttpServerRequest): SerializedRpcActivity {\r\n const headerNames: SerializedRpcActivity = protocol.serializedClientRequestContextHeaderNames;\r\n const parsedHeaders: SerializedRpcActivity = {\r\n id: req.header(headerNames.id) || \"\",\r\n applicationId: req.header(headerNames.applicationId) || \"\",\r\n applicationVersion: req.header(headerNames.applicationVersion) || \"\",\r\n sessionId: req.header(headerNames.sessionId) || \"\",\r\n authorization: (headerNames.authorization ? req.header(headerNames.authorization) : \"\") ?? \"\",\r\n };\r\n return parsedHeaders;\r\n}\r\n\r\nfunction parseFromPath(operation: SerializedRpcOperation): RpcSerializedValue {\r\n const decoded = operation.encodedRequest ? Buffer.from(operation.encodedRequest, \"base64\").toString(\"binary\") : \"\";\r\n return RpcSerializedValue.create(decoded);\r\n}\r\n\r\nasync function parseFromBody(req: HttpServerRequest): Promise<RpcSerializedValue> {\r\n const contentType = WebAppRpcProtocol.computeContentType(req.header(WEB_RPC_CONSTANTS.CONTENT));\r\n if (contentType === RpcContentType.Binary) {\r\n const objects = JSON.stringify([MarshalingBinaryMarker.createDefault()]);\r\n const data = [req.body as Buffer];\r\n return RpcSerializedValue.create(objects, data);\r\n } else if (contentType === RpcContentType.Multipart) {\r\n return RpcMultipart.parseRequest(req);\r\n } else {\r\n return RpcSerializedValue.create(req.body as string);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport async function parseRequest(protocol: WebAppRpcProtocol, req: HttpServerRequest): Promise<SerializedRpcRequest> {\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n const operation = protocol.getOperationFromPath(req.url!);\r\n\r\n const parsedHeaders = parseHeaders(protocol, req);\r\n\r\n const request: SerializedRpcRequest = {\r\n ...parsedHeaders,\r\n operation: {\r\n interfaceDefinition: operation.interfaceDefinition,\r\n operationName: operation.operationName,\r\n interfaceVersion: operation.interfaceVersion,\r\n },\r\n method: req.method,\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n path: req.url!,\r\n parameters: operation.encodedRequest ? parseFromPath(operation) : await parseFromBody(req),\r\n caching: operation.encodedRequest ? RpcResponseCacheControl.Immutable : RpcResponseCacheControl.None,\r\n };\r\n\r\n request.ip = req.ip;\r\n\r\n request.protocolVersion = 0;\r\n\r\n if (protocol.protocolVersionHeaderName) {\r\n const version = req.header(protocol.protocolVersionHeaderName);\r\n if (version) {\r\n request.protocolVersion = parseInt(version, 10);\r\n }\r\n }\r\n\r\n if (!request.id) {\r\n throw new IModelError(BentleyStatus.ERROR, `Invalid request: Missing required activity ID.`);\r\n }\r\n\r\n return request;\r\n}\r\n"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/rpc/web/request.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAc4B;AAE5B,4CAA4C;AAE5C,SAAS,YAAY,CAAC,QAA2B,EAAE,GAAsB;IACvE,MAAM,WAAW,GAA0B,QAAQ,CAAC,yCAA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C,yBAAyB,CAAC,CAAC;QAC/D,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,eAAe,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,yBAAW,CAAC,2BAAa,CAAC,KAAK,EAAE,gDAAgD,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AApCD,oCAoCC","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 {\n BentleyStatus,\n HttpServerRequest,\n IModelError,\n MarshalingBinaryMarker,\n RpcContentType,\n RpcMultipart,\n RpcResponseCacheControl,\n RpcSerializedValue,\n SerializedRpcActivity,\n SerializedRpcOperation,\n SerializedRpcRequest,\n WEB_RPC_CONSTANTS,\n WebAppRpcProtocol,\n} from \"@itwin/core-common\";\n\n/* eslint-disable deprecation/deprecation */\n\nfunction parseHeaders(protocol: WebAppRpcProtocol, req: HttpServerRequest): SerializedRpcActivity {\n const headerNames: SerializedRpcActivity = protocol.serializedClientRequestContextHeaderNames;\n const parsedHeaders: SerializedRpcActivity = {\n id: req.header(headerNames.id) || \"\",\n applicationId: req.header(headerNames.applicationId) || \"\",\n applicationVersion: req.header(headerNames.applicationVersion) || \"\",\n sessionId: req.header(headerNames.sessionId) || \"\",\n authorization: (headerNames.authorization ? req.header(headerNames.authorization) : \"\") ?? \"\",\n };\n return parsedHeaders;\n}\n\nfunction parseFromPath(operation: SerializedRpcOperation): RpcSerializedValue {\n const decoded = operation.encodedRequest ? Buffer.from(operation.encodedRequest, \"base64\").toString(\"binary\") : \"\";\n return RpcSerializedValue.create(decoded);\n}\n\nasync function parseFromBody(req: HttpServerRequest): Promise<RpcSerializedValue> {\n const contentType = WebAppRpcProtocol.computeContentType(req.header(WEB_RPC_CONSTANTS.CONTENT));\n if (contentType === RpcContentType.Binary) {\n const objects = JSON.stringify([MarshalingBinaryMarker.createDefault()]);\n const data = [req.body as Buffer];\n return RpcSerializedValue.create(objects, data);\n } else if (contentType === RpcContentType.Multipart) {\n return RpcMultipart.parseRequest(req);\n } else {\n return RpcSerializedValue.create(req.body as string);\n }\n}\n\n/** @internal */\nexport async function parseRequest(protocol: WebAppRpcProtocol, req: HttpServerRequest): Promise<SerializedRpcRequest> {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const operation = protocol.getOperationFromPath(req.url!);\n\n const parsedHeaders = parseHeaders(protocol, req);\n\n const request: SerializedRpcRequest = {\n ...parsedHeaders,\n operation: {\n interfaceDefinition: operation.interfaceDefinition,\n operationName: operation.operationName,\n interfaceVersion: operation.interfaceVersion,\n },\n method: req.method,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n path: req.url!,\n parameters: operation.encodedRequest ? parseFromPath(operation) : await parseFromBody(req),\n caching: operation.encodedRequest ? RpcResponseCacheControl.Immutable : RpcResponseCacheControl.None,\n };\n\n request.ip = req.ip;\n\n request.protocolVersion = 0;\n\n if (protocol.protocolVersionHeaderName) {\n const version = req.header(protocol.protocolVersionHeaderName);\n if (version) {\n request.protocolVersion = parseInt(version, 10);\n }\n }\n\n if (!request.id) {\n throw new IModelError(BentleyStatus.ERROR, `Invalid request: Missing required activity ID.`);\n }\n\n return request;\n}\n"]}
@@ -107,7 +107,7 @@ async function sendResponse(protocol, request, fulfillment, req, res) {
107
107
  exports.sendResponse = sendResponse;
108
108
  function logResponse(request, statusCode, resultObj) {
109
109
  const metadata = {
110
- ActivityId: request.id,
110
+ ActivityId: request.id, // eslint-disable-line @typescript-eslint/naming-convention
111
111
  method: request.method,
112
112
  path: request.path,
113
113
  operation: request.operation,
@@ -1 +1 @@
1
- {"version":3,"file":"response.js","sourceRoot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gC,EAAE,QAAQ,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport {\r\n CommonLoggerCategory,\r\n HttpServerRequest,\r\n HttpServerResponse,\r\n ReadableFormData,\r\n RpcContentType,\r\n RpcMultipart,\r\n RpcProtocol,\r\n RpcRequestFulfillment,\r\n RpcRequestStatus,\r\n RpcResponseCacheControl,\r\n SerializedRpcRequest,\r\n WEB_RPC_CONSTANTS,\r\n WebAppRpcProtocol,\r\n WebAppRpcRequest,\r\n} from \"@itwin/core-common\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nfunction configureResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, res: HttpServerResponse) {\r\n const success = protocol.getStatus(fulfillment.status) === RpcRequestStatus.Resolved;\r\n // TODO: Use stale-while-revalidate in cache headers. This needs to be tested, and does not currently have support in the router/caching-service.\r\n // This will allow browsers to use stale cached responses while also revalidating with the router, allowing us to start up a backend if necessary.\r\n\r\n // RPC Caching Service uses the s-maxage header to determine the TTL for the redis cache.\r\n const oneHourInSeconds = 3600;\r\n if (success && request.caching === RpcResponseCacheControl.Immutable) {\r\n // If response size is > 50 MB, do not cache it.\r\n if (fulfillment.result.objects.length > (50 * 10 ** 7)) {\r\n res.set(\"Cache-Control\", \"no-store\");\r\n } else if (request.operation.operationName === \"generateTileContent\") {\r\n res.set(\"Cache-Control\", \"no-store\");\r\n } else if (request.operation.operationName === \"getConnectionProps\") {\r\n // GetConnectionprops can't be cached on the browser longer than the lifespan of the backend. The lifespan of backend may shrink too. Keep it at 1 second to be safe.\r\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=1, immutable`);\r\n } else if (request.operation.operationName === \"getTileCacheContainerUrl\") {\r\n // getTileCacheContainerUrl returns a SAS with an expiry of 23:59:59. We can't exceed that time when setting the max-age.\r\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 23}, max-age=${oneHourInSeconds * 23}, immutable`);\r\n } else {\r\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=${oneHourInSeconds * 48}, immutable`);\r\n }\r\n }\r\n\r\n if (fulfillment.retry) {\r\n res.set(\"Retry-After\", fulfillment.retry);\r\n }\r\n}\r\n\r\nfunction configureText(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): string {\r\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.TEXT);\r\n return (fulfillment.status === 204) ? \"\" : fulfillment.result.objects;\r\n}\r\n\r\nfunction configureBinary(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): Buffer {\r\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.BINARY);\r\n const data = fulfillment.result.data[0];\r\n return Buffer.isBuffer(data) ? data : Buffer.from(data);\r\n}\r\n\r\nfunction configureMultipart(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): ReadableFormData {\r\n const response = RpcMultipart.createStream(fulfillment.result);\r\n const headers = response.getHeaders();\r\n for (const header in headers) {\r\n if (headers.hasOwnProperty(header)) {\r\n res.set(header, headers[header]);\r\n }\r\n }\r\n\r\n return response;\r\n}\r\n\r\nfunction configureStream(fulfillment: RpcRequestFulfillment) {\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n return fulfillment.result.stream!;\r\n}\r\n\r\n/** @internal */\r\nexport async function sendResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, req: HttpServerRequest, res: HttpServerResponse) {\r\n logResponse(request, fulfillment.status, fulfillment.rawResult);\r\n\r\n const versionHeader = protocol.protocolVersionHeaderName;\r\n if (versionHeader && RpcProtocol.protocolVersion) {\r\n res.set(versionHeader, RpcProtocol.protocolVersion.toString());\r\n }\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const { Readable, Stream } = await import(/* webpackIgnore: true */ \"stream\");\r\n const { createGzip } = await import(/* webpackIgnore: true */ \"zlib\");\r\n\r\n const transportType = WebAppRpcRequest.computeTransportType(fulfillment.result, fulfillment.rawResult);\r\n let responseBody;\r\n if (transportType === RpcContentType.Binary) {\r\n responseBody = configureBinary(fulfillment, res);\r\n } else if (transportType === RpcContentType.Multipart) {\r\n responseBody = configureMultipart(fulfillment, res);\r\n } else if (transportType === RpcContentType.Stream) {\r\n responseBody = configureStream(fulfillment);\r\n } else {\r\n responseBody = configureText(fulfillment, res);\r\n }\r\n\r\n configureResponse(protocol, request, fulfillment, res);\r\n res.status(fulfillment.status);\r\n\r\n if (fulfillment.allowCompression && req.header(\"Accept-Encoding\")?.includes(\"gzip\")) {\r\n res.set(\"Content-Encoding\", \"gzip\");\r\n const readableResponseBody = (responseBody instanceof Stream) ? responseBody : Readable.from(responseBody);\r\n responseBody = readableResponseBody.pipe(createGzip());\r\n }\r\n\r\n // This check should in theory look for instances of Readable, but that would break backend implementation at\r\n // core/backend/src/RpcBackend.ts\r\n if (responseBody instanceof Stream) {\r\n responseBody.pipe(res);\r\n } else {\r\n res.send(responseBody);\r\n }\r\n}\r\n\r\nfunction logResponse(request: SerializedRpcRequest, statusCode: number, resultObj: unknown) {\r\n const metadata = {\r\n ActivityId: request.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n method: request.method,\r\n path: request.path,\r\n operation: request.operation,\r\n statusCode,\r\n error: resultObj instanceof Error ? resultObj : undefined,\r\n };\r\n\r\n if (statusCode < 400)\r\n Logger.logInfo(CommonLoggerCategory.RpcInterfaceBackend, \"RPC over HTTP success response\", metadata);\r\n else\r\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, \"RPC over HTTP failure response\", metadata);\r\n}\r\n"]}
1
+ {"version":3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AC,SAAS,CAAC,CAAC,CAAC,SAAS;KAC1D,CAAC;IAEF,IAAI,UAAU,GAAG,GAAG;QAClB,qBAAM,CAAC,OAAO,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,gCAAgC,EAAE,QAAQ,CAAC,CAAC;;QAErG,qBAAM,CAAC,QAAQ,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,gCAAgC,EAAE,QAAQ,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport {\n CommonLoggerCategory,\n HttpServerRequest,\n HttpServerResponse,\n ReadableFormData,\n RpcContentType,\n RpcMultipart,\n RpcProtocol,\n RpcRequestFulfillment,\n RpcRequestStatus,\n RpcResponseCacheControl,\n SerializedRpcRequest,\n WEB_RPC_CONSTANTS,\n WebAppRpcProtocol,\n WebAppRpcRequest,\n} from \"@itwin/core-common\";\n\n/* eslint-disable deprecation/deprecation */\n\nfunction configureResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, res: HttpServerResponse) {\n const success = protocol.getStatus(fulfillment.status) === RpcRequestStatus.Resolved;\n // TODO: Use stale-while-revalidate in cache headers. This needs to be tested, and does not currently have support in the router/caching-service.\n // This will allow browsers to use stale cached responses while also revalidating with the router, allowing us to start up a backend if necessary.\n\n // RPC Caching Service uses the s-maxage header to determine the TTL for the redis cache.\n const oneHourInSeconds = 3600;\n if (success && request.caching === RpcResponseCacheControl.Immutable) {\n // If response size is > 50 MB, do not cache it.\n if (fulfillment.result.objects.length > (50 * 10 ** 7)) {\n res.set(\"Cache-Control\", \"no-store\");\n } else if (request.operation.operationName === \"generateTileContent\") {\n res.set(\"Cache-Control\", \"no-store\");\n } else if (request.operation.operationName === \"getConnectionProps\") {\n // GetConnectionprops can't be cached on the browser longer than the lifespan of the backend. The lifespan of backend may shrink too. Keep it at 1 second to be safe.\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=1, immutable`);\n } else if (request.operation.operationName === \"getTileCacheContainerUrl\") {\n // getTileCacheContainerUrl returns a SAS with an expiry of 23:59:59. We can't exceed that time when setting the max-age.\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 23}, max-age=${oneHourInSeconds * 23}, immutable`);\n } else {\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=${oneHourInSeconds * 48}, immutable`);\n }\n }\n\n if (fulfillment.retry) {\n res.set(\"Retry-After\", fulfillment.retry);\n }\n}\n\nfunction configureText(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): string {\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.TEXT);\n return (fulfillment.status === 204) ? \"\" : fulfillment.result.objects;\n}\n\nfunction configureBinary(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): Buffer {\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.BINARY);\n const data = fulfillment.result.data[0];\n return Buffer.isBuffer(data) ? data : Buffer.from(data);\n}\n\nfunction configureMultipart(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): ReadableFormData {\n const response = RpcMultipart.createStream(fulfillment.result);\n const headers = response.getHeaders();\n for (const header in headers) {\n if (headers.hasOwnProperty(header)) {\n res.set(header, headers[header]);\n }\n }\n\n return response;\n}\n\nfunction configureStream(fulfillment: RpcRequestFulfillment) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return fulfillment.result.stream!;\n}\n\n/** @internal */\nexport async function sendResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, req: HttpServerRequest, res: HttpServerResponse) {\n logResponse(request, fulfillment.status, fulfillment.rawResult);\n\n const versionHeader = protocol.protocolVersionHeaderName;\n if (versionHeader && RpcProtocol.protocolVersion) {\n res.set(versionHeader, RpcProtocol.protocolVersion.toString());\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { Readable, Stream } = await import(/* webpackIgnore: true */ \"stream\");\n const { createGzip } = await import(/* webpackIgnore: true */ \"zlib\");\n\n const transportType = WebAppRpcRequest.computeTransportType(fulfillment.result, fulfillment.rawResult);\n let responseBody;\n if (transportType === RpcContentType.Binary) {\n responseBody = configureBinary(fulfillment, res);\n } else if (transportType === RpcContentType.Multipart) {\n responseBody = configureMultipart(fulfillment, res);\n } else if (transportType === RpcContentType.Stream) {\n responseBody = configureStream(fulfillment);\n } else {\n responseBody = configureText(fulfillment, res);\n }\n\n configureResponse(protocol, request, fulfillment, res);\n res.status(fulfillment.status);\n\n if (fulfillment.allowCompression && req.header(\"Accept-Encoding\")?.includes(\"gzip\")) {\n res.set(\"Content-Encoding\", \"gzip\");\n const readableResponseBody = (responseBody instanceof Stream) ? responseBody : Readable.from(responseBody);\n responseBody = readableResponseBody.pipe(createGzip());\n }\n\n // This check should in theory look for instances of Readable, but that would break backend implementation at\n // core/backend/src/RpcBackend.ts\n if (responseBody instanceof Stream) {\n responseBody.pipe(res);\n } else {\n res.send(responseBody);\n }\n}\n\nfunction logResponse(request: SerializedRpcRequest, statusCode: number, resultObj: unknown) {\n const metadata = {\n ActivityId: request.id, // eslint-disable-line @typescript-eslint/naming-convention\n method: request.method,\n path: request.path,\n operation: request.operation,\n statusCode,\n error: resultObj instanceof Error ? resultObj : undefined,\n };\n\n if (statusCode < 400)\n Logger.logInfo(CommonLoggerCategory.RpcInterfaceBackend, \"RPC over HTTP success response\", metadata);\n else\n Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, \"RPC over HTTP failure response\", metadata);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DevToolsRpcImpl.js","sourceRoot":"","sources":["../../../src/rpc-impl/DevToolsRpcImpl.ts"],"names":[],"mappings":";;;AAQA,oDAA0H;AAC1H,0CAA+D;AAE/D;;GAEG;AACH,MAAa,eAAgB,SAAQ,0BAAY;IACxC,MAAM,CAAC,QAAQ,KAAK,wBAAU,CAAC,YAAY,CAAC,kCAAoB,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE5F,gDAAgD;IACzC,KAAK,CAAC,IAAI,CAAC,WAA2B;QAC3C,OAAO,mBAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,KAAK,CAAC,WAA2B,EAAE,OAA6B;QAC3E,MAAM,KAAK,GAAG,mBAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,OAAO,KAAK,kCAAoB,CAAC,IAAI;YACvC,OAAO,KAAK,CAAC;QACf,MAAM,cAAc,GAAG,iCAAsB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACrE,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,uEAAuE;IAChE,KAAK,CAAC,QAAQ,CAAC,WAA2B;QAC/C,OAAO,mBAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED,qCAAqC;IAC9B,KAAK,CAAC,WAAW,CAAC,WAA2B,EAAE,cAAsB,EAAE,QAAkB;QAC9F,OAAO,mBAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AA1BD,0CA0BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\nimport { LogLevel } from \"@itwin/core-bentley\";\r\nimport { DevToolsRpcInterface, DevToolsStatsOptions, IModelRpcProps, RpcInterface, RpcManager } from \"@itwin/core-common\";\r\nimport { DevTools, DevToolsStatsFormatter } from \"../DevTools\";\r\n\r\n/** The backend implementation of WipRpcInterface.\r\n * @internal\r\n */\r\nexport class DevToolsRpcImpl extends RpcInterface implements DevToolsRpcInterface { // eslint-disable-line deprecation/deprecation\r\n public static register() { RpcManager.registerImpl(DevToolsRpcInterface, DevToolsRpcImpl); }\r\n\r\n // Returns true if the backend received the ping\r\n public async ping(_tokenProps: IModelRpcProps): Promise<boolean> {\r\n return DevTools.ping();\r\n }\r\n\r\n // Returns JSON object with statistics\r\n public async stats(_tokenProps: IModelRpcProps, options: DevToolsStatsOptions): Promise<any> {\r\n const stats = DevTools.stats();\r\n if (options === DevToolsStatsOptions.None)\r\n return stats;\r\n const formattedStats = DevToolsStatsFormatter.toFormattedJson(stats);\r\n return formattedStats;\r\n }\r\n\r\n // Returns JSON object with backend versions (application and iModelJs)\r\n public async versions(_tokenProps: IModelRpcProps): Promise<any> {\r\n return DevTools.versions();\r\n }\r\n\r\n // Sets up a log level at the backend\r\n public async setLogLevel(_tokenProps: IModelRpcProps, loggerCategory: string, logLevel: LogLevel): Promise<LogLevel | undefined> {\r\n return DevTools.setLogLevel(loggerCategory, logLevel);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"DevToolsRpcImpl.js","sourceRoot":"","sources":["../../../src/rpc-impl/DevToolsRpcImpl.ts"],"names":[],"mappings":";;;AAQA,oDAA0H;AAC1H,0CAA+D;AAE/D;;GAEG;AACH,MAAa,eAAgB,SAAQ,0BAAY;IACxC,MAAM,CAAC,QAAQ,KAAK,wBAAU,CAAC,YAAY,CAAC,kCAAoB,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE5F,gDAAgD;IACzC,KAAK,CAAC,IAAI,CAAC,WAA2B;QAC3C,OAAO,mBAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,KAAK,CAAC,WAA2B,EAAE,OAA6B;QAC3E,MAAM,KAAK,GAAG,mBAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,OAAO,KAAK,kCAAoB,CAAC,IAAI;YACvC,OAAO,KAAK,CAAC;QACf,MAAM,cAAc,GAAG,iCAAsB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACrE,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,uEAAuE;IAChE,KAAK,CAAC,QAAQ,CAAC,WAA2B;QAC/C,OAAO,mBAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED,qCAAqC;IAC9B,KAAK,CAAC,WAAW,CAAC,WAA2B,EAAE,cAAsB,EAAE,QAAkB;QAC9F,OAAO,mBAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AA1BD,0CA0BC","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 */\nimport { LogLevel } from \"@itwin/core-bentley\";\nimport { DevToolsRpcInterface, DevToolsStatsOptions, IModelRpcProps, RpcInterface, RpcManager } from \"@itwin/core-common\";\nimport { DevTools, DevToolsStatsFormatter } from \"../DevTools\";\n\n/** The backend implementation of WipRpcInterface.\n * @internal\n */\nexport class DevToolsRpcImpl extends RpcInterface implements DevToolsRpcInterface { // eslint-disable-line deprecation/deprecation\n public static register() { RpcManager.registerImpl(DevToolsRpcInterface, DevToolsRpcImpl); }\n\n // Returns true if the backend received the ping\n public async ping(_tokenProps: IModelRpcProps): Promise<boolean> {\n return DevTools.ping();\n }\n\n // Returns JSON object with statistics\n public async stats(_tokenProps: IModelRpcProps, options: DevToolsStatsOptions): Promise<any> {\n const stats = DevTools.stats();\n if (options === DevToolsStatsOptions.None)\n return stats;\n const formattedStats = DevToolsStatsFormatter.toFormattedJson(stats);\n return formattedStats;\n }\n\n // Returns JSON object with backend versions (application and iModelJs)\n public async versions(_tokenProps: IModelRpcProps): Promise<any> {\n return DevTools.versions();\n }\n\n // Sets up a log level at the backend\n public async setLogLevel(_tokenProps: IModelRpcProps, loggerCategory: string, logLevel: LogLevel): Promise<LogLevel | undefined> {\n return DevTools.setLogLevel(loggerCategory, logLevel);\n }\n}\n"]}