@itwin/core-backend 5.15.0-dev.9 → 5.15.1

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 (231) hide show
  1. package/CHANGELOG.md +46 -1
  2. package/lib/cjs/BlobContainerService.d.ts +2 -0
  3. package/lib/cjs/BlobContainerService.d.ts.map +1 -1
  4. package/lib/cjs/BlobContainerService.js.map +1 -1
  5. package/lib/cjs/BriefcaseManager.d.ts +2 -1
  6. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  7. package/lib/cjs/BriefcaseManager.js +39 -9
  8. package/lib/cjs/BriefcaseManager.js.map +1 -1
  9. package/lib/cjs/ChangeUnifier.d.ts +82 -0
  10. package/lib/cjs/ChangeUnifier.d.ts.map +1 -0
  11. package/lib/cjs/ChangeUnifier.js +163 -0
  12. package/lib/cjs/ChangeUnifier.js.map +1 -0
  13. package/lib/cjs/ChangesetReader.d.ts +21 -2
  14. package/lib/cjs/ChangesetReader.d.ts.map +1 -1
  15. package/lib/cjs/ChangesetReader.js +37 -1
  16. package/lib/cjs/ChangesetReader.js.map +1 -1
  17. package/lib/cjs/CloudSqlite.d.ts +15 -0
  18. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  19. package/lib/cjs/CloudSqlite.js.map +1 -1
  20. package/lib/cjs/ECDb.d.ts +1 -0
  21. package/lib/cjs/ECDb.d.ts.map +1 -1
  22. package/lib/cjs/ECDb.js +4 -1
  23. package/lib/cjs/ECDb.js.map +1 -1
  24. package/lib/cjs/EditTxn.d.ts +61 -19
  25. package/lib/cjs/EditTxn.d.ts.map +1 -1
  26. package/lib/cjs/EditTxn.js +84 -29
  27. package/lib/cjs/EditTxn.js.map +1 -1
  28. package/lib/cjs/GeoCoordConfig.d.ts +1 -0
  29. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  30. package/lib/cjs/GeoCoordConfig.js +12 -8
  31. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  32. package/lib/cjs/IModelDb.d.ts +22 -9
  33. package/lib/cjs/IModelDb.d.ts.map +1 -1
  34. package/lib/cjs/IModelDb.js +54 -12
  35. package/lib/cjs/IModelDb.js.map +1 -1
  36. package/lib/cjs/NativeHost.d.ts.map +1 -1
  37. package/lib/cjs/NativeHost.js +5 -1
  38. package/lib/cjs/NativeHost.js.map +1 -1
  39. package/lib/cjs/Relationship.d.ts +28 -0
  40. package/lib/cjs/Relationship.d.ts.map +1 -1
  41. package/lib/cjs/Relationship.js +78 -0
  42. package/lib/cjs/Relationship.js.map +1 -1
  43. package/lib/cjs/SQLiteDb.d.ts +52 -5
  44. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  45. package/lib/cjs/SQLiteDb.js +40 -5
  46. package/lib/cjs/SQLiteDb.js.map +1 -1
  47. package/lib/cjs/SchemaSync.d.ts.map +1 -1
  48. package/lib/cjs/SchemaSync.js +1 -0
  49. package/lib/cjs/SchemaSync.js.map +1 -1
  50. package/lib/cjs/TxnManager.d.ts +126 -89
  51. package/lib/cjs/TxnManager.d.ts.map +1 -1
  52. package/lib/cjs/TxnManager.js +114 -76
  53. package/lib/cjs/TxnManager.js.map +1 -1
  54. package/lib/cjs/ViewStateHydrator.d.ts.map +1 -1
  55. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  56. package/lib/cjs/ViewStore.d.ts.map +1 -1
  57. package/lib/cjs/ViewStore.js +62 -19
  58. package/lib/cjs/ViewStore.js.map +1 -1
  59. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
  60. package/lib/cjs/annotations/LeaderGeometry.js +3 -0
  61. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  62. package/lib/cjs/core-backend.d.ts +1 -0
  63. package/lib/cjs/core-backend.d.ts.map +1 -1
  64. package/lib/cjs/core-backend.js +1 -0
  65. package/lib/cjs/core-backend.js.map +1 -1
  66. package/lib/cjs/internal/BriefcaseUtils.d.ts +19 -0
  67. package/lib/cjs/internal/BriefcaseUtils.d.ts.map +1 -0
  68. package/lib/cjs/internal/BriefcaseUtils.js +65 -0
  69. package/lib/cjs/internal/BriefcaseUtils.js.map +1 -0
  70. package/lib/cjs/internal/QueryMetadataCache.d.ts +44 -0
  71. package/lib/cjs/internal/QueryMetadataCache.d.ts.map +1 -0
  72. package/lib/cjs/internal/QueryMetadataCache.js +107 -0
  73. package/lib/cjs/internal/QueryMetadataCache.js.map +1 -0
  74. package/lib/cjs/internal/Symbols.d.ts +9 -0
  75. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  76. package/lib/cjs/internal/Symbols.js +10 -1
  77. package/lib/cjs/internal/Symbols.js.map +1 -1
  78. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  79. package/lib/cjs/internal/workspace/WorkspaceImpl.js +20 -6
  80. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  81. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +6 -6
  82. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  83. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  84. package/lib/cjs/workspace/SettingsEditor.d.ts +4 -3
  85. package/lib/cjs/workspace/SettingsEditor.d.ts.map +1 -1
  86. package/lib/cjs/workspace/SettingsEditor.js +7 -5
  87. package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
  88. package/lib/esm/BlobContainerService.d.ts +2 -0
  89. package/lib/esm/BlobContainerService.d.ts.map +1 -1
  90. package/lib/esm/BlobContainerService.js.map +1 -1
  91. package/lib/esm/BriefcaseManager.d.ts +2 -1
  92. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  93. package/lib/esm/BriefcaseManager.js +40 -10
  94. package/lib/esm/BriefcaseManager.js.map +1 -1
  95. package/lib/esm/ChangeUnifier.d.ts +82 -0
  96. package/lib/esm/ChangeUnifier.d.ts.map +1 -0
  97. package/lib/esm/ChangeUnifier.js +159 -0
  98. package/lib/esm/ChangeUnifier.js.map +1 -0
  99. package/lib/esm/ChangesetReader.d.ts +21 -2
  100. package/lib/esm/ChangesetReader.d.ts.map +1 -1
  101. package/lib/esm/ChangesetReader.js +38 -2
  102. package/lib/esm/ChangesetReader.js.map +1 -1
  103. package/lib/esm/CloudSqlite.d.ts +15 -0
  104. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  105. package/lib/esm/CloudSqlite.js.map +1 -1
  106. package/lib/esm/ECDb.d.ts +1 -0
  107. package/lib/esm/ECDb.d.ts.map +1 -1
  108. package/lib/esm/ECDb.js +4 -1
  109. package/lib/esm/ECDb.js.map +1 -1
  110. package/lib/esm/EditTxn.d.ts +61 -19
  111. package/lib/esm/EditTxn.d.ts.map +1 -1
  112. package/lib/esm/EditTxn.js +85 -30
  113. package/lib/esm/EditTxn.js.map +1 -1
  114. package/lib/esm/GeoCoordConfig.d.ts +1 -0
  115. package/lib/esm/GeoCoordConfig.d.ts.map +1 -1
  116. package/lib/esm/GeoCoordConfig.js +12 -8
  117. package/lib/esm/GeoCoordConfig.js.map +1 -1
  118. package/lib/esm/IModelDb.d.ts +22 -9
  119. package/lib/esm/IModelDb.d.ts.map +1 -1
  120. package/lib/esm/IModelDb.js +56 -14
  121. package/lib/esm/IModelDb.js.map +1 -1
  122. package/lib/esm/NativeHost.d.ts.map +1 -1
  123. package/lib/esm/NativeHost.js +5 -1
  124. package/lib/esm/NativeHost.js.map +1 -1
  125. package/lib/esm/Relationship.d.ts +28 -0
  126. package/lib/esm/Relationship.d.ts.map +1 -1
  127. package/lib/esm/Relationship.js +78 -0
  128. package/lib/esm/Relationship.js.map +1 -1
  129. package/lib/esm/SQLiteDb.d.ts +52 -5
  130. package/lib/esm/SQLiteDb.d.ts.map +1 -1
  131. package/lib/esm/SQLiteDb.js +40 -5
  132. package/lib/esm/SQLiteDb.js.map +1 -1
  133. package/lib/esm/SchemaSync.d.ts.map +1 -1
  134. package/lib/esm/SchemaSync.js +1 -0
  135. package/lib/esm/SchemaSync.js.map +1 -1
  136. package/lib/esm/TxnManager.d.ts +126 -89
  137. package/lib/esm/TxnManager.d.ts.map +1 -1
  138. package/lib/esm/TxnManager.js +116 -78
  139. package/lib/esm/TxnManager.js.map +1 -1
  140. package/lib/esm/ViewStateHydrator.d.ts.map +1 -1
  141. package/lib/esm/ViewStateHydrator.js.map +1 -1
  142. package/lib/esm/ViewStore.d.ts.map +1 -1
  143. package/lib/esm/ViewStore.js +62 -19
  144. package/lib/esm/ViewStore.js.map +1 -1
  145. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
  146. package/lib/esm/annotations/LeaderGeometry.js +3 -0
  147. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  148. package/lib/esm/core-backend.d.ts +1 -0
  149. package/lib/esm/core-backend.d.ts.map +1 -1
  150. package/lib/esm/core-backend.js +1 -0
  151. package/lib/esm/core-backend.js.map +1 -1
  152. package/lib/esm/internal/BriefcaseUtils.d.ts +19 -0
  153. package/lib/esm/internal/BriefcaseUtils.d.ts.map +1 -0
  154. package/lib/esm/internal/BriefcaseUtils.js +61 -0
  155. package/lib/esm/internal/BriefcaseUtils.js.map +1 -0
  156. package/lib/esm/internal/QueryMetadataCache.d.ts +44 -0
  157. package/lib/esm/internal/QueryMetadataCache.d.ts.map +1 -0
  158. package/lib/esm/internal/QueryMetadataCache.js +103 -0
  159. package/lib/esm/internal/QueryMetadataCache.js.map +1 -0
  160. package/lib/esm/internal/Symbols.d.ts +9 -0
  161. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  162. package/lib/esm/internal/Symbols.js +9 -0
  163. package/lib/esm/internal/Symbols.js.map +1 -1
  164. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  165. package/lib/esm/internal/workspace/WorkspaceImpl.js +20 -6
  166. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  167. package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts +6 -6
  168. package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  169. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  170. package/lib/esm/test/annotations/LeaderGeometry.test.js +15 -1
  171. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  172. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +144 -30
  173. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  174. package/lib/esm/test/ecdb/QueryMetadataCache.test.d.ts +2 -0
  175. package/lib/esm/test/ecdb/QueryMetadataCache.test.d.ts.map +1 -0
  176. package/lib/esm/test/ecdb/QueryMetadataCache.test.js +630 -0
  177. package/lib/esm/test/ecdb/QueryMetadataCache.test.js.map +1 -0
  178. package/lib/esm/test/element/DeleteDefinitionElements.test.js +403 -249
  179. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  180. package/lib/esm/test/element/RelationshipBatchLookup.test.d.ts +2 -0
  181. package/lib/esm/test/element/RelationshipBatchLookup.test.d.ts.map +1 -0
  182. package/lib/esm/test/element/RelationshipBatchLookup.test.js +202 -0
  183. package/lib/esm/test/element/RelationshipBatchLookup.test.js.map +1 -0
  184. package/lib/esm/test/hubaccess/BriefcaseManager.test.js +187 -1
  185. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  186. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.d.ts +2 -0
  187. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.d.ts.map +1 -0
  188. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.js +142 -0
  189. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.js.map +1 -0
  190. package/lib/esm/test/imodel/IModelGeolocation.test.js +8 -6
  191. package/lib/esm/test/imodel/IModelGeolocation.test.js.map +1 -1
  192. package/lib/esm/test/imodel/IModelProps.test.d.ts +2 -0
  193. package/lib/esm/test/imodel/IModelProps.test.d.ts.map +1 -0
  194. package/lib/esm/test/imodel/IModelProps.test.js +411 -0
  195. package/lib/esm/test/imodel/IModelProps.test.js.map +1 -0
  196. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.d.ts +2 -0
  197. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.d.ts.map +1 -0
  198. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.js +240 -0
  199. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.js.map +1 -0
  200. package/lib/esm/test/schema/SchemaViewValidation.test.js +2 -8
  201. package/lib/esm/test/schema/SchemaViewValidation.test.js.map +1 -1
  202. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.d.ts +2 -0
  203. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.d.ts.map +1 -0
  204. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.js +159 -0
  205. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.js.map +1 -0
  206. package/lib/esm/test/standalone/ChangeUnifier.test.d.ts +2 -0
  207. package/lib/esm/test/standalone/ChangeUnifier.test.d.ts.map +1 -0
  208. package/lib/esm/test/standalone/ChangeUnifier.test.js +732 -0
  209. package/lib/esm/test/standalone/ChangeUnifier.test.js.map +1 -0
  210. package/lib/esm/test/standalone/DeleteElements.test.js +962 -83
  211. package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -1
  212. package/lib/esm/test/standalone/EditTxn.test.js +72 -1
  213. package/lib/esm/test/standalone/EditTxn.test.js.map +1 -1
  214. package/lib/esm/test/standalone/GeoCoordConfig.test.d.ts +2 -0
  215. package/lib/esm/test/standalone/GeoCoordConfig.test.d.ts.map +1 -0
  216. package/lib/esm/test/standalone/GeoCoordConfig.test.js +158 -0
  217. package/lib/esm/test/standalone/GeoCoordConfig.test.js.map +1 -0
  218. package/lib/esm/test/standalone/SQLiteDb.test.d.ts.map +1 -1
  219. package/lib/esm/test/standalone/SQLiteDb.test.js +422 -1
  220. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  221. package/lib/esm/test/standalone/ViewStoreDb.test.js +53 -0
  222. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  223. package/lib/esm/test/workspace/SettingsContainers.test.d.ts +2 -0
  224. package/lib/esm/test/workspace/SettingsContainers.test.d.ts.map +1 -0
  225. package/lib/esm/test/workspace/SettingsContainers.test.js +95 -0
  226. package/lib/esm/test/workspace/SettingsContainers.test.js.map +1 -0
  227. package/lib/esm/workspace/SettingsEditor.d.ts +4 -3
  228. package/lib/esm/workspace/SettingsEditor.d.ts.map +1 -1
  229. package/lib/esm/workspace/SettingsEditor.js +7 -5
  230. package/lib/esm/workspace/SettingsEditor.js.map +1 -1
  231. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"LeaderGeometry.d.ts","sourceRoot":"","sources":["../../../src/annotations/LeaderGeometry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAY,eAAe,EAAe,cAAc,EAAE,oBAAoB,EAAuC,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1K,OAAO,EAAyE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEvJ,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAuGnP;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,iEAAiE;IACjE,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC;IACjC,iGAAiG;IACjG,KAAK,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,GAAG,EAAE,QAAQ,CAAC;IACd,yDAAyD;IACzD,MAAM,EAAE,cAAc,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nP;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,iEAAiE;IACjE,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC;IACjC,iGAAiG;IACjG,KAAK,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,GAAG,EAAE,QAAQ,CAAC;IACd,yDAAyD;IACzD,MAAM,EAAE,cAAc,CAAC;IACvB,gFAAgF;IAChF,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,gHAAgH;IAChH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,4BAA4B,GAAG,OAAO,CA0HpF;AAGD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CA8BlI;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,oBAAoB,EAC5B,UAAU,EAAE,IAAI,GAAG,IAAI,EACvB,UAAU,EAAE,eAAe,EAC3B,SAAS,EAAE,SAAS,GACnB,OAAO,GAAG,SAAS,CAyCrB"}
@@ -133,6 +133,7 @@ export function createTerminatorGeometry(args) {
133
133
  // Helper function to add fill parameters
134
134
  const addFillParams = () => {
135
135
  params.fillDisplay = FillDisplay.Always;
136
+ params.fillColor = params.lineColor;
136
137
  result = result && builder.appendGeometryParamsChange(params);
137
138
  };
138
139
  // Helper function to create geometry entry
@@ -238,6 +239,8 @@ export function createTerminatorGeometry(args) {
238
239
  * @beta
239
240
  */
240
241
  export function computeElbowDirection(attachmentPoint, frameCurve, elbowLength) {
242
+ if (elbowLength <= 0)
243
+ return undefined;
241
244
  let elbowDirection;
242
245
  // Determine the direction based on the closest point's position relative to the frame
243
246
  const isCloserToLeft = Math.abs(attachmentPoint.x - frameCurve.range().low.x) < Math.abs(attachmentPoint.x - frameCurve.range().high.x);
@@ -1 +1 @@
1
- {"version":3,"file":"LeaderGeometry.js","sourceRoot":"","sources":["../../../src/annotations/LeaderGeometry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAmB,WAAW,EAAgG,MAAM,oBAAoB,CAAC;AAC1K,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAkB,aAAa,EAAE,YAAY,EAAE,IAAI,EAAQ,OAAO,EAAa,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACvJ,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAgC,EAAE,OAA+B,EAAE,MAAuB,EAAE,SAAoB,EAAE,MAAsB,EAAE,iBAAoC,EAAE,WAAmB;IACxO,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC;IACvF,IAAI,KAAK,GAAoC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC;IAEnF,6FAA6F;IAC7F,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;QAClD,KAAK,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAA;IAChC,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACtE,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAExF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAA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CAAC,CAAC;QACvE,IAAI,qBAAqB,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE1G,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,qBAAqB,GAAG,qBAAqB,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7G,cAAc,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QAC3C,CAAC;QACD,uFAAuF;QACvF,+EAA+E;QAC/E,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,8CAA8C;QACzH,MAAM,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;QAClF,MAAM,kBAAkB,GAAG,UAAU,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QACvG,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ElementGeometry\r\n */\r\n\r\nimport { ColorDef, ElementGeometry, FillDisplay, GeometryParams, TextAnnotationLeader, TextFrameStyleProps, TextStyleColor, TextStyleSettings } from \"@itwin/core-common\";\r\nimport { Angle, Arc3d, CurveCurve, CurvePrimitive, LineSegment3d, LineString3d, Loop, Path, Point3d, Transform, Vector3d } from \"@itwin/core-geometry\";\r\nimport { computeFrame } from \"./FrameGeometry\";\r\nimport { TextBlockLayout, TextStyleResolver } from \"./TextBlockLayout\";\r\n\r\n/**\r\n * Constructs and appends leader lines and their terminators to the provided geometry builder for a text annotation.\r\n *\r\n * This function processes an array of `TextAnnotationLeader` objects, computes their attachment points\r\n * relative to a text frame (or a default rectangular frame if none is provided), and appends the leader\r\n * line and terminator geometry to the builder. It also applies color overrides if specified\r\n * in the leader's style overrides.\r\n *\r\n * @param builder - The geometry builder to which the leader geometries will be appended.\r\n * @param leaders - An array of leader properties.\r\n * @param layout - The layout information for the text block, including its range.\r\n * @param transform - The transform to apply to the frame and leader geometry.\r\n * @param params - The geometry parameters, such as color, to use for the leader lines.\r\n * @param textStyleResolver - Resolver for text styles, used to obtain leader styles.\r\n * @param scaleFactor - The scale factor to apply to leader dimensions, usually comes from the `scaleFactor` of a [[Drawing]] element.\r\n * @returns `true` if at least one leader with a terminator was successfully appended; otherwise, `false`.\r\n * @beta\r\n */\r\nexport function appendLeadersToBuilder(builder: ElementGeometry.Builder, leaders: TextAnnotationLeader[], layout: TextBlockLayout, transform: Transform, params: GeometryParams, textStyleResolver: TextStyleResolver, scaleFactor: number): boolean {\r\n let result = true;\r\n const scaledBlockTextHeight = textStyleResolver.blockSettings.textHeight * scaleFactor;\r\n let frame: TextFrameStyleProps | undefined = textStyleResolver.blockSettings.frame;\r\n\r\n // If there is no frame, use a rectangular frame to compute the attachmentPoints for leaders.\r\n if (frame === undefined || frame.shape === \"none\") {\r\n frame = { shape: \"rectangle\" }\r\n }\r\n if (frame.shape === undefined || frame.shape === \"none\") return false;\r\n const frameCurve = computeFrame({ frame: frame.shape, range: layout.range, transform });\r\n\r\n for (const leader of leaders) {\r\n const leaderStyle = textStyleResolver.resolveSettings(leader.styleOverrides ?? {}, true);\r\n\r\n let effectiveColor: TextStyleColor = \"subcategory\";\r\n\r\n if (leaderStyle.leader.color === \"inherit\") {\r\n effectiveColor = leaderStyle.color;\r\n } else if (leaderStyle.leader.color !== \"subcategory\") {\r\n effectiveColor = leaderStyle.leader.color;\r\n }\r\n\r\n if (effectiveColor !== \"subcategory\") {\r\n params.lineColor = ColorDef.fromJSON(effectiveColor);\r\n result = result && builder.appendGeometryParamsChange(params);\r\n }\r\n\r\n if (leaderStyle.leader.showLeaders) {\r\n const attachmentPoint = computeLeaderAttachmentPoint(leader, frameCurve, layout, transform);\r\n if (!attachmentPoint) return false;\r\n\r\n let elbowPoint: Point3d | undefined;\r\n if (leaderStyle.leader.wantElbow) {\r\n const elbowLength = leaderStyle.leader.elbowLength * scaledBlockTextHeight;\r\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve, elbowLength);\r\n if (elbowDirection)\r\n elbowPoint = attachmentPoint.plusScaled(elbowDirection, elbowLength);\r\n }\r\n\r\n // Leader line geometry\r\n const leaderLinePoints: Point3d[] = [];\r\n const terminatorWidth = leaderStyle.leader.terminatorWidthFactor * scaledBlockTextHeight;\r\n let leaderStartPoint = leader.startPoint;\r\n if (leaderStyle.leader.showTargetPoint && leaderStyle.leader.targetPointOffsetFactor !== 0) {\r\n const offset = leaderStyle.leader.targetPointOffsetFactor * scaledBlockTextHeight;\r\n let firstSegmentEnd = leader.intermediatePoints?.[0];\r\n\r\n // If there are no intermediate points, offset along the elbow segment when present.\r\n if (!firstSegmentEnd && elbowPoint)\r\n firstSegmentEnd = elbowPoint;\r\n\r\n if (!firstSegmentEnd)\r\n firstSegmentEnd = attachmentPoint;\r\n\r\n\r\n // Offset the target-point marker away from the start point along the first leader segment.\r\n // Clamp the added distance so negative values resolve to 0 and large values cannot overshoot the first vertex.\r\n // When terminators are hidden, use the text height as a conservative guard distance; otherwise use the terminator width.\r\n const firstSegmentLength = leader.startPoint.distance(firstSegmentEnd);\r\n const clampDistance = leaderStyle.leader.showTerminators ? terminatorWidth : scaledBlockTextHeight;\r\n const maxOffset = Math.max(0, firstSegmentLength - clampDistance);\r\n const clampedOffset = Math.min(Math.max(offset, 0), maxOffset);\r\n const leaderDirection = Vector3d.createStartEnd(leader.startPoint, firstSegmentEnd).normalize();\r\n if (leaderDirection)\r\n leaderStartPoint = leader.startPoint.plusScaled(leaderDirection, clampedOffset);\r\n }\r\n leaderLinePoints.push(leaderStartPoint);\r\n\r\n leader.intermediatePoints?.forEach((point) => {\r\n leaderLinePoints.push(point);\r\n });\r\n\r\n if (elbowPoint)\r\n leaderLinePoints.push(elbowPoint);\r\n\r\n leaderLinePoints.push(attachmentPoint);\r\n\r\n const terminatorDirection = Vector3d.createStartEnd(\r\n leaderLinePoints[0], leaderLinePoints[1]\r\n ).normalize();\r\n\r\n // Truncate the first segment of the leader lines to account for the arrowhead size when closedArrow (hollow triangle) terminatorShape is used.\r\n if (leaderStyle.leader.showTerminators && leaderStyle.leader.terminatorShape === \"closedArrow\") {\r\n if (terminatorDirection)\r\n leaderLinePoints[0] = leaderLinePoints[0].plusScaled(terminatorDirection, terminatorWidth);\r\n }\r\n\r\n result = result && builder.appendGeometryQuery(LineString3d.create(leaderLinePoints));\r\n if (leaderStyle.leader.terminatorShape !== \"none\" && leaderStyle.leader.showTerminators) {\r\n // Terminator geometry\r\n if (!terminatorDirection) continue; // Assuming leaders without terminators is a valid case.\r\n result = result && createTerminatorGeometry({ builder, point: leaderStartPoint, dir: terminatorDirection, params, textStyleSettings: leaderStyle, textHeight: scaledBlockTextHeight });\r\n\r\n }\r\n }\r\n\r\n if (leaderStyle.leader.showTargetPoint) {\r\n result = result && createTerminatorGeometry({ builder, point: leader.startPoint, dir: Vector3d.unitX(), params, textStyleSettings: leaderStyle, textHeight: scaledBlockTextHeight, isArrow: false });\r\n }\r\n\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Arguments supplied to [[createTerminatorGeometry]].\r\n * @beta\r\n */\r\nexport interface CreateTerminatorGeometryArgs {\r\n /** The geometry builder to append the terminator geometry to. */\r\n builder: ElementGeometry.Builder;\r\n /** The point at which the terminator is placed - typically the start or end of a leader line. */\r\n point: Point3d;\r\n /** The direction vector of the leader line. */\r\n dir: Vector3d;\r\n /** The geometry parameters to use for the terminator. */\r\n params: GeometryParams;\r\n /** The text style settings describing the terminator's shape and dimensions. */\r\n textStyleSettings: TextStyleSettings;\r\n /** The height of the text block, used to scale the terminator's dimensions. */\r\n textHeight: number;\r\n /** If `true` (the default), the leader's terminator shape is used; otherwise the target-point shape is used. */\r\n isArrow?: boolean;\r\n}\r\n\r\n/**\r\n * Creates the geometry for a terminator at the end of a leader line.\r\n * @param args Describes the terminator geometry to create. See [[CreateTerminatorGeometryArgs]].\r\n * @returns True if the geometry was successfully created, false otherwise.\r\n * @beta\r\n */\r\nexport function createTerminatorGeometry(args: CreateTerminatorGeometryArgs): boolean {\r\n const { builder, point, dir, params, textStyleSettings, textHeight } = args;\r\n const isArrow = args.isArrow ?? true;\r\n\r\n let result = true;\r\n const termY = dir.unitCrossProduct(Vector3d.unitZ());\r\n if (!termY) return false; // If dir is parallel to Z, we can't create a terminator\r\n const terminatorHeight = textStyleSettings.leader.terminatorHeightFactor * textHeight;\r\n const terminatorWidth = textStyleSettings.leader.terminatorWidthFactor * textHeight;\r\n const terminatorHalfHeight = terminatorHeight / 2;\r\n const basePoint = point.plusScaled(dir, terminatorWidth);\r\n const point1 = basePoint.plusScaled(termY, terminatorHalfHeight);\r\n const point2 = basePoint.plusScaled(termY.negate(), terminatorHalfHeight);\r\n\r\n // Helper function to add fill parameters\r\n const addFillParams = () => {\r\n params.fillDisplay = FillDisplay.Always;\r\n result = result && builder.appendGeometryParamsChange(params);\r\n };\r\n\r\n // Helper function to create geometry entry\r\n const addGeometry = (content: CurvePrimitive, useLoop = false) => {\r\n const finalContent = useLoop ? Loop.create(content) : content;\r\n result = result && builder.appendGeometryQuery(finalContent);\r\n };\r\n const shape = isArrow ? textStyleSettings.leader.terminatorShape : textStyleSettings.leader.targetPointShape;\r\n\r\n switch (shape) {\r\n case \"openArrow\": {\r\n const lineString = LineString3d.create([point1, point, point2]);\r\n addGeometry(lineString);\r\n break;\r\n }\r\n\r\n case \"closedArrow\": {\r\n const lineString = LineString3d.create([point1, point, point2, point1]);\r\n addGeometry(lineString);\r\n break;\r\n }\r\n\r\n case \"closedArrowFilled\": {\r\n addFillParams();\r\n const lineString = LineString3d.create([point1, point, point2, point1]);\r\n addGeometry(lineString, true);\r\n break;\r\n }\r\n\r\n case \"circle\": {\r\n const circle = Arc3d.createXY(point, terminatorHalfHeight);\r\n addGeometry(circle);\r\n break;\r\n }\r\n\r\n case \"circleFilled\": {\r\n addFillParams();\r\n const circle = Arc3d.createXY(point, terminatorHalfHeight);\r\n addGeometry(circle, true);\r\n break;\r\n }\r\n\r\n case \"slash\": {\r\n const normalizedVector = dir.normalize();\r\n if (!normalizedVector) throw new Error(\"Invalid reference vector for slash terminator.\");\r\n\r\n const rotatedVector = normalizedVector.rotateXY(Angle.createDegrees(45));\r\n const startPoint = point.plusScaled(rotatedVector, -terminatorHalfHeight);\r\n const endPoint = point.plusScaled(rotatedVector, terminatorHalfHeight);\r\n\r\n const slashLine = LineSegment3d.create(startPoint, endPoint);\r\n addGeometry(slashLine);\r\n break;\r\n }\r\n\r\n case \"cross\": {\r\n // Diagonal \"X\" centered on the point, axis-aligned (horizontal upright).\r\n const halfSize = terminatorHalfHeight;\r\n addGeometry(LineSegment3d.create(point.plusXYZ(-halfSize, -halfSize), point.plusXYZ(halfSize, halfSize)));\r\n addGeometry(LineSegment3d.create(point.plusXYZ(-halfSize, halfSize), point.plusXYZ(halfSize, -halfSize)));\r\n break;\r\n }\r\n\r\n case \"plus\": {\r\n // Orthogonal \"+\" centered on the point, axis-aligned (horizontal upright).\r\n const halfSize = terminatorHalfHeight;\r\n addGeometry(LineSegment3d.create(point.plusXYZ(-halfSize, 0), point.plusXYZ(halfSize, 0)));\r\n addGeometry(LineSegment3d.create(point.plusXYZ(0, -halfSize), point.plusXYZ(0, halfSize)));\r\n break;\r\n }\r\n\r\n case \"square\": {\r\n // Axis-aligned square centered on the point (horizontal upright).\r\n const halfSize = terminatorHalfHeight;\r\n const square = LineString3d.create([\r\n point.plusXYZ(-halfSize, -halfSize),\r\n point.plusXYZ(halfSize, -halfSize),\r\n point.plusXYZ(halfSize, halfSize),\r\n point.plusXYZ(-halfSize, halfSize),\r\n point.plusXYZ(-halfSize, -halfSize),\r\n ]);\r\n addGeometry(square);\r\n break;\r\n }\r\n\r\n case \"rectangle\": {\r\n // Axis-aligned rectangle centered on the point (horizontal upright).\r\n // Respect the configured width/height factors directly.\r\n const halfWidth = terminatorWidth / 2;\r\n const halfHeight = terminatorHalfHeight;\r\n const rectangle = LineString3d.create([\r\n point.plusXYZ(-halfWidth, -halfHeight),\r\n point.plusXYZ(halfWidth, -halfHeight),\r\n point.plusXYZ(halfWidth, halfHeight),\r\n point.plusXYZ(-halfWidth, halfHeight),\r\n point.plusXYZ(-halfWidth, -halfHeight),\r\n ]);\r\n addGeometry(rectangle);\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\n\r\n/**\r\n * Computes the direction vector for an \"elbow\" for leader based on the attachment point and a frame curve.\r\n * The elbow direction is determined by whether the attachment point is closer to the left or right side of the frame.\r\n * If the computed elbow would be tangent to the frame at the intersection, no elbow direction is returned.\r\n *\r\n * @param attachmentPoint - The point where the leader attaches.\r\n * @param frameCurve - The frame curve (either a Loop or Path) to which the leader is attached.\r\n * @param elbowLength - The length of the elbow segment to be created.\r\n * @returns The direction vector for the elbow, or `undefined` if the elbow would be tangent to the frame.\r\n * @beta\r\n */\r\nexport function computeElbowDirection(attachmentPoint: Point3d, frameCurve: Loop | Path, elbowLength: number): Vector3d | undefined {\r\n\r\n let elbowDirection: Vector3d | undefined;\r\n // Determine the direction based on the closest point's position relative to the frame\r\n const isCloserToLeft = Math.abs(attachmentPoint.x - frameCurve.range().low.x) < Math.abs(attachmentPoint.x - frameCurve.range().high.x);\r\n\r\n // Decide the direction: left (-X) or right (+X)\r\n elbowDirection = isCloserToLeft ? Vector3d.unitX().negate() : Vector3d.unitX();\r\n\r\n // Verify if the elbow is a tangent to the frame, if yes, do not create an elbow\r\n const elbowPoint = attachmentPoint.plusScaled(elbowDirection, elbowLength);\r\n const elbowLine = LineSegment3d.create(attachmentPoint, elbowPoint);\r\n // Find intersection points between the elbow and the frame\r\n const intersections = CurveCurve.intersectionXYZPairs(elbowLine, false, frameCurve, false);\r\n // As the elbow will intersect the frame only at one point, we can safely use the first intersection\r\n const intersection = intersections[0];\r\n const curveFraction = intersection.detailB.fraction;\r\n const derivative = intersection.detailB.curve?.fractionToPointAndDerivative(curveFraction);\r\n const tangent = derivative?.direction.normalize();\r\n const lineDirection = Vector3d.createStartEnd(elbowLine.point0Ref, elbowLine.point1Ref).normalize();\r\n if (tangent && lineDirection) {\r\n const dot = tangent.dotProduct(lineDirection);\r\n // If the tangent and line direction are aligned (dot product close to 1 or -1), it's tangent\r\n if (Math.abs(dot) > 0.999) {\r\n elbowDirection = undefined;\r\n }\r\n }\r\n return elbowDirection;\r\n}\r\n\r\n/**\r\n * Computes the attachment point for a leader line on a text annotation frame.\r\n *\r\n * The attachment point is determined based on the leader's attachment mode:\r\n * - `\"Nearest\"`: Finds the closest point on the frame curve to the leader's start point.\r\n * - `\"KeyPoint\"`: Uses a specific curve segment and fraction along that segment to determine the point.\r\n * - `\"TextPoint\"`: Calculates a point on the text layout (top/bottom, left/right) and projects it onto the frame curve.\r\n *\r\n * @param leader - The leader props.\r\n * @param frameCurve - The curve (Loop or Path) representing the annotation frame.\r\n * @param textLayout - The layout information for the text block.\r\n * @param transform - The transform applied to the text layout.\r\n * @returns The computed attachment point as a `Point3d`, or `undefined` if it cannot be determined.\r\n * @beta\r\n */\r\nexport function computeLeaderAttachmentPoint(\r\n leader: TextAnnotationLeader,\r\n frameCurve: Loop | Path,\r\n textLayout: TextBlockLayout,\r\n transform: Transform\r\n): Point3d | undefined {\r\n let attachmentPoint: Point3d | undefined;\r\n\r\n if (leader.attachment.mode === \"Nearest\") {\r\n attachmentPoint = frameCurve.closestPoint(leader.startPoint)?.point;\r\n } else if (leader.attachment.mode === \"KeyPoint\") {\r\n const curves = frameCurve.collectCurvePrimitives(undefined, false, true);\r\n const curveIndex = leader.attachment.curveIndex;\r\n const fraction = leader.attachment.fraction;\r\n if (curveIndex >= curves.length) {\r\n // If the curveIndex is invalid, use the last curve\r\n // This is a fallback to avoid out-of-bounds access\r\n attachmentPoint = curves[curves.length - 1].fractionToPoint(fraction);\r\n } else {\r\n attachmentPoint = curves[curveIndex].fractionToPoint(fraction);\r\n }\r\n } else { // attachment.mode=\"TextPoint\"\r\n let scaleDirection = transform.matrix.getColumn(0).negate(); // direction to draw a scaled line from text attachment point to find intersection point on frame\r\n let lineIndex: number;\r\n if (leader.attachment.position.includes(\"Top\")) {\r\n lineIndex = 0\r\n } else {\r\n lineIndex = textLayout.lines.length - 1\r\n }\r\n const lineRange = textLayout.lines[lineIndex].range;\r\n const lineOffset = textLayout.lines[lineIndex].offsetFromDocument;\r\n const origin = transform.multiplyPoint3d(Point3d.fromJSON(lineOffset));\r\n let attachmentPointOnText = origin.plusScaled(transform.matrix.getColumn(1), ((lineRange.yLength()) / 2));\r\n\r\n if (leader.attachment.position.includes(\"Right\")) {\r\n attachmentPointOnText = attachmentPointOnText.plusScaled(transform.matrix.getColumn(0), lineRange.xLength());\r\n scaleDirection = scaleDirection.negate();\r\n }\r\n // Find the nearest intersection point on the frame to get the correct attachment point\r\n // Extend the direction vector to create a target point far along the direction\r\n const targetPoint = attachmentPointOnText.plusScaled(scaleDirection, 1e6); // Scale the direction vector to a large value\r\n const intersectionLine = LineSegment3d.create(attachmentPointOnText, targetPoint);\r\n const closestPointDetail = CurveCurve.intersectionXYZPairs(intersectionLine, false, frameCurve, false);\r\n attachmentPoint = closestPointDetail[0]?.detailA.point;\r\n }\r\n return attachmentPoint;\r\n}"]}
1
+ {"version":3,"file":"LeaderGeometry.js","sourceRoot":"","sources":["../../../src/annotations/LeaderGeometry.ts"],"names":[],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UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE1G,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,qBAAqB,GAAG,qBAAqB,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7G,cAAc,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QAC3C,CAAC;QACD,uFAAuF;QACvF,+EAA+E;QAC/E,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,8CAA8C;QACzH,MAAM,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;QAClF,MAAM,kBAAkB,GAAG,UAAU,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QACvG,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ElementGeometry\r\n */\r\n\r\nimport { ColorDef, ElementGeometry, FillDisplay, GeometryParams, TextAnnotationLeader, TextFrameStyleProps, TextStyleColor, TextStyleSettings } from \"@itwin/core-common\";\r\nimport { Angle, Arc3d, CurveCurve, CurvePrimitive, LineSegment3d, LineString3d, Loop, Path, Point3d, Transform, Vector3d } from \"@itwin/core-geometry\";\r\nimport { computeFrame } from \"./FrameGeometry\";\r\nimport { TextBlockLayout, TextStyleResolver } from \"./TextBlockLayout\";\r\n\r\n/**\r\n * Constructs and appends leader lines and their terminators to the provided geometry builder for a text annotation.\r\n *\r\n * This function processes an array of `TextAnnotationLeader` objects, computes their attachment points\r\n * relative to a text frame (or a default rectangular frame if none is provided), and appends the leader\r\n * line and terminator geometry to the builder. It also applies color overrides if specified\r\n * in the leader's style overrides.\r\n *\r\n * @param builder - The geometry builder to which the leader geometries will be appended.\r\n * @param leaders - An array of leader properties.\r\n * @param layout - The layout information for the text block, including its range.\r\n * @param transform - The transform to apply to the frame and leader geometry.\r\n * @param params - The geometry parameters, such as color, to use for the leader lines.\r\n * @param textStyleResolver - Resolver for text styles, used to obtain leader styles.\r\n * @param scaleFactor - The scale factor to apply to leader dimensions, usually comes from the `scaleFactor` of a [[Drawing]] element.\r\n * @returns `true` if at least one leader with a terminator was successfully appended; otherwise, `false`.\r\n * @beta\r\n */\r\nexport function appendLeadersToBuilder(builder: ElementGeometry.Builder, leaders: TextAnnotationLeader[], layout: TextBlockLayout, transform: Transform, params: GeometryParams, textStyleResolver: TextStyleResolver, scaleFactor: number): boolean {\r\n let result = true;\r\n const scaledBlockTextHeight = textStyleResolver.blockSettings.textHeight * scaleFactor;\r\n let frame: TextFrameStyleProps | undefined = textStyleResolver.blockSettings.frame;\r\n\r\n // If there is no frame, use a rectangular frame to compute the attachmentPoints for leaders.\r\n if (frame === undefined || frame.shape === \"none\") {\r\n frame = { shape: \"rectangle\" }\r\n }\r\n if (frame.shape === undefined || frame.shape === \"none\") return false;\r\n const frameCurve = computeFrame({ frame: frame.shape, range: layout.range, transform });\r\n\r\n for (const leader of leaders) {\r\n const leaderStyle = textStyleResolver.resolveSettings(leader.styleOverrides ?? {}, true);\r\n\r\n let effectiveColor: TextStyleColor = \"subcategory\";\r\n\r\n if (leaderStyle.leader.color === \"inherit\") {\r\n effectiveColor = leaderStyle.color;\r\n } else if (leaderStyle.leader.color !== \"subcategory\") {\r\n effectiveColor = leaderStyle.leader.color;\r\n }\r\n\r\n if (effectiveColor !== \"subcategory\") {\r\n params.lineColor = ColorDef.fromJSON(effectiveColor);\r\n result = result && builder.appendGeometryParamsChange(params);\r\n }\r\n\r\n if (leaderStyle.leader.showLeaders) {\r\n const attachmentPoint = computeLeaderAttachmentPoint(leader, frameCurve, layout, transform);\r\n if (!attachmentPoint) return false;\r\n\r\n let elbowPoint: Point3d | undefined;\r\n if (leaderStyle.leader.wantElbow) {\r\n const elbowLength = leaderStyle.leader.elbowLength * scaledBlockTextHeight;\r\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve, elbowLength);\r\n if (elbowDirection)\r\n elbowPoint = attachmentPoint.plusScaled(elbowDirection, elbowLength);\r\n }\r\n\r\n // Leader line geometry\r\n const leaderLinePoints: Point3d[] = [];\r\n const terminatorWidth = leaderStyle.leader.terminatorWidthFactor * scaledBlockTextHeight;\r\n let leaderStartPoint = leader.startPoint;\r\n if (leaderStyle.leader.showTargetPoint && leaderStyle.leader.targetPointOffsetFactor !== 0) {\r\n const offset = leaderStyle.leader.targetPointOffsetFactor * scaledBlockTextHeight;\r\n let firstSegmentEnd = leader.intermediatePoints?.[0];\r\n\r\n // If there are no intermediate points, offset along the elbow segment when present.\r\n if (!firstSegmentEnd && elbowPoint)\r\n firstSegmentEnd = elbowPoint;\r\n\r\n if (!firstSegmentEnd)\r\n firstSegmentEnd = attachmentPoint;\r\n\r\n\r\n // Offset the target-point marker away from the start point along the first leader segment.\r\n // Clamp the added distance so negative values resolve to 0 and large values cannot overshoot the first vertex.\r\n // When terminators are hidden, use the text height as a conservative guard distance; otherwise use the terminator width.\r\n const firstSegmentLength = leader.startPoint.distance(firstSegmentEnd);\r\n const clampDistance = leaderStyle.leader.showTerminators ? terminatorWidth : scaledBlockTextHeight;\r\n const maxOffset = Math.max(0, firstSegmentLength - clampDistance);\r\n const clampedOffset = Math.min(Math.max(offset, 0), maxOffset);\r\n const leaderDirection = Vector3d.createStartEnd(leader.startPoint, firstSegmentEnd).normalize();\r\n if (leaderDirection)\r\n leaderStartPoint = leader.startPoint.plusScaled(leaderDirection, clampedOffset);\r\n }\r\n leaderLinePoints.push(leaderStartPoint);\r\n\r\n leader.intermediatePoints?.forEach((point) => {\r\n leaderLinePoints.push(point);\r\n });\r\n\r\n if (elbowPoint)\r\n leaderLinePoints.push(elbowPoint);\r\n\r\n leaderLinePoints.push(attachmentPoint);\r\n\r\n const terminatorDirection = Vector3d.createStartEnd(\r\n leaderLinePoints[0], leaderLinePoints[1]\r\n ).normalize();\r\n\r\n // Truncate the first segment of the leader lines to account for the arrowhead size when closedArrow (hollow triangle) terminatorShape is used.\r\n if (leaderStyle.leader.showTerminators && leaderStyle.leader.terminatorShape === \"closedArrow\") {\r\n if (terminatorDirection)\r\n leaderLinePoints[0] = leaderLinePoints[0].plusScaled(terminatorDirection, terminatorWidth);\r\n }\r\n\r\n result = result && builder.appendGeometryQuery(LineString3d.create(leaderLinePoints));\r\n if (leaderStyle.leader.terminatorShape !== \"none\" && leaderStyle.leader.showTerminators) {\r\n // Terminator geometry\r\n if (!terminatorDirection) continue; // Assuming leaders without terminators is a valid case.\r\n result = result && createTerminatorGeometry({ builder, point: leaderStartPoint, dir: terminatorDirection, params, textStyleSettings: leaderStyle, textHeight: scaledBlockTextHeight });\r\n\r\n }\r\n }\r\n\r\n if (leaderStyle.leader.showTargetPoint) {\r\n result = result && createTerminatorGeometry({ builder, point: leader.startPoint, dir: Vector3d.unitX(), params, textStyleSettings: leaderStyle, textHeight: scaledBlockTextHeight, isArrow: false });\r\n }\r\n\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Arguments supplied to [[createTerminatorGeometry]].\r\n * @beta\r\n */\r\nexport interface CreateTerminatorGeometryArgs {\r\n /** The geometry builder to append the terminator geometry to. */\r\n builder: ElementGeometry.Builder;\r\n /** The point at which the terminator is placed - typically the start or end of a leader line. */\r\n point: Point3d;\r\n /** The direction vector of the leader line. */\r\n dir: Vector3d;\r\n /** The geometry parameters to use for the terminator. */\r\n params: GeometryParams;\r\n /** The text style settings describing the terminator's shape and dimensions. */\r\n textStyleSettings: TextStyleSettings;\r\n /** The height of the text block, used to scale the terminator's dimensions. */\r\n textHeight: number;\r\n /** If `true` (the default), the leader's terminator shape is used; otherwise the target-point shape is used. */\r\n isArrow?: boolean;\r\n}\r\n\r\n/**\r\n * Creates the geometry for a terminator at the end of a leader line.\r\n * @param args Describes the terminator geometry to create. See [[CreateTerminatorGeometryArgs]].\r\n * @returns True if the geometry was successfully created, false otherwise.\r\n * @beta\r\n */\r\nexport function createTerminatorGeometry(args: CreateTerminatorGeometryArgs): boolean {\r\n const { builder, point, dir, params, textStyleSettings, textHeight } = args;\r\n const isArrow = args.isArrow ?? true;\r\n\r\n let result = true;\r\n const termY = dir.unitCrossProduct(Vector3d.unitZ());\r\n if (!termY) return false; // If dir is parallel to Z, we can't create a terminator\r\n const terminatorHeight = textStyleSettings.leader.terminatorHeightFactor * textHeight;\r\n const terminatorWidth = textStyleSettings.leader.terminatorWidthFactor * textHeight;\r\n const terminatorHalfHeight = terminatorHeight / 2;\r\n const basePoint = point.plusScaled(dir, terminatorWidth);\r\n const point1 = basePoint.plusScaled(termY, terminatorHalfHeight);\r\n const point2 = basePoint.plusScaled(termY.negate(), terminatorHalfHeight);\r\n\r\n // Helper function to add fill parameters\r\n const addFillParams = () => {\r\n params.fillDisplay = FillDisplay.Always;\r\n params.fillColor = params.lineColor;\r\n result = result && builder.appendGeometryParamsChange(params);\r\n };\r\n\r\n // Helper function to create geometry entry\r\n const addGeometry = (content: CurvePrimitive, useLoop = false) => {\r\n const finalContent = useLoop ? Loop.create(content) : content;\r\n result = result && builder.appendGeometryQuery(finalContent);\r\n };\r\n const shape = isArrow ? textStyleSettings.leader.terminatorShape : textStyleSettings.leader.targetPointShape;\r\n\r\n switch (shape) {\r\n case \"openArrow\": {\r\n const lineString = LineString3d.create([point1, point, point2]);\r\n addGeometry(lineString);\r\n break;\r\n }\r\n\r\n case \"closedArrow\": {\r\n const lineString = LineString3d.create([point1, point, point2, point1]);\r\n addGeometry(lineString);\r\n break;\r\n }\r\n\r\n case \"closedArrowFilled\": {\r\n addFillParams();\r\n const lineString = LineString3d.create([point1, point, point2, point1]);\r\n addGeometry(lineString, true);\r\n break;\r\n }\r\n\r\n case \"circle\": {\r\n const circle = Arc3d.createXY(point, terminatorHalfHeight);\r\n addGeometry(circle);\r\n break;\r\n }\r\n\r\n case \"circleFilled\": {\r\n addFillParams();\r\n const circle = Arc3d.createXY(point, terminatorHalfHeight);\r\n addGeometry(circle, true);\r\n break;\r\n }\r\n\r\n case \"slash\": {\r\n const normalizedVector = dir.normalize();\r\n if (!normalizedVector) throw new Error(\"Invalid reference vector for slash terminator.\");\r\n\r\n const rotatedVector = normalizedVector.rotateXY(Angle.createDegrees(45));\r\n const startPoint = point.plusScaled(rotatedVector, -terminatorHalfHeight);\r\n const endPoint = point.plusScaled(rotatedVector, terminatorHalfHeight);\r\n\r\n const slashLine = LineSegment3d.create(startPoint, endPoint);\r\n addGeometry(slashLine);\r\n break;\r\n }\r\n\r\n case \"cross\": {\r\n // Diagonal \"X\" centered on the point, axis-aligned (horizontal upright).\r\n const halfSize = terminatorHalfHeight;\r\n addGeometry(LineSegment3d.create(point.plusXYZ(-halfSize, -halfSize), point.plusXYZ(halfSize, halfSize)));\r\n addGeometry(LineSegment3d.create(point.plusXYZ(-halfSize, halfSize), point.plusXYZ(halfSize, -halfSize)));\r\n break;\r\n }\r\n\r\n case \"plus\": {\r\n // Orthogonal \"+\" centered on the point, axis-aligned (horizontal upright).\r\n const halfSize = terminatorHalfHeight;\r\n addGeometry(LineSegment3d.create(point.plusXYZ(-halfSize, 0), point.plusXYZ(halfSize, 0)));\r\n addGeometry(LineSegment3d.create(point.plusXYZ(0, -halfSize), point.plusXYZ(0, halfSize)));\r\n break;\r\n }\r\n\r\n case \"square\": {\r\n // Axis-aligned square centered on the point (horizontal upright).\r\n const halfSize = terminatorHalfHeight;\r\n const square = LineString3d.create([\r\n point.plusXYZ(-halfSize, -halfSize),\r\n point.plusXYZ(halfSize, -halfSize),\r\n point.plusXYZ(halfSize, halfSize),\r\n point.plusXYZ(-halfSize, halfSize),\r\n point.plusXYZ(-halfSize, -halfSize),\r\n ]);\r\n addGeometry(square);\r\n break;\r\n }\r\n\r\n case \"rectangle\": {\r\n // Axis-aligned rectangle centered on the point (horizontal upright).\r\n // Respect the configured width/height factors directly.\r\n const halfWidth = terminatorWidth / 2;\r\n const halfHeight = terminatorHalfHeight;\r\n const rectangle = LineString3d.create([\r\n point.plusXYZ(-halfWidth, -halfHeight),\r\n point.plusXYZ(halfWidth, -halfHeight),\r\n point.plusXYZ(halfWidth, halfHeight),\r\n point.plusXYZ(-halfWidth, halfHeight),\r\n point.plusXYZ(-halfWidth, -halfHeight),\r\n ]);\r\n addGeometry(rectangle);\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\n\r\n/**\r\n * Computes the direction vector for an \"elbow\" for leader based on the attachment point and a frame curve.\r\n * The elbow direction is determined by whether the attachment point is closer to the left or right side of the frame.\r\n * If the computed elbow would be tangent to the frame at the intersection, no elbow direction is returned.\r\n *\r\n * @param attachmentPoint - The point where the leader attaches.\r\n * @param frameCurve - The frame curve (either a Loop or Path) to which the leader is attached.\r\n * @param elbowLength - The length of the elbow segment to be created.\r\n * @returns The direction vector for the elbow, or `undefined` if the elbow would be tangent to the frame.\r\n * @beta\r\n */\r\nexport function computeElbowDirection(attachmentPoint: Point3d, frameCurve: Loop | Path, elbowLength: number): Vector3d | undefined {\r\n if (elbowLength <= 0)\r\n return undefined;\r\n\r\n let elbowDirection: Vector3d | undefined;\r\n // Determine the direction based on the closest point's position relative to the frame\r\n const isCloserToLeft = Math.abs(attachmentPoint.x - frameCurve.range().low.x) < Math.abs(attachmentPoint.x - frameCurve.range().high.x);\r\n\r\n // Decide the direction: left (-X) or right (+X)\r\n elbowDirection = isCloserToLeft ? Vector3d.unitX().negate() : Vector3d.unitX();\r\n\r\n // Verify if the elbow is a tangent to the frame, if yes, do not create an elbow\r\n const elbowPoint = attachmentPoint.plusScaled(elbowDirection, elbowLength);\r\n const elbowLine = LineSegment3d.create(attachmentPoint, elbowPoint);\r\n // Find intersection points between the elbow and the frame\r\n const intersections = CurveCurve.intersectionXYZPairs(elbowLine, false, frameCurve, false);\r\n // As the elbow will intersect the frame only at one point, we can safely use the first intersection\r\n const intersection = intersections[0];\r\n const curveFraction = intersection.detailB.fraction;\r\n const derivative = intersection.detailB.curve?.fractionToPointAndDerivative(curveFraction);\r\n const tangent = derivative?.direction.normalize();\r\n const lineDirection = Vector3d.createStartEnd(elbowLine.point0Ref, elbowLine.point1Ref).normalize();\r\n if (tangent && lineDirection) {\r\n const dot = tangent.dotProduct(lineDirection);\r\n // If the tangent and line direction are aligned (dot product close to 1 or -1), it's tangent\r\n if (Math.abs(dot) > 0.999) {\r\n elbowDirection = undefined;\r\n }\r\n }\r\n return elbowDirection;\r\n}\r\n\r\n/**\r\n * Computes the attachment point for a leader line on a text annotation frame.\r\n *\r\n * The attachment point is determined based on the leader's attachment mode:\r\n * - `\"Nearest\"`: Finds the closest point on the frame curve to the leader's start point.\r\n * - `\"KeyPoint\"`: Uses a specific curve segment and fraction along that segment to determine the point.\r\n * - `\"TextPoint\"`: Calculates a point on the text layout (top/bottom, left/right) and projects it onto the frame curve.\r\n *\r\n * @param leader - The leader props.\r\n * @param frameCurve - The curve (Loop or Path) representing the annotation frame.\r\n * @param textLayout - The layout information for the text block.\r\n * @param transform - The transform applied to the text layout.\r\n * @returns The computed attachment point as a `Point3d`, or `undefined` if it cannot be determined.\r\n * @beta\r\n */\r\nexport function computeLeaderAttachmentPoint(\r\n leader: TextAnnotationLeader,\r\n frameCurve: Loop | Path,\r\n textLayout: TextBlockLayout,\r\n transform: Transform\r\n): Point3d | undefined {\r\n let attachmentPoint: Point3d | undefined;\r\n\r\n if (leader.attachment.mode === \"Nearest\") {\r\n attachmentPoint = frameCurve.closestPoint(leader.startPoint)?.point;\r\n } else if (leader.attachment.mode === \"KeyPoint\") {\r\n const curves = frameCurve.collectCurvePrimitives(undefined, false, true);\r\n const curveIndex = leader.attachment.curveIndex;\r\n const fraction = leader.attachment.fraction;\r\n if (curveIndex >= curves.length) {\r\n // If the curveIndex is invalid, use the last curve\r\n // This is a fallback to avoid out-of-bounds access\r\n attachmentPoint = curves[curves.length - 1].fractionToPoint(fraction);\r\n } else {\r\n attachmentPoint = curves[curveIndex].fractionToPoint(fraction);\r\n }\r\n } else { // attachment.mode=\"TextPoint\"\r\n let scaleDirection = transform.matrix.getColumn(0).negate(); // direction to draw a scaled line from text attachment point to find intersection point on frame\r\n let lineIndex: number;\r\n if (leader.attachment.position.includes(\"Top\")) {\r\n lineIndex = 0\r\n } else {\r\n lineIndex = textLayout.lines.length - 1\r\n }\r\n const lineRange = textLayout.lines[lineIndex].range;\r\n const lineOffset = textLayout.lines[lineIndex].offsetFromDocument;\r\n const origin = transform.multiplyPoint3d(Point3d.fromJSON(lineOffset));\r\n let attachmentPointOnText = origin.plusScaled(transform.matrix.getColumn(1), ((lineRange.yLength()) / 2));\r\n\r\n if (leader.attachment.position.includes(\"Right\")) {\r\n attachmentPointOnText = attachmentPointOnText.plusScaled(transform.matrix.getColumn(0), lineRange.xLength());\r\n scaleDirection = scaleDirection.negate();\r\n }\r\n // Find the nearest intersection point on the frame to get the correct attachment point\r\n // Extend the direction vector to create a target point far along the direction\r\n const targetPoint = attachmentPointOnText.plusScaled(scaleDirection, 1e6); // Scale the direction vector to a large value\r\n const intersectionLine = LineSegment3d.create(attachmentPointOnText, targetPoint);\r\n const closestPointDetail = CurveCurve.intersectionXYZPairs(intersectionLine, false, frameCurve, false);\r\n attachmentPoint = closestPointDetail[0]?.detailA.point;\r\n }\r\n return attachmentPoint;\r\n}"]}
@@ -84,6 +84,7 @@ export * from "./ChangesetECAdaptor";
84
84
  export * from "./ChangesetReader";
85
85
  export * from "./ChangesetReaderTypes";
86
86
  export * from "./PartialChangeUnifier";
87
+ export * from "./ChangeUnifier";
87
88
  export * from "./internal/cross-package";
88
89
  /** @docs-package-description
89
90
  * The core-backend package always runs on the computer with a local Briefcase.
@@ -1 +1 @@
1
- {"version":3,"file":"core-backend.d.ts","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":"AAKA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACz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B,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,0BAA0B,CAAC;AA2BzC;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;IAGI;AAEJ;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG"}
@@ -88,6 +88,7 @@ export * from "./ChangesetECAdaptor";
88
88
  export * from "./ChangesetReader";
89
89
  export * from "./ChangesetReaderTypes";
90
90
  export * from "./PartialChangeUnifier";
91
+ export * from "./ChangeUnifier";
91
92
  export * from "./internal/cross-package";
92
93
  const globalSymbolCoreBackend = Symbol.for("itwin.core.backend.globals");
93
94
  if (globalThis[globalSymbolCoreBackend]) {
@@ -1 +1 @@
1
- {"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+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AAuC,EAAE,KAAK,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC;IAC3D,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1D,8BAA8B;IAE9B,MAAM,KAAK,CAAC;AACd,CAAC;KAAM,CAAC;IACL,UAAkB,CAAC,uBAAuB,CAAC,GAAG;QAC7C,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC,KAAK;KACzB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;IAGI;AAEJ;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./annotations/ElementDrivesTextAnnotation\";\r\nexport * from \"./annotations/FrameGeometry\";\r\nexport * from \"./annotations/LeaderGeometry\";\r\nexport * from \"./annotations/TextAnnotationElement\";\r\nexport * from \"./annotations/TextAnnotationGeometry\";\r\nexport * from \"./annotations/TextBlockGeometry\";\r\nexport * from \"./annotations/TextBlockLayout\";\r\nexport * from \"./BackendHubAccess\";\r\nexport * from \"./BackendLoggerCategory\";\r\nexport * from \"./BisCoreSchema\";\r\nexport * from \"./BlobContainerService\";\r\nexport * from \"./BriefcaseManager\";\r\nexport * from \"./CatalogDb\";\r\nexport * from \"./Category\";\r\nexport * from \"./ChangedElementsDb\";\r\nexport * from \"./ChangeSummaryManager\";\r\nexport * from \"./ChannelControl\";\r\nexport * from \"./CheckpointManager\";\r\nexport * from \"./ClassRegistry\";\r\nexport * from \"./CloudSqlite\";\r\nexport * from \"./CodeService\";\r\nexport * from \"./CodeSpecs\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyle\";\r\nexport * from \"./domains/FunctionalElements\";\r\nexport * from \"./domains/FunctionalSchema\";\r\nexport * from \"./domains/GenericElements\";\r\nexport * from \"./domains/GenericSchema\";\r\nexport * from \"./ECDb\";\r\nexport * from \"./ECSchemaXmlContext\";\r\nexport * from \"./ECSqlStatement\";\r\nexport * from \"./ECSqlSyncReader\";\r\nexport * from \"./EditTxn\";\r\nexport * from \"./Element\";\r\nexport * from \"./ElementAspect\";\r\nexport * from \"./ElementGraphics\";\r\nexport * from \"./ElementTreeWalker\";\r\nexport * from \"./Entity\";\r\nexport * from \"./EntityReferences\";\r\nexport * from \"./ExportGraphics\";\r\nexport * from \"./ExternalSource\";\r\nexport * from \"./FontFile\";\r\nexport * from \"./GeoCoordConfig\";\r\nexport * from \"./GeographicCRSServices\";\r\nexport * from \"./ImageSourceConversion\";\r\nexport * from \"./IModelDb\";\r\nexport * from \"./IModelDbFonts\";\r\nexport * from \"./IModelElementCloneContext\";\r\nexport * from \"./IModelHost\";\r\nexport * from \"./IModelJsFs\";\r\nexport * from \"./SchemaSync\";\r\nexport * from \"./IpcHost\";\r\nexport * from \"./LineStyle\";\r\nexport * from \"./LocalhostIpcHost\";\r\nexport * from \"./LocalHub\";\r\nexport * from \"./LockControl\";\r\nexport * from \"./SynchronousChannel\";\r\nexport * from \"./Material\";\r\nexport * from \"./Model\";\r\nexport * from \"./NativeAppStorage\";\r\nexport * from \"./NativeHost\";\r\nexport * from \"./NavigationRelationship\";\r\nexport * from \"./PropertyStore\";\r\nexport * from \"./Relationship\";\r\nexport * from \"./rpc/tracing\";\r\nexport * from \"./Schema\";\r\nexport * from \"./SchemaUtils\";\r\nexport * from \"./SheetIndex\";\r\nexport * from \"./SQLiteDb\";\r\nexport * from \"./SqliteStatement\";\r\nexport * from \"./Texture\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TxnManager\";\r\nexport * from \"./ViewDefinition\";\r\nexport * from \"./ViewStore\";\r\nexport * from \"./workspace/Settings\";\r\nexport * from \"./workspace/SettingsDb\";\r\nexport * from \"./workspace/SettingsEditor\";\r\nexport * from \"./workspace/SettingsSchemas\";\r\nexport * from \"./workspace/Workspace\";\r\nexport * from \"./workspace/WorkspaceEditor\";\r\nexport * from \"./SqliteChangesetReader\";\r\nexport * from \"./ChangesetECAdaptor\";\r\nexport * from \"./ChangesetReader\";\r\nexport * from \"./ChangesetReaderTypes\";\r\nexport * from \"./PartialChangeUnifier\";\r\n\r\nexport * from \"./internal/cross-package\";\r\n\r\nconst globalSymbolCoreBackend = Symbol.for(\"itwin.core.backend.globals\");\r\nif ((globalThis as any)[globalSymbolCoreBackend]) {\r\n // Get the stack trace from when the module was first loaded\r\n const firstLoadStack = (globalThis as any)[globalSymbolCoreBackend].stack;\r\n\r\n const error = new Error(\r\n \"Multiple @itwin/core-backend imports detected! This may happen if:\\n\" +\r\n \"- You have multiple versions of the package installed\\n\" +\r\n \"- Your bundling configuration is incorrect\\n\" +\r\n \"- You're importing from both ESM and CommonJS versions\"\r\n );\r\n\r\n /* eslint-disable no-console */\r\n console.error(\"Duplicate @itwin/core-backend import:\", error);\r\n console.error(\"First import occurred at:\", firstLoadStack);\r\n console.error(\"Current import occurred at:\", error.stack);\r\n /* eslint-enable no-console */\r\n\r\n throw error;\r\n} else {\r\n (globalThis as any)[globalSymbolCoreBackend] = {\r\n stack: new Error().stack,\r\n };\r\n}\r\n\r\n/** @docs-package-description\r\n * The core-backend package always runs on the computer with a local Briefcase.\r\n *\r\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\r\n */\r\n\r\n/**\r\n * @docs-group-description BlobContainers\r\n * Classes for working with cloud-based blob containers.\r\n */\r\n\r\n/**\r\n * @docs-group-description Codes\r\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ECDb\r\n * Classes for working with ECDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description ECSQL\r\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementAspects\r\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementGeometry\r\n * Classes for defining the symbology and geometry of geometric elements\r\n */\r\n\r\n/**\r\n * @docs-group-description Elements\r\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ExportGraphics\r\n * APIs for producing low-level graphics primitives from element geometry.\r\n */\r\n\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n\r\n/**\r\n * @docs-group-description Images\r\n * APIs for encoding and decoding images\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelHost\r\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\r\n * See [the learning article]($docs/learning/backend/IModelHost.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description iModels\r\n * Classes for working with [iModels]($docs/learning/iModels.md).\r\n * See [the learning article]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package.\r\n */\r\n\r\n/**\r\n * @docs-group-description Models\r\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Mobile/Desktop Application.\r\n */\r\n\r\n/**\r\n * @docs-group-description Portability\r\n */\r\n\r\n/**\r\n * @docs-group-description Relationships\r\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\r\n */\r\n\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Schema\r\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLite\r\n * Classes for working directly with SQLite\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLiteDb\r\n * Classes for working with SQLiteDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n */\r\n\r\n/**\r\n * @docs-group-description ViewDefinitions\r\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\r\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\r\n */\r\n\r\n/**\r\n * @docs-group-description Workspace\r\n * APIs for loading and using Settings and Workspace resources\r\n */\r\n"]}
1
+ {"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;A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AAM,KAAK,CAAC;AACd,CAAC;KAAM,CAAC;IACL,UAAkB,CAAC,uBAAuB,CAAC,GAAG;QAC7C,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC,KAAK;KACzB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;IAGI;AAEJ;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./annotations/ElementDrivesTextAnnotation\";\r\nexport * from \"./annotations/FrameGeometry\";\r\nexport * from \"./annotations/LeaderGeometry\";\r\nexport * from \"./annotations/TextAnnotationElement\";\r\nexport * from \"./annotations/TextAnnotationGeometry\";\r\nexport * from \"./annotations/TextBlockGeometry\";\r\nexport * from \"./annotations/TextBlockLayout\";\r\nexport * from \"./BackendHubAccess\";\r\nexport * from \"./BackendLoggerCategory\";\r\nexport * from \"./BisCoreSchema\";\r\nexport * from \"./BlobContainerService\";\r\nexport * from \"./BriefcaseManager\";\r\nexport * from \"./CatalogDb\";\r\nexport * from \"./Category\";\r\nexport * from \"./ChangedElementsDb\";\r\nexport * from \"./ChangeSummaryManager\";\r\nexport * from \"./ChannelControl\";\r\nexport * from \"./CheckpointManager\";\r\nexport * from \"./ClassRegistry\";\r\nexport * from \"./CloudSqlite\";\r\nexport * from \"./CodeService\";\r\nexport * from \"./CodeSpecs\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyle\";\r\nexport * from \"./domains/FunctionalElements\";\r\nexport * from \"./domains/FunctionalSchema\";\r\nexport * from \"./domains/GenericElements\";\r\nexport * from \"./domains/GenericSchema\";\r\nexport * from \"./ECDb\";\r\nexport * from \"./ECSchemaXmlContext\";\r\nexport * from \"./ECSqlStatement\";\r\nexport * from \"./ECSqlSyncReader\";\r\nexport * from \"./EditTxn\";\r\nexport * from \"./Element\";\r\nexport * from \"./ElementAspect\";\r\nexport * from \"./ElementGraphics\";\r\nexport * from \"./ElementTreeWalker\";\r\nexport * from \"./Entity\";\r\nexport * from \"./EntityReferences\";\r\nexport * from \"./ExportGraphics\";\r\nexport * from \"./ExternalSource\";\r\nexport * from \"./FontFile\";\r\nexport * from \"./GeoCoordConfig\";\r\nexport * from \"./GeographicCRSServices\";\r\nexport * from \"./ImageSourceConversion\";\r\nexport * from \"./IModelDb\";\r\nexport * from \"./IModelDbFonts\";\r\nexport * from \"./IModelElementCloneContext\";\r\nexport * from \"./IModelHost\";\r\nexport * from \"./IModelJsFs\";\r\nexport * from \"./SchemaSync\";\r\nexport * from \"./IpcHost\";\r\nexport * from \"./LineStyle\";\r\nexport * from \"./LocalhostIpcHost\";\r\nexport * from \"./LocalHub\";\r\nexport * from \"./LockControl\";\r\nexport * from \"./SynchronousChannel\";\r\nexport * from \"./Material\";\r\nexport * from \"./Model\";\r\nexport * from \"./NativeAppStorage\";\r\nexport * from \"./NativeHost\";\r\nexport * from \"./NavigationRelationship\";\r\nexport * from \"./PropertyStore\";\r\nexport * from \"./Relationship\";\r\nexport * from \"./rpc/tracing\";\r\nexport * from \"./Schema\";\r\nexport * from \"./SchemaUtils\";\r\nexport * from \"./SheetIndex\";\r\nexport * from \"./SQLiteDb\";\r\nexport * from \"./SqliteStatement\";\r\nexport * from \"./Texture\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TxnManager\";\r\nexport * from \"./ViewDefinition\";\r\nexport * from \"./ViewStore\";\r\nexport * from \"./workspace/Settings\";\r\nexport * from \"./workspace/SettingsDb\";\r\nexport * from \"./workspace/SettingsEditor\";\r\nexport * from \"./workspace/SettingsSchemas\";\r\nexport * from \"./workspace/Workspace\";\r\nexport * from \"./workspace/WorkspaceEditor\";\r\nexport * from \"./SqliteChangesetReader\";\r\nexport * from \"./ChangesetECAdaptor\";\r\nexport * from \"./ChangesetReader\";\r\nexport * from \"./ChangesetReaderTypes\";\r\nexport * from \"./PartialChangeUnifier\";\r\nexport * from \"./ChangeUnifier\";\r\n\r\nexport * from \"./internal/cross-package\";\r\n\r\nconst globalSymbolCoreBackend = Symbol.for(\"itwin.core.backend.globals\");\r\nif ((globalThis as any)[globalSymbolCoreBackend]) {\r\n // Get the stack trace from when the module was first loaded\r\n const firstLoadStack = (globalThis as any)[globalSymbolCoreBackend].stack;\r\n\r\n const error = new Error(\r\n \"Multiple @itwin/core-backend imports detected! This may happen if:\\n\" +\r\n \"- You have multiple versions of the package installed\\n\" +\r\n \"- Your bundling configuration is incorrect\\n\" +\r\n \"- You're importing from both ESM and CommonJS versions\"\r\n );\r\n\r\n /* eslint-disable no-console */\r\n console.error(\"Duplicate @itwin/core-backend import:\", error);\r\n console.error(\"First import occurred at:\", firstLoadStack);\r\n console.error(\"Current import occurred at:\", error.stack);\r\n /* eslint-enable no-console */\r\n\r\n throw error;\r\n} else {\r\n (globalThis as any)[globalSymbolCoreBackend] = {\r\n stack: new Error().stack,\r\n };\r\n}\r\n\r\n/** @docs-package-description\r\n * The core-backend package always runs on the computer with a local Briefcase.\r\n *\r\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\r\n */\r\n\r\n/**\r\n * @docs-group-description BlobContainers\r\n * Classes for working with cloud-based blob containers.\r\n */\r\n\r\n/**\r\n * @docs-group-description Codes\r\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ECDb\r\n * Classes for working with ECDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description ECSQL\r\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementAspects\r\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementGeometry\r\n * Classes for defining the symbology and geometry of geometric elements\r\n */\r\n\r\n/**\r\n * @docs-group-description Elements\r\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ExportGraphics\r\n * APIs for producing low-level graphics primitives from element geometry.\r\n */\r\n\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n\r\n/**\r\n * @docs-group-description Images\r\n * APIs for encoding and decoding images\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelHost\r\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\r\n * See [the learning article]($docs/learning/backend/IModelHost.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description iModels\r\n * Classes for working with [iModels]($docs/learning/iModels.md).\r\n * See [the learning article]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package.\r\n */\r\n\r\n/**\r\n * @docs-group-description Models\r\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Mobile/Desktop Application.\r\n */\r\n\r\n/**\r\n * @docs-group-description Portability\r\n */\r\n\r\n/**\r\n * @docs-group-description Relationships\r\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\r\n */\r\n\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Schema\r\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLite\r\n * Classes for working directly with SQLite\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLiteDb\r\n * Classes for working with SQLiteDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n */\r\n\r\n/**\r\n * @docs-group-description ViewDefinitions\r\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\r\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\r\n */\r\n\r\n/**\r\n * @docs-group-description Workspace\r\n * APIs for loading and using Settings and Workspace resources\r\n */\r\n"]}
@@ -0,0 +1,19 @@
1
+ import { LocalDirName, LocalFileName } from "@itwin/core-common";
2
+ /**
3
+ * Determine whether `fileName` is a file associated with the briefcase named `briefcaseName`. That is, whether it is named
4
+ * `<briefcaseName>-*` or `<briefcaseName>.*` (e.g. "a.bim-wal", "a.bim-locks", "a.bim.Tiles", "a.bim.HierarchyCache.db").
5
+ * Several native modules create their own files alongside a briefcase, so this is a naming rule rather than a fixed list.
6
+ * @internal
7
+ */
8
+ export declare function isBriefcaseSidecar(fileName: string, briefcaseName: string): boolean;
9
+ /**
10
+ * Check a briefcase path received from the frontend (via [NativeApp.deleteBriefcase]($frontend)) before it is passed to
11
+ * [[BriefcaseManager.deleteBriefcaseFiles]]. The frontend may only delete files that are inside the briefcase cache, or that are valid iModels.
12
+ * @param filePath the path supplied by the frontend.
13
+ * @param cacheDir the briefcase cache directory (see [[BriefcaseManager.cacheDir]]).
14
+ * @returns the resolved path to delete, or `undefined` if there is nothing to delete (the file does not exist and is outside the briefcase cache).
15
+ * @throws [IModelError]($common) with [IModelStatus.BadRequest]($bentley) if the file exists but is neither a valid iModel nor in the briefcase cache.
16
+ * @internal
17
+ */
18
+ export declare function checkFrontendBriefcaseDelete(filePath: LocalFileName, cacheDir: LocalDirName | undefined): LocalFileName | undefined;
19
+ //# sourceMappingURL=BriefcaseUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BriefcaseUtils.d.ts","sourceRoot":"","sources":["../../../src/internal/BriefcaseUtils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAe,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAI9E;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAOnF;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAanI"}
@@ -0,0 +1,61 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import * as path from "node:path";
6
+ import { IModelStatus, OpenMode } from "@itwin/core-bentley";
7
+ import { IModelError } from "@itwin/core-common";
8
+ import { IModelDb } from "../IModelDb";
9
+ import { IModelJsFs } from "../IModelJsFs";
10
+ /**
11
+ * Determine whether `fileName` is a file associated with the briefcase named `briefcaseName`. That is, whether it is named
12
+ * `<briefcaseName>-*` or `<briefcaseName>.*` (e.g. "a.bim-wal", "a.bim-locks", "a.bim.Tiles", "a.bim.HierarchyCache.db").
13
+ * Several native modules create their own files alongside a briefcase, so this is a naming rule rather than a fixed list.
14
+ * @internal
15
+ */
16
+ export function isBriefcaseSidecar(fileName, briefcaseName) {
17
+ if (process.platform === "win32") {
18
+ fileName = fileName.toLowerCase();
19
+ briefcaseName = briefcaseName.toLowerCase();
20
+ }
21
+ const separator = fileName[briefcaseName.length];
22
+ return fileName.length > briefcaseName.length + 1 && fileName.startsWith(briefcaseName) && (separator === "-" || separator === ".");
23
+ }
24
+ function isInDirectory(resolvedPath, dir) {
25
+ if (!dir)
26
+ return false;
27
+ const root = path.resolve(dir) + path.sep;
28
+ return process.platform === "win32"
29
+ ? resolvedPath.toLowerCase().startsWith(root.toLowerCase())
30
+ : resolvedPath.startsWith(root);
31
+ }
32
+ function isValidIModel(resolvedPath) {
33
+ try {
34
+ IModelDb.openDgnDb({ path: resolvedPath }, OpenMode.Readonly).closeFile();
35
+ return true;
36
+ }
37
+ catch {
38
+ return false;
39
+ }
40
+ }
41
+ /**
42
+ * Check a briefcase path received from the frontend (via [NativeApp.deleteBriefcase]($frontend)) before it is passed to
43
+ * [[BriefcaseManager.deleteBriefcaseFiles]]. The frontend may only delete files that are inside the briefcase cache, or that are valid iModels.
44
+ * @param filePath the path supplied by the frontend.
45
+ * @param cacheDir the briefcase cache directory (see [[BriefcaseManager.cacheDir]]).
46
+ * @returns the resolved path to delete, or `undefined` if there is nothing to delete (the file does not exist and is outside the briefcase cache).
47
+ * @throws [IModelError]($common) with [IModelStatus.BadRequest]($bentley) if the file exists but is neither a valid iModel nor in the briefcase cache.
48
+ * @internal
49
+ */
50
+ export function checkFrontendBriefcaseDelete(filePath, cacheDir) {
51
+ const resolvedPath = path.resolve(filePath);
52
+ if (isInDirectory(resolvedPath, cacheDir))
53
+ return resolvedPath;
54
+ // Don't pass a missing file outside the cache along, since deleteBriefcaseFiles would still delete its associated files.
55
+ if (!IModelJsFs.existsSync(resolvedPath))
56
+ return undefined;
57
+ if (!isValidIModel(resolvedPath))
58
+ throw new IModelError(IModelStatus.BadRequest, `cannot delete "${filePath}": it is not a valid iModel and is not in the briefcase cache`);
59
+ return resolvedPath;
60
+ }
61
+ //# sourceMappingURL=BriefcaseUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BriefcaseUtils.js","sourceRoot":"","sources":["../../../src/intern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AAC;QACH,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAuB,EAAE,QAAkC;IACtG,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC;QACvC,OAAO,YAAY,CAAC;IAEtB,yHAAyH;IACzH,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC;QACtC,OAAO,SAAS,CAAC;IAEnB,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC;QAC9B,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,kBAAkB,QAAQ,+DAA+D,CAAC,CAAC;IAE5I,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as path from \"node:path\";\r\nimport { IModelStatus, OpenMode } from \"@itwin/core-bentley\";\r\nimport { IModelError, LocalDirName, LocalFileName } from \"@itwin/core-common\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { IModelJsFs } from \"../IModelJsFs\";\r\n\r\n/**\r\n * Determine whether `fileName` is a file associated with the briefcase named `briefcaseName`. That is, whether it is named\r\n * `<briefcaseName>-*` or `<briefcaseName>.*` (e.g. \"a.bim-wal\", \"a.bim-locks\", \"a.bim.Tiles\", \"a.bim.HierarchyCache.db\").\r\n * Several native modules create their own files alongside a briefcase, so this is a naming rule rather than a fixed list.\r\n * @internal\r\n */\r\nexport function isBriefcaseSidecar(fileName: string, briefcaseName: string): boolean {\r\n if (process.platform === \"win32\") {\r\n fileName = fileName.toLowerCase();\r\n briefcaseName = briefcaseName.toLowerCase();\r\n }\r\n const separator = fileName[briefcaseName.length];\r\n return fileName.length > briefcaseName.length + 1 && fileName.startsWith(briefcaseName) && (separator === \"-\" || separator === \".\");\r\n}\r\n\r\nfunction isInDirectory(resolvedPath: string, dir: LocalDirName | undefined): boolean {\r\n if (!dir)\r\n return false;\r\n\r\n const root = path.resolve(dir) + path.sep;\r\n return process.platform === \"win32\"\r\n ? resolvedPath.toLowerCase().startsWith(root.toLowerCase())\r\n : resolvedPath.startsWith(root);\r\n}\r\n\r\nfunction isValidIModel(resolvedPath: string): boolean {\r\n try {\r\n IModelDb.openDgnDb({ path: resolvedPath }, OpenMode.Readonly).closeFile();\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Check a briefcase path received from the frontend (via [NativeApp.deleteBriefcase]($frontend)) before it is passed to\r\n * [[BriefcaseManager.deleteBriefcaseFiles]]. The frontend may only delete files that are inside the briefcase cache, or that are valid iModels.\r\n * @param filePath the path supplied by the frontend.\r\n * @param cacheDir the briefcase cache directory (see [[BriefcaseManager.cacheDir]]).\r\n * @returns the resolved path to delete, or `undefined` if there is nothing to delete (the file does not exist and is outside the briefcase cache).\r\n * @throws [IModelError]($common) with [IModelStatus.BadRequest]($bentley) if the file exists but is neither a valid iModel nor in the briefcase cache.\r\n * @internal\r\n */\r\nexport function checkFrontendBriefcaseDelete(filePath: LocalFileName, cacheDir: LocalDirName | undefined): LocalFileName | undefined {\r\n const resolvedPath = path.resolve(filePath);\r\n if (isInDirectory(resolvedPath, cacheDir))\r\n return resolvedPath;\r\n\r\n // Don't pass a missing file outside the cache along, since deleteBriefcaseFiles would still delete its associated files.\r\n if (!IModelJsFs.existsSync(resolvedPath))\r\n return undefined;\r\n\r\n if (!isValidIModel(resolvedPath))\r\n throw new IModelError(IModelStatus.BadRequest, `cannot delete \"${filePath}\": it is not a valid iModel and is not in the briefcase cache`);\r\n\r\n return resolvedPath;\r\n}\r\n"]}
@@ -0,0 +1,44 @@
1
+ /** @packageDocumentation
2
+ * @module ECDb
3
+ */
4
+ import { DbQueryRequest, DbQueryResponse } from "@itwin/core-common";
5
+ /**
6
+ * Caches the column metadata returned by concurrent query requests so that new [ECSqlReader]($common) instances for an
7
+ * already-seen ECSQL can skip asking native to build and marshal it again.
8
+ *
9
+ * Column metadata only depends on the prepared statement (i.e. the schema) and the options that influence property naming.
10
+ * The owning database clears it only in a full `clearCaches()`, together with its statement cache, so it stays exactly as
11
+ * fresh as the metadata [ECSqlStatement]($backend) caches for `withPreparedStatement` and `withQueryReader`. Every path that
12
+ * changes the schema must therefore do a full `clearCaches()`. Undo and redo never need to, because saving a schema txn
13
+ * starts a new undo session, so undo/redo cannot cross a schema change.
14
+ * A schema change made by another process to a file opened without change watching is not detected; the statement
15
+ * cache has the same limitation.
16
+ * @internal
17
+ */
18
+ export declare class QueryMetadataCache {
19
+ private readonly _capacity;
20
+ static readonly defaultCapacity = 200;
21
+ private readonly _entries;
22
+ private _generation;
23
+ constructor(_capacity?: number);
24
+ /** Number of cached entries. */
25
+ get size(): number;
26
+ /** Drop all cached metadata. Requests already in flight will not populate the cache. */
27
+ clear(): void;
28
+ private static makeKey;
29
+ private static copy;
30
+ private get;
31
+ private set;
32
+ /**
33
+ * The cached counterpart of `executeQueryRequest`, serving column metadata from the cache when possible.
34
+ * On a cache hit, `executeQueryRequest` is called with `includeMetaData: false` and the cached metadata is attached to the response.
35
+ * On a miss, `executeQueryRequest` is called with the request unchanged and the returned metadata is cached.
36
+ * @param request The request to execute. It is not modified.
37
+ * @param executeQueryRequest Sends a request to native without consulting this cache, typically
38
+ * `ConcurrentQuery.executeQueryRequest` with the database already bound. Called once, or twice if the cache is cleared
39
+ * while a successful cache hit is in flight. The second call has no `restartToken`.
40
+ */
41
+ executeCachedQueryRequest(request: DbQueryRequest, executeQueryRequest: (request: DbQueryRequest) => Promise<DbQueryResponse>): Promise<DbQueryResponse>;
42
+ private static hasResult;
43
+ }
44
+ //# sourceMappingURL=QueryMetadataCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryMetadataCache.d.ts","sourceRoot":"","sources":["../../../src/internal/QueryMetadataCache.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAA2C,MAAM,oBAAoB,CAAC;AAE9G;;;;;;;;;;;;GAYG;AACH,qBAAa,kBAAkB;IAKV,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJ7C,gBAAuB,eAAe,OAAO;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8C;IACvE,OAAO,CAAC,WAAW,CAAK;gBAEY,SAAS,SAAqC;IAElF,gCAAgC;IAChC,IAAW,IAAI,IAAI,MAAM,CAA+B;IAExD,wFAAwF;IACjF,KAAK,IAAI,IAAI;IAKpB,OAAO,CAAC,MAAM,CAAC,OAAO;IAKtB,OAAO,CAAC,MAAM,CAAC,IAAI;IAInB,OAAO,CAAC,GAAG;IAUX,OAAO,CAAC,GAAG;IASX;;;;;;;;OAQG;IACU,yBAAyB,CAAC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAkCrK,OAAO,CAAC,MAAM,CAAC,SAAS;CAGzB"}
@@ -0,0 +1,103 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module ECDb
7
+ */
8
+ import { DbResponseStatus } from "@itwin/core-common";
9
+ /**
10
+ * Caches the column metadata returned by concurrent query requests so that new [ECSqlReader]($common) instances for an
11
+ * already-seen ECSQL can skip asking native to build and marshal it again.
12
+ *
13
+ * Column metadata only depends on the prepared statement (i.e. the schema) and the options that influence property naming.
14
+ * The owning database clears it only in a full `clearCaches()`, together with its statement cache, so it stays exactly as
15
+ * fresh as the metadata [ECSqlStatement]($backend) caches for `withPreparedStatement` and `withQueryReader`. Every path that
16
+ * changes the schema must therefore do a full `clearCaches()`. Undo and redo never need to, because saving a schema txn
17
+ * starts a new undo session, so undo/redo cannot cross a schema change.
18
+ * A schema change made by another process to a file opened without change watching is not detected; the statement
19
+ * cache has the same limitation.
20
+ * @internal
21
+ */
22
+ export class QueryMetadataCache {
23
+ _capacity;
24
+ static defaultCapacity = 200;
25
+ _entries = new Map();
26
+ _generation = 0;
27
+ constructor(_capacity = QueryMetadataCache.defaultCapacity) {
28
+ this._capacity = _capacity;
29
+ }
30
+ /** Number of cached entries. */
31
+ get size() { return this._entries.size; }
32
+ /** Drop all cached metadata. Requests already in flight will not populate the cache. */
33
+ clear() {
34
+ this._entries.clear();
35
+ ++this._generation;
36
+ }
37
+ static makeKey(request) {
38
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
39
+ return `${request.usePrimaryConn ? 1 : 0}|${request.valueFormat ?? 0}|${request.abbreviateBlobs ? 1 : 0}|${request.convertClassIdsToClassNames ? 1 : 0}|${request.query}`;
40
+ }
41
+ static copy(properties) {
42
+ return properties.map((property) => ({ ...property }));
43
+ }
44
+ get(key) {
45
+ const properties = this._entries.get(key);
46
+ if (properties && this._entries.size > 1) {
47
+ // Move to the most-recently-used position.
48
+ this._entries.delete(key);
49
+ this._entries.set(key, properties);
50
+ }
51
+ return properties;
52
+ }
53
+ set(key, properties) {
54
+ this._entries.delete(key);
55
+ this._entries.set(key, properties);
56
+ while (this._entries.size > this._capacity) {
57
+ const oldest = this._entries.keys().next().value;
58
+ this._entries.delete(oldest);
59
+ }
60
+ }
61
+ /**
62
+ * The cached counterpart of `executeQueryRequest`, serving column metadata from the cache when possible.
63
+ * On a cache hit, `executeQueryRequest` is called with `includeMetaData: false` and the cached metadata is attached to the response.
64
+ * On a miss, `executeQueryRequest` is called with the request unchanged and the returned metadata is cached.
65
+ * @param request The request to execute. It is not modified.
66
+ * @param executeQueryRequest Sends a request to native without consulting this cache, typically
67
+ * `ConcurrentQuery.executeQueryRequest` with the database already bound. Called once, or twice if the cache is cleared
68
+ * while a successful cache hit is in flight. The second call has no `restartToken`.
69
+ */
70
+ async executeCachedQueryRequest(request, executeQueryRequest) {
71
+ if (!request.includeMetaData)
72
+ return executeQueryRequest(request);
73
+ const key = QueryMetadataCache.makeKey(request);
74
+ const cached = this.get(key);
75
+ let missRequest = request;
76
+ if (cached) {
77
+ const hitGeneration = this._generation;
78
+ const hitResponse = await executeQueryRequest({ ...request, includeMetaData: false });
79
+ // Cancelled, failed or busy: there are no rows to describe, so hand the status back to the caller as is.
80
+ if (!QueryMetadataCache.hasResult(hitResponse))
81
+ return hitResponse;
82
+ if (hitGeneration === this._generation) {
83
+ if (hitResponse.meta === undefined || hitResponse.meta.length === 0)
84
+ hitResponse.meta = QueryMetadataCache.copy(cached);
85
+ return hitResponse;
86
+ }
87
+ // Invalidated while in flight: the cached metadata may not match the statement that produced the rows, so run
88
+ // the request again with metadata. Drop the restart token: a newer request may already be using it, and
89
+ // resubmitting with it would cancel that request.
90
+ missRequest = { ...request };
91
+ delete missRequest.restartToken;
92
+ }
93
+ const generation = this._generation;
94
+ const response = await executeQueryRequest(missRequest);
95
+ if (generation === this._generation && QueryMetadataCache.hasResult(response) && response.meta !== undefined && response.meta.length > 0)
96
+ this.set(key, QueryMetadataCache.copy(response.meta));
97
+ return response;
98
+ }
99
+ static hasResult(response) {
100
+ return response.status === DbResponseStatus.Done || response.status === DbResponseStatus.Partial;
101
+ }
102
+ }
103
+ //# sourceMappingURL=QueryMetadataCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryMetadataCache.js","sourceRoot":"","sources":["../../../src/internal/QueryMetadataCache.ts"],"names":[],"mappings":"A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AC,kBAAkB,CAAC,SAAS,CAAC,WAAW,CAAC;gBAC5C,OAAO,WAAW,CAAC;YAErB,IAAI,aAAa,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;gBACvC,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;oBACjE,WAAW,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACrD,OAAO,WAAW,CAAC;YACrB,CAAC;YAED,8GAA8G;YAC9G,wGAAwG;YACxG,kDAAkD;YAClD,WAAW,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;YAC7B,OAAO,WAAW,CAAC,YAAY,CAAC;QAClC,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACxD,IAAI,UAAU,KAAK,IAAI,CAAC,WAAW,IAAI,kBAAkB,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YACtI,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACxD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,QAAyB;QAChD,OAAO,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,OAAO,CAAC;IACnG,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ECDb\r\n */\r\n\r\nimport { DbQueryRequest, DbQueryResponse, DbResponseStatus, QueryPropertyMetaData } from \"@itwin/core-common\";\r\n\r\n/**\r\n * Caches the column metadata returned by concurrent query requests so that new [ECSqlReader]($common) instances for an\r\n * already-seen ECSQL can skip asking native to build and marshal it again.\r\n *\r\n * Column metadata only depends on the prepared statement (i.e. the schema) and the options that influence property naming.\r\n * The owning database clears it only in a full `clearCaches()`, together with its statement cache, so it stays exactly as\r\n * fresh as the metadata [ECSqlStatement]($backend) caches for `withPreparedStatement` and `withQueryReader`. Every path that\r\n * changes the schema must therefore do a full `clearCaches()`. Undo and redo never need to, because saving a schema txn\r\n * starts a new undo session, so undo/redo cannot cross a schema change.\r\n * A schema change made by another process to a file opened without change watching is not detected; the statement\r\n * cache has the same limitation.\r\n * @internal\r\n */\r\nexport class QueryMetadataCache {\r\n public static readonly defaultCapacity = 200;\r\n private readonly _entries = new Map<string, QueryPropertyMetaData[]>();\r\n private _generation = 0;\r\n\r\n public constructor(private readonly _capacity = QueryMetadataCache.defaultCapacity) { }\r\n\r\n /** Number of cached entries. */\r\n public get size(): number { return this._entries.size; }\r\n\r\n /** Drop all cached metadata. Requests already in flight will not populate the cache. */\r\n public clear(): void {\r\n this._entries.clear();\r\n ++this._generation;\r\n }\r\n\r\n private static makeKey(request: DbQueryRequest): string {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return `${request.usePrimaryConn ? 1 : 0}|${request.valueFormat ?? 0}|${request.abbreviateBlobs ? 1 : 0}|${request.convertClassIdsToClassNames ? 1 : 0}|${request.query}`;\r\n }\r\n\r\n private static copy(properties: QueryPropertyMetaData[]): QueryPropertyMetaData[] {\r\n return properties.map((property) => ({ ...property }));\r\n }\r\n\r\n private get(key: string): QueryPropertyMetaData[] | undefined {\r\n const properties = this._entries.get(key);\r\n if (properties && this._entries.size > 1) {\r\n // Move to the most-recently-used position.\r\n this._entries.delete(key);\r\n this._entries.set(key, properties);\r\n }\r\n return properties;\r\n }\r\n\r\n private set(key: string, properties: QueryPropertyMetaData[]): void {\r\n this._entries.delete(key);\r\n this._entries.set(key, properties);\r\n while (this._entries.size > this._capacity) {\r\n const oldest = this._entries.keys().next().value as string;\r\n this._entries.delete(oldest);\r\n }\r\n }\r\n\r\n /**\r\n * The cached counterpart of `executeQueryRequest`, serving column metadata from the cache when possible.\r\n * On a cache hit, `executeQueryRequest` is called with `includeMetaData: false` and the cached metadata is attached to the response.\r\n * On a miss, `executeQueryRequest` is called with the request unchanged and the returned metadata is cached.\r\n * @param request The request to execute. It is not modified.\r\n * @param executeQueryRequest Sends a request to native without consulting this cache, typically\r\n * `ConcurrentQuery.executeQueryRequest` with the database already bound. Called once, or twice if the cache is cleared\r\n * while a successful cache hit is in flight. The second call has no `restartToken`.\r\n */\r\n public async executeCachedQueryRequest(request: DbQueryRequest, executeQueryRequest: (request: DbQueryRequest) => Promise<DbQueryResponse>): Promise<DbQueryResponse> {\r\n if (!request.includeMetaData)\r\n return executeQueryRequest(request);\r\n\r\n const key = QueryMetadataCache.makeKey(request);\r\n const cached = this.get(key);\r\n let missRequest = request;\r\n if (cached) {\r\n const hitGeneration = this._generation;\r\n const hitResponse = await executeQueryRequest({ ...request, includeMetaData: false });\r\n // Cancelled, failed or busy: there are no rows to describe, so hand the status back to the caller as is.\r\n if (!QueryMetadataCache.hasResult(hitResponse))\r\n return hitResponse;\r\n\r\n if (hitGeneration === this._generation) {\r\n if (hitResponse.meta === undefined || hitResponse.meta.length === 0)\r\n hitResponse.meta = QueryMetadataCache.copy(cached);\r\n return hitResponse;\r\n }\r\n\r\n // Invalidated while in flight: the cached metadata may not match the statement that produced the rows, so run\r\n // the request again with metadata. Drop the restart token: a newer request may already be using it, and\r\n // resubmitting with it would cancel that request.\r\n missRequest = { ...request };\r\n delete missRequest.restartToken;\r\n }\r\n\r\n const generation = this._generation;\r\n const response = await executeQueryRequest(missRequest);\r\n if (generation === this._generation && QueryMetadataCache.hasResult(response) && response.meta !== undefined && response.meta.length > 0)\r\n this.set(key, QueryMetadataCache.copy(response.meta));\r\n return response;\r\n }\r\n\r\n private static hasResult(response: DbQueryResponse): boolean {\r\n return response.status === DbResponseStatus.Done || response.status === DbResponseStatus.Partial;\r\n }\r\n}\r\n"]}
@@ -22,6 +22,15 @@ export declare const _cache: unique symbol;
22
22
  export declare const _instanceKeyCache: unique symbol;
23
23
  /** @internal */
24
24
  export declare const _activeTxn: unique symbol;
25
+ /** @internal */
26
+ export declare const _refreshIModelProps: unique symbol;
27
+ export declare const _refreshGeographicCoordinateSystem: unique symbol;
28
+ export declare const _verifyTxnWrite: unique symbol;
29
+ export declare const _updateIModelProps: unique symbol;
25
30
  export declare const _resetIModelDb: unique symbol;
26
31
  export declare const _onReservedElementInsert: unique symbol;
32
+ /** @internal */
33
+ export declare const _readerOptions: unique symbol;
34
+ /** @internal */
35
+ export declare const _appendToNativeUnifier: unique symbol;
27
36
  //# sourceMappingURL=Symbols.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Symbols.d.ts","sourceRoot":"","sources":["../../../src/internal/Symbols.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,eAAO,MAAM,yBAAyB,eAAmG,CAAC;AAM1I,eAAO,MAAM,MAAM,eAA2B,CAAC;AAC/C,eAAO,MAAM,kBAAkB,eAAuC,CAAC;AACvE,eAAO,MAAM,UAAU,eAA+B,CAAC;AACvD,eAAO,MAAM,QAAQ,eAA6B,CAAC;AACnD,eAAO,MAAM,IAAI,eAAyB,CAAC;AAC3C,gBAAgB;AAChB,eAAO,MAAM,YAAY,eAAiC,CAAC;AAC3D,gBAAgB;AAChB,eAAO,MAAM,SAAS,eAA8B,CAAC;AACrD,eAAO,MAAM,gBAAgB,eAAqC,CAAC;AACnE,eAAO,MAAM,cAAc,eAAmC,CAAC;AAC/D,gBAAgB;AAChB,eAAO,MAAM,UAAU,eAA+B,CAAC;AACvD,eAAO,MAAM,aAAa,eAAkC,CAAC;AAC7D,eAAO,MAAM,aAAa,eAAkC,CAAC;AAC7D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AM,cAAc,eAAmC,CAAC;AAC/D,eAAO,MAAM,wBAAwB,eAA6C,CAAC;AACnF,gBAAgB;AAChB,eAAO,MAAM,cAAc,eAAmC,CAAC;AAC/D,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,eAA2C,CAAC"}
@@ -29,6 +29,15 @@ export const _cache = Symbol.for(sym("cache"));
29
29
  export const _instanceKeyCache = Symbol.for(sym("instanceKeyCache"));
30
30
  /** @internal */
31
31
  export const _activeTxn = Symbol.for(sym("activeTxn"));
32
+ /** @internal */
33
+ export const _refreshIModelProps = Symbol.for(sym("refreshIModelProps"));
34
+ export const _refreshGeographicCoordinateSystem = Symbol.for(sym("refreshGeographicCoordinateSystem"));
35
+ export const _verifyTxnWrite = Symbol.for(sym("verifyTxnWrite"));
36
+ export const _updateIModelProps = Symbol.for(sym("updateIModelProps"));
32
37
  export const _resetIModelDb = Symbol.for(sym("resetIModelDb"));
33
38
  export const _onReservedElementInsert = Symbol.for(sym("onReservedElementInsert"));
39
+ /** @internal */
40
+ export const _readerOptions = Symbol.for(sym("readerOptions"));
41
+ /** @internal */
42
+ export const _appendToNativeUnifier = Symbol.for(sym("appendToNativeUnifier"));
34
43
  //# sourceMappingURL=Symbols.js.map