@itwin/core-backend 3.4.0-dev.43 → 3.4.0-dev.44

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 (219) hide show
  1. package/lib/cjs/AliCloudStorageService.d.ts +17 -17
  2. package/lib/cjs/AliCloudStorageService.js +68 -68
  3. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  4. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  5. package/lib/cjs/BackendHubAccess.js +41 -41
  6. package/lib/cjs/BackendHubAccess.js.map +1 -1
  7. package/lib/cjs/BackendLoggerCategory.d.ts +82 -82
  8. package/lib/cjs/BackendLoggerCategory.js +90 -90
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  11. package/lib/cjs/BisCoreSchema.js +60 -60
  12. package/lib/cjs/BisCoreSchema.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.d.ts +165 -165
  14. package/lib/cjs/BriefcaseManager.js +405 -405
  15. package/lib/cjs/BriefcaseManager.js.map +1 -1
  16. package/lib/cjs/Category.d.ts +153 -153
  17. package/lib/cjs/Category.js +243 -243
  18. package/lib/cjs/Category.js.map +1 -1
  19. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  20. package/lib/cjs/ChangeSummaryManager.js +445 -445
  21. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  22. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  23. package/lib/cjs/ChangedElementsDb.js +165 -165
  24. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  25. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  26. package/lib/cjs/ChangedElementsManager.js +88 -88
  27. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  28. package/lib/cjs/CheckpointManager.d.ts +122 -122
  29. package/lib/cjs/CheckpointManager.js +354 -354
  30. package/lib/cjs/CheckpointManager.js.map +1 -1
  31. package/lib/cjs/ClassRegistry.d.ts +71 -71
  32. package/lib/cjs/ClassRegistry.js +213 -213
  33. package/lib/cjs/ClassRegistry.js.map +1 -1
  34. package/lib/cjs/CloudSqlite.d.ts +328 -328
  35. package/lib/cjs/CloudSqlite.js +135 -135
  36. package/lib/cjs/CloudSqlite.js.map +1 -1
  37. package/lib/cjs/CloudStorageBackend.d.ts +46 -46
  38. package/lib/cjs/CloudStorageBackend.js +164 -164
  39. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  40. package/lib/cjs/CodeService.d.ts +391 -391
  41. package/lib/cjs/CodeService.js +61 -61
  42. package/lib/cjs/CodeService.js.map +1 -1
  43. package/lib/cjs/CodeSpecs.d.ts +50 -50
  44. package/lib/cjs/CodeSpecs.js +112 -112
  45. package/lib/cjs/CodeSpecs.js.map +1 -1
  46. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  47. package/lib/cjs/ConcurrentQuery.js +30 -30
  48. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  49. package/lib/cjs/CustomViewState3dCreator.d.ts +32 -32
  50. package/lib/cjs/CustomViewState3dCreator.js +99 -99
  51. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  52. package/lib/cjs/DevTools.d.ts +71 -71
  53. package/lib/cjs/DevTools.js +154 -154
  54. package/lib/cjs/DevTools.js.map +1 -1
  55. package/lib/cjs/DisplayStyle.d.ts +106 -106
  56. package/lib/cjs/DisplayStyle.js +256 -256
  57. package/lib/cjs/DisplayStyle.js.map +1 -1
  58. package/lib/cjs/ECDb.d.ts +191 -191
  59. package/lib/cjs/ECDb.js +350 -350
  60. package/lib/cjs/ECDb.js.map +1 -1
  61. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  62. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  63. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  64. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  65. package/lib/cjs/ECSqlStatement.js +791 -791
  66. package/lib/cjs/ECSqlStatement.js.map +1 -1
  67. package/lib/cjs/Element.d.ts +1109 -1109
  68. package/lib/cjs/Element.js +1421 -1421
  69. package/lib/cjs/Element.js.map +1 -1
  70. package/lib/cjs/ElementAspect.d.ts +156 -156
  71. package/lib/cjs/ElementAspect.js +178 -178
  72. package/lib/cjs/ElementAspect.js.map +1 -1
  73. package/lib/cjs/ElementGraphics.d.ts +9 -9
  74. package/lib/cjs/ElementGraphics.js +41 -41
  75. package/lib/cjs/ElementGraphics.js.map +1 -1
  76. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  77. package/lib/cjs/ElementTreeWalker.js +409 -409
  78. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  79. package/lib/cjs/Entity.d.ts +76 -76
  80. package/lib/cjs/Entity.js +82 -82
  81. package/lib/cjs/Entity.js.map +1 -1
  82. package/lib/cjs/ExportGraphics.d.ts +317 -317
  83. package/lib/cjs/ExportGraphics.js +208 -208
  84. package/lib/cjs/ExportGraphics.js.map +1 -1
  85. package/lib/cjs/ExternalSource.d.ts +94 -94
  86. package/lib/cjs/ExternalSource.js +125 -125
  87. package/lib/cjs/ExternalSource.js.map +1 -1
  88. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  89. package/lib/cjs/GeoCoordConfig.js +82 -82
  90. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  91. package/lib/cjs/GeometrySummary.d.ts +4 -4
  92. package/lib/cjs/GeometrySummary.js +380 -380
  93. package/lib/cjs/GeometrySummary.js.map +1 -1
  94. package/lib/cjs/HubMock.d.ts +93 -93
  95. package/lib/cjs/HubMock.js +190 -190
  96. package/lib/cjs/HubMock.js.map +1 -1
  97. package/lib/cjs/IModelCloneContext.d.ts +85 -85
  98. package/lib/cjs/IModelCloneContext.js +150 -150
  99. package/lib/cjs/IModelCloneContext.js.map +1 -1
  100. package/lib/cjs/IModelDb.d.ts +1164 -1164
  101. package/lib/cjs/IModelDb.js +2321 -2321
  102. package/lib/cjs/IModelDb.js.map +1 -1
  103. package/lib/cjs/IModelHost.d.ts +347 -347
  104. package/lib/cjs/IModelHost.js +457 -457
  105. package/lib/cjs/IModelHost.js.map +1 -1
  106. package/lib/cjs/IModelJsFs.d.ts +62 -62
  107. package/lib/cjs/IModelJsFs.js +140 -140
  108. package/lib/cjs/IModelJsFs.js.map +1 -1
  109. package/lib/cjs/IpcHost.d.ts +98 -98
  110. package/lib/cjs/IpcHost.js +234 -234
  111. package/lib/cjs/IpcHost.js.map +1 -1
  112. package/lib/cjs/LineStyle.d.ts +311 -311
  113. package/lib/cjs/LineStyle.js +295 -295
  114. package/lib/cjs/LineStyle.js.map +1 -1
  115. package/lib/cjs/LocalHub.d.ts +162 -162
  116. package/lib/cjs/LocalHub.js +587 -587
  117. package/lib/cjs/LocalHub.js.map +1 -1
  118. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  119. package/lib/cjs/LocalhostIpcHost.js +81 -81
  120. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  121. package/lib/cjs/Material.d.ts +103 -103
  122. package/lib/cjs/Material.js +147 -147
  123. package/lib/cjs/Material.js.map +1 -1
  124. package/lib/cjs/Model.d.ts +386 -386
  125. package/lib/cjs/Model.js +468 -468
  126. package/lib/cjs/Model.js.map +1 -1
  127. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  128. package/lib/cjs/NativeAppStorage.js +202 -202
  129. package/lib/cjs/NativeAppStorage.js.map +1 -1
  130. package/lib/cjs/NativeHost.d.ts +52 -52
  131. package/lib/cjs/NativeHost.js +168 -168
  132. package/lib/cjs/NativeHost.js.map +1 -1
  133. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  134. package/lib/cjs/NavigationRelationship.js +225 -225
  135. package/lib/cjs/NavigationRelationship.js.map +1 -1
  136. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  137. package/lib/cjs/PromiseMemoizer.js +95 -95
  138. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  139. package/lib/cjs/PropertyStore.d.ts +132 -132
  140. package/lib/cjs/PropertyStore.js +11 -11
  141. package/lib/cjs/PropertyStore.js.map +1 -1
  142. package/lib/cjs/Relationship.d.ts +400 -400
  143. package/lib/cjs/Relationship.js +465 -465
  144. package/lib/cjs/Relationship.js.map +1 -1
  145. package/lib/cjs/RpcBackend.d.ts +28 -28
  146. package/lib/cjs/RpcBackend.js +126 -126
  147. package/lib/cjs/RpcBackend.js.map +1 -1
  148. package/lib/cjs/SQLiteDb.d.ts +219 -219
  149. package/lib/cjs/SQLiteDb.js +214 -214
  150. package/lib/cjs/SQLiteDb.js.map +1 -1
  151. package/lib/cjs/Schema.d.ts +55 -55
  152. package/lib/cjs/Schema.js +83 -83
  153. package/lib/cjs/Schema.js.map +1 -1
  154. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  155. package/lib/cjs/ServerBasedLocks.js +168 -168
  156. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  157. package/lib/cjs/SqliteStatement.d.ts +283 -283
  158. package/lib/cjs/SqliteStatement.js +448 -448
  159. package/lib/cjs/SqliteStatement.js.map +1 -1
  160. package/lib/cjs/Texture.d.ts +58 -58
  161. package/lib/cjs/Texture.js +82 -82
  162. package/lib/cjs/Texture.js.map +1 -1
  163. package/lib/cjs/TxnManager.d.ts +202 -202
  164. package/lib/cjs/TxnManager.js +353 -353
  165. package/lib/cjs/TxnManager.js.map +1 -1
  166. package/lib/cjs/ViewDefinition.d.ts +435 -435
  167. package/lib/cjs/ViewDefinition.js +629 -629
  168. package/lib/cjs/ViewDefinition.js.map +1 -1
  169. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  170. package/lib/cjs/ViewStateHydrator.js +103 -103
  171. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  172. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  173. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  174. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  175. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  176. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  177. package/lib/cjs/core-backend.d.ts +178 -178
  178. package/lib/cjs/core-backend.js +198 -198
  179. package/lib/cjs/core-backend.js.map +1 -1
  180. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  181. package/lib/cjs/domains/FunctionalElements.js +145 -145
  182. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  183. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  184. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  185. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  186. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  187. package/lib/cjs/domains/GenericElements.js +263 -263
  188. package/lib/cjs/domains/GenericElements.js.map +1 -1
  189. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  190. package/lib/cjs/domains/GenericSchema.js +28 -28
  191. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  192. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  193. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  194. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  195. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +45 -45
  196. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +262 -262
  197. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  198. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +20 -20
  199. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +195 -195
  200. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  201. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  202. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +165 -165
  203. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  204. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  205. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  206. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  207. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  208. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  209. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  210. package/lib/cjs/workspace/Settings.d.ts +186 -186
  211. package/lib/cjs/workspace/Settings.js +152 -152
  212. package/lib/cjs/workspace/Settings.js.map +1 -1
  213. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  214. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  215. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  216. package/lib/cjs/workspace/Workspace.d.ts +405 -405
  217. package/lib/cjs/workspace/Workspace.js +539 -539
  218. package/lib/cjs/workspace/Workspace.js.map +1 -1
  219. package/package.json +12 -12
@@ -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\";\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
+ {"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,33 +1,33 @@
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
+ /**
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
+ }
33
33
  //# sourceMappingURL=CustomViewState3dCreator.d.ts.map
@@ -1,100 +1,100 @@
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
- /**
12
- * Class which helps to generate a custom ViewState3d.
13
- * @internal
14
- */
15
- class CustomViewState3dCreator {
16
- constructor(iModel) {
17
- /**
18
- * Helper function to execute ECSql queries.
19
- */
20
- this._executeQuery = async (query) => {
21
- const rows = [];
22
- for await (const row of this._imodel.query(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
23
- rows.push(row.id);
24
- return rows;
25
- };
26
- this._imodel = iModel;
27
- }
28
- /**
29
- * 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.
30
- * @param [modelIds] Ids of models to display in the view.
31
- * @throws [IModelError]($common) If no 3d models are found in the iModel.
32
- * @returns CustomViewState3dProps
33
- */
34
- async getCustomViewState3dData(options) {
35
- let decompressedModelIds;
36
- if ((options === null || options === void 0 ? void 0 : options.modelIds) !== undefined)
37
- decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
38
- const models = decompressedModelIds !== null && decompressedModelIds !== void 0 ? decompressedModelIds : await this._getAllModels();
39
- const categories = await this._getAllCategories();
40
- const modelExtents = await this._getModelExtents(models);
41
- return {
42
- modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
43
- categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
44
- modelExtents: modelExtents.toJSON(),
45
- };
46
- }
47
- async _getAllCategories() {
48
- // Only use categories with elements in them
49
- const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
50
- const categories = await this._executeQuery(query);
51
- return categories;
52
- }
53
- /**
54
- * 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.
55
- * @param modelIdsList array of modelIds to get extents for
56
- * @returns Range3d, the union of the extents of each model id
57
- */
58
- async _getModelExtents(modelIdsList) {
59
- const modelExtents = new core_geometry_1.Range3d();
60
- if (modelIdsList.length === 0)
61
- return modelExtents;
62
- const modelIds = new Set(modelIdsList);
63
- for (const id of modelIds) {
64
- try {
65
- 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.
66
- const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;
67
- modelExtents.union(core_geometry_1.Range3d.fromJSON(props), modelExtents);
68
- }
69
- catch (err) {
70
- if (err.errorNumber === core_common_1.IModelStatus.NoGeometry) { // if there was no geometry, just return null range
71
- continue;
72
- }
73
- if (modelIds.size === 1)
74
- throw err; // if they're asking for more than one model, don't throw on error.
75
- continue;
76
- }
77
- }
78
- return modelExtents;
79
- }
80
- /**
81
- * Get all PhysicalModel ids in the iModel
82
- */
83
- async _getAllModels() {
84
- // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
85
- // If the iModel has an earlier version, the statement will throw because the property does not exist.
86
- // 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.
87
- const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
88
- const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
89
- let models = [];
90
- try {
91
- models = await this._executeQuery(`${select} ${spatialCriterion}`);
92
- }
93
- catch {
94
- models = await this._executeQuery(select);
95
- }
96
- return models;
97
- }
98
- }
99
- 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
+ /**
12
+ * Class which helps to generate a custom ViewState3d.
13
+ * @internal
14
+ */
15
+ class CustomViewState3dCreator {
16
+ constructor(iModel) {
17
+ /**
18
+ * Helper function to execute ECSql queries.
19
+ */
20
+ this._executeQuery = async (query) => {
21
+ const rows = [];
22
+ for await (const row of this._imodel.query(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
23
+ rows.push(row.id);
24
+ return rows;
25
+ };
26
+ this._imodel = iModel;
27
+ }
28
+ /**
29
+ * 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.
30
+ * @param [modelIds] Ids of models to display in the view.
31
+ * @throws [IModelError]($common) If no 3d models are found in the iModel.
32
+ * @returns CustomViewState3dProps
33
+ */
34
+ async getCustomViewState3dData(options) {
35
+ let decompressedModelIds;
36
+ if ((options === null || options === void 0 ? void 0 : options.modelIds) !== undefined)
37
+ decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
38
+ const models = decompressedModelIds !== null && decompressedModelIds !== void 0 ? decompressedModelIds : await this._getAllModels();
39
+ const categories = await this._getAllCategories();
40
+ const modelExtents = await this._getModelExtents(models);
41
+ return {
42
+ modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
43
+ categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
44
+ modelExtents: modelExtents.toJSON(),
45
+ };
46
+ }
47
+ async _getAllCategories() {
48
+ // Only use categories with elements in them
49
+ const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
50
+ const categories = await this._executeQuery(query);
51
+ return categories;
52
+ }
53
+ /**
54
+ * 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.
55
+ * @param modelIdsList array of modelIds to get extents for
56
+ * @returns Range3d, the union of the extents of each model id
57
+ */
58
+ async _getModelExtents(modelIdsList) {
59
+ const modelExtents = new core_geometry_1.Range3d();
60
+ if (modelIdsList.length === 0)
61
+ return modelExtents;
62
+ const modelIds = new Set(modelIdsList);
63
+ for (const id of modelIds) {
64
+ try {
65
+ 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.
66
+ const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;
67
+ modelExtents.union(core_geometry_1.Range3d.fromJSON(props), modelExtents);
68
+ }
69
+ catch (err) {
70
+ if (err.errorNumber === core_common_1.IModelStatus.NoGeometry) { // if there was no geometry, just return null range
71
+ continue;
72
+ }
73
+ if (modelIds.size === 1)
74
+ throw err; // if they're asking for more than one model, don't throw on error.
75
+ continue;
76
+ }
77
+ }
78
+ return modelExtents;
79
+ }
80
+ /**
81
+ * Get all PhysicalModel ids in the iModel
82
+ */
83
+ async _getAllModels() {
84
+ // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
85
+ // If the iModel has an earlier version, the statement will throw because the property does not exist.
86
+ // 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.
87
+ const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
88
+ const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
89
+ let models = [];
90
+ try {
91
+ models = await this._executeQuery(`${select} ${spatialCriterion}`);
92
+ }
93
+ catch {
94
+ models = await this._executeQuery(select);
95
+ }
96
+ return models;
97
+ }
98
+ }
99
+ exports.CustomViewState3dCreator = CustomViewState3dCreator;
100
100
  //# sourceMappingURL=CustomViewState3dCreator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":"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","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\nimport { CompressedId64Set, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, IModelError, IModelStatus, QueryRowFormat } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { IModelDb } from \"./IModelDb\";\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 /**\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 * @returns CustomViewState3dProps\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 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 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\r\n return categories;\r\n }\r\n\r\n /**\r\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.\r\n * @param modelIdsList array of modelIds to get extents for\r\n * @returns Range3d, the union of the extents of each model id\r\n */\r\n private async _getModelExtents(modelIdsList: Id64String[]): Promise<Range3d> {\r\n const modelExtents = new Range3d();\r\n if (modelIdsList.length === 0)\r\n return modelExtents;\r\n const modelIds = new Set(modelIdsList);\r\n for (const id of modelIds) {\r\n try {\r\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.\r\n const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;\r\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\r\n } catch (err: any) {\r\n if ((err as IModelError).errorNumber === IModelStatus.NoGeometry) { // if there was no geometry, just return null range\r\n continue;\r\n }\r\n if (modelIds.size === 1)\r\n throw err; // if they're asking for more than one model, don't throw on error.\r\n continue;\r\n }\r\n }\r\n return modelExtents;\r\n }\r\n\r\n /**\r\n * Get all PhysicalModel ids in the iModel\r\n */\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 let models = [];\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 return models;\r\n }\r\n /**\r\n * Helper function to execute ECSql queries.\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
+ {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":"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","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 } from \"@itwin/core-bentley\";\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, IModelError, IModelStatus, QueryRowFormat } from \"@itwin/core-common\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { IModelDb } from \"./IModelDb\";\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 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\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 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 const props = this._imodel.nativeDb.queryModelExtents({ id }).modelExtents;\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\n } catch (err: any) {\n if ((err as IModelError).errorNumber === IModelStatus.NoGeometry) { // if there was no geometry, just return null range\n continue;\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 try {\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\n } catch {\n models = await this._executeQuery(select);\n }\n\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,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