@itwin/core-backend 3.5.0-dev.8 → 3.5.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 (279) hide show
  1. package/CHANGELOG.md +112 -1
  2. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  3. package/lib/cjs/AliCloudStorageService.js +71 -71
  4. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  5. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  6. package/lib/cjs/BackendHubAccess.js +41 -41
  7. package/lib/cjs/BackendHubAccess.js.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  9. package/lib/cjs/BackendLoggerCategory.js +99 -99
  10. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  11. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  12. package/lib/cjs/BisCoreSchema.js +60 -60
  13. package/lib/cjs/BisCoreSchema.js.map +1 -1
  14. package/lib/cjs/BriefcaseManager.d.ts +170 -165
  15. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  16. package/lib/cjs/BriefcaseManager.js +413 -405
  17. package/lib/cjs/BriefcaseManager.js.map +1 -1
  18. package/lib/cjs/Category.d.ts +153 -153
  19. package/lib/cjs/Category.js +243 -243
  20. package/lib/cjs/Category.js.map +1 -1
  21. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  22. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  23. package/lib/cjs/ChangeSummaryManager.js +447 -445
  24. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  25. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  26. package/lib/cjs/ChangedElementsDb.js +165 -165
  27. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  28. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  29. package/lib/cjs/ChangedElementsManager.js +88 -88
  30. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  31. package/lib/cjs/CheckpointManager.d.ts +120 -120
  32. package/lib/cjs/CheckpointManager.js +343 -343
  33. package/lib/cjs/CheckpointManager.js.map +1 -1
  34. package/lib/cjs/ClassRegistry.d.ts +79 -71
  35. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  36. package/lib/cjs/ClassRegistry.js +249 -215
  37. package/lib/cjs/ClassRegistry.js.map +1 -1
  38. package/lib/cjs/CloudSqlite.d.ts +350 -349
  39. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  40. package/lib/cjs/CloudSqlite.js +152 -151
  41. package/lib/cjs/CloudSqlite.js.map +1 -1
  42. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  43. package/lib/cjs/CloudStorageBackend.js +173 -173
  44. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  45. package/lib/cjs/CodeService.d.ts +396 -396
  46. package/lib/cjs/CodeService.js +63 -63
  47. package/lib/cjs/CodeService.js.map +1 -1
  48. package/lib/cjs/CodeSpecs.d.ts +50 -50
  49. package/lib/cjs/CodeSpecs.js +112 -112
  50. package/lib/cjs/CodeSpecs.js.map +1 -1
  51. package/lib/cjs/ConcurrentQuery.d.ts +13 -11
  52. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  53. package/lib/cjs/ConcurrentQuery.js +36 -30
  54. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  55. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -32
  56. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  57. package/lib/cjs/CustomViewState3dCreator.js +81 -113
  58. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  59. package/lib/cjs/DevTools.d.ts +71 -71
  60. package/lib/cjs/DevTools.js +154 -154
  61. package/lib/cjs/DevTools.js.map +1 -1
  62. package/lib/cjs/DisplayStyle.d.ts +106 -106
  63. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  64. package/lib/cjs/DisplayStyle.js +256 -256
  65. package/lib/cjs/DisplayStyle.js.map +1 -1
  66. package/lib/cjs/ECDb.d.ts +191 -191
  67. package/lib/cjs/ECDb.js +350 -350
  68. package/lib/cjs/ECDb.js.map +1 -1
  69. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  70. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  71. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  72. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  73. package/lib/cjs/ECSqlStatement.js +791 -791
  74. package/lib/cjs/ECSqlStatement.js.map +1 -1
  75. package/lib/cjs/Element.d.ts +1102 -1109
  76. package/lib/cjs/Element.d.ts.map +1 -1
  77. package/lib/cjs/Element.js +1416 -1420
  78. package/lib/cjs/Element.js.map +1 -1
  79. package/lib/cjs/ElementAspect.d.ts +176 -156
  80. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  81. package/lib/cjs/ElementAspect.js +211 -178
  82. package/lib/cjs/ElementAspect.js.map +1 -1
  83. package/lib/cjs/ElementGraphics.d.ts +9 -9
  84. package/lib/cjs/ElementGraphics.js +41 -41
  85. package/lib/cjs/ElementGraphics.js.map +1 -1
  86. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  87. package/lib/cjs/ElementTreeWalker.js +409 -409
  88. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  89. package/lib/cjs/Entity.d.ts +106 -76
  90. package/lib/cjs/Entity.d.ts.map +1 -1
  91. package/lib/cjs/Entity.js +134 -82
  92. package/lib/cjs/Entity.js.map +1 -1
  93. package/lib/cjs/EntityReferences.d.ts +50 -0
  94. package/lib/cjs/EntityReferences.d.ts.map +1 -0
  95. package/lib/cjs/EntityReferences.js +96 -0
  96. package/lib/cjs/EntityReferences.js.map +1 -0
  97. package/lib/cjs/ExportGraphics.d.ts +317 -317
  98. package/lib/cjs/ExportGraphics.js +208 -208
  99. package/lib/cjs/ExportGraphics.js.map +1 -1
  100. package/lib/cjs/ExternalSource.d.ts +96 -94
  101. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  102. package/lib/cjs/ExternalSource.js +131 -125
  103. package/lib/cjs/ExternalSource.js.map +1 -1
  104. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  105. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  106. package/lib/cjs/GeoCoordConfig.js +85 -82
  107. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  108. package/lib/cjs/GeometrySummary.d.ts +4 -4
  109. package/lib/cjs/GeometrySummary.js +380 -380
  110. package/lib/cjs/GeometrySummary.js.map +1 -1
  111. package/lib/cjs/HubMock.d.ts +94 -93
  112. package/lib/cjs/HubMock.d.ts.map +1 -1
  113. package/lib/cjs/HubMock.js +222 -190
  114. package/lib/cjs/HubMock.js.map +1 -1
  115. package/lib/cjs/IModelCloneContext.d.ts +8 -85
  116. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  117. package/lib/cjs/IModelCloneContext.js +15 -150
  118. package/lib/cjs/IModelCloneContext.js.map +1 -1
  119. package/lib/cjs/IModelDb.d.ts +1183 -1164
  120. package/lib/cjs/IModelDb.d.ts.map +1 -1
  121. package/lib/cjs/IModelDb.js +2374 -2324
  122. package/lib/cjs/IModelDb.js.map +1 -1
  123. package/lib/cjs/IModelElementCloneContext.d.ts +90 -0
  124. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -0
  125. package/lib/cjs/IModelElementCloneContext.js +160 -0
  126. package/lib/cjs/IModelElementCloneContext.js.map +1 -0
  127. package/lib/cjs/IModelHost.d.ts +370 -361
  128. package/lib/cjs/IModelHost.d.ts.map +1 -1
  129. package/lib/cjs/IModelHost.js +496 -489
  130. package/lib/cjs/IModelHost.js.map +1 -1
  131. package/lib/cjs/IModelJsFs.d.ts +62 -62
  132. package/lib/cjs/IModelJsFs.js +140 -140
  133. package/lib/cjs/IModelJsFs.js.map +1 -1
  134. package/lib/cjs/IpcHost.d.ts +104 -98
  135. package/lib/cjs/IpcHost.d.ts.map +1 -1
  136. package/lib/cjs/IpcHost.js +278 -234
  137. package/lib/cjs/IpcHost.js.map +1 -1
  138. package/lib/cjs/LineStyle.d.ts +311 -311
  139. package/lib/cjs/LineStyle.js +295 -295
  140. package/lib/cjs/LineStyle.js.map +1 -1
  141. package/lib/cjs/LocalHub.d.ts +162 -162
  142. package/lib/cjs/LocalHub.js +587 -587
  143. package/lib/cjs/LocalHub.js.map +1 -1
  144. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  145. package/lib/cjs/LocalhostIpcHost.js +81 -81
  146. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  147. package/lib/cjs/Material.d.ts +103 -103
  148. package/lib/cjs/Material.js +147 -147
  149. package/lib/cjs/Material.js.map +1 -1
  150. package/lib/cjs/Model.d.ts +392 -386
  151. package/lib/cjs/Model.d.ts.map +1 -1
  152. package/lib/cjs/Model.js +485 -471
  153. package/lib/cjs/Model.js.map +1 -1
  154. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  155. package/lib/cjs/NativeAppStorage.js +202 -202
  156. package/lib/cjs/NativeAppStorage.js.map +1 -1
  157. package/lib/cjs/NativeHost.d.ts +52 -52
  158. package/lib/cjs/NativeHost.d.ts.map +1 -1
  159. package/lib/cjs/NativeHost.js +163 -168
  160. package/lib/cjs/NativeHost.js.map +1 -1
  161. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  162. package/lib/cjs/NavigationRelationship.js +225 -225
  163. package/lib/cjs/NavigationRelationship.js.map +1 -1
  164. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  165. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  166. package/lib/cjs/PromiseMemoizer.js +101 -101
  167. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  168. package/lib/cjs/PropertyStore.d.ts +132 -132
  169. package/lib/cjs/PropertyStore.js +11 -11
  170. package/lib/cjs/PropertyStore.js.map +1 -1
  171. package/lib/cjs/Relationship.d.ts +416 -400
  172. package/lib/cjs/Relationship.d.ts.map +1 -1
  173. package/lib/cjs/Relationship.js +494 -465
  174. package/lib/cjs/Relationship.js.map +1 -1
  175. package/lib/cjs/RpcBackend.d.ts +5 -28
  176. package/lib/cjs/RpcBackend.d.ts.map +1 -1
  177. package/lib/cjs/RpcBackend.js +31 -126
  178. package/lib/cjs/RpcBackend.js.map +1 -1
  179. package/lib/cjs/SQLiteDb.d.ts +219 -219
  180. package/lib/cjs/SQLiteDb.js +214 -214
  181. package/lib/cjs/SQLiteDb.js.map +1 -1
  182. package/lib/cjs/Schema.d.ts +55 -55
  183. package/lib/cjs/Schema.js +83 -83
  184. package/lib/cjs/Schema.js.map +1 -1
  185. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  186. package/lib/cjs/ServerBasedLocks.js +168 -168
  187. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  188. package/lib/cjs/SqliteStatement.d.ts +360 -283
  189. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  190. package/lib/cjs/SqliteStatement.js +586 -448
  191. package/lib/cjs/SqliteStatement.js.map +1 -1
  192. package/lib/cjs/Texture.d.ts +58 -58
  193. package/lib/cjs/Texture.js +82 -82
  194. package/lib/cjs/Texture.js.map +1 -1
  195. package/lib/cjs/TileStorage.d.ts +18 -18
  196. package/lib/cjs/TileStorage.js +90 -90
  197. package/lib/cjs/TileStorage.js.map +1 -1
  198. package/lib/cjs/TxnManager.d.ts +202 -202
  199. package/lib/cjs/TxnManager.js +356 -356
  200. package/lib/cjs/TxnManager.js.map +1 -1
  201. package/lib/cjs/ViewDefinition.d.ts +439 -435
  202. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  203. package/lib/cjs/ViewDefinition.js +646 -635
  204. package/lib/cjs/ViewDefinition.js.map +1 -1
  205. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  206. package/lib/cjs/ViewStateHydrator.js +103 -103
  207. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  208. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  209. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  210. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  211. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  212. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  213. package/lib/cjs/core-backend.d.ts +184 -182
  214. package/lib/cjs/core-backend.d.ts.map +1 -1
  215. package/lib/cjs/core-backend.js +204 -202
  216. package/lib/cjs/core-backend.js.map +1 -1
  217. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  218. package/lib/cjs/domains/FunctionalElements.js +145 -145
  219. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  220. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  221. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  222. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  223. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  224. package/lib/cjs/domains/GenericElements.js +263 -263
  225. package/lib/cjs/domains/GenericElements.js.map +1 -1
  226. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  227. package/lib/cjs/domains/GenericSchema.js +28 -28
  228. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  229. package/lib/cjs/rpc/multipart.d.ts +12 -0
  230. package/lib/cjs/rpc/multipart.d.ts.map +1 -0
  231. package/lib/cjs/rpc/multipart.js +71 -0
  232. package/lib/cjs/rpc/multipart.js.map +1 -0
  233. package/lib/cjs/rpc/tracing.d.ts +29 -0
  234. package/lib/cjs/rpc/tracing.d.ts.map +1 -0
  235. package/lib/cjs/rpc/tracing.js +74 -0
  236. package/lib/cjs/rpc/tracing.js.map +1 -0
  237. package/lib/cjs/rpc/web/logging.d.ts +10 -0
  238. package/lib/cjs/rpc/web/logging.d.ts.map +1 -0
  239. package/lib/cjs/rpc/web/logging.js +43 -0
  240. package/lib/cjs/rpc/web/logging.js.map +1 -0
  241. package/lib/cjs/rpc/web/request.d.ts +7 -0
  242. package/lib/cjs/rpc/web/request.d.ts.map +1 -0
  243. package/lib/cjs/rpc/web/request.js +74 -0
  244. package/lib/cjs/rpc/web/request.js.map +1 -0
  245. package/lib/cjs/rpc/web/response.d.ts +7 -0
  246. package/lib/cjs/rpc/web/response.d.ts.map +1 -0
  247. package/lib/cjs/rpc/web/response.js +106 -0
  248. package/lib/cjs/rpc/web/response.js.map +1 -0
  249. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  250. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  251. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  252. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -45
  253. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  254. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +291 -262
  255. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  256. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  257. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  258. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -204
  259. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  260. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  261. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  262. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  263. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  264. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  265. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  266. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  267. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  268. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  269. package/lib/cjs/workspace/Settings.d.ts +186 -186
  270. package/lib/cjs/workspace/Settings.js +155 -155
  271. package/lib/cjs/workspace/Settings.js.map +1 -1
  272. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  273. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  274. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  275. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  276. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  277. package/lib/cjs/workspace/Workspace.js +543 -543
  278. package/lib/cjs/workspace/Workspace.js.map +1 -1
  279. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"IModelJsFs.js","sourceRoot":"","sources":["../../src/IModelJsFs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,uBAAuB;AAEvB,+BAA+B;AAC/B,6BAA6B;AAE7B,uDAAuD;AACvD;;GAEG;AACH,MAAa,eAAe;IAC1B,YACS,IAAY,EACZ,OAAe,EACf,OAAe,EACf,WAAmB,EACnB,WAAoB,EACpB,MAAe,EACf,QAAiB,EACjB,cAAuB,EACvB,UAAmB;QARnB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAAS;QACpB,WAAM,GAAN,MAAM,CAAS;QACf,aAAQ,GAAR,QAAQ,CAAS;QACjB,mBAAc,GAAd,cAAc,CAAS;QACvB,eAAU,GAAV,UAAU,CAAS;IACxB,CAAC;CACN;AAZD,0CAYC;AAED;;GAEG;AACH,MAAa,UAAU;IAErB,oCAAoC;IAC7B,MAAM,CAAC,UAAU,CAAC,QAAgB,IAAa,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEvF,qBAAqB;IACd,MAAM,CAAC,UAAU,CAAC,QAAgB,IAAU,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE7E,mDAAmD;IAC5C,M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T,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAClC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACjC;iBAAM;gBACL,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACjC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAhID,gCAgIC","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\n/** @packageDocumentation\r\n * @module Portability\r\n */\r\n\r\n// cspell: ignore wflag\r\n\r\nimport * as fs from \"fs-extra\";\r\nimport * as path from \"path\";\r\n\r\n/* TODO: define File Mode Constants: S_IWUSR, et al. */\r\n/** Information about a file. See [[IModelJsFs.lstatSync]]\r\n * @public\r\n */\r\nexport class IModelJsFsStats {\r\n constructor(\r\n public size: number,\r\n public atimeMs: number,\r\n public mtimeMs: number,\r\n public birthtimeMs: number,\r\n public isDirectory: boolean,\r\n public isFile: boolean,\r\n public isSocket: boolean,\r\n public isSymbolicLink: boolean,\r\n public isReadOnly: boolean,\r\n ) { }\r\n}\r\n\r\n/** File system operations that are defined on all platforms. See also [[Platform]] and [[KnownLocations]]\r\n * @public\r\n */\r\nexport class IModelJsFs {\r\n\r\n /** Does file or directory exist? */\r\n public static existsSync(pathname: string): boolean { return fs.existsSync(pathname); }\r\n\r\n /** Delete a file. */\r\n public static unlinkSync(pathname: string): void { fs.unlinkSync(pathname); }\r\n\r\n /** Delete a file or remove a directory (rm -r). */\r\n public static removeSync(pathname: string): void { fs.removeSync(pathname); }\r\n\r\n /** Create a directory. */\r\n public static mkdirSync(pathname: string): void { fs.mkdirSync(pathname); }\r\n\r\n /** Remove a directory. */\r\n public static rmdirSync(pathname: string): void { fs.rmdirSync(pathname); }\r\n\r\n /** Write to a file. */\r\n public static writeFileSync(pathname: string, data: string | Uint8Array, wflag: string = \"w\"): void { fs.writeFileSync(pathname, data, { flag: wflag }); }\r\n\r\n /** Append to a file. */\r\n public static appendFileSync(pathname: string, str: string): void { fs.appendFileSync(pathname, str); }\r\n\r\n /** Make a copy of a file */\r\n public static copySync(src: string, dest: string, opts?: any): void { fs.copySync(src, dest, opts); }\r\n\r\n /** Gets the file and directory names in the specified directory. Excludes \".\" and \"..\". Returns an empty array if the specified directory does not exist. */\r\n public static readdirSync(pathname: string): string[] { return fs.existsSync(pathname) ? fs.readdirSync(pathname) : []; }\r\n\r\n /** Read file */\r\n public static readFileSync(pathname: string): string | Buffer { return fs.readFileSync(pathname); }\r\n\r\n /** Test if the current user has permission to write to a file. */\r\n private static isFileWritable(pathname: string): boolean {\r\n try {\r\n fs.accessSync(pathname, fs.constants.W_OK);\r\n return true;\r\n } catch (_err) {\r\n return false;\r\n }\r\n }\r\n\r\n /** Get information about a file. */\r\n public static lstatSync(pathname: string): IModelJsFsStats | undefined {\r\n const stats = fs.lstatSync(pathname);\r\n if (stats === undefined)\r\n return undefined;\r\n\r\n return new IModelJsFsStats(\r\n stats.size,\r\n stats.atime.getTime(),\r\n stats.mtime.getTime(),\r\n stats.birthtime.getTime(),\r\n stats.isDirectory(),\r\n stats.isFile(),\r\n stats.isSocket(),\r\n stats.isSymbolicLink(),\r\n !IModelJsFs.isFileWritable(pathname));\r\n }\r\n\r\n /**\r\n * Finds files recursively based on a pattern\r\n * @param rootDir Directory from where to start searching for files.\r\n * @param pattern A Regex that would be match to basename of files including extension\r\n * @returns list of file that match the pattern.\r\n */\r\n public static recursiveFindSync(rootDir: string, pattern: RegExp): string[] {\r\n const files: string[] = [];\r\n IModelJsFs.walkDirSync(rootDir, (pathname: string, isDir: boolean) => {\r\n if (!isDir) {\r\n const fileName = path.basename(pathname);\r\n if (pattern.test(fileName)) {\r\n files.push(pathname);\r\n }\r\n }\r\n return true;\r\n });\r\n return files;\r\n }\r\n\r\n /**\r\n * Walks a directory in breadth first fashion\r\n * @param rootDir directory from where the traversal starts\r\n * @param cb callback that would be called with full path of file or directory\r\n */\r\n public static walkDirSync(rootDir: string, cb: (pathname: string, isDir: boolean) => boolean): void {\r\n const subDir = [];\r\n for (const childPath of IModelJsFs.readdirSync(rootDir)) {\r\n const fullPath = path.join(rootDir, childPath);\r\n const isDir = IModelJsFs.lstatSync(fullPath)?.isDirectory;\r\n if (!cb(fullPath, isDir ?? false)) {\r\n return;\r\n }\r\n // Need to check if the directory still exists in case the callback has deleted it.\r\n if (isDir && IModelJsFs.existsSync(fullPath)) {\r\n subDir.push(fullPath);\r\n }\r\n }\r\n subDir.forEach((v) => {\r\n IModelJsFs.walkDirSync(v, cb);\r\n });\r\n }\r\n\r\n /** Create a directory, recursively setting up the path as necessary */\r\n public static recursiveMkDirSync(dirPath: string) {\r\n if (IModelJsFs.existsSync(dirPath))\r\n return;\r\n const parentPath = path.dirname(dirPath);\r\n if (parentPath !== dirPath)\r\n IModelJsFs.recursiveMkDirSync(parentPath);\r\n IModelJsFs.mkdirSync(dirPath);\r\n }\r\n\r\n /** Remove a directory, recursively */\r\n public static purgeDirSync(dirPath: string) {\r\n if (!IModelJsFs.existsSync(dirPath))\r\n return;\r\n\r\n IModelJsFs.walkDirSync(dirPath, (pathName: string, isDir: boolean) => {\r\n if (isDir) {\r\n IModelJsFs.purgeDirSync(pathName);\r\n IModelJsFs.removeSync(pathName);\r\n } else {\r\n IModelJsFs.unlinkSync(pathName);\r\n }\r\n return true;\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"IModelJsFs.js","sourceRoot":"","sources":["../../src/IModelJsFs.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,uBAAuB;AAEvB,+BAA+B;AAC/B,6BAA6B;AAE7B,uDAAuD;AACvD;;GAEG;AACH,MAAa,eAAe;IAC1B,YACS,IAAY,EACZ,OAAe,EACf,OAAe,EACf,WAAmB,EACnB,WAAoB,EACpB,MAAe,EACf,QA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,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,uEAAuE;IAChE,MAAM,CAAC,kBAAkB,CAAC,OAAe;QAC9C,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;YAChC,OAAO;QACT,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,UAAU,KAAK,OAAO;YACxB,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAC5C,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,sCAAsC;IAC/B,MAAM,CAAC,YAAY,CAAC,OAAe;QACxC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;YACjC,OAAO;QAET,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,QAAgB,EAAE,KAAc,EAAE,EAAE;YACnE,IAAI,KAAK,EAAE;gBACT,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAClC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACjC;iBAAM;gBACL,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACjC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAhID,gCAgIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Portability\n */\n\n// cspell: ignore wflag\n\nimport * as fs from \"fs-extra\";\nimport * as path from \"path\";\n\n/* TODO: define File Mode Constants: S_IWUSR, et al. */\n/** Information about a file. See [[IModelJsFs.lstatSync]]\n * @public\n */\nexport class IModelJsFsStats {\n constructor(\n public size: number,\n public atimeMs: number,\n public mtimeMs: number,\n public birthtimeMs: number,\n public isDirectory: boolean,\n public isFile: boolean,\n public isSocket: boolean,\n public isSymbolicLink: boolean,\n public isReadOnly: boolean,\n ) { }\n}\n\n/** File system operations that are defined on all platforms. See also [[Platform]] and [[KnownLocations]]\n * @public\n */\nexport class IModelJsFs {\n\n /** Does file or directory exist? */\n public static existsSync(pathname: string): boolean { return fs.existsSync(pathname); }\n\n /** Delete a file. */\n public static unlinkSync(pathname: string): void { fs.unlinkSync(pathname); }\n\n /** Delete a file or remove a directory (rm -r). */\n public static removeSync(pathname: string): void { fs.removeSync(pathname); }\n\n /** Create a directory. */\n public static mkdirSync(pathname: string): void { fs.mkdirSync(pathname); }\n\n /** Remove a directory. */\n public static rmdirSync(pathname: string): void { fs.rmdirSync(pathname); }\n\n /** Write to a file. */\n public static writeFileSync(pathname: string, data: string | Uint8Array, wflag: string = \"w\"): void { fs.writeFileSync(pathname, data, { flag: wflag }); }\n\n /** Append to a file. */\n public static appendFileSync(pathname: string, str: string): void { fs.appendFileSync(pathname, str); }\n\n /** Make a copy of a file */\n public static copySync(src: string, dest: string, opts?: any): void { fs.copySync(src, dest, opts); }\n\n /** Gets the file and directory names in the specified directory. Excludes \".\" and \"..\". Returns an empty array if the specified directory does not exist. */\n public static readdirSync(pathname: string): string[] { return fs.existsSync(pathname) ? fs.readdirSync(pathname) : []; }\n\n /** Read file */\n public static readFileSync(pathname: string): string | Buffer { return fs.readFileSync(pathname); }\n\n /** Test if the current user has permission to write to a file. */\n private static isFileWritable(pathname: string): boolean {\n try {\n fs.accessSync(pathname, fs.constants.W_OK);\n return true;\n } catch (_err) {\n return false;\n }\n }\n\n /** Get information about a file. */\n public static lstatSync(pathname: string): IModelJsFsStats | undefined {\n const stats = fs.lstatSync(pathname);\n if (stats === undefined)\n return undefined;\n\n return new IModelJsFsStats(\n stats.size,\n stats.atime.getTime(),\n stats.mtime.getTime(),\n stats.birthtime.getTime(),\n stats.isDirectory(),\n stats.isFile(),\n stats.isSocket(),\n stats.isSymbolicLink(),\n !IModelJsFs.isFileWritable(pathname));\n }\n\n /**\n * Finds files recursively based on a pattern\n * @param rootDir Directory from where to start searching for files.\n * @param pattern A Regex that would be match to basename of files including extension\n * @returns list of file that match the pattern.\n */\n public static recursiveFindSync(rootDir: string, pattern: RegExp): string[] {\n const files: string[] = [];\n IModelJsFs.walkDirSync(rootDir, (pathname: string, isDir: boolean) => {\n if (!isDir) {\n const fileName = path.basename(pathname);\n if (pattern.test(fileName)) {\n files.push(pathname);\n }\n }\n return true;\n });\n return files;\n }\n\n /**\n * Walks a directory in breadth first fashion\n * @param rootDir directory from where the traversal starts\n * @param cb callback that would be called with full path of file or directory\n */\n public static walkDirSync(rootDir: string, cb: (pathname: string, isDir: boolean) => boolean): void {\n const subDir = [];\n for (const childPath of IModelJsFs.readdirSync(rootDir)) {\n const fullPath = path.join(rootDir, childPath);\n const isDir = IModelJsFs.lstatSync(fullPath)?.isDirectory;\n if (!cb(fullPath, isDir ?? false)) {\n return;\n }\n // Need to check if the directory still exists in case the callback has deleted it.\n if (isDir && IModelJsFs.existsSync(fullPath)) {\n subDir.push(fullPath);\n }\n }\n subDir.forEach((v) => {\n IModelJsFs.walkDirSync(v, cb);\n });\n }\n\n /** Create a directory, recursively setting up the path as necessary */\n public static recursiveMkDirSync(dirPath: string) {\n if (IModelJsFs.existsSync(dirPath))\n return;\n const parentPath = path.dirname(dirPath);\n if (parentPath !== dirPath)\n IModelJsFs.recursiveMkDirSync(parentPath);\n IModelJsFs.mkdirSync(dirPath);\n }\n\n /** Remove a directory, recursively */\n public static purgeDirSync(dirPath: string) {\n if (!IModelJsFs.existsSync(dirPath))\n return;\n\n IModelJsFs.walkDirSync(dirPath, (pathName: string, isDir: boolean) => {\n if (isDir) {\n IModelJsFs.purgeDirSync(pathName);\n IModelJsFs.removeSync(pathName);\n } else {\n IModelJsFs.unlinkSync(pathName);\n }\n return true;\n });\n }\n}\n"]}
@@ -1,99 +1,105 @@
1
- /** @packageDocumentation
2
- * @module NativeApp
3
- */
4
- import { EditingScopeNotifications, IpcAppNotifications, IpcListener, IpcSocketBackend, RemoveFunction, TxnNotifications } from "@itwin/core-common";
5
- import { BriefcaseDb, StandaloneDb } from "./IModelDb";
6
- import { IModelHostOptions } from "./IModelHost";
7
- /**
8
- * Options for [[IpcHost.startup]]
9
- * @public
10
- */
11
- export interface IpcHostOpts {
12
- iModelHost?: IModelHostOptions;
13
- ipcHost?: {
14
- /** The Ipc socket to use for communications with frontend. Allows undefined only for headless tests. */
15
- socket?: IpcSocketBackend;
16
- /** don't send stack information on exceptions */
17
- exceptions?: {
18
- noStack?: boolean;
19
- };
20
- };
21
- }
22
- /**
23
- * Used by applications that have a dedicated backend. IpcHosts may send messages to their corresponding IpcApp.
24
- * @note if either end terminates, the other must too.
25
- * @public
26
- */
27
- export declare class IpcHost {
28
- static noStack: boolean;
29
- private static _ipc;
30
- /** Get the implementation of the [IpcSocketBackend]($common) interface. */
31
- private static get ipc();
32
- /** Determine whether Ipc is available for this backend. This will only be true if [[startup]] has been called on this class. */
33
- static get isValid(): boolean;
34
- /**
35
- * Send a message to the frontend over an Ipc channel.
36
- * @param channel the name of the channel matching the name registered with [[IpcApp.addListener]].
37
- * @param data The content of the message.
38
- */
39
- static send(channel: string, ...data: any[]): void;
40
- /**
41
- * Establish a handler for an Ipc channel to receive [[Frontend.invoke]] calls
42
- * @param channel The name of the channel for this handler.
43
- * @param handler A function that supplies the implementation for `channel`
44
- * @note returns A function to call to remove the handler.
45
- */
46
- static handle(channel: string, handler: (...args: any[]) => Promise<any>): RemoveFunction;
47
- /**
48
- * Establish a handler to receive messages sent via [[IpcApp.send]].
49
- * @param channel The name of the channel for the messages.
50
- * @param listener A function called when messages are sent over `channel`
51
- * @note returns A function to call to remove the listener.
52
- */
53
- static addListener(channel: string, listener: IpcListener): RemoveFunction;
54
- /**
55
- * Remove a previously registered listener
56
- * @param channel The name of the channel for the listener previously registered with [[addListener]]
57
- * @param listener The function passed to [[addListener]]
58
- */
59
- static removeListener(channel: string, listener: IpcListener): void;
60
- private static notify;
61
- /** @internal */
62
- static notifyIpcFrontend<T extends keyof IpcAppNotifications>(methodName: T, ...args: Parameters<IpcAppNotifications[T]>): void;
63
- /** @internal */
64
- static notifyTxns<T extends keyof TxnNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<TxnNotifications[T]>): void;
65
- /** @internal */
66
- static notifyEditingScope<T extends keyof EditingScopeNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<EditingScopeNotifications[T]>): void;
67
- /**
68
- * Start the backend of an Ipc app.
69
- * @param opt
70
- * @note this method calls [[IModelHost.startup]] internally.
71
- */
72
- static startup(opt?: IpcHostOpts): Promise<void>;
73
- /** Shutdown IpcHost backend. Also calls [[IModelHost.shutdown]] */
74
- static shutdown(): Promise<void>;
75
- }
76
- /**
77
- * Base class for all implementations of an Ipc interface.
78
- *
79
- * Create a subclass to implement your Ipc interface. Your class should be declared like this:
80
- * ```ts
81
- * class MyHandler extends IpcHandler implements MyInterface
82
- * ```
83
- * to ensure all methods and signatures are correct.
84
- *
85
- * Then, call `MyClass.register` at startup to connect your class to your channel.
86
- * @public
87
- */
88
- export declare abstract class IpcHandler {
89
- /** All subclasses must implement this method to specify their channel name. */
90
- abstract get channelName(): string;
91
- /**
92
- * Register this class as the handler for methods on its channel. This static method creates a new instance
93
- * that becomes the handler and is `this` when its methods are called.
94
- * @returns A function that can be called to remove the handler.
95
- * @note this method should only be called once per channel. If it is called multiple times, subsequent calls replace the previous ones.
96
- */
97
- static register(): RemoveFunction;
98
- }
1
+ /** @packageDocumentation
2
+ * @module NativeApp
3
+ */
4
+ import { EditingScopeNotifications, IpcAppNotifications, IpcListener, IpcSocketBackend, RemoveFunction, TxnNotifications } from "@itwin/core-common";
5
+ import { BriefcaseDb, StandaloneDb } from "./IModelDb";
6
+ import { IModelHostOptions } from "./IModelHost";
7
+ import { ProgressFunction, ProgressStatus } from "./CheckpointManager";
8
+ /**
9
+ * Options for [[IpcHost.startup]]
10
+ * @public
11
+ */
12
+ export interface IpcHostOpts {
13
+ iModelHost?: IModelHostOptions;
14
+ ipcHost?: {
15
+ /** The Ipc socket to use for communications with frontend. Allows undefined only for headless tests. */
16
+ socket?: IpcSocketBackend;
17
+ /** don't send stack information on exceptions */
18
+ exceptions?: {
19
+ noStack?: boolean;
20
+ };
21
+ };
22
+ }
23
+ /**
24
+ * Used by applications that have a dedicated backend. IpcHosts may send messages to their corresponding IpcApp.
25
+ * @note if either end terminates, the other must too.
26
+ * @public
27
+ */
28
+ export declare class IpcHost {
29
+ static noStack: boolean;
30
+ private static _ipc;
31
+ /** Get the implementation of the [IpcSocketBackend]($common) interface. */
32
+ private static get ipc();
33
+ /** Determine whether Ipc is available for this backend. This will only be true if [[startup]] has been called on this class. */
34
+ static get isValid(): boolean;
35
+ /**
36
+ * Send a message to the frontend over an Ipc channel.
37
+ * @param channel the name of the channel matching the name registered with [[IpcApp.addListener]].
38
+ * @param data The content of the message.
39
+ */
40
+ static send(channel: string, ...data: any[]): void;
41
+ /**
42
+ * Establish a handler for an Ipc channel to receive [[Frontend.invoke]] calls
43
+ * @param channel The name of the channel for this handler.
44
+ * @param handler A function that supplies the implementation for `channel`
45
+ * @note returns A function to call to remove the handler.
46
+ */
47
+ static handle(channel: string, handler: (...args: any[]) => Promise<any>): RemoveFunction;
48
+ /**
49
+ * Establish a handler to receive messages sent via [[IpcApp.send]].
50
+ * @param channel The name of the channel for the messages.
51
+ * @param listener A function called when messages are sent over `channel`
52
+ * @note returns A function to call to remove the listener.
53
+ */
54
+ static addListener(channel: string, listener: IpcListener): RemoveFunction;
55
+ /**
56
+ * Remove a previously registered listener
57
+ * @param channel The name of the channel for the listener previously registered with [[addListener]]
58
+ * @param listener The function passed to [[addListener]]
59
+ */
60
+ static removeListener(channel: string, listener: IpcListener): void;
61
+ private static notify;
62
+ /** @internal */
63
+ static notifyIpcFrontend<T extends keyof IpcAppNotifications>(methodName: T, ...args: Parameters<IpcAppNotifications[T]>): void;
64
+ /** @internal */
65
+ static notifyTxns<T extends keyof TxnNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<TxnNotifications[T]>): void;
66
+ /** @internal */
67
+ static notifyEditingScope<T extends keyof EditingScopeNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<EditingScopeNotifications[T]>): void;
68
+ /**
69
+ * Start the backend of an Ipc app.
70
+ * @param opt
71
+ * @note this method calls [[IModelHost.startup]] internally.
72
+ */
73
+ static startup(opt?: IpcHostOpts): Promise<void>;
74
+ /** Shutdown IpcHost backend. Also calls [[IModelHost.shutdown]] */
75
+ static shutdown(): Promise<void>;
76
+ }
77
+ /**
78
+ * Base class for all implementations of an Ipc interface.
79
+ *
80
+ * Create a subclass to implement your Ipc interface. Your class should be declared like this:
81
+ * ```ts
82
+ * class MyHandler extends IpcHandler implements MyInterface
83
+ * ```
84
+ * to ensure all methods and signatures are correct.
85
+ *
86
+ * Then, call `MyClass.register` at startup to connect your class to your channel.
87
+ * @public
88
+ */
89
+ export declare abstract class IpcHandler {
90
+ /** All subclasses must implement this method to specify their channel name. */
91
+ abstract get channelName(): string;
92
+ /**
93
+ * Register this class as the handler for methods on its channel. This static method creates a new instance
94
+ * that becomes the handler and is `this` when its methods are called.
95
+ * @returns A function that can be called to remove the handler.
96
+ * @note this method should only be called once per channel. If it is called multiple times, subsequent calls replace the previous ones.
97
+ */
98
+ static register(): RemoveFunction;
99
+ }
100
+ /**
101
+ * Prevents progress callback being called more frequently when provided interval.
102
+ * @internal
103
+ */
104
+ export declare function throttleProgressCallback(func: ProgressFunction, checkAbort: () => ProgressStatus, progressInterval?: number): ProgressFunction;
99
105
  //# sourceMappingURL=IpcHost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IpcHost.d.ts","sourceRoot":"","sources":["../../src/IpcHost.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACgC,yBAAyB,EAC9D,mBAAmB,E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