@itwin/core-backend 3.5.0-dev.4 → 3.5.0-dev.43

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 (278) hide show
  1. package/CHANGELOG.md +77 -1
  2. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  3. package/lib/cjs/AliCloudStorageService.js +71 -71
  4. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  5. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  6. package/lib/cjs/BackendHubAccess.js +41 -41
  7. package/lib/cjs/BackendHubAccess.js.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  9. package/lib/cjs/BackendLoggerCategory.js +99 -99
  10. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  11. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  12. package/lib/cjs/BisCoreSchema.js +60 -60
  13. package/lib/cjs/BisCoreSchema.js.map +1 -1
  14. package/lib/cjs/BriefcaseManager.d.ts +170 -165
  15. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  16. package/lib/cjs/BriefcaseManager.js +413 -405
  17. package/lib/cjs/BriefcaseManager.js.map +1 -1
  18. package/lib/cjs/Category.d.ts +153 -153
  19. package/lib/cjs/Category.js +243 -243
  20. package/lib/cjs/Category.js.map +1 -1
  21. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  22. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  23. package/lib/cjs/ChangeSummaryManager.js +447 -445
  24. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  25. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  26. package/lib/cjs/ChangedElementsDb.js +165 -165
  27. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  28. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  29. package/lib/cjs/ChangedElementsManager.js +88 -88
  30. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  31. package/lib/cjs/CheckpointManager.d.ts +120 -120
  32. package/lib/cjs/CheckpointManager.js +343 -343
  33. package/lib/cjs/CheckpointManager.js.map +1 -1
  34. package/lib/cjs/ClassRegistry.d.ts +79 -71
  35. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  36. package/lib/cjs/ClassRegistry.js +249 -215
  37. package/lib/cjs/ClassRegistry.js.map +1 -1
  38. package/lib/cjs/CloudSqlite.d.ts +350 -349
  39. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  40. package/lib/cjs/CloudSqlite.js +152 -151
  41. package/lib/cjs/CloudSqlite.js.map +1 -1
  42. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  43. package/lib/cjs/CloudStorageBackend.js +173 -173
  44. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  45. package/lib/cjs/CodeService.d.ts +396 -396
  46. package/lib/cjs/CodeService.js +63 -63
  47. package/lib/cjs/CodeService.js.map +1 -1
  48. package/lib/cjs/CodeSpecs.d.ts +50 -50
  49. package/lib/cjs/CodeSpecs.js +112 -112
  50. package/lib/cjs/CodeSpecs.js.map +1 -1
  51. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  52. package/lib/cjs/ConcurrentQuery.js +30 -30
  53. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  54. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -32
  55. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  56. package/lib/cjs/CustomViewState3dCreator.js +81 -113
  57. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  58. package/lib/cjs/DevTools.d.ts +71 -71
  59. package/lib/cjs/DevTools.js +154 -154
  60. package/lib/cjs/DevTools.js.map +1 -1
  61. package/lib/cjs/DisplayStyle.d.ts +106 -106
  62. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  63. package/lib/cjs/DisplayStyle.js +256 -256
  64. package/lib/cjs/DisplayStyle.js.map +1 -1
  65. package/lib/cjs/ECDb.d.ts +191 -191
  66. package/lib/cjs/ECDb.js +350 -350
  67. package/lib/cjs/ECDb.js.map +1 -1
  68. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  69. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  70. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  71. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  72. package/lib/cjs/ECSqlStatement.js +791 -791
  73. package/lib/cjs/ECSqlStatement.js.map +1 -1
  74. package/lib/cjs/Element.d.ts +1102 -1109
  75. package/lib/cjs/Element.d.ts.map +1 -1
  76. package/lib/cjs/Element.js +1416 -1420
  77. package/lib/cjs/Element.js.map +1 -1
  78. package/lib/cjs/ElementAspect.d.ts +176 -156
  79. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  80. package/lib/cjs/ElementAspect.js +211 -178
  81. package/lib/cjs/ElementAspect.js.map +1 -1
  82. package/lib/cjs/ElementGraphics.d.ts +9 -9
  83. package/lib/cjs/ElementGraphics.js +41 -41
  84. package/lib/cjs/ElementGraphics.js.map +1 -1
  85. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  86. package/lib/cjs/ElementTreeWalker.js +409 -409
  87. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  88. package/lib/cjs/Entity.d.ts +106 -76
  89. package/lib/cjs/Entity.d.ts.map +1 -1
  90. package/lib/cjs/Entity.js +134 -82
  91. package/lib/cjs/Entity.js.map +1 -1
  92. package/lib/cjs/EntityReferences.d.ts +50 -0
  93. package/lib/cjs/EntityReferences.d.ts.map +1 -0
  94. package/lib/cjs/EntityReferences.js +96 -0
  95. package/lib/cjs/EntityReferences.js.map +1 -0
  96. package/lib/cjs/ExportGraphics.d.ts +317 -317
  97. package/lib/cjs/ExportGraphics.js +208 -208
  98. package/lib/cjs/ExportGraphics.js.map +1 -1
  99. package/lib/cjs/ExternalSource.d.ts +96 -94
  100. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  101. package/lib/cjs/ExternalSource.js +131 -125
  102. package/lib/cjs/ExternalSource.js.map +1 -1
  103. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  104. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  105. package/lib/cjs/GeoCoordConfig.js +85 -82
  106. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  107. package/lib/cjs/GeometrySummary.d.ts +4 -4
  108. package/lib/cjs/GeometrySummary.js +380 -380
  109. package/lib/cjs/GeometrySummary.js.map +1 -1
  110. package/lib/cjs/HubMock.d.ts +94 -93
  111. package/lib/cjs/HubMock.d.ts.map +1 -1
  112. package/lib/cjs/HubMock.js +222 -190
  113. package/lib/cjs/HubMock.js.map +1 -1
  114. package/lib/cjs/IModelCloneContext.d.ts +8 -85
  115. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  116. package/lib/cjs/IModelCloneContext.js +15 -150
  117. package/lib/cjs/IModelCloneContext.js.map +1 -1
  118. package/lib/cjs/IModelDb.d.ts +1183 -1164
  119. package/lib/cjs/IModelDb.d.ts.map +1 -1
  120. package/lib/cjs/IModelDb.js +2374 -2324
  121. package/lib/cjs/IModelDb.js.map +1 -1
  122. package/lib/cjs/IModelElementCloneContext.d.ts +90 -0
  123. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -0
  124. package/lib/cjs/IModelElementCloneContext.js +160 -0
  125. package/lib/cjs/IModelElementCloneContext.js.map +1 -0
  126. package/lib/cjs/IModelHost.d.ts +370 -361
  127. package/lib/cjs/IModelHost.d.ts.map +1 -1
  128. package/lib/cjs/IModelHost.js +496 -489
  129. package/lib/cjs/IModelHost.js.map +1 -1
  130. package/lib/cjs/IModelJsFs.d.ts +62 -62
  131. package/lib/cjs/IModelJsFs.js +140 -140
  132. package/lib/cjs/IModelJsFs.js.map +1 -1
  133. package/lib/cjs/IpcHost.d.ts +104 -98
  134. package/lib/cjs/IpcHost.d.ts.map +1 -1
  135. package/lib/cjs/IpcHost.js +278 -234
  136. package/lib/cjs/IpcHost.js.map +1 -1
  137. package/lib/cjs/LineStyle.d.ts +311 -311
  138. package/lib/cjs/LineStyle.js +295 -295
  139. package/lib/cjs/LineStyle.js.map +1 -1
  140. package/lib/cjs/LocalHub.d.ts +162 -162
  141. package/lib/cjs/LocalHub.js +587 -587
  142. package/lib/cjs/LocalHub.js.map +1 -1
  143. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  144. package/lib/cjs/LocalhostIpcHost.js +81 -81
  145. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  146. package/lib/cjs/Material.d.ts +103 -103
  147. package/lib/cjs/Material.js +147 -147
  148. package/lib/cjs/Material.js.map +1 -1
  149. package/lib/cjs/Model.d.ts +392 -386
  150. package/lib/cjs/Model.d.ts.map +1 -1
  151. package/lib/cjs/Model.js +485 -471
  152. package/lib/cjs/Model.js.map +1 -1
  153. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  154. package/lib/cjs/NativeAppStorage.js +202 -202
  155. package/lib/cjs/NativeAppStorage.js.map +1 -1
  156. package/lib/cjs/NativeHost.d.ts +52 -52
  157. package/lib/cjs/NativeHost.d.ts.map +1 -1
  158. package/lib/cjs/NativeHost.js +163 -168
  159. package/lib/cjs/NativeHost.js.map +1 -1
  160. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  161. package/lib/cjs/NavigationRelationship.js +225 -225
  162. package/lib/cjs/NavigationRelationship.js.map +1 -1
  163. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  164. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  165. package/lib/cjs/PromiseMemoizer.js +101 -101
  166. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  167. package/lib/cjs/PropertyStore.d.ts +132 -132
  168. package/lib/cjs/PropertyStore.js +11 -11
  169. package/lib/cjs/PropertyStore.js.map +1 -1
  170. package/lib/cjs/Relationship.d.ts +416 -400
  171. package/lib/cjs/Relationship.d.ts.map +1 -1
  172. package/lib/cjs/Relationship.js +494 -465
  173. package/lib/cjs/Relationship.js.map +1 -1
  174. package/lib/cjs/RpcBackend.d.ts +5 -28
  175. package/lib/cjs/RpcBackend.d.ts.map +1 -1
  176. package/lib/cjs/RpcBackend.js +31 -126
  177. package/lib/cjs/RpcBackend.js.map +1 -1
  178. package/lib/cjs/SQLiteDb.d.ts +219 -219
  179. package/lib/cjs/SQLiteDb.js +214 -214
  180. package/lib/cjs/SQLiteDb.js.map +1 -1
  181. package/lib/cjs/Schema.d.ts +55 -55
  182. package/lib/cjs/Schema.js +83 -83
  183. package/lib/cjs/Schema.js.map +1 -1
  184. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  185. package/lib/cjs/ServerBasedLocks.js +168 -168
  186. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  187. package/lib/cjs/SqliteStatement.d.ts +360 -283
  188. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  189. package/lib/cjs/SqliteStatement.js +586 -448
  190. package/lib/cjs/SqliteStatement.js.map +1 -1
  191. package/lib/cjs/Texture.d.ts +58 -58
  192. package/lib/cjs/Texture.js +82 -82
  193. package/lib/cjs/Texture.js.map +1 -1
  194. package/lib/cjs/TileStorage.d.ts +18 -18
  195. package/lib/cjs/TileStorage.js +90 -90
  196. package/lib/cjs/TileStorage.js.map +1 -1
  197. package/lib/cjs/TxnManager.d.ts +202 -202
  198. package/lib/cjs/TxnManager.js +356 -356
  199. package/lib/cjs/TxnManager.js.map +1 -1
  200. package/lib/cjs/ViewDefinition.d.ts +439 -435
  201. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  202. package/lib/cjs/ViewDefinition.js +646 -635
  203. package/lib/cjs/ViewDefinition.js.map +1 -1
  204. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  205. package/lib/cjs/ViewStateHydrator.js +103 -103
  206. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  207. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  208. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  209. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  210. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  211. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  212. package/lib/cjs/core-backend.d.ts +184 -182
  213. package/lib/cjs/core-backend.d.ts.map +1 -1
  214. package/lib/cjs/core-backend.js +204 -202
  215. package/lib/cjs/core-backend.js.map +1 -1
  216. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  217. package/lib/cjs/domains/FunctionalElements.js +145 -145
  218. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  219. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  220. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  221. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  222. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  223. package/lib/cjs/domains/GenericElements.js +263 -263
  224. package/lib/cjs/domains/GenericElements.js.map +1 -1
  225. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  226. package/lib/cjs/domains/GenericSchema.js +28 -28
  227. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  228. package/lib/cjs/rpc/multipart.d.ts +12 -0
  229. package/lib/cjs/rpc/multipart.d.ts.map +1 -0
  230. package/lib/cjs/rpc/multipart.js +71 -0
  231. package/lib/cjs/rpc/multipart.js.map +1 -0
  232. package/lib/cjs/rpc/tracing.d.ts +29 -0
  233. package/lib/cjs/rpc/tracing.d.ts.map +1 -0
  234. package/lib/cjs/rpc/tracing.js +74 -0
  235. package/lib/cjs/rpc/tracing.js.map +1 -0
  236. package/lib/cjs/rpc/web/logging.d.ts +10 -0
  237. package/lib/cjs/rpc/web/logging.d.ts.map +1 -0
  238. package/lib/cjs/rpc/web/logging.js +43 -0
  239. package/lib/cjs/rpc/web/logging.js.map +1 -0
  240. package/lib/cjs/rpc/web/request.d.ts +7 -0
  241. package/lib/cjs/rpc/web/request.d.ts.map +1 -0
  242. package/lib/cjs/rpc/web/request.js +74 -0
  243. package/lib/cjs/rpc/web/request.js.map +1 -0
  244. package/lib/cjs/rpc/web/response.d.ts +7 -0
  245. package/lib/cjs/rpc/web/response.d.ts.map +1 -0
  246. package/lib/cjs/rpc/web/response.js +106 -0
  247. package/lib/cjs/rpc/web/response.js.map +1 -0
  248. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  249. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  250. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  251. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +46 -45
  252. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  253. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +287 -262
  254. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  255. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  256. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  257. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -204
  258. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  259. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  260. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  261. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  262. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  263. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  264. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  265. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  266. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  267. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  268. package/lib/cjs/workspace/Settings.d.ts +186 -186
  269. package/lib/cjs/workspace/Settings.js +155 -155
  270. package/lib/cjs/workspace/Settings.js.map +1 -1
  271. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  272. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  273. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  274. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  275. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  276. package/lib/cjs/workspace/Workspace.js +543 -543
  277. package/lib/cjs/workspace/Workspace.js.map +1 -1
  278. package/package.json +14 -13
@@ -1 +1 @@
1
- {"version":3,"file":"CodeSpecs.js","sourceRoot":"","sources":["../../src/CodeSpecs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+E;AAC/E,oDAA0E;AAI1E;;GAEG;AACH,MAAa,SAAS;IAIpB,YAAY,MAAgB;QAFpB,qBAAgB,GAAe,EAAE,CAAC;QAGxC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,MAAM,CAAC,aAAa,EAAE,EAAE;YAC1B,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC/E;IACH,CAAC;IAED,8DAA8D;IACvD,OAAO,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,4DAA4D,EAAE,CAAC,IAAoB,EAAE,EAAE;YAC/H,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC9B,IAAI,uBAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,IAAI,EAAE;gBACxC,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACvF,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;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,2BAAY,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;YAEtE,MAAM,GAAG,GAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,sBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxHD,8BAwHC","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 Codes\n */\n\nimport { DbResult, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport { CodeScopeSpec, CodeSpec, IModelError } from \"@itwin/core-common\";\nimport { ECSqlStatement } from \"./ECSqlStatement\";\nimport { IModelDb } from \"./IModelDb\";\n\n/** Manages [CodeSpecs]($docs/BIS/guide/fundamentals/element-fundamentals.md#codespec) within an [[IModelDb]]\n * @public\n */\nexport class CodeSpecs {\n private _imodel: IModelDb;\n private _loadedCodeSpecs: CodeSpec[] = [];\n\n constructor(imodel: IModelDb) {\n this._imodel = imodel;\n if (imodel.isBriefcaseDb()) {\n imodel.onChangesetApplied.addListener(() => this._loadedCodeSpecs.length = 0);\n }\n }\n\n /** Look up the Id of the CodeSpec with the specified name. */\n public queryId(name: string): Id64String {\n return this._imodel.withPreparedStatement(\"SELECT ECInstanceId FROM BisCore.CodeSpec WHERE Name=:name\", (stmt: ECSqlStatement) => {\n stmt.bindString(\"name\", name);\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\n throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\", () => ({ name }));\n return stmt.getValue(0).getId();\n });\n }\n\n /** Look up a CodeSpec by Id. The CodeSpec will be loaded from the database if necessary.\n * @param codeSpecId The Id of the CodeSpec to load\n * @returns The CodeSpec with the specified Id\n * @throws [[IModelError]] if the Id is invalid or if no CodeSpec with that Id could be found.\n */\n public getById(codeSpecId: Id64String): CodeSpec {\n if (Id64.isInvalid(codeSpecId))\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\n\n // good chance it is already loaded - check there before running a query\n const found = this._loadedCodeSpecs.find((codeSpec) => codeSpec.id === codeSpecId);\n if (found !== undefined)\n return found;\n\n // must load this codespec\n const loadedCodeSpec = this.load(codeSpecId);\n this._loadedCodeSpecs.push(loadedCodeSpec);\n return loadedCodeSpec;\n }\n\n /** Returns true if the IModelDb has a CodeSpec of the specified Id. */\n public hasId(codeSpecId: Id64String): boolean {\n try {\n return undefined !== this.getById(codeSpecId);\n } catch (error) {\n return false;\n }\n }\n\n /** Look up a CodeSpec by name. The CodeSpec will be loaded from the database if necessary.\n * @param name The name of the CodeSpec to load\n * @returns The CodeSpec with the specified name\n * @throws [[IModelError]] if no CodeSpec with the specified name could be found.\n */\n public getByName(name: string): CodeSpec {\n // good chance it is already loaded - check there before running a query\n const found: CodeSpec | undefined = this._loadedCodeSpecs.find((codeSpec) => codeSpec.name === name);\n if (found !== undefined)\n return found;\n const codeSpecId = this.queryId(name);\n if (codeSpecId === undefined)\n throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\", () => ({ name }));\n return this.getById(codeSpecId);\n }\n\n /** Returns true if the IModelDb has a CodeSpec of the specified name. */\n public hasName(name: string): boolean {\n try {\n return undefined !== this.getByName(name);\n } catch (error) {\n return false;\n }\n }\n\n /** Add a new CodeSpec to the iModel.\n * @param codeSpec The CodeSpec to insert\n * @returns The Id of the persistent CodeSpec.\n * @note If successful, this method will assign a valid CodeSpecId to the supplied CodeSpec\n * @throws IModelError if the insertion fails\n */\n public insert(codeSpec: CodeSpec): Id64String;\n /** Add a new CodeSpec to the IModelDb.\n * @param name The name for the new CodeSpec.\n * @param scopeType The scope type\n * @returns The Id of the persistent CodeSpec.\n * @throws IModelError if the insertion fails\n */\n public insert(name: string, scopeType: CodeScopeSpec.Type): Id64String;\n public insert(codeSpecOrName: CodeSpec | string, scopeType?: CodeScopeSpec.Type): Id64String {\n if (codeSpecOrName instanceof CodeSpec) {\n const codeSpec = codeSpecOrName;\n const id: Id64String = this._imodel.insertCodeSpec(codeSpec);\n codeSpec.id = id;\n return id;\n }\n if (typeof codeSpecOrName === \"string\") {\n const name = codeSpecOrName;\n if (scopeType)\n return this._imodel.insertCodeSpec(CodeSpec.create(this._imodel, name, scopeType));\n }\n throw new IModelError(IModelStatus.BadArg, \"Invalid argument\");\n }\n\n /** Load a CodeSpec from the iModel\n * @param id The persistent Id of the CodeSpec to load\n */\n public load(id: Id64String): CodeSpec {\n if (Id64.isInvalid(id))\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\n\n return this._imodel.withPreparedStatement(\"SELECT name,jsonProperties FROM BisCore.CodeSpec WHERE ECInstanceId=?\", (stmt: ECSqlStatement) => {\n stmt.bindId(1, id);\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\n\n const row: any = stmt.getRow();\n return CodeSpec.createFromJson(this._imodel, id, row.name, JSON.parse(row.jsonProperties));\n });\n }\n}\n"]}
1
+ {"version":3,"file":"CodeSpecs.js","sourceRoot":"","sources":["../../src/CodeSpecs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+E;AAC/E,oDAA0E;AAI1E;;GAEG;AACH,MAAa,SAAS;IAIpB,YAAY,MAAgB;QAFpB,qBAAgB,GAAe,EAAE,CAAC;QAGxC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,MAAM,CAAC,aAAa,EAAE,EAAE;YAC1B,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC/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AAC,CAAC;SACtF;QACD,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,EAAc;QACxB,IAAI,mBAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAEtE,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,uEAAuE,EAAE,CAAC,IAAoB,EAAE,EAAE;YAC1I,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnB,IAAI,uBAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,IAAI,EAAE;gBACxC,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;YAEtE,MAAM,GAAG,GAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,sBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxHD,8BAwHC","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 Codes\r\n */\r\n\r\nimport { DbResult, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { CodeScopeSpec, CodeSpec, IModelError } from \"@itwin/core-common\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\n/** Manages [CodeSpecs]($docs/BIS/guide/fundamentals/element-fundamentals.md#codespec) within an [[IModelDb]]\r\n * @public\r\n */\r\nexport class CodeSpecs {\r\n private _imodel: IModelDb;\r\n private _loadedCodeSpecs: CodeSpec[] = [];\r\n\r\n constructor(imodel: IModelDb) {\r\n this._imodel = imodel;\r\n if (imodel.isBriefcaseDb()) {\r\n imodel.onChangesetApplied.addListener(() => this._loadedCodeSpecs.length = 0);\r\n }\r\n }\r\n\r\n /** Look up the Id of the CodeSpec with the specified name. */\r\n public queryId(name: string): Id64String {\r\n return this._imodel.withPreparedStatement(\"SELECT ECInstanceId FROM BisCore.CodeSpec WHERE Name=:name\", (stmt: ECSqlStatement) => {\r\n stmt.bindString(\"name\", name);\r\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\r\n throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\", () => ({ name }));\r\n return stmt.getValue(0).getId();\r\n });\r\n }\r\n\r\n /** Look up a CodeSpec by Id. The CodeSpec will be loaded from the database if necessary.\r\n * @param codeSpecId The Id of the CodeSpec to load\r\n * @returns The CodeSpec with the specified Id\r\n * @throws [[IModelError]] if the Id is invalid or if no CodeSpec with that Id could be found.\r\n */\r\n public getById(codeSpecId: Id64String): CodeSpec {\r\n if (Id64.isInvalid(codeSpecId))\r\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\r\n\r\n // good chance it is already loaded - check there before running a query\r\n const found = this._loadedCodeSpecs.find((codeSpec) => codeSpec.id === codeSpecId);\r\n if (found !== undefined)\r\n return found;\r\n\r\n // must load this codespec\r\n const loadedCodeSpec = this.load(codeSpecId);\r\n this._loadedCodeSpecs.push(loadedCodeSpec);\r\n return loadedCodeSpec;\r\n }\r\n\r\n /** Returns true if the IModelDb has a CodeSpec of the specified Id. */\r\n public hasId(codeSpecId: Id64String): boolean {\r\n try {\r\n return undefined !== this.getById(codeSpecId);\r\n } catch (error) {\r\n return false;\r\n }\r\n }\r\n\r\n /** Look up a CodeSpec by name. The CodeSpec will be loaded from the database if necessary.\r\n * @param name The name of the CodeSpec to load\r\n * @returns The CodeSpec with the specified name\r\n * @throws [[IModelError]] if no CodeSpec with the specified name could be found.\r\n */\r\n public getByName(name: string): CodeSpec {\r\n // good chance it is already loaded - check there before running a query\r\n const found: CodeSpec | undefined = this._loadedCodeSpecs.find((codeSpec) => codeSpec.name === name);\r\n if (found !== undefined)\r\n return found;\r\n const codeSpecId = this.queryId(name);\r\n if (codeSpecId === undefined)\r\n throw new IModelError(IModelStatus.NotFound, \"CodeSpec not found\", () => ({ name }));\r\n return this.getById(codeSpecId);\r\n }\r\n\r\n /** Returns true if the IModelDb has a CodeSpec of the specified name. */\r\n public hasName(name: string): boolean {\r\n try {\r\n return undefined !== this.getByName(name);\r\n } catch (error) {\r\n return false;\r\n }\r\n }\r\n\r\n /** Add a new CodeSpec to the iModel.\r\n * @param codeSpec The CodeSpec to insert\r\n * @returns The Id of the persistent CodeSpec.\r\n * @note If successful, this method will assign a valid CodeSpecId to the supplied CodeSpec\r\n * @throws IModelError if the insertion fails\r\n */\r\n public insert(codeSpec: CodeSpec): Id64String;\r\n /** Add a new CodeSpec to the IModelDb.\r\n * @param name The name for the new CodeSpec.\r\n * @param scopeType The scope type\r\n * @returns The Id of the persistent CodeSpec.\r\n * @throws IModelError if the insertion fails\r\n */\r\n public insert(name: string, scopeType: CodeScopeSpec.Type): Id64String;\r\n public insert(codeSpecOrName: CodeSpec | string, scopeType?: CodeScopeSpec.Type): Id64String {\r\n if (codeSpecOrName instanceof CodeSpec) {\r\n const codeSpec = codeSpecOrName;\r\n const id: Id64String = this._imodel.insertCodeSpec(codeSpec);\r\n codeSpec.id = id;\r\n return id;\r\n }\r\n if (typeof codeSpecOrName === \"string\") {\r\n const name = codeSpecOrName;\r\n if (scopeType)\r\n return this._imodel.insertCodeSpec(CodeSpec.create(this._imodel, name, scopeType));\r\n }\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid argument\");\r\n }\r\n\r\n /** Load a CodeSpec from the iModel\r\n * @param id The persistent Id of the CodeSpec to load\r\n */\r\n public load(id: Id64String): CodeSpec {\r\n if (Id64.isInvalid(id))\r\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\r\n\r\n return this._imodel.withPreparedStatement(\"SELECT name,jsonProperties FROM BisCore.CodeSpec WHERE ECInstanceId=?\", (stmt: ECSqlStatement) => {\r\n stmt.bindId(1, id);\r\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\r\n throw new IModelError(IModelStatus.InvalidId, \"Invalid codeSpecId\");\r\n\r\n const row: any = stmt.getRow();\r\n return CodeSpec.createFromJson(this._imodel, id, row.name, JSON.parse(row.jsonProperties));\r\n });\r\n }\r\n}\r\n"]}
@@ -1,12 +1,12 @@
1
- import { IModelJsNative } from "@bentley/imodeljs-native";
2
- import { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse } from "@itwin/core-common";
3
- /** @internal */
4
- export declare type OnResponse = (response: Response) => void;
5
- /** @internal */
6
- export declare class ConcurrentQuery {
7
- /** @internal */
8
- static executeQueryRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbQueryRequest): Promise<DbQueryResponse>;
9
- /** @internal */
10
- static executeBlobRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbBlobRequest): Promise<DbBlobResponse>;
11
- }
1
+ import { IModelJsNative } from "@bentley/imodeljs-native";
2
+ import { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse } from "@itwin/core-common";
3
+ /** @internal */
4
+ export declare type OnResponse = (response: Response) => void;
5
+ /** @internal */
6
+ export declare class ConcurrentQuery {
7
+ /** @internal */
8
+ static executeQueryRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbQueryRequest): Promise<DbQueryResponse>;
9
+ /** @internal */
10
+ static executeBlobRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbBlobRequest): Promise<DbBlobResponse>;
11
+ }
12
12
  //# sourceMappingURL=ConcurrentQuery.d.ts.map
@@ -1,31 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConcurrentQuery = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const core_common_1 = require("@itwin/core-common");
9
- /** @internal */
10
- class ConcurrentQuery {
11
- /** @internal */
12
- static async executeQueryRequest(conn, request) {
13
- return new Promise((resolve) => {
14
- request.kind = core_common_1.DbRequestKind.ECSql;
15
- conn.concurrentQueryExecute(request, (response) => {
16
- resolve(response);
17
- });
18
- });
19
- }
20
- /** @internal */
21
- static async executeBlobRequest(conn, request) {
22
- return new Promise((resolve) => {
23
- request.kind = core_common_1.DbRequestKind.BlobIO;
24
- conn.concurrentQueryExecute(request, (response) => {
25
- resolve(response);
26
- });
27
- });
28
- }
29
- }
30
- exports.ConcurrentQuery = ConcurrentQuery;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConcurrentQuery = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ const core_common_1 = require("@itwin/core-common");
9
+ /** @internal */
10
+ class ConcurrentQuery {
11
+ /** @internal */
12
+ static async executeQueryRequest(conn, request) {
13
+ return new Promise((resolve) => {
14
+ request.kind = core_common_1.DbRequestKind.ECSql;
15
+ conn.concurrentQueryExecute(request, (response) => {
16
+ resolve(response);
17
+ });
18
+ });
19
+ }
20
+ /** @internal */
21
+ static async executeBlobRequest(conn, request) {
22
+ return new Promise((resolve) => {
23
+ request.kind = core_common_1.DbRequestKind.BlobIO;
24
+ conn.concurrentQueryExecute(request, (response) => {
25
+ resolve(response);
26
+ });
27
+ });
28
+ }
29
+ }
30
+ exports.ConcurrentQuery = ConcurrentQuery;
31
31
  //# sourceMappingURL=ConcurrentQuery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AACA;;;+FAG+F;AAC/F,oDAAmH;AAKnH,gBAAgB;AAChB,MAAa,eAAe;IAC1B,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAgD,EAAE,OAAuB;QAC/G,OAAO,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,EAAE;YAC9C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,KAAK,CAAC;YACnC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA2B,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAgD,EAAE,OAAsB;QAC7G,OAAO,IAAI,OAAO,CAAiB,CAAC,OAAO,EAAE,EAAE;YAC7C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,MAAM,CAAC;YACpC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA0B,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,0CAmBC","sourcesContent":["import { IModelJsNative } from \"@bentley/imodeljs-native\";\n/*---------------------------------------------------------------------------------------------\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*--------------------------------------------------------------------------------------------*/\nimport { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse, DbRequestKind } from \"@itwin/core-common\";\n\n/** @internal */\nexport type OnResponse = (response: Response) => void;\n\n/** @internal */\nexport class ConcurrentQuery {\n /** @internal */\n public static async executeQueryRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbQueryRequest): Promise<DbQueryResponse> {\n return new Promise<DbQueryResponse>((resolve) => {\n request.kind = DbRequestKind.ECSql;\n conn.concurrentQueryExecute(request as any, (response: any) => {\n resolve(response as DbQueryResponse);\n });\n });\n }\n /** @internal */\n public static async executeBlobRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbBlobRequest): Promise<DbBlobResponse> {\n return new Promise<DbBlobResponse>((resolve) => {\n request.kind = DbRequestKind.BlobIO;\n conn.concurrentQueryExecute(request as any, (response: any) => {\n resolve(response as DbBlobResponse);\n });\n });\n }\n}\n"]}
1
+ {"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AACA;;;+FAG+F;AAC/F,oDAAmH;AAKnH,gBAAgB;AAChB,MAAa,eAAe;IAC1B,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAgD,EAAE,OAAuB;QAC/G,OAAO,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,EAAE;YAC9C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,KAAK,CAAC;YACnC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA2B,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACD,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAgD,EAAE,OAAsB;QAC7G,OAAO,IAAI,OAAO,CAAiB,CAAC,OAAO,EAAE,EAAE;YAC7C,OAAO,CAAC,IAAI,GAAG,2BAAa,CAAC,MAAM,CAAC;YACpC,IAAI,CAAC,sBAAsB,CAAC,OAAc,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,OAAO,CAAC,QAA0B,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,0CAmBC","sourcesContent":["import { IModelJsNative } from \"@bentley/imodeljs-native\";\r\n/*---------------------------------------------------------------------------------------------\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\nimport { DbBlobRequest, DbBlobResponse, DbQueryRequest, DbQueryResponse, DbRequestKind } from \"@itwin/core-common\";\r\n\r\n/** @internal */\r\nexport type OnResponse = (response: Response) => void;\r\n\r\n/** @internal */\r\nexport class ConcurrentQuery {\r\n /** @internal */\r\n public static async executeQueryRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbQueryRequest): Promise<DbQueryResponse> {\r\n return new Promise<DbQueryResponse>((resolve) => {\r\n request.kind = DbRequestKind.ECSql;\r\n conn.concurrentQueryExecute(request as any, (response: any) => {\r\n resolve(response as DbQueryResponse);\r\n });\r\n });\r\n }\r\n /** @internal */\r\n public static async executeBlobRequest(conn: IModelJsNative.ECDb | IModelJsNative.DgnDb, request: DbBlobRequest): Promise<DbBlobResponse> {\r\n return new Promise<DbBlobResponse>((resolve) => {\r\n request.kind = DbRequestKind.BlobIO;\r\n conn.concurrentQueryExecute(request as any, (response: any) => {\r\n resolve(response as DbBlobResponse);\r\n });\r\n });\r\n }\r\n}\r\n"]}
@@ -1,33 +1,22 @@
1
- import { CustomViewState3dCreatorOptions, CustomViewState3dProps } from "@itwin/core-common";
2
- import { IModelDb } from "./IModelDb";
3
- /**
4
- * Class which helps to generate a custom ViewState3d.
5
- * @internal
6
- */
7
- export declare class CustomViewState3dCreator {
8
- private _imodel;
9
- constructor(iModel: IModelDb);
10
- /**
11
- * Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
12
- * @param [modelIds] Ids of models to display in the view.
13
- * @throws [IModelError]($common) If no 3d models are found in the iModel.
14
- * @returns CustomViewState3dProps
15
- */
16
- getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps>;
17
- private _getAllCategories;
18
- /**
19
- * Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.
20
- * @param modelIdsList array of modelIds to get extents for
21
- * @returns Range3d, the union of the extents of each model id
22
- */
23
- private _getModelExtents;
24
- /**
25
- * Get all PhysicalModel ids in the iModel
26
- */
27
- private _getAllModels;
28
- /**
29
- * Helper function to execute ECSql queries.
30
- */
31
- private _executeQuery;
32
- }
1
+ import { CustomViewState3dCreatorOptions, CustomViewState3dProps } from "@itwin/core-common";
2
+ import { IModelDb } from "./IModelDb";
3
+ /**
4
+ * Class which helps to generate a custom ViewState3d.
5
+ * @internal
6
+ */
7
+ export declare class CustomViewState3dCreator {
8
+ private _imodel;
9
+ constructor(iModel: IModelDb);
10
+ /** Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
11
+ * @param [modelIds] Ids of models to display in the view.
12
+ * @throws [IModelError]($common) If no 3d models are found in the iModel.
13
+ */
14
+ getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps>;
15
+ private _getAllCategories;
16
+ /** Compute the union of the extents of all the specified models. */
17
+ private _getModelExtents;
18
+ /** Get the Ids of all spatially-located, non-template 3d models in the iModel. */
19
+ private _getAllModels;
20
+ private _executeQuery;
21
+ }
33
22
  //# sourceMappingURL=CustomViewState3dCreator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomViewState3dCreator.d.ts","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAA6C,MAAM,oBAAoB,CAAC;AAGxI,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC;;;GAGG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,OAAO,CAAW;gBACP,MAAM,EAAE,QAAQ;IAGnC;;;;;OAKG;IACU,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAclG,iBAAiB;IAS/B;;;;OAIG;YACW,gBAAgB;IA+B9B;;OAEG;YACW,aAAa;IAgB3B;;OAEG;IACH,OAAO,CAAC,aAAa,CAMnB;CACH"}
1
+ {"version":3,"file":"CustomViewState3dCreator.d.ts","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAAkB,MAAM,oBAAoB,CAAC;AAG7G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC;;;GAGG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,OAAO,CAAW;gBACP,MAAM,EAAE,QAAQ;IAGnC;;;OAGG;IACU,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAelG,iBAAiB;IAS/B,oEAAoE;YACtD,gBAAgB;IAa9B,kFAAkF;YACpE,aAAa;IAmB3B,OAAO,CAAC,aAAa,CAMnB;CACH"}
@@ -1,114 +1,82 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.CustomViewState3dCreator = void 0;
8
- const core_bentley_1 = require("@itwin/core-bentley");
9
- const core_common_1 = require("@itwin/core-common");
10
- const core_geometry_1 = require("@itwin/core-geometry");
11
- const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
12
- const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.CustomViewState3dCreator;
13
- /**
14
- * Class which helps to generate a custom ViewState3d.
15
- * @internal
16
- */
17
- class CustomViewState3dCreator {
18
- constructor(iModel) {
19
- /**
20
- * Helper function to execute ECSql queries.
21
- */
22
- this._executeQuery = async (query) => {
23
- const rows = [];
24
- for await (const row of this._imodel.query(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
25
- rows.push(row.id);
26
- return rows;
27
- };
28
- this._imodel = iModel;
29
- }
30
- /**
31
- * Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
32
- * @param [modelIds] Ids of models to display in the view.
33
- * @throws [IModelError]($common) If no 3d models are found in the iModel.
34
- * @returns CustomViewState3dProps
35
- */
36
- async getCustomViewState3dData(options) {
37
- let decompressedModelIds;
38
- if ((options === null || options === void 0 ? void 0 : options.modelIds) !== undefined)
39
- decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
40
- const models = decompressedModelIds !== null && decompressedModelIds !== void 0 ? decompressedModelIds : await this._getAllModels();
41
- const categories = await this._getAllCategories();
42
- const modelExtents = await this._getModelExtents(models);
43
- return {
44
- modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
45
- categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
46
- modelExtents: modelExtents.toJSON(),
47
- };
48
- }
49
- async _getAllCategories() {
50
- // Only use categories with elements in them
51
- core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllCategories query.");
52
- const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
53
- const categories = await this._executeQuery(query);
54
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllCategories query.");
55
- return categories;
56
- }
57
- /**
58
- * Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.
59
- * @param modelIdsList array of modelIds to get extents for
60
- * @returns Range3d, the union of the extents of each model id
61
- */
62
- async _getModelExtents(modelIdsList) {
63
- const modelExtents = new core_geometry_1.Range3d();
64
- if (modelIdsList.length === 0)
65
- return modelExtents;
66
- const modelIds = new Set(modelIdsList);
67
- for (const id of modelIds) {
68
- const modelExtentsStopWatch = new core_bentley_1.StopWatch("getModelExtents query", false);
69
- try {
70
- await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.
71
- core_bentley_1.Logger.logInfo(loggerCategory, "Starting getModelExtents query.", { modelId: id });
72
- modelExtentsStopWatch.start();
73
- const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;
74
- modelExtentsStopWatch.stop();
75
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
76
- modelExtents.union(core_geometry_1.Range3d.fromJSON(props), modelExtents);
77
- }
78
- catch (err) {
79
- modelExtentsStopWatch.stop();
80
- if (err.errorNumber === core_common_1.IModelStatus.NoGeometry) { // if there was no geometry, just return null range
81
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with NoGeometry error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id });
82
- continue;
83
- }
84
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query with error.", { timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id, errorMessage: err === null || err === void 0 ? void 0 : err.message, errorNumber: err === null || err === void 0 ? void 0 : err.errorNumber });
85
- if (modelIds.size === 1)
86
- throw err; // if they're asking for more than one model, don't throw on error.
87
- continue;
88
- }
89
- }
90
- return modelExtents;
91
- }
92
- /**
93
- * Get all PhysicalModel ids in the iModel
94
- */
95
- async _getAllModels() {
96
- // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
97
- // If the iModel has an earlier version, the statement will throw because the property does not exist.
98
- // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.
99
- const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
100
- const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
101
- let models = [];
102
- core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllModels query.");
103
- try {
104
- models = await this._executeQuery(`${select} ${spatialCriterion}`);
105
- }
106
- catch {
107
- models = await this._executeQuery(select);
108
- }
109
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllModels query.");
110
- return models;
111
- }
112
- }
113
- exports.CustomViewState3dCreator = CustomViewState3dCreator;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CustomViewState3dCreator = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_common_1 = require("@itwin/core-common");
10
+ const core_geometry_1 = require("@itwin/core-geometry");
11
+ const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
12
+ const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.CustomViewState3dCreator;
13
+ /**
14
+ * Class which helps to generate a custom ViewState3d.
15
+ * @internal
16
+ */
17
+ class CustomViewState3dCreator {
18
+ constructor(iModel) {
19
+ this._executeQuery = async (query) => {
20
+ const rows = [];
21
+ for await (const row of this._imodel.query(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
22
+ rows.push(row.id);
23
+ return rows;
24
+ };
25
+ this._imodel = iModel;
26
+ }
27
+ /** Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
28
+ * @param [modelIds] Ids of models to display in the view.
29
+ * @throws [IModelError]($common) If no 3d models are found in the iModel.
30
+ */
31
+ async getCustomViewState3dData(options) {
32
+ let decompressedModelIds;
33
+ if ((options === null || options === void 0 ? void 0 : options.modelIds) !== undefined)
34
+ decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
35
+ const models = decompressedModelIds !== null && decompressedModelIds !== void 0 ? decompressedModelIds : await this._getAllModels();
36
+ const categories = await this._getAllCategories();
37
+ const modelExtents = await this._getModelExtents(models);
38
+ return {
39
+ modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
40
+ categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
41
+ modelExtents: modelExtents.toJSON(),
42
+ };
43
+ }
44
+ async _getAllCategories() {
45
+ // Only use categories with elements in them
46
+ core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllCategories query.");
47
+ const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
48
+ const categories = await this._executeQuery(query);
49
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllCategories query.");
50
+ return categories;
51
+ }
52
+ /** Compute the union of the extents of all the specified models. */
53
+ async _getModelExtents(modelIds) {
54
+ if (modelIds.length === 0)
55
+ return new core_geometry_1.Range3d();
56
+ const timer = new core_bentley_1.StopWatch("getModelExtents query", true);
57
+ const range = await this._imodel.models.queryRange(modelIds);
58
+ timer.stop();
59
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.", { timeElapsedMs: timer.elapsed });
60
+ return range;
61
+ }
62
+ /** Get the Ids of all spatially-located, non-template 3d models in the iModel. */
63
+ async _getAllModels() {
64
+ // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
65
+ // If the iModel has an earlier version, the statement will throw because the property does not exist.
66
+ // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.
67
+ const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
68
+ const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
69
+ let models = [];
70
+ core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllModels query.");
71
+ try {
72
+ models = await this._executeQuery(`${select} ${spatialCriterion}`);
73
+ }
74
+ catch {
75
+ models = await this._executeQuery(select);
76
+ }
77
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllModels query.");
78
+ return models;
79
+ }
80
+ }
81
+ exports.CustomViewState3dCreator = CustomViewState3dCreator;
114
82
  //# sourceMappingURL=CustomViewState3dCreator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAkG;AAClG,oDAAwI;AACxI,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAgB;QAuFnC;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,4BAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5G,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QA/FA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,wBAAwB,CAAC,OAAwC;QAC5E,IAAI,oBAAoB,CAAC;QACzB,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAK,SAAS;YACjC,oBAAoB,GAAG,gCAAiB,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7E,MAAM,MAAM,GAAc,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC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C7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QACD,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC;CAWF;AAnGD,4DAmGC","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\nimport { CompressedId64Set, Id64Array, Id64String, Logger, StopWatch } from \"@itwin/core-bentley\";\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, IModelError, IModelStatus, QueryRowFormat } from \"@itwin/core-common\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { IModelDb } from \"./IModelDb\";\n\nconst loggerCategory = BackendLoggerCategory.CustomViewState3dCreator;\n\n/**\n * Class which helps to generate a custom ViewState3d.\n * @internal\n */\nexport class CustomViewState3dCreator {\n private _imodel: IModelDb;\n public constructor(iModel: IModelDb) {\n this._imodel = iModel;\n }\n /**\n * Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.\n * @param [modelIds] Ids of models to display in the view.\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\n * @returns CustomViewState3dProps\n */\n public async getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> {\n let decompressedModelIds;\n if (options?.modelIds !== undefined)\n decompressedModelIds = CompressedId64Set.decompressArray(options.modelIds);\n const models: Id64Array = decompressedModelIds ?? await this._getAllModels();\n const categories: Id64Array = await this._getAllCategories();\n const modelExtents: Range3d = await this._getModelExtents(models);\n return {\n modelIds: CompressedId64Set.sortAndCompress(models),\n categoryIds: CompressedId64Set.sortAndCompress(categories),\n modelExtents: modelExtents.toJSON(),\n };\n }\n\n private async _getAllCategories(): Promise<Id64Array> {\n // Only use categories with elements in them\n Logger.logInfo(loggerCategory, \"Starting getAllCategories query.\");\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\n const categories: Id64Array = await this._executeQuery(query);\n Logger.logInfo(loggerCategory, \"Finished getAllCategories query.\");\n return categories;\n }\n\n /**\n * Gets the union of the extents of each model id passed in. Can return null range if no ids are passed, or no geometry found for the models.\n * @param modelIdsList array of modelIds to get extents for\n * @returns Range3d, the union of the extents of each model id\n */\n private async _getModelExtents(modelIdsList: Id64String[]): Promise<Range3d> {\n const modelExtents = new Range3d();\n if (modelIdsList.length === 0)\n return modelExtents;\n const modelIds = new Set(modelIdsList);\n for (const id of modelIds) {\n const modelExtentsStopWatch = new StopWatch(\"getModelExtents query\", false);\n try {\n await new Promise((resolve) => setImmediate(resolve)); // Free up main thread temporarily. Ideally we get queryModelExtents off the main thread and do not need to do this.\n Logger.logInfo(loggerCategory, \"Starting getModelExtents query.\", {modelId: id});\n modelExtentsStopWatch.start();\n const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;\n modelExtentsStopWatch.stop();\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id});\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\n } catch (err: any) {\n modelExtentsStopWatch.stop();\n if ((err as IModelError).errorNumber === IModelStatus.NoGeometry) { // if there was no geometry, just return null range\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query with NoGeometry error.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id});\n continue;\n }\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query with error.\", {timeElapsedMs: modelExtentsStopWatch.elapsed, modelId: id, errorMessage: err?.message, errorNumber: err?.errorNumber});\n\n if (modelIds.size === 1)\n throw err; // if they're asking for more than one model, don't throw on error.\n continue;\n }\n }\n return modelExtents;\n }\n\n /**\n * Get all PhysicalModel ids in the iModel\n */\n private async _getAllModels(): Promise<Id64Array> {\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\n let models = [];\n Logger.logInfo(loggerCategory, \"Starting getAllModels query.\");\n try {\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\n } catch {\n models = await this._executeQuery(select);\n }\n Logger.logInfo(loggerCategory, \"Finished getAllModels query.\");\n return models;\n }\n /**\n * Helper function to execute ECSql queries.\n */\n private _executeQuery = async (query: string) => {\n const rows = [];\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\n rows.push(row.id);\n\n return rows;\n };\n}\n"]}
1
+ {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAkG;AAClG,oDAA6G;AAC7G,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAgB;QAiE3B,kBAAa,G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------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String, Logger, StopWatch } from \"@itwin/core-bentley\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, QueryRowFormat } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.CustomViewState3dCreator;\r\n\r\n/**\r\n * Class which helps to generate a custom ViewState3d.\r\n * @internal\r\n */\r\nexport class CustomViewState3dCreator {\r\n private _imodel: IModelDb;\r\n public constructor(iModel: IModelDb) {\r\n this._imodel = iModel;\r\n }\r\n /** Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n */\r\n public async getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> {\r\n let decompressedModelIds;\r\n if (options?.modelIds !== undefined)\r\n decompressedModelIds = CompressedId64Set.decompressArray(options.modelIds);\r\n\r\n const models: Id64Array = decompressedModelIds ?? await this._getAllModels();\r\n const categories: Id64Array = await this._getAllCategories();\r\n const modelExtents: Range3d = await this._getModelExtents(models);\r\n return {\r\n modelIds: CompressedId64Set.sortAndCompress(models),\r\n categoryIds: CompressedId64Set.sortAndCompress(categories),\r\n modelExtents: modelExtents.toJSON(),\r\n };\r\n }\r\n\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n Logger.logInfo(loggerCategory, \"Starting getAllCategories query.\");\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n Logger.logInfo(loggerCategory, \"Finished getAllCategories query.\");\r\n return categories;\r\n }\r\n\r\n /** Compute the union of the extents of all the specified models. */\r\n private async _getModelExtents(modelIds: Id64String[]): Promise<Range3d> {\r\n if (modelIds.length === 0)\r\n return new Range3d();\r\n\r\n const timer = new StopWatch(\"getModelExtents query\", true);\r\n const range = await this._imodel.models.queryRange(modelIds);\r\n\r\n timer.stop();\r\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query.\", {timeElapsedMs: timer.elapsed});\r\n\r\n return range;\r\n }\r\n\r\n /** Get the Ids of all spatially-located, non-template 3d models in the iModel. */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n\r\n let models = [];\r\n Logger.logInfo(loggerCategory, \"Starting getAllModels query.\");\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n\r\n Logger.logInfo(loggerCategory, \"Finished getAllModels query.\");\r\n return models;\r\n }\r\n\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
@@ -1,72 +1,72 @@
1
- /// <reference types="node" />
2
- import * as os from "os";
3
- import { LogLevel } from "@itwin/core-bentley";
4
- /**
5
- * Performance and Memory statistics of backend
6
- * @internal
7
- */
8
- export interface DevToolsStats {
9
- os: DevToolsOsStats;
10
- process: DevToolsProcessStats;
11
- }
12
- /**
13
- * OS stats of backend
14
- * @internal
15
- */
16
- export interface DevToolsOsStats {
17
- platform: NodeJS.Platform;
18
- hostname: string;
19
- totalmem: number;
20
- freemem: number;
21
- uptime: number;
22
- cpus: os.CpuInfo[];
23
- cpuUsage: number;
24
- }
25
- /**
26
- * Process stats of backend
27
- * @internal
28
- */
29
- export interface DevToolsProcessStats {
30
- uptime: number;
31
- pid: number;
32
- ppid: number;
33
- memoryUsage: NodeJS.MemoryUsage;
34
- }
35
- /** Utility to format the JSON created by DevTools.stats() to include the appropriate units
36
- * @internal
37
- */
38
- export declare class DevToolsStatsFormatter {
39
- private static readonly _megaByteProps;
40
- private static readonly _percentProps;
41
- private static readonly _mHzProps;
42
- private static readonly _secondsProps;
43
- /** Replacer that includes units - can be used with JSON.stringify() */
44
- private static _replacer;
45
- /** Converts the input stats to another JSON object with the appropriate units setup for various fields */
46
- static toFormattedJson(stats: any): any;
47
- }
48
- /**
49
- * Internal diagnostic utility
50
- * @internal
51
- */
52
- export declare class DevTools {
53
- /** Receives a ping and returns true */
54
- static ping(): boolean;
55
- private static hrtimeToMS;
56
- private static bytesToMegaBytes;
57
- private static evaluateCpuUsage;
58
- private static evaluateCpus;
59
- private static evaluateMemoryUsage;
60
- private static evaluateProcessStats;
61
- private static evaluateOsStats;
62
- /** Returns JSON object with backend statistics */
63
- static stats(): DevToolsStats;
64
- /** Sets up a log level at the backend and returns the old log level */
65
- static setLogLevel(inLoggerCategory: string, newLevel: LogLevel): LogLevel | undefined;
66
- /** Obtains the backend application and iTwin.js Core versions */
67
- static versions(): {
68
- application: string;
69
- iTwinJs: any;
70
- };
71
- }
1
+ /// <reference types="node" />
2
+ import * as os from "os";
3
+ import { LogLevel } from "@itwin/core-bentley";
4
+ /**
5
+ * Performance and Memory statistics of backend
6
+ * @internal
7
+ */
8
+ export interface DevToolsStats {
9
+ os: DevToolsOsStats;
10
+ process: DevToolsProcessStats;
11
+ }
12
+ /**
13
+ * OS stats of backend
14
+ * @internal
15
+ */
16
+ export interface DevToolsOsStats {
17
+ platform: NodeJS.Platform;
18
+ hostname: string;
19
+ totalmem: number;
20
+ freemem: number;
21
+ uptime: number;
22
+ cpus: os.CpuInfo[];
23
+ cpuUsage: number;
24
+ }
25
+ /**
26
+ * Process stats of backend
27
+ * @internal
28
+ */
29
+ export interface DevToolsProcessStats {
30
+ uptime: number;
31
+ pid: number;
32
+ ppid: number;
33
+ memoryUsage: NodeJS.MemoryUsage;
34
+ }
35
+ /** Utility to format the JSON created by DevTools.stats() to include the appropriate units
36
+ * @internal
37
+ */
38
+ export declare class DevToolsStatsFormatter {
39
+ private static readonly _megaByteProps;
40
+ private static readonly _percentProps;
41
+ private static readonly _mHzProps;
42
+ private static readonly _secondsProps;
43
+ /** Replacer that includes units - can be used with JSON.stringify() */
44
+ private static _replacer;
45
+ /** Converts the input stats to another JSON object with the appropriate units setup for various fields */
46
+ static toFormattedJson(stats: any): any;
47
+ }
48
+ /**
49
+ * Internal diagnostic utility
50
+ * @internal
51
+ */
52
+ export declare class DevTools {
53
+ /** Receives a ping and returns true */
54
+ static ping(): boolean;
55
+ private static hrtimeToMS;
56
+ private static bytesToMegaBytes;
57
+ private static evaluateCpuUsage;
58
+ private static evaluateCpus;
59
+ private static evaluateMemoryUsage;
60
+ private static evaluateProcessStats;
61
+ private static evaluateOsStats;
62
+ /** Returns JSON object with backend statistics */
63
+ static stats(): DevToolsStats;
64
+ /** Sets up a log level at the backend and returns the old log level */
65
+ static setLogLevel(inLoggerCategory: string, newLevel: LogLevel): LogLevel | undefined;
66
+ /** Obtains the backend application and iTwin.js Core versions */
67
+ static versions(): {
68
+ application: string;
69
+ iTwinJs: any;
70
+ };
71
+ }
72
72
  //# sourceMappingURL=DevTools.d.ts.map