@itwin/core-backend 3.6.1 → 3.7.0-dev.2

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 (245) hide show
  1. package/CHANGELOG.md +67 -72
  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 -170
  15. package/lib/cjs/BriefcaseManager.js +414 -414
  16. package/lib/cjs/BriefcaseManager.js.map +1 -1
  17. package/lib/cjs/Category.d.ts +153 -153
  18. package/lib/cjs/Category.js +243 -243
  19. package/lib/cjs/Category.js.map +1 -1
  20. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  21. package/lib/cjs/ChangeSummaryManager.js +447 -447
  22. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  23. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  24. package/lib/cjs/ChangedElementsDb.js +165 -165
  25. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  26. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  27. package/lib/cjs/ChangedElementsManager.js +88 -88
  28. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  29. package/lib/cjs/CheckpointManager.d.ts +121 -121
  30. package/lib/cjs/CheckpointManager.js +349 -349
  31. package/lib/cjs/CheckpointManager.js.map +1 -1
  32. package/lib/cjs/ClassRegistry.d.ts +79 -79
  33. package/lib/cjs/ClassRegistry.js +250 -250
  34. package/lib/cjs/ClassRegistry.js.map +1 -1
  35. package/lib/cjs/CloudSqlite.d.ts +350 -350
  36. package/lib/cjs/CloudSqlite.js +153 -153
  37. package/lib/cjs/CloudSqlite.js.map +1 -1
  38. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  39. package/lib/cjs/CloudStorageBackend.js +173 -173
  40. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  41. package/lib/cjs/CodeService.d.ts +396 -396
  42. package/lib/cjs/CodeService.js +63 -63
  43. package/lib/cjs/CodeService.js.map +1 -1
  44. package/lib/cjs/CodeSpecs.d.ts +55 -55
  45. package/lib/cjs/CodeSpecs.js +124 -124
  46. package/lib/cjs/CodeSpecs.js.map +1 -1
  47. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  48. package/lib/cjs/ConcurrentQuery.js +36 -36
  49. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  50. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  51. package/lib/cjs/CustomViewState3dCreator.js +81 -81
  52. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  53. package/lib/cjs/DevTools.d.ts +71 -71
  54. package/lib/cjs/DevTools.js +154 -154
  55. package/lib/cjs/DevTools.js.map +1 -1
  56. package/lib/cjs/DisplayStyle.d.ts +106 -106
  57. package/lib/cjs/DisplayStyle.js +256 -256
  58. package/lib/cjs/DisplayStyle.js.map +1 -1
  59. package/lib/cjs/ECDb.d.ts +191 -191
  60. package/lib/cjs/ECDb.js +350 -350
  61. package/lib/cjs/ECDb.js.map +1 -1
  62. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  63. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  64. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  65. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  66. package/lib/cjs/ECSqlStatement.js +791 -791
  67. package/lib/cjs/ECSqlStatement.js.map +1 -1
  68. package/lib/cjs/Element.d.ts +1109 -1109
  69. package/lib/cjs/Element.js +1427 -1427
  70. package/lib/cjs/Element.js.map +1 -1
  71. package/lib/cjs/ElementAspect.d.ts +179 -179
  72. package/lib/cjs/ElementAspect.js +211 -211
  73. package/lib/cjs/ElementAspect.js.map +1 -1
  74. package/lib/cjs/ElementGraphics.d.ts +9 -9
  75. package/lib/cjs/ElementGraphics.js +41 -41
  76. package/lib/cjs/ElementGraphics.js.map +1 -1
  77. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  78. package/lib/cjs/ElementTreeWalker.js +409 -409
  79. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  80. package/lib/cjs/Entity.d.ts +106 -106
  81. package/lib/cjs/Entity.js +134 -134
  82. package/lib/cjs/Entity.js.map +1 -1
  83. package/lib/cjs/EntityReferences.d.ts +49 -49
  84. package/lib/cjs/EntityReferences.js +95 -95
  85. package/lib/cjs/EntityReferences.js.map +1 -1
  86. package/lib/cjs/ExportGraphics.d.ts +317 -317
  87. package/lib/cjs/ExportGraphics.js +208 -208
  88. package/lib/cjs/ExportGraphics.js.map +1 -1
  89. package/lib/cjs/ExternalSource.d.ts +96 -96
  90. package/lib/cjs/ExternalSource.js +131 -131
  91. package/lib/cjs/ExternalSource.js.map +1 -1
  92. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  93. package/lib/cjs/GeoCoordConfig.js +85 -85
  94. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  95. package/lib/cjs/GeometrySummary.d.ts +4 -4
  96. package/lib/cjs/GeometrySummary.js +380 -380
  97. package/lib/cjs/GeometrySummary.js.map +1 -1
  98. package/lib/cjs/HubMock.d.ts +94 -94
  99. package/lib/cjs/HubMock.js +222 -222
  100. package/lib/cjs/HubMock.js.map +1 -1
  101. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  102. package/lib/cjs/IModelCloneContext.js +15 -15
  103. package/lib/cjs/IModelCloneContext.js.map +1 -1
  104. package/lib/cjs/IModelDb.d.ts +1210 -1210
  105. package/lib/cjs/IModelDb.js +2386 -2386
  106. package/lib/cjs/IModelDb.js.map +1 -1
  107. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  108. package/lib/cjs/IModelElementCloneContext.js +159 -159
  109. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  110. package/lib/cjs/IModelHost.d.ts +369 -369
  111. package/lib/cjs/IModelHost.d.ts.map +1 -1
  112. package/lib/cjs/IModelHost.js +496 -496
  113. package/lib/cjs/IModelHost.js.map +1 -1
  114. package/lib/cjs/IModelJsFs.d.ts +62 -62
  115. package/lib/cjs/IModelJsFs.js +140 -140
  116. package/lib/cjs/IModelJsFs.js.map +1 -1
  117. package/lib/cjs/IpcHost.d.ts +104 -104
  118. package/lib/cjs/IpcHost.js +278 -278
  119. package/lib/cjs/IpcHost.js.map +1 -1
  120. package/lib/cjs/LineStyle.d.ts +311 -311
  121. package/lib/cjs/LineStyle.js +295 -295
  122. package/lib/cjs/LineStyle.js.map +1 -1
  123. package/lib/cjs/LocalHub.d.ts +162 -162
  124. package/lib/cjs/LocalHub.js +585 -585
  125. package/lib/cjs/LocalHub.js.map +1 -1
  126. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  127. package/lib/cjs/LocalhostIpcHost.js +81 -81
  128. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  129. package/lib/cjs/Material.d.ts +131 -131
  130. package/lib/cjs/Material.js +181 -181
  131. package/lib/cjs/Material.js.map +1 -1
  132. package/lib/cjs/Model.d.ts +392 -392
  133. package/lib/cjs/Model.js +485 -485
  134. package/lib/cjs/Model.js.map +1 -1
  135. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  136. package/lib/cjs/NativeAppStorage.js +202 -202
  137. package/lib/cjs/NativeAppStorage.js.map +1 -1
  138. package/lib/cjs/NativeHost.d.ts +52 -52
  139. package/lib/cjs/NativeHost.js +163 -163
  140. package/lib/cjs/NativeHost.js.map +1 -1
  141. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  142. package/lib/cjs/NavigationRelationship.js +225 -225
  143. package/lib/cjs/NavigationRelationship.js.map +1 -1
  144. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  145. package/lib/cjs/PromiseMemoizer.js +101 -101
  146. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  147. package/lib/cjs/PropertyStore.d.ts +132 -132
  148. package/lib/cjs/PropertyStore.js +11 -11
  149. package/lib/cjs/PropertyStore.js.map +1 -1
  150. package/lib/cjs/Relationship.d.ts +416 -416
  151. package/lib/cjs/Relationship.js +494 -494
  152. package/lib/cjs/Relationship.js.map +1 -1
  153. package/lib/cjs/RpcBackend.d.ts +5 -5
  154. package/lib/cjs/RpcBackend.js +32 -32
  155. package/lib/cjs/RpcBackend.js.map +1 -1
  156. package/lib/cjs/SQLiteDb.d.ts +219 -219
  157. package/lib/cjs/SQLiteDb.js +214 -214
  158. package/lib/cjs/SQLiteDb.js.map +1 -1
  159. package/lib/cjs/Schema.d.ts +55 -55
  160. package/lib/cjs/Schema.js +83 -83
  161. package/lib/cjs/Schema.js.map +1 -1
  162. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  163. package/lib/cjs/ServerBasedLocks.js +168 -168
  164. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  165. package/lib/cjs/SqliteStatement.d.ts +360 -360
  166. package/lib/cjs/SqliteStatement.js +586 -586
  167. package/lib/cjs/SqliteStatement.js.map +1 -1
  168. package/lib/cjs/Texture.d.ts +58 -58
  169. package/lib/cjs/Texture.js +82 -82
  170. package/lib/cjs/Texture.js.map +1 -1
  171. package/lib/cjs/TileStorage.d.ts +18 -18
  172. package/lib/cjs/TileStorage.js +90 -90
  173. package/lib/cjs/TileStorage.js.map +1 -1
  174. package/lib/cjs/TxnManager.d.ts +202 -202
  175. package/lib/cjs/TxnManager.js +356 -356
  176. package/lib/cjs/TxnManager.js.map +1 -1
  177. package/lib/cjs/ViewDefinition.d.ts +439 -439
  178. package/lib/cjs/ViewDefinition.js +646 -646
  179. package/lib/cjs/ViewDefinition.js.map +1 -1
  180. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  181. package/lib/cjs/ViewStateHydrator.js +103 -103
  182. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  183. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  184. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  185. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  186. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  187. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  188. package/lib/cjs/core-backend.d.ts +184 -184
  189. package/lib/cjs/core-backend.js +204 -204
  190. package/lib/cjs/core-backend.js.map +1 -1
  191. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  192. package/lib/cjs/domains/FunctionalElements.js +145 -145
  193. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  194. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  195. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  196. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  197. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  198. package/lib/cjs/domains/GenericElements.js +263 -263
  199. package/lib/cjs/domains/GenericElements.js.map +1 -1
  200. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  201. package/lib/cjs/domains/GenericSchema.js +28 -28
  202. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  203. package/lib/cjs/rpc/multipart.d.ts +11 -11
  204. package/lib/cjs/rpc/multipart.js +71 -71
  205. package/lib/cjs/rpc/multipart.js.map +1 -1
  206. package/lib/cjs/rpc/tracing.d.ts +28 -28
  207. package/lib/cjs/rpc/tracing.js +74 -74
  208. package/lib/cjs/rpc/tracing.js.map +1 -1
  209. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  210. package/lib/cjs/rpc/web/logging.js +43 -43
  211. package/lib/cjs/rpc/web/logging.js.map +1 -1
  212. package/lib/cjs/rpc/web/request.d.ts +6 -6
  213. package/lib/cjs/rpc/web/request.js +74 -74
  214. package/lib/cjs/rpc/web/request.js.map +1 -1
  215. package/lib/cjs/rpc/web/response.d.ts +6 -6
  216. package/lib/cjs/rpc/web/response.js +106 -106
  217. package/lib/cjs/rpc/web/response.js.map +1 -1
  218. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  219. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  220. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  221. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  222. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +294 -294
  223. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  224. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  225. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +205 -205
  226. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  227. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  228. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  229. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  230. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  231. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  232. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  233. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  234. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  235. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  236. package/lib/cjs/workspace/Settings.d.ts +186 -186
  237. package/lib/cjs/workspace/Settings.js +155 -155
  238. package/lib/cjs/workspace/Settings.js.map +1 -1
  239. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  240. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  241. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  242. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  243. package/lib/cjs/workspace/Workspace.js +543 -543
  244. package/lib/cjs/workspace/Workspace.js.map +1 -1
  245. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,11 +1,6 @@
1
1
  # Change Log - @itwin/core-backend
2
2
 
3
- This log was last generated on Fri, 24 Feb 2023 22:00:48 GMT and should not be manually modified.
4
-
5
- ## 3.6.1
6
- Fri, 24 Feb 2023 22:00:48 GMT
7
-
8
- _Version update only_
3
+ This log was last generated on Wed, 08 Feb 2023 14:58:39 GMT and should not be manually modified.
9
4
 
10
5
  ## 3.6.0
11
6
  Wed, 08 Feb 2023 14:58:39 GMT
@@ -523,7 +518,7 @@ Mon, 26 Jul 2021 12:21:25 GMT
523
518
 
524
519
  - Reactivated test that stopped working when a previous PR for ecef dependency to geographicCRS was reverted
525
520
  - store changesetIndex on IModelDb
526
- - Better error checks when creating SpatialViewDefinition-s.
521
+ - Better error checks when creating SpatialViewDefinition-s.
527
522
  - remove internal barrel-import usage
528
523
  - throw exception when attempting to download a briefcase on top of an existing file
529
524
  - Add case for InterpolationCurve3d
@@ -558,11 +553,11 @@ Fri, 09 Jul 2021 18:11:24 GMT
558
553
  ### Updates
559
554
 
560
555
  - TemplateModelCloner now assigns a new FederationGuid for cloned element instances.
561
- - Accomodated the inability to reverse Changesets when creating change summaries.
556
+ - Accomodated the inability to reverse Changesets when creating change summaries.
562
557
  - fix lint issue
563
558
  - begin api transition to changeset index rather than changeset Id
564
559
  - Use ecef location calculated for projected iModels
565
- - Push refreshes access token if necessary.
560
+ - Push refreshes access token if necessary.
566
561
  - Do not reuse briefcase ids in ReadWrite workflows when using the RPC interfaces (if the briefcase was not found in the local file system)
567
562
  - Add missing SectionDrawing properties.
568
563
 
@@ -583,7 +578,7 @@ Fri, 02 Jul 2021 15:38:31 GMT
583
578
 
584
579
  ### Updates
585
580
 
586
- - Update to @bentley/imodeljs-native@2.17.10
581
+ - Update to @bentley/imodeljs-native@2.17.10
587
582
 
588
583
  ## 2.17.0
589
584
  Mon, 28 Jun 2021 16:20:11 GMT
@@ -849,8 +844,8 @@ Thu, 28 Jan 2021 13:39:27 GMT
849
844
 
850
845
  - Changed storageType from azure to azure?sas=1 for getCommandArgs function
851
846
  - Fix brep DataProps to/from flatbuffer to account for base64 string header.
852
- - Element geometry creation by brep operations.
853
- - Reinstated behavior when re-opening files read-write.
847
+ - Element geometry creation by brep operations.
848
+ - Reinstated behavior when re-opening files read-write.
854
849
  - enhance BriefcaseManager and BriefcaseDb for edit commands
855
850
  - Improve ElementGeometry documentation.
856
851
  - Add a check to verify, and fix, the DbGuid in the iModel if it is different than the Guid in iModelHub.
@@ -1040,8 +1035,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
1040
1035
  ### Updates
1041
1036
 
1042
1037
  - Update to @bentley/imodeljs-native@2.7.4
1043
- - Fixes to front end methods to pull, merge and push.
1044
- - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
1038
+ - Fixes to front end methods to pull, merge and push.
1039
+ - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
1045
1040
  - On iOS download in background
1046
1041
  - Fix ios hang issue
1047
1042
  - Modify queryModelRanges to handle non geometric model errors
@@ -1132,7 +1127,7 @@ Thu, 20 Aug 2020 20:57:09 GMT
1132
1127
  ### Updates
1133
1128
 
1134
1129
  - Update to imodeljs-native 2.5.0
1135
- - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
1130
+ - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
1136
1131
  - Fix for a recursive exception while closing a briefcase
1137
1132
  - Added mobile oidc client
1138
1133
  - Remove special code handling for mobile.
@@ -1196,7 +1191,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
1196
1191
  - Changes to support imodel-bridge
1197
1192
  - fix spelling mistakes in Device class
1198
1193
  - Fix typo in comments
1199
- - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
1194
+ - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
1200
1195
  - disallow protected operations for missing schemas marked with SchemaHasBehavior custom attribute
1201
1196
 
1202
1197
  ## 2.2.1
@@ -1237,25 +1232,25 @@ Thu, 28 May 2020 22:48:59 GMT
1237
1232
  - Update to imodeljs-native 2.1.0
1238
1233
  - Support for finding an ExternalSourceAspect given scope, id, and kind/hash.
1239
1234
  - ApplyChangeset perf tests updated
1240
- - Fixed token expiry check for desktop authorization.
1235
+ - Fixed token expiry check for desktop authorization.
1241
1236
  - Download ChangeSets in chunks
1242
1237
  - (1) In xy region booleans, support curved edges; (2) ExportGraphicsMeshVisitor class
1243
1238
  - Add ability to convert ExportGraphicsMesh to Polyface
1244
1239
  - Fixed validation of Guids (ContextId, IModelId) cached within a briefcase.
1245
1240
  - Moved iModelBridgeFwk to a separate package
1246
- - Simplified logging for monitoring briefcase operations.
1241
+ - Simplified logging for monitoring briefcase operations.
1247
1242
  - Fix transforms for creating and querying part instance geometry in world coordinate.
1248
1243
  - Fix and improvement to performance tests
1249
1244
  - Added support for schema XML import to iModelJs backend via the IModelDb.importSchemaStrings method.
1250
1245
  - channel rules
1251
- - Fixed logging usage when opening connections.
1246
+ - Fixed logging usage when opening connections.
1252
1247
 
1253
1248
  ## 2.0.0
1254
1249
  Wed, 06 May 2020 13:17:49 GMT
1255
1250
 
1256
1251
  ### Updates
1257
1252
 
1258
- - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
1253
+ - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
1259
1254
  - Added RivisionUtility class for debug/testing
1260
1255
  - node addon 2.0.18
1261
1256
  - addon 2.0.25
@@ -1268,23 +1263,23 @@ Wed, 06 May 2020 13:17:49 GMT
1268
1263
  - Performance tests for Applying Changesets
1269
1264
  - `IModelHost.startup` is now async.
1270
1265
  - `IModelHost.shutdown` is now async.
1271
- - Refined checks for briefcase id, and fixed failing integration tests.
1266
+ - Refined checks for briefcase id, and fixed failing integration tests.
1272
1267
  - Product Backlog Item 276268: Deleting the briefcase cache if the cache version is incorrect should not attempt to delete the root directory.
1273
1268
  - Setup initialization of briefcase cache for offline workflows. (VSTS#286489)
1274
- - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1269
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1275
1270
  - Move briefcase-specific events into BriefcaseIModelDb subclass
1276
1271
  - Fixed param when calling logger so that it is a function as the logger expects
1277
- - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
1272
+ - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
1278
1273
  - Changed ChangeSets download API
1279
1274
  - Added unlink for file handler
1280
1275
  - Update UlasClient tests to send more detailed feature log data
1281
1276
  - react to renaming of imodeljs-clients-backend to backend-itwin-client
1282
1277
  - apply changeset performance tests with local datasets
1283
- - BriefcaseManager.delete should work in offline scenarios.
1278
+ - BriefcaseManager.delete should work in offline scenarios.
1284
1279
  - Remove deprecated members of SectionLocation and downgrade to alpha pending refactor.
1285
1280
  - Support for progress/cancel from ios
1286
1281
  - Remove deprecated ExportGraphics types etc for 2.0
1287
- - Updated docs.
1282
+ - Updated docs.
1288
1283
  - IModelDb.findByKey replaces IModelDb.find
1289
1284
  - Include model extents with ViewStateProps for drawing views.
1290
1285
  - Remove deprecated APIs; see NextVersion.md for details.
@@ -1305,29 +1300,29 @@ Wed, 06 May 2020 13:17:49 GMT
1305
1300
  - Introduce the BriefcaseIModelDb class, make IModelDb abstract.
1306
1301
  - Cleaned up unused async-s in BriefcaseManager
1307
1302
  - Avoided casting of BriefcaseProps to IModelRpcProps.
1308
- - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1303
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1309
1304
  - Move briefcase property from IModelDb --> BriefcaseIModelDb
1310
1305
  - BriefcaseId is now an enum instead of a class
1311
1306
  - Rename BriefcaseId --> ReservedBriefcaseId, introduce BriefcaseId type
1312
- - VSTS#297017: Update cached briefcase information if changes were applied.
1313
- - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1314
- - Removed the call to simultaneously download and open the briefcase at the backend. This should be done in two separate steps henceforth. The download must be done with BriefcaseManager, and the open is now a synchronous call in BriefcaseDb.
1315
- - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
1307
+ - VSTS#297017: Update cached briefcase information if changes were applied.
1308
+ - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1309
+ - Removed the call to simultaneously download and open the briefcase at the backend. This should be done in two separate steps henceforth. The download must be done with BriefcaseManager, and the open is now a synchronous call in BriefcaseDb.
1310
+ - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
1316
1311
  - Removed BriefcaseDb.create
1317
- - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1312
+ - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1318
1313
  - fixed flaky test
1319
- - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1314
+ - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1320
1315
  - do not throw exception in NativeAppBackend.startup()
1321
- - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1316
+ - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1322
1317
  - Move concurrencyControl from IModelDb to BriefcaseIModelDb
1323
1318
  - Renamed OIDC constructs for consistency; Removed SAML support.
1324
1319
  - Add support for password-protecting snapshot iModels
1325
1320
  - Fixed typo for ElementAspect perf tests
1326
- - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
1321
+ - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
1327
1322
  - Add purge dir method to iModelJsFs
1328
1323
  - react to creation of new clients packages from imodeljs-clients
1329
1324
  - ; substitute current date for feature usage without any set start/end dates
1330
- - Removed deprecated utilities.
1325
+ - Removed deprecated utilities.
1331
1326
  - enforce opening Snapshots readonly through StandaloneDb
1332
1327
  - Remove the deprecated Entity.clone method
1333
1328
  - Adjusted calls to some node addon changes (ECUtils removed)
@@ -1339,13 +1334,13 @@ Wed, 06 May 2020 13:17:49 GMT
1339
1334
  - Add FileNameResolver class
1340
1335
  - Move snapshot methods out of IModelDb and into new SnapshotIModelDb class.
1341
1336
  - Add TemplateModelCloner to place instances of a template model
1342
- - Renamed TestOidcClient and related constructs for consistency.
1337
+ - Renamed TestOidcClient and related constructs for consistency.
1343
1338
  - Add IModelDb.tryPrepareStatement
1344
- - Fixed usage logging.
1339
+ - Fixed usage logging.
1345
1340
  - fix failing ulas tests due to invalid featureId
1346
1341
  - update ULAS test logging & feedback
1347
1342
  - Update UlasUtilities to support exception-throwing native functions
1348
- - Use standalone briefcases for PullOnly cases.
1343
+ - Use standalone briefcases for PullOnly cases.
1349
1344
 
1350
1345
  ## 1.14.1
1351
1346
  Wed, 22 Apr 2020 19:04:00 GMT
@@ -1360,7 +1355,7 @@ Tue, 31 Mar 2020 15:44:19 GMT
1360
1355
  ### Updates
1361
1356
 
1362
1357
  - Update to addon 1.14.1
1363
- - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
1358
+ - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
1364
1359
  - Add handling for invalid predecessor ids to IModelTransformer
1365
1360
  - Accomodate updated imodeljs-native ULAS functions
1366
1361
 
@@ -1375,7 +1370,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1375
1370
  ### Updates
1376
1371
 
1377
1372
  - Fix IGeometry roundtripping issue through ECSql. Fix insert/update binary properties for Element Aspect.
1378
- - Separated out routines to download and open briefcases.
1373
+ - Separated out routines to download and open briefcases.
1379
1374
  - bulk mode
1380
1375
  - Consolidated sign-in for integration tests
1381
1376
  - bulkmode
@@ -1386,7 +1381,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1386
1381
  - Add ViewDefinition.getAuxiliaryCoordinateSystemId and ViewDefinition.setAuxiliaryCoordinateSystemId methods
1387
1382
  - Add SpatialLocationModel.insert
1388
1383
  - Add optional isPlantProjection parameter to PhysicalModel.insert
1389
- - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1384
+ - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1390
1385
  - Better documentation of OidcDesktopClient
1391
1386
  - Fixed changeset perf test by using another iModel on Hub
1392
1387
  - Add ViewDetails to ViewDefinition.
@@ -1419,7 +1414,7 @@ Tue, 07 Jan 2020 19:44:01 GMT
1419
1414
  - Allow events to be sent from backend to frontend
1420
1415
  - Add tryGetInstance / tryGetInstanceProps methods to the Relationship class which return undefined rather than throwing an exception when a relationship is not found.
1421
1416
  - Fix webpack for ios test that were failing due to new dependencies
1422
- - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
1417
+ - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
1423
1418
  - Add tryGetElement / tryGetElementProps which return undefined rather than throwing an exception when an element is not found.
1424
1419
  - Add tryGetModel, tryGetModelProps, tryGetSubModel which return undefined instead of throwing exceptions when the model is not found.
1425
1420
 
@@ -1431,7 +1426,7 @@ Tue, 10 Dec 2019 18:08:56 GMT
1431
1426
  - Updated to addon 9.1.3
1432
1427
  - Added AliCloud tile cache service
1433
1428
  - Added framework to run imodeljs-backend test on ios using appcenter
1434
- - Setup OidcDesktopClient for Electron use cases.
1429
+ - Setup OidcDesktopClient for Electron use cases.
1435
1430
  - fix warnings from static analysis
1436
1431
  - Enabling testing code for updating LR aspects after fix in native side.
1437
1432
  - Addressing typo in a couple of members, making them match the schema properly.
@@ -1487,9 +1482,9 @@ Mon, 30 Sep 2019 22:28:48 GMT
1487
1482
  ### Updates
1488
1483
 
1489
1484
  - added support for blank IModelConnections
1490
- - Setup a way to supply authorization through the backend for frontend requests.
1491
- - Error log when downloading change sets should include iModelId for context.
1492
- - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1485
+ - Setup a way to supply authorization through the backend for frontend requests.
1486
+ - Error log when downloading change sets should include iModelId for context.
1487
+ - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1493
1488
  - Add IModelDb.Elements.hasSubModel
1494
1489
  - Make ExternalSourceAspect.checksum optional
1495
1490
  - Clear statement cache after schema import
@@ -1504,14 +1499,14 @@ Tue, 10 Sep 2019 12:09:49 GMT
1504
1499
 
1505
1500
  ### Updates
1506
1501
 
1507
- - Setup a way to supply authorization through the backend for frontend requests.
1508
- - Allow attaching change cache file before change summary extraction.
1509
- - Added change summary test, and improved doc a little.
1502
+ - Setup a way to supply authorization through the backend for frontend requests.
1503
+ - Allow attaching change cache file before change summary extraction.
1504
+ - Added change summary test, and improved doc a little.
1510
1505
  - Add minimum brep size option to IModelDb.exportGraphics
1511
1506
  - FunctionalSchema.importSchema is now deprecated.
1512
1507
  - Add support for GeometricModel.geometryGuid for detecting whether tiles for a model can be reused across versions
1513
1508
  - Added performance logging for tile upload
1514
- - IModelConnection.close() for read-only connections should not close the Db at the backend; Opening an iModel with SyncModel.PullAndPush() multiple times (without disposing it) must reuse the briefcase.
1509
+ - IModelConnection.close() for read-only connections should not close the Db at the backend; Opening an iModel with SyncModel.PullAndPush() multiple times (without disposing it) must reuse the briefcase.
1515
1510
  - Add method to create view with camera
1516
1511
  - Fixed misleading logging output in tile upload
1517
1512
 
@@ -1521,14 +1516,14 @@ Tue, 13 Aug 2019 20:25:53 GMT
1521
1516
  ### Updates
1522
1517
 
1523
1518
  - Allow custom tile cache services.
1524
- - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1525
- - Added Change Summary integration test, and fixed documentation.
1519
+ - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1520
+ - Added Change Summary integration test, and fixed documentation.
1526
1521
  - Trial code for tile upload errors
1527
1522
  - Fixed changeset performance tests
1528
1523
  - Tile upload logging.
1529
1524
  - Mark ExportGraphics API as public
1530
1525
  - Support for gzip compression of tiles
1531
- - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1526
+ - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1532
1527
  - Add IModelDb.isSnapshot
1533
1528
  - Tile upload error catching.
1534
1529
  - Azure tile upload logging
@@ -1540,7 +1535,7 @@ Wed, 24 Jul 2019 11:47:26 GMT
1540
1535
  ### Updates
1541
1536
 
1542
1537
  - Added option to restrict tile cache URLs by client IP address.
1543
- - Apply change sets at the backend in a non-blocking worker thread.
1538
+ - Apply change sets at the backend in a non-blocking worker thread.
1544
1539
  - Add ElementAspect handler methods
1545
1540
  - When deleting a parent element, make sure there are onDelete/onDeleted callbacks for child elements
1546
1541
  - Add support for linework to IModelDb.exportGraphics
@@ -1558,19 +1553,19 @@ Mon, 01 Jul 2019 19:04:29 GMT
1558
1553
 
1559
1554
  ### Updates
1560
1555
 
1561
- - Open fixes when briefcase requires merges.
1556
+ - Open fixes when briefcase requires merges.
1562
1557
  - Catch tile upload errors.
1563
- - Setting up briefcase is always from an older checkpoint.
1558
+ - Setting up briefcase is always from an older checkpoint.
1564
1559
  - Add materialId, subCategory to ExportGraphicsInfo
1565
- - Fix crash in getViewThumbnail for odd number of bytes
1560
+ - Fix crash in getViewThumbnail for odd number of bytes
1566
1561
  - Adding relationship class for GraphicalElement3dRepresentsElement.
1567
1562
  - Initial implementation of the LinearReferencing typescript domain
1568
1563
  - Adding domain classes for all relatinships in the LinearReferencing schema.
1569
1564
  - Exporting relationships module.
1570
- - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1571
- - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1565
+ - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1566
+ - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1572
1567
  - Add a new method `forceLoadSchemas` to `IModelJsNative.ECPresentationManager`.
1573
- - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1568
+ - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1574
1569
  - Properly document ModelSelector.models and CategorySelector.categories as Id64String arrays
1575
1570
  - Made `insertElement` not return Id64.invalid, throws error instead
1576
1571
  - Update to TypeScript 3.5
@@ -1581,7 +1576,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
1581
1576
 
1582
1577
  ### Updates
1583
1578
 
1584
- - Migrated agent applications to the newer client
1579
+ - Migrated agent applications to the newer client
1585
1580
  - RPC system now accepts only basic values (primitives, "interface" objects, and binary).
1586
1581
  - Switched from iModelHub Project API to Context API
1587
1582
  - Fix bug in IModelDb.createSnapshotFromSeed
@@ -1629,12 +1624,12 @@ Mon, 13 May 2019 15:52:05 GMT
1629
1624
  - Cleanup old imodelbank references
1630
1625
  - Add InformationRecordModel.insert, GroupModel.insert
1631
1626
  - Introduce LoggerCategory enum to advertise logger categories used by this package.
1632
- - Limited maximum cache size of the backend PromiseMemoizer.
1627
+ - Limited maximum cache size of the backend PromiseMemoizer.
1633
1628
  - Missing dependency on node-report
1634
- - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1629
+ - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1635
1630
  - Reinstated old version of OidcAgentClient
1636
- - Unauthorized open requests should cause a more obvious error.
1637
- - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1631
+ - Unauthorized open requests should cause a more obvious error.
1632
+ - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1638
1633
  - Memoization fix when opening iModels in shared, read-only mode .
1639
1634
  - Fixed setup of application version.
1640
1635
  - Updated Element CRUD perf tests
@@ -1644,7 +1639,7 @@ Mon, 13 May 2019 15:52:05 GMT
1644
1639
  - Remove ElementPropertyFormatter, IModelDb.getElementPropertiesForDisplay (use presentation rules instead)
1645
1640
  - Remove StandaloneIModelRpcImpl
1646
1641
  - Fix for Render Gradient.Symb test
1647
- - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1642
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1648
1643
  - Add IModelDb.createSnapshot/openSnapshot/closeSnapshot, deprecate IModelDb.createStandalone/openStandalone/closeStandalone
1649
1644
  - Moved IModelJsExpressServer class into a new package (@itwin/express-server).
1650
1645
  - Simplified tile caching IModelHost config and removed dev flags. Allow
@@ -1671,7 +1666,7 @@ Wed, 06 Mar 2019 15:41:22 GMT
1671
1666
  - Changes package.json to include api-extractor and adds api-extractor.json
1672
1667
  - Use new buildIModelJsBuild script
1673
1668
  - AxisAlignedBox and ElementAlignedBox are now typed to Range3d rather than classes
1674
- - Moved AzureFileHandler, IOSAzureFileHandler, UrlFileHandler and the iModelHub tests to the imodeljs-clients-backend package. This removes the dependency of imodeljs-clients on the "fs" module, and turns it into a browser only package.
1669
+ - Moved AzureFileHandler, IOSAzureFileHandler, UrlFileHandler and the iModelHub tests to the imodeljs-clients-backend package. This removes the dependency of imodeljs-clients on the "fs" module, and turns it into a browser only package.
1675
1670
  - Clone methods are no longer generic
1676
1671
  - Remove unneeded typedoc plugin dependency
1677
1672
  - Added spatial <-> cartographic methods that check/use the geographic coordinate system before using ecef location.
@@ -1716,8 +1711,8 @@ Mon, 14 Jan 2019 23:09:10 GMT
1716
1711
 
1717
1712
  ### Updates
1718
1713
 
1719
- - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1720
- - Removed IModelDb's cache of accessToken. For long running operations like AutoPush, the user must explicitly supply an IAccessTokenManager to keep the token current.
1714
+ - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1715
+ - Removed IModelDb's cache of accessToken. For long running operations like AutoPush, the user must explicitly supply an IAccessTokenManager to keep the token current.
1721
1716
  - Renamed RequestProxy->RequestHost. Allowed applications to configure proxy server with HTTPS_PROXY env.
1722
1717
  - Add backend TextureAPI and accompanying test
1723
1718
 
@@ -1822,7 +1817,7 @@ Mon, 03 Dec 2018 18:52:58 GMT
1822
1817
 
1823
1818
  ### Updates
1824
1819
 
1825
- - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1820
+ - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1826
1821
  - Add ElementRefersToElements.insert
1827
1822
  - Fixed front end integration tests.
1828
1823
  - Document the intended purpose of IModelJsExpressServer within a deployment environment.
@@ -1891,11 +1886,11 @@ Thu, 08 Nov 2018 17:59:20 GMT
1891
1886
 
1892
1887
  - Fix JSON representation of DisplayStyle.
1893
1888
  - Add IModelImporter as a base class for utility methods needed by all importers
1894
- - Removed assertion when deleting a memoized open call.
1889
+ - Removed assertion when deleting a memoized open call.
1895
1890
  - Add more methods to IModelImporter
1896
1891
  - Fix snapping test
1897
1892
  - OIDC related enhancments (WIP).
1898
- - Re-enabled several backend integration tests.
1893
+ - Re-enabled several backend integration tests.
1899
1894
  - Refactor analysis-importer to use IModelImporter
1900
1895
  - Updated to TypeScript 3.1
1901
1896
 
@@ -1,24 +1,24 @@
1
- import { CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from "@itwin/core-common";
2
- import { CloudStorageService, CloudStorageUploadOptions } from "./CloudStorageBackend";
3
- /**
4
- * @beta
5
- * @deprecated in 3.x.
6
- */
7
- export interface AliCloudStorageServiceCredentials {
8
- region: string;
9
- accessKeyId: string;
10
- accessKeySecret: string;
11
- }
12
- /**
13
- * @beta
14
- * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.
15
- */
16
- export declare class AliCloudStorageService extends CloudStorageService {
17
- private _client;
18
- id: CloudStorageProvider;
19
- constructor(credentials: AliCloudStorageServiceCredentials);
20
- obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, _clientIp?: string): CloudStorageContainerUrl;
21
- listContainer(name: string, marker: string, count: number): Promise<string[]>;
22
- upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions): Promise<string>;
23
- }
1
+ import { CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from "@itwin/core-common";
2
+ import { CloudStorageService, CloudStorageUploadOptions } from "./CloudStorageBackend";
3
+ /**
4
+ * @beta
5
+ * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.
6
+ */
7
+ export interface AliCloudStorageServiceCredentials {
8
+ region: string;
9
+ accessKeyId: string;
10
+ accessKeySecret: string;
11
+ }
12
+ /**
13
+ * @beta
14
+ * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.
15
+ */
16
+ export declare class AliCloudStorageService extends CloudStorageService {
17
+ private _client;
18
+ id: CloudStorageProvider;
19
+ constructor(credentials: AliCloudStorageServiceCredentials);
20
+ obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, _clientIp?: string): CloudStorageContainerUrl;
21
+ listContainer(name: string, marker: string, count: number): Promise<string[]>;
22
+ upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions): Promise<string>;
23
+ }
24
24
  //# sourceMappingURL=AliCloudStorageService.d.ts.map
@@ -1,72 +1,72 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AliCloudStorageService = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const stream_1 = require("stream");
9
- const zlib = require("zlib");
10
- const core_bentley_1 = require("@itwin/core-bentley");
11
- const core_common_1 = require("@itwin/core-common");
12
- const CloudStorageBackend_1 = require("./CloudStorageBackend");
13
- /**
14
- * @beta
15
- * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.
16
- */
17
- class AliCloudStorageService extends CloudStorageBackend_1.CloudStorageService {
18
- constructor(credentials) {
19
- super();
20
- this.id = core_common_1.CloudStorageProvider.AliCloud;
21
- this._client = new OSS(credentials);
22
- }
23
- obtainContainerUrl(id, expiry, _clientIp) {
24
- const now = new Date().getTime();
25
- const policy = {
26
- expires: expiry.getTime() - now,
27
- };
28
- this._client.useBucket(id.name);
29
- if (undefined === id.resource)
30
- throw new core_common_1.IModelError(core_bentley_1.BentleyStatus.ERROR, "Attribute 'resource' on CloudStorageContainerDescriptor object is undefined.");
31
- const url = {
32
- descriptor: this.makeDescriptor(id),
33
- valid: 0,
34
- expires: expiry.getTime(),
35
- url: this._client.signatureUrl(id.resource, policy),
36
- bound: true,
37
- };
38
- return url;
39
- }
40
- async listContainer(name, marker, count) {
41
- this._client.useBucket(name);
42
- const query = await this._client.list({ marker, "max-keys": count }, {});
43
- return query.objects ? query.objects.map((o) => o.name) : [];
44
- }
45
- async upload(container, name, data, options) {
46
- await this._client.putBucket(container);
47
- await this._client.putBucketCORS(container, [{ allowedOrigin: "*", allowedMethod: ["GET", "POST", "PUT", "DELETE", "HEAD"], allowedHeader: "*" }]);
48
- this._client.useBucket(container);
49
- const dataStream = new stream_1.PassThrough();
50
- dataStream.end(data);
51
- let source;
52
- const putOptions = {
53
- mime: (options && options.type) ? options.type : "application/octet-stream",
54
- headers: {
55
- // eslint-disable-next-line @typescript-eslint/naming-convention
56
- "Cache-Control": (options && options.cacheControl) ? options.cacheControl : "private, max-age=31536000, immutable",
57
- },
58
- };
59
- if (options && options.contentEncoding === "gzip") {
60
- putOptions.headers["Content-Encoding"] = options.contentEncoding;
61
- const compressor = zlib.createGzip();
62
- source = dataStream.pipe(compressor);
63
- }
64
- else {
65
- source = dataStream;
66
- }
67
- await this._client.putStream(name, source, putOptions);
68
- return "";
69
- }
70
- }
71
- exports.AliCloudStorageService = AliCloudStorageService;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AliCloudStorageService = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ const stream_1 = require("stream");
9
+ const zlib = require("zlib");
10
+ const core_bentley_1 = require("@itwin/core-bentley");
11
+ const core_common_1 = require("@itwin/core-common");
12
+ const CloudStorageBackend_1 = require("./CloudStorageBackend");
13
+ /**
14
+ * @beta
15
+ * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.
16
+ */
17
+ class AliCloudStorageService extends CloudStorageBackend_1.CloudStorageService {
18
+ constructor(credentials) {
19
+ super();
20
+ this.id = core_common_1.CloudStorageProvider.AliCloud;
21
+ this._client = new OSS(credentials);
22
+ }
23
+ obtainContainerUrl(id, expiry, _clientIp) {
24
+ const now = new Date().getTime();
25
+ const policy = {
26
+ expires: expiry.getTime() - now,
27
+ };
28
+ this._client.useBucket(id.name);
29
+ if (undefined === id.resource)
30
+ throw new core_common_1.IModelError(core_bentley_1.BentleyStatus.ERROR, "Attribute 'resource' on CloudStorageContainerDescriptor object is undefined.");
31
+ const url = {
32
+ descriptor: this.makeDescriptor(id),
33
+ valid: 0,
34
+ expires: expiry.getTime(),
35
+ url: this._client.signatureUrl(id.resource, policy),
36
+ bound: true,
37
+ };
38
+ return url;
39
+ }
40
+ async listContainer(name, marker, count) {
41
+ this._client.useBucket(name);
42
+ const query = await this._client.list({ marker, "max-keys": count }, {});
43
+ return query.objects ? query.objects.map((o) => o.name) : [];
44
+ }
45
+ async upload(container, name, data, options) {
46
+ await this._client.putBucket(container);
47
+ await this._client.putBucketCORS(container, [{ allowedOrigin: "*", allowedMethod: ["GET", "POST", "PUT", "DELETE", "HEAD"], allowedHeader: "*" }]);
48
+ this._client.useBucket(container);
49
+ const dataStream = new stream_1.PassThrough();
50
+ dataStream.end(data);
51
+ let source;
52
+ const putOptions = {
53
+ mime: (options && options.type) ? options.type : "application/octet-stream",
54
+ headers: {
55
+ // eslint-disable-next-line @typescript-eslint/naming-convention
56
+ "Cache-Control": (options && options.cacheControl) ? options.cacheControl : "private, max-age=31536000, immutable",
57
+ },
58
+ };
59
+ if (options && options.contentEncoding === "gzip") {
60
+ putOptions.headers["Content-Encoding"] = options.contentEncoding;
61
+ const compressor = zlib.createGzip();
62
+ source = dataStream.pipe(compressor);
63
+ }
64
+ else {
65
+ source = dataStream;
66
+ }
67
+ await this._client.putStream(name, source, putOptions);
68
+ return "";
69
+ }
70
+ }
71
+ exports.AliCloudStorageService = AliCloudStorageService;
72
72
  //# sourceMappingURL=AliCloudStorageService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AliCloudStorageService.js","sourceRoot":"","sources":["../../src/AliCloudStorageService.ts"],"names":[],"mappings":"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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { PassThrough, Readable } from \"stream\";\r\nimport * as zlib from \"zlib\";\r\nimport { BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider, IModelError } from \"@itwin/core-common\";\r\nimport { CloudStorageService, CloudStorageUploadOptions } from \"./CloudStorageBackend\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x.\r\n */\r\nexport interface AliCloudStorageServiceCredentials {\r\n region: string;\r\n accessKeyId: string;\r\n accessKeySecret: string;\r\n}\r\n\r\ndeclare class OSS {\r\n constructor(params: AliCloudStorageServiceCredentials)\r\n public useBucket(name: string): void;\r\n public signatureUrl(name: string, policy: OSS.SignatureUrlOptions): string;\r\n public list(params: { marker: string, \"max-keys\": number }, arg2: {}): Promise<{ objects?: Array<{ name: string }> }>;\r\n public putBucket(name: string): Promise<void>;\r\n public putBucketCORS(name: string, params: Array<{ allowedOrigin: string, allowedMethod: string[], allowedHeader: string }>): Promise<void>;\r\n public putStream(name: string, source: Readable, options: OSS.PutStreamOptions): Promise<void>;\r\n}\r\n\r\ndeclare namespace OSS { // eslint-disable-line no-redeclare\r\n interface SignatureUrlOptions {\r\n expires: number;\r\n }\r\n\r\n interface PutStreamOptions {\r\n mime: string;\r\n headers: { [index: string]: string };\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.\r\n */\r\nexport class AliCloudStorageService extends CloudStorageService {\r\n private _client: OSS;\r\n\r\n public id = CloudStorageProvider.AliCloud;\r\n\r\n public constructor(credentials: AliCloudStorageServiceCredentials) {\r\n super();\r\n\r\n this._client = new OSS(credentials);\r\n }\r\n\r\n public obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, _clientIp?: string): CloudStorageContainerUrl {\r\n const now = new Date().getTime();\r\n\r\n const policy: OSS.SignatureUrlOptions = {\r\n expires: expiry.getTime() - now,\r\n };\r\n\r\n this._client.useBucket(id.name);\r\n\r\n if (undefined === id.resource)\r\n throw new IModelError(BentleyStatus.ERROR, \"Attribute 'resource' on CloudStorageContainerDescriptor object is undefined.\");\r\n\r\n const url: CloudStorageContainerUrl = {\r\n descriptor: this.makeDescriptor(id),\r\n valid: 0,\r\n expires: expiry.getTime(),\r\n url: this._client.signatureUrl(id.resource, policy),\r\n bound: true,\r\n };\r\n\r\n return url;\r\n }\r\n\r\n public async listContainer(name: string, marker: string, count: number): Promise<string[]> {\r\n this._client.useBucket(name);\r\n const query = await this._client.list({ marker, \"max-keys\": count }, {});\r\n return query.objects ? query.objects.map((o) => o.name) : [];\r\n }\r\n\r\n public async upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions): Promise<string> {\r\n await this._client.putBucket(container);\r\n await this._client.putBucketCORS(container, [{ allowedOrigin: \"*\", allowedMethod: [\"GET\", \"POST\", \"PUT\", \"DELETE\", \"HEAD\"], allowedHeader: \"*\" }]);\r\n this._client.useBucket(container);\r\n\r\n const dataStream = new PassThrough();\r\n dataStream.end(data);\r\n\r\n let source: Readable;\r\n\r\n const putOptions = {\r\n mime: (options && options.type) ? options.type : \"application/octet-stream\",\r\n headers: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \"Cache-Control\": (options && options.cacheControl) ? options.cacheControl : \"private, max-age=31536000, immutable\",\r\n },\r\n } as OSS.PutStreamOptions;\r\n\r\n if (options && options.contentEncoding === \"gzip\") {\r\n (putOptions.headers as any)[\"Content-Encoding\"] = options.contentEncoding;\r\n const compressor = zlib.createGzip();\r\n source = dataStream.pipe(compressor);\r\n } else {\r\n source = dataStream;\r\n }\r\n await this._client.putStream(name, source, putOptions);\r\n return \"\";\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AliCloudStorageService.js","sourceRoot":"","sources":["../../src/AliCloudStorageService.ts"],"names":[],"mappings":"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","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { PassThrough, Readable } from \"stream\";\nimport * as zlib from \"zlib\";\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider, IModelError } from \"@itwin/core-common\";\nimport { CloudStorageService, CloudStorageUploadOptions } from \"./CloudStorageBackend\";\n\n/* eslint-disable deprecation/deprecation */\n\n/**\n * @beta\n * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.\n */\nexport interface AliCloudStorageServiceCredentials {\n region: string;\n accessKeyId: string;\n accessKeySecret: string;\n}\n\ndeclare class OSS {\n constructor(params: AliCloudStorageServiceCredentials)\n public useBucket(name: string): void;\n public signatureUrl(name: string, policy: OSS.SignatureUrlOptions): string;\n public list(params: { marker: string, \"max-keys\": number }, arg2: {}): Promise<{ objects?: Array<{ name: string }> }>;\n public putBucket(name: string): Promise<void>;\n public putBucketCORS(name: string, params: Array<{ allowedOrigin: string, allowedMethod: string[], allowedHeader: string }>): Promise<void>;\n public putStream(name: string, source: Readable, options: OSS.PutStreamOptions): Promise<void>;\n}\n\ndeclare namespace OSS { // eslint-disable-line no-redeclare\n interface SignatureUrlOptions {\n expires: number;\n }\n\n interface PutStreamOptions {\n mime: string;\n headers: { [index: string]: string };\n }\n}\n\n/**\n * @beta\n * @deprecated in 3.x. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.\n */\nexport class AliCloudStorageService extends CloudStorageService {\n private _client: OSS;\n\n public id = CloudStorageProvider.AliCloud;\n\n public constructor(credentials: AliCloudStorageServiceCredentials) {\n super();\n\n this._client = new OSS(credentials);\n }\n\n public obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, _clientIp?: string): CloudStorageContainerUrl {\n const now = new Date().getTime();\n\n const policy: OSS.SignatureUrlOptions = {\n expires: expiry.getTime() - now,\n };\n\n this._client.useBucket(id.name);\n\n if (undefined === id.resource)\n throw new IModelError(BentleyStatus.ERROR, \"Attribute 'resource' on CloudStorageContainerDescriptor object is undefined.\");\n\n const url: CloudStorageContainerUrl = {\n descriptor: this.makeDescriptor(id),\n valid: 0,\n expires: expiry.getTime(),\n url: this._client.signatureUrl(id.resource, policy),\n bound: true,\n };\n\n return url;\n }\n\n public async listContainer(name: string, marker: string, count: number): Promise<string[]> {\n this._client.useBucket(name);\n const query = await this._client.list({ marker, \"max-keys\": count }, {});\n return query.objects ? query.objects.map((o) => o.name) : [];\n }\n\n public async upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions): Promise<string> {\n await this._client.putBucket(container);\n await this._client.putBucketCORS(container, [{ allowedOrigin: \"*\", allowedMethod: [\"GET\", \"POST\", \"PUT\", \"DELETE\", \"HEAD\"], allowedHeader: \"*\" }]);\n this._client.useBucket(container);\n\n const dataStream = new PassThrough();\n dataStream.end(data);\n\n let source: Readable;\n\n const putOptions = {\n mime: (options && options.type) ? options.type : \"application/octet-stream\",\n headers: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n \"Cache-Control\": (options && options.cacheControl) ? options.cacheControl : \"private, max-age=31536000, immutable\",\n },\n } as OSS.PutStreamOptions;\n\n if (options && options.contentEncoding === \"gzip\") {\n (putOptions.headers as any)[\"Content-Encoding\"] = options.contentEncoding;\n const compressor = zlib.createGzip();\n source = dataStream.pipe(compressor);\n } else {\n source = dataStream;\n }\n await this._client.putStream(name, source, putOptions);\n return \"\";\n }\n}\n"]}