@itwin/core-backend 3.4.0-dev.9 → 3.4.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 (270) hide show
  1. package/CHANGELOG.md +97 -1
  2. package/lib/cjs/AliCloudStorageService.d.ts +23 -17
  3. package/lib/cjs/AliCloudStorageService.d.ts.map +1 -1
  4. package/lib/cjs/AliCloudStorageService.js +71 -68
  5. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  6. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  7. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  8. package/lib/cjs/BackendHubAccess.js +41 -41
  9. package/lib/cjs/BackendHubAccess.js.map +1 -1
  10. package/lib/cjs/BackendLoggerCategory.d.ts +91 -87
  11. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  12. package/lib/cjs/BackendLoggerCategory.js +99 -95
  13. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  14. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  15. package/lib/cjs/BisCoreSchema.js +60 -60
  16. package/lib/cjs/BisCoreSchema.js.map +1 -1
  17. package/lib/cjs/BriefcaseManager.d.ts +165 -165
  18. package/lib/cjs/BriefcaseManager.js +405 -405
  19. package/lib/cjs/BriefcaseManager.js.map +1 -1
  20. package/lib/cjs/Category.d.ts +153 -153
  21. package/lib/cjs/Category.js +243 -243
  22. package/lib/cjs/Category.js.map +1 -1
  23. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  24. package/lib/cjs/ChangeSummaryManager.js +445 -445
  25. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  26. package/lib/cjs/ChangedElementsDb.d.ts +99 -98
  27. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
  28. package/lib/cjs/ChangedElementsDb.js +165 -165
  29. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  30. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  31. package/lib/cjs/ChangedElementsManager.js +88 -88
  32. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  33. package/lib/cjs/CheckpointManager.d.ts +120 -122
  34. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  35. package/lib/cjs/CheckpointManager.js +343 -354
  36. package/lib/cjs/CheckpointManager.js.map +1 -1
  37. package/lib/cjs/ClassRegistry.d.ts +72 -71
  38. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  39. package/lib/cjs/ClassRegistry.js +243 -213
  40. package/lib/cjs/ClassRegistry.js.map +1 -1
  41. package/lib/cjs/CloudSqlite.d.ts +350 -0
  42. package/lib/cjs/CloudSqlite.d.ts.map +1 -0
  43. package/lib/cjs/CloudSqlite.js +152 -0
  44. package/lib/cjs/CloudSqlite.js.map +1 -0
  45. package/lib/cjs/CloudStorageBackend.d.ts +58 -46
  46. package/lib/cjs/CloudStorageBackend.d.ts.map +1 -1
  47. package/lib/cjs/CloudStorageBackend.js +173 -164
  48. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  49. package/lib/cjs/CodeService.d.ts +397 -0
  50. package/lib/cjs/CodeService.d.ts.map +1 -0
  51. package/lib/cjs/CodeService.js +64 -0
  52. package/lib/cjs/CodeService.js.map +1 -0
  53. package/lib/cjs/CodeSpecs.d.ts +50 -50
  54. package/lib/cjs/CodeSpecs.js +112 -112
  55. package/lib/cjs/CodeSpecs.js.map +1 -1
  56. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  57. package/lib/cjs/ConcurrentQuery.js +30 -30
  58. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  59. package/lib/cjs/CustomViewState3dCreator.d.ts +32 -32
  60. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  61. package/lib/cjs/CustomViewState3dCreator.js +113 -98
  62. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  63. package/lib/cjs/DevTools.d.ts +71 -71
  64. package/lib/cjs/DevTools.d.ts.map +1 -1
  65. package/lib/cjs/DevTools.js +154 -154
  66. package/lib/cjs/DevTools.js.map +1 -1
  67. package/lib/cjs/DisplayStyle.d.ts +106 -106
  68. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  69. package/lib/cjs/DisplayStyle.js +256 -256
  70. package/lib/cjs/DisplayStyle.js.map +1 -1
  71. package/lib/cjs/ECDb.d.ts +191 -191
  72. package/lib/cjs/ECDb.js +350 -350
  73. package/lib/cjs/ECDb.js.map +1 -1
  74. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  75. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  76. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  77. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  78. package/lib/cjs/ECSqlStatement.js +791 -791
  79. package/lib/cjs/ECSqlStatement.js.map +1 -1
  80. package/lib/cjs/Element.d.ts +1120 -1109
  81. package/lib/cjs/Element.d.ts.map +1 -1
  82. package/lib/cjs/Element.js +1438 -1417
  83. package/lib/cjs/Element.js.map +1 -1
  84. package/lib/cjs/ElementAspect.d.ts +158 -156
  85. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  86. package/lib/cjs/ElementAspect.js +186 -178
  87. package/lib/cjs/ElementAspect.js.map +1 -1
  88. package/lib/cjs/ElementGraphics.d.ts +9 -9
  89. package/lib/cjs/ElementGraphics.js +41 -41
  90. package/lib/cjs/ElementGraphics.js.map +1 -1
  91. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  92. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  93. package/lib/cjs/ElementTreeWalker.js +409 -409
  94. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  95. package/lib/cjs/Entity.d.ts +106 -76
  96. package/lib/cjs/Entity.d.ts.map +1 -1
  97. package/lib/cjs/Entity.js +134 -82
  98. package/lib/cjs/Entity.js.map +1 -1
  99. package/lib/cjs/EntityReferences.d.ts +46 -0
  100. package/lib/cjs/EntityReferences.d.ts.map +1 -0
  101. package/lib/cjs/EntityReferences.js +92 -0
  102. package/lib/cjs/EntityReferences.js.map +1 -0
  103. package/lib/cjs/ExportGraphics.d.ts +317 -317
  104. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  105. package/lib/cjs/ExportGraphics.js +208 -208
  106. package/lib/cjs/ExportGraphics.js.map +1 -1
  107. package/lib/cjs/ExternalSource.d.ts +96 -94
  108. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  109. package/lib/cjs/ExternalSource.js +131 -125
  110. package/lib/cjs/ExternalSource.js.map +1 -1
  111. package/lib/cjs/GeoCoordConfig.d.ts +19 -13
  112. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  113. package/lib/cjs/GeoCoordConfig.js +82 -73
  114. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  115. package/lib/cjs/GeometrySummary.d.ts +4 -4
  116. package/lib/cjs/GeometrySummary.js +380 -380
  117. package/lib/cjs/GeometrySummary.js.map +1 -1
  118. package/lib/cjs/HubMock.d.ts +93 -93
  119. package/lib/cjs/HubMock.d.ts.map +1 -1
  120. package/lib/cjs/HubMock.js +190 -190
  121. package/lib/cjs/HubMock.js.map +1 -1
  122. package/lib/cjs/IModelCloneContext.d.ts +89 -85
  123. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  124. package/lib/cjs/IModelCloneContext.js +159 -150
  125. package/lib/cjs/IModelCloneContext.js.map +1 -1
  126. package/lib/cjs/IModelDb.d.ts +1164 -1151
  127. package/lib/cjs/IModelDb.d.ts.map +1 -1
  128. package/lib/cjs/IModelDb.js +2324 -2286
  129. package/lib/cjs/IModelDb.js.map +1 -1
  130. package/lib/cjs/IModelHost.d.ts +361 -347
  131. package/lib/cjs/IModelHost.d.ts.map +1 -1
  132. package/lib/cjs/IModelHost.js +489 -455
  133. package/lib/cjs/IModelHost.js.map +1 -1
  134. package/lib/cjs/IModelJsFs.d.ts +62 -62
  135. package/lib/cjs/IModelJsFs.d.ts.map +1 -1
  136. package/lib/cjs/IModelJsFs.js +140 -140
  137. package/lib/cjs/IModelJsFs.js.map +1 -1
  138. package/lib/cjs/IpcHost.d.ts +98 -98
  139. package/lib/cjs/IpcHost.js +234 -234
  140. package/lib/cjs/IpcHost.js.map +1 -1
  141. package/lib/cjs/LineStyle.d.ts +311 -311
  142. package/lib/cjs/LineStyle.js +295 -295
  143. package/lib/cjs/LineStyle.js.map +1 -1
  144. package/lib/cjs/LocalHub.d.ts +162 -162
  145. package/lib/cjs/LocalHub.js +587 -587
  146. package/lib/cjs/LocalHub.js.map +1 -1
  147. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  148. package/lib/cjs/LocalhostIpcHost.js +81 -81
  149. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  150. package/lib/cjs/Material.d.ts +103 -101
  151. package/lib/cjs/Material.d.ts.map +1 -1
  152. package/lib/cjs/Material.js +147 -145
  153. package/lib/cjs/Material.js.map +1 -1
  154. package/lib/cjs/Model.d.ts +388 -386
  155. package/lib/cjs/Model.d.ts.map +1 -1
  156. package/lib/cjs/Model.js +479 -468
  157. package/lib/cjs/Model.js.map +1 -1
  158. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  159. package/lib/cjs/NativeAppStorage.js +202 -202
  160. package/lib/cjs/NativeAppStorage.js.map +1 -1
  161. package/lib/cjs/NativeHost.d.ts +52 -52
  162. package/lib/cjs/NativeHost.js +168 -168
  163. package/lib/cjs/NativeHost.js.map +1 -1
  164. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  165. package/lib/cjs/NavigationRelationship.js +225 -225
  166. package/lib/cjs/NavigationRelationship.js.map +1 -1
  167. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  168. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  169. package/lib/cjs/PromiseMemoizer.js +101 -95
  170. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  171. package/lib/cjs/PropertyStore.d.ts +133 -0
  172. package/lib/cjs/PropertyStore.d.ts.map +1 -0
  173. package/lib/cjs/PropertyStore.js +12 -0
  174. package/lib/cjs/PropertyStore.js.map +1 -0
  175. package/lib/cjs/Relationship.d.ts +416 -400
  176. package/lib/cjs/Relationship.d.ts.map +1 -1
  177. package/lib/cjs/Relationship.js +494 -465
  178. package/lib/cjs/Relationship.js.map +1 -1
  179. package/lib/cjs/RpcBackend.d.ts +28 -28
  180. package/lib/cjs/RpcBackend.js +126 -126
  181. package/lib/cjs/RpcBackend.js.map +1 -1
  182. package/lib/cjs/SQLiteDb.d.ts +219 -173
  183. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  184. package/lib/cjs/SQLiteDb.js +214 -211
  185. package/lib/cjs/SQLiteDb.js.map +1 -1
  186. package/lib/cjs/Schema.d.ts +55 -55
  187. package/lib/cjs/Schema.js +83 -83
  188. package/lib/cjs/Schema.js.map +1 -1
  189. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  190. package/lib/cjs/ServerBasedLocks.js +168 -168
  191. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  192. package/lib/cjs/SqliteStatement.d.ts +283 -271
  193. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  194. package/lib/cjs/SqliteStatement.js +448 -426
  195. package/lib/cjs/SqliteStatement.js.map +1 -1
  196. package/lib/cjs/Texture.d.ts +58 -58
  197. package/lib/cjs/Texture.js +82 -82
  198. package/lib/cjs/Texture.js.map +1 -1
  199. package/lib/cjs/TileStorage.d.ts +19 -0
  200. package/lib/cjs/TileStorage.d.ts.map +1 -0
  201. package/lib/cjs/TileStorage.js +91 -0
  202. package/lib/cjs/TileStorage.js.map +1 -0
  203. package/lib/cjs/TxnManager.d.ts +202 -202
  204. package/lib/cjs/TxnManager.d.ts.map +1 -1
  205. package/lib/cjs/TxnManager.js +356 -353
  206. package/lib/cjs/TxnManager.js.map +1 -1
  207. package/lib/cjs/ViewDefinition.d.ts +439 -435
  208. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  209. package/lib/cjs/ViewDefinition.js +646 -629
  210. package/lib/cjs/ViewDefinition.js.map +1 -1
  211. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  212. package/lib/cjs/ViewStateHydrator.js +103 -103
  213. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  214. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  215. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  216. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -21
  217. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  218. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  219. package/lib/cjs/core-backend.d.ts +183 -175
  220. package/lib/cjs/core-backend.d.ts.map +1 -1
  221. package/lib/cjs/core-backend.js +203 -195
  222. package/lib/cjs/core-backend.js.map +1 -1
  223. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  224. package/lib/cjs/domains/FunctionalElements.js +145 -145
  225. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  226. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  227. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  228. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  229. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  230. package/lib/cjs/domains/GenericElements.js +263 -263
  231. package/lib/cjs/domains/GenericElements.js.map +1 -1
  232. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  233. package/lib/cjs/domains/GenericSchema.js +28 -28
  234. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  235. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  236. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  237. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  238. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +45 -45
  239. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +262 -262
  240. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  241. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -20
  242. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  243. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +204 -195
  244. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  245. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  246. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  247. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -165
  248. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  249. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  250. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  251. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  252. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  253. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  254. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  255. package/lib/cjs/workspace/Settings.d.ts +186 -186
  256. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  257. package/lib/cjs/workspace/Settings.js +155 -152
  258. package/lib/cjs/workspace/Settings.js.map +1 -1
  259. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  260. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  261. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  262. package/lib/cjs/workspace/Workspace.d.ts +414 -401
  263. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  264. package/lib/cjs/workspace/Workspace.js +543 -534
  265. package/lib/cjs/workspace/Workspace.js.map +1 -1
  266. package/package.json +20 -20
  267. package/lib/cjs/IModelSchemaLoader.d.ts +0 -26
  268. package/lib/cjs/IModelSchemaLoader.d.ts.map +0 -1
  269. package/lib/cjs/IModelSchemaLoader.js +0 -122
  270. package/lib/cjs/IModelSchemaLoader.js.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AE;gBACjC,OAAO;aACR;YACD,mFAAmF;YACnF,IAAI,KAAK,IAAI,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;gBAC5C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACvB;SACF;QACD,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACnB,UAAU,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":["/*---------------------------------------------------------------------------------------------\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 /** Get the file and directory names in the specified directory. Excludes \".\" and \"..\". */\r\n public static readdirSync(pathname: string): string[] { return 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,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,QAAg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C/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,99 @@
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
+ /**
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
+ }
99
99
  //# sourceMappingURL=IpcHost.d.ts.map