@itwin/core-backend 3.7.0-dev.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 (244) hide show
  1. package/CHANGELOG.md +71 -66
  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.js +496 -496
  112. package/lib/cjs/IModelHost.js.map +1 -1
  113. package/lib/cjs/IModelJsFs.d.ts +62 -62
  114. package/lib/cjs/IModelJsFs.js +140 -140
  115. package/lib/cjs/IModelJsFs.js.map +1 -1
  116. package/lib/cjs/IpcHost.d.ts +104 -104
  117. package/lib/cjs/IpcHost.js +278 -278
  118. package/lib/cjs/IpcHost.js.map +1 -1
  119. package/lib/cjs/LineStyle.d.ts +311 -311
  120. package/lib/cjs/LineStyle.js +295 -295
  121. package/lib/cjs/LineStyle.js.map +1 -1
  122. package/lib/cjs/LocalHub.d.ts +162 -162
  123. package/lib/cjs/LocalHub.js +585 -585
  124. package/lib/cjs/LocalHub.js.map +1 -1
  125. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  126. package/lib/cjs/LocalhostIpcHost.js +81 -81
  127. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  128. package/lib/cjs/Material.d.ts +131 -131
  129. package/lib/cjs/Material.js +181 -181
  130. package/lib/cjs/Material.js.map +1 -1
  131. package/lib/cjs/Model.d.ts +392 -392
  132. package/lib/cjs/Model.js +485 -485
  133. package/lib/cjs/Model.js.map +1 -1
  134. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  135. package/lib/cjs/NativeAppStorage.js +202 -202
  136. package/lib/cjs/NativeAppStorage.js.map +1 -1
  137. package/lib/cjs/NativeHost.d.ts +52 -52
  138. package/lib/cjs/NativeHost.js +163 -163
  139. package/lib/cjs/NativeHost.js.map +1 -1
  140. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  141. package/lib/cjs/NavigationRelationship.js +225 -225
  142. package/lib/cjs/NavigationRelationship.js.map +1 -1
  143. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  144. package/lib/cjs/PromiseMemoizer.js +101 -101
  145. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  146. package/lib/cjs/PropertyStore.d.ts +132 -132
  147. package/lib/cjs/PropertyStore.js +11 -11
  148. package/lib/cjs/PropertyStore.js.map +1 -1
  149. package/lib/cjs/Relationship.d.ts +416 -416
  150. package/lib/cjs/Relationship.js +494 -494
  151. package/lib/cjs/Relationship.js.map +1 -1
  152. package/lib/cjs/RpcBackend.d.ts +5 -5
  153. package/lib/cjs/RpcBackend.js +32 -32
  154. package/lib/cjs/RpcBackend.js.map +1 -1
  155. package/lib/cjs/SQLiteDb.d.ts +219 -219
  156. package/lib/cjs/SQLiteDb.js +214 -214
  157. package/lib/cjs/SQLiteDb.js.map +1 -1
  158. package/lib/cjs/Schema.d.ts +55 -55
  159. package/lib/cjs/Schema.js +83 -83
  160. package/lib/cjs/Schema.js.map +1 -1
  161. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  162. package/lib/cjs/ServerBasedLocks.js +168 -168
  163. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  164. package/lib/cjs/SqliteStatement.d.ts +360 -360
  165. package/lib/cjs/SqliteStatement.js +586 -586
  166. package/lib/cjs/SqliteStatement.js.map +1 -1
  167. package/lib/cjs/Texture.d.ts +58 -58
  168. package/lib/cjs/Texture.js +82 -82
  169. package/lib/cjs/Texture.js.map +1 -1
  170. package/lib/cjs/TileStorage.d.ts +18 -18
  171. package/lib/cjs/TileStorage.js +90 -90
  172. package/lib/cjs/TileStorage.js.map +1 -1
  173. package/lib/cjs/TxnManager.d.ts +202 -202
  174. package/lib/cjs/TxnManager.js +356 -356
  175. package/lib/cjs/TxnManager.js.map +1 -1
  176. package/lib/cjs/ViewDefinition.d.ts +439 -439
  177. package/lib/cjs/ViewDefinition.js +646 -646
  178. package/lib/cjs/ViewDefinition.js.map +1 -1
  179. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  180. package/lib/cjs/ViewStateHydrator.js +103 -103
  181. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  182. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  183. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  184. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  185. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  186. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  187. package/lib/cjs/core-backend.d.ts +184 -184
  188. package/lib/cjs/core-backend.js +204 -204
  189. package/lib/cjs/core-backend.js.map +1 -1
  190. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  191. package/lib/cjs/domains/FunctionalElements.js +145 -145
  192. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  193. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  194. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  195. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  196. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  197. package/lib/cjs/domains/GenericElements.js +263 -263
  198. package/lib/cjs/domains/GenericElements.js.map +1 -1
  199. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  200. package/lib/cjs/domains/GenericSchema.js +28 -28
  201. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  202. package/lib/cjs/rpc/multipart.d.ts +11 -11
  203. package/lib/cjs/rpc/multipart.js +71 -71
  204. package/lib/cjs/rpc/multipart.js.map +1 -1
  205. package/lib/cjs/rpc/tracing.d.ts +28 -28
  206. package/lib/cjs/rpc/tracing.js +74 -74
  207. package/lib/cjs/rpc/tracing.js.map +1 -1
  208. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  209. package/lib/cjs/rpc/web/logging.js +43 -43
  210. package/lib/cjs/rpc/web/logging.js.map +1 -1
  211. package/lib/cjs/rpc/web/request.d.ts +6 -6
  212. package/lib/cjs/rpc/web/request.js +74 -74
  213. package/lib/cjs/rpc/web/request.js.map +1 -1
  214. package/lib/cjs/rpc/web/response.d.ts +6 -6
  215. package/lib/cjs/rpc/web/response.js +106 -106
  216. package/lib/cjs/rpc/web/response.js.map +1 -1
  217. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  218. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  219. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  220. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  221. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +294 -294
  222. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  223. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  224. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +205 -205
  225. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  226. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  227. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  228. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  229. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  230. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  231. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  232. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  233. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  234. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  235. package/lib/cjs/workspace/Settings.d.ts +186 -186
  236. package/lib/cjs/workspace/Settings.js +155 -155
  237. package/lib/cjs/workspace/Settings.js.map +1 -1
  238. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  239. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  240. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  241. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  242. package/lib/cjs/workspace/Workspace.js +543 -543
  243. package/lib/cjs/workspace/Workspace.js.map +1 -1
  244. package/package.json +12 -12
package/CHANGELOG.md CHANGED
@@ -19,6 +19,11 @@ Wed, 08 Feb 2023 14:58:39 GMT
19
19
  - Element.toJSON should not include undefined values for userLabel or federationGuid
20
20
  - allow passing a custom schema read context to IModelDb.importSchemas
21
21
 
22
+ ## 3.5.6
23
+ Fri, 24 Feb 2023 16:02:47 GMT
24
+
25
+ _Version update only_
26
+
22
27
  ## 3.5.5
23
28
  Thu, 26 Jan 2023 22:53:27 GMT
24
29
 
@@ -513,7 +518,7 @@ Mon, 26 Jul 2021 12:21:25 GMT
513
518
 
514
519
  - Reactivated test that stopped working when a previous PR for ecef dependency to geographicCRS was reverted
515
520
  - store changesetIndex on IModelDb
516
- - Better error checks when creating SpatialViewDefinition-s.
521
+ - Better error checks when creating SpatialViewDefinition-s.
517
522
  - remove internal barrel-import usage
518
523
  - throw exception when attempting to download a briefcase on top of an existing file
519
524
  - Add case for InterpolationCurve3d
@@ -548,11 +553,11 @@ Fri, 09 Jul 2021 18:11:24 GMT
548
553
  ### Updates
549
554
 
550
555
  - TemplateModelCloner now assigns a new FederationGuid for cloned element instances.
551
- - Accomodated the inability to reverse Changesets when creating change summaries.
556
+ - Accomodated the inability to reverse Changesets when creating change summaries.
552
557
  - fix lint issue
553
558
  - begin api transition to changeset index rather than changeset Id
554
559
  - Use ecef location calculated for projected iModels
555
- - Push refreshes access token if necessary.
560
+ - Push refreshes access token if necessary.
556
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)
557
562
  - Add missing SectionDrawing properties.
558
563
 
@@ -573,7 +578,7 @@ Fri, 02 Jul 2021 15:38:31 GMT
573
578
 
574
579
  ### Updates
575
580
 
576
- - Update to @bentley/imodeljs-native@2.17.10
581
+ - Update to @bentley/imodeljs-native@2.17.10
577
582
 
578
583
  ## 2.17.0
579
584
  Mon, 28 Jun 2021 16:20:11 GMT
@@ -839,8 +844,8 @@ Thu, 28 Jan 2021 13:39:27 GMT
839
844
 
840
845
  - Changed storageType from azure to azure?sas=1 for getCommandArgs function
841
846
  - Fix brep DataProps to/from flatbuffer to account for base64 string header.
842
- - Element geometry creation by brep operations.
843
- - Reinstated behavior when re-opening files read-write.
847
+ - Element geometry creation by brep operations.
848
+ - Reinstated behavior when re-opening files read-write.
844
849
  - enhance BriefcaseManager and BriefcaseDb for edit commands
845
850
  - Improve ElementGeometry documentation.
846
851
  - Add a check to verify, and fix, the DbGuid in the iModel if it is different than the Guid in iModelHub.
@@ -1030,8 +1035,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
1030
1035
  ### Updates
1031
1036
 
1032
1037
  - Update to @bentley/imodeljs-native@2.7.4
1033
- - Fixes to front end methods to pull, merge and push.
1034
- - 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.
1035
1040
  - On iOS download in background
1036
1041
  - Fix ios hang issue
1037
1042
  - Modify queryModelRanges to handle non geometric model errors
@@ -1122,7 +1127,7 @@ Thu, 20 Aug 2020 20:57:09 GMT
1122
1127
  ### Updates
1123
1128
 
1124
1129
  - Update to imodeljs-native 2.5.0
1125
- - 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.
1126
1131
  - Fix for a recursive exception while closing a briefcase
1127
1132
  - Added mobile oidc client
1128
1133
  - Remove special code handling for mobile.
@@ -1186,7 +1191,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
1186
1191
  - Changes to support imodel-bridge
1187
1192
  - fix spelling mistakes in Device class
1188
1193
  - Fix typo in comments
1189
- - 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.
1190
1195
  - disallow protected operations for missing schemas marked with SchemaHasBehavior custom attribute
1191
1196
 
1192
1197
  ## 2.2.1
@@ -1227,25 +1232,25 @@ Thu, 28 May 2020 22:48:59 GMT
1227
1232
  - Update to imodeljs-native 2.1.0
1228
1233
  - Support for finding an ExternalSourceAspect given scope, id, and kind/hash.
1229
1234
  - ApplyChangeset perf tests updated
1230
- - Fixed token expiry check for desktop authorization.
1235
+ - Fixed token expiry check for desktop authorization.
1231
1236
  - Download ChangeSets in chunks
1232
1237
  - (1) In xy region booleans, support curved edges; (2) ExportGraphicsMeshVisitor class
1233
1238
  - Add ability to convert ExportGraphicsMesh to Polyface
1234
1239
  - Fixed validation of Guids (ContextId, IModelId) cached within a briefcase.
1235
1240
  - Moved iModelBridgeFwk to a separate package
1236
- - Simplified logging for monitoring briefcase operations.
1241
+ - Simplified logging for monitoring briefcase operations.
1237
1242
  - Fix transforms for creating and querying part instance geometry in world coordinate.
1238
1243
  - Fix and improvement to performance tests
1239
1244
  - Added support for schema XML import to iModelJs backend via the IModelDb.importSchemaStrings method.
1240
1245
  - channel rules
1241
- - Fixed logging usage when opening connections.
1246
+ - Fixed logging usage when opening connections.
1242
1247
 
1243
1248
  ## 2.0.0
1244
1249
  Wed, 06 May 2020 13:17:49 GMT
1245
1250
 
1246
1251
  ### Updates
1247
1252
 
1248
- - 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.
1249
1254
  - Added RivisionUtility class for debug/testing
1250
1255
  - node addon 2.0.18
1251
1256
  - addon 2.0.25
@@ -1258,23 +1263,23 @@ Wed, 06 May 2020 13:17:49 GMT
1258
1263
  - Performance tests for Applying Changesets
1259
1264
  - `IModelHost.startup` is now async.
1260
1265
  - `IModelHost.shutdown` is now async.
1261
- - Refined checks for briefcase id, and fixed failing integration tests.
1266
+ - Refined checks for briefcase id, and fixed failing integration tests.
1262
1267
  - Product Backlog Item 276268: Deleting the briefcase cache if the cache version is incorrect should not attempt to delete the root directory.
1263
1268
  - Setup initialization of briefcase cache for offline workflows. (VSTS#286489)
1264
- - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1269
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1265
1270
  - Move briefcase-specific events into BriefcaseIModelDb subclass
1266
1271
  - Fixed param when calling logger so that it is a function as the logger expects
1267
- - 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.
1268
1273
  - Changed ChangeSets download API
1269
1274
  - Added unlink for file handler
1270
1275
  - Update UlasClient tests to send more detailed feature log data
1271
1276
  - react to renaming of imodeljs-clients-backend to backend-itwin-client
1272
1277
  - apply changeset performance tests with local datasets
1273
- - BriefcaseManager.delete should work in offline scenarios.
1278
+ - BriefcaseManager.delete should work in offline scenarios.
1274
1279
  - Remove deprecated members of SectionLocation and downgrade to alpha pending refactor.
1275
1280
  - Support for progress/cancel from ios
1276
1281
  - Remove deprecated ExportGraphics types etc for 2.0
1277
- - Updated docs.
1282
+ - Updated docs.
1278
1283
  - IModelDb.findByKey replaces IModelDb.find
1279
1284
  - Include model extents with ViewStateProps for drawing views.
1280
1285
  - Remove deprecated APIs; see NextVersion.md for details.
@@ -1295,29 +1300,29 @@ Wed, 06 May 2020 13:17:49 GMT
1295
1300
  - Introduce the BriefcaseIModelDb class, make IModelDb abstract.
1296
1301
  - Cleaned up unused async-s in BriefcaseManager
1297
1302
  - Avoided casting of BriefcaseProps to IModelRpcProps.
1298
- - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1303
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1299
1304
  - Move briefcase property from IModelDb --> BriefcaseIModelDb
1300
1305
  - BriefcaseId is now an enum instead of a class
1301
1306
  - Rename BriefcaseId --> ReservedBriefcaseId, introduce BriefcaseId type
1302
- - VSTS#297017: Update cached briefcase information if changes were applied.
1303
- - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1304
- - 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.
1305
- - 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.
1306
1311
  - Removed BriefcaseDb.create
1307
- - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1312
+ - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1308
1313
  - fixed flaky test
1309
- - 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).
1310
1315
  - do not throw exception in NativeAppBackend.startup()
1311
- - 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.
1312
1317
  - Move concurrencyControl from IModelDb to BriefcaseIModelDb
1313
1318
  - Renamed OIDC constructs for consistency; Removed SAML support.
1314
1319
  - Add support for password-protecting snapshot iModels
1315
1320
  - Fixed typo for ElementAspect perf tests
1316
- - 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.
1317
1322
  - Add purge dir method to iModelJsFs
1318
1323
  - react to creation of new clients packages from imodeljs-clients
1319
1324
  - ; substitute current date for feature usage without any set start/end dates
1320
- - Removed deprecated utilities.
1325
+ - Removed deprecated utilities.
1321
1326
  - enforce opening Snapshots readonly through StandaloneDb
1322
1327
  - Remove the deprecated Entity.clone method
1323
1328
  - Adjusted calls to some node addon changes (ECUtils removed)
@@ -1329,13 +1334,13 @@ Wed, 06 May 2020 13:17:49 GMT
1329
1334
  - Add FileNameResolver class
1330
1335
  - Move snapshot methods out of IModelDb and into new SnapshotIModelDb class.
1331
1336
  - Add TemplateModelCloner to place instances of a template model
1332
- - Renamed TestOidcClient and related constructs for consistency.
1337
+ - Renamed TestOidcClient and related constructs for consistency.
1333
1338
  - Add IModelDb.tryPrepareStatement
1334
- - Fixed usage logging.
1339
+ - Fixed usage logging.
1335
1340
  - fix failing ulas tests due to invalid featureId
1336
1341
  - update ULAS test logging & feedback
1337
1342
  - Update UlasUtilities to support exception-throwing native functions
1338
- - Use standalone briefcases for PullOnly cases.
1343
+ - Use standalone briefcases for PullOnly cases.
1339
1344
 
1340
1345
  ## 1.14.1
1341
1346
  Wed, 22 Apr 2020 19:04:00 GMT
@@ -1350,7 +1355,7 @@ Tue, 31 Mar 2020 15:44:19 GMT
1350
1355
  ### Updates
1351
1356
 
1352
1357
  - Update to addon 1.14.1
1353
- - 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.
1354
1359
  - Add handling for invalid predecessor ids to IModelTransformer
1355
1360
  - Accomodate updated imodeljs-native ULAS functions
1356
1361
 
@@ -1365,7 +1370,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1365
1370
  ### Updates
1366
1371
 
1367
1372
  - Fix IGeometry roundtripping issue through ECSql. Fix insert/update binary properties for Element Aspect.
1368
- - Separated out routines to download and open briefcases.
1373
+ - Separated out routines to download and open briefcases.
1369
1374
  - bulk mode
1370
1375
  - Consolidated sign-in for integration tests
1371
1376
  - bulkmode
@@ -1376,7 +1381,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1376
1381
  - Add ViewDefinition.getAuxiliaryCoordinateSystemId and ViewDefinition.setAuxiliaryCoordinateSystemId methods
1377
1382
  - Add SpatialLocationModel.insert
1378
1383
  - Add optional isPlantProjection parameter to PhysicalModel.insert
1379
- - 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.
1380
1385
  - Better documentation of OidcDesktopClient
1381
1386
  - Fixed changeset perf test by using another iModel on Hub
1382
1387
  - Add ViewDetails to ViewDefinition.
@@ -1409,7 +1414,7 @@ Tue, 07 Jan 2020 19:44:01 GMT
1409
1414
  - Allow events to be sent from backend to frontend
1410
1415
  - Add tryGetInstance / tryGetInstanceProps methods to the Relationship class which return undefined rather than throwing an exception when a relationship is not found.
1411
1416
  - Fix webpack for ios test that were failing due to new dependencies
1412
- - 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.
1413
1418
  - Add tryGetElement / tryGetElementProps which return undefined rather than throwing an exception when an element is not found.
1414
1419
  - Add tryGetModel, tryGetModelProps, tryGetSubModel which return undefined instead of throwing exceptions when the model is not found.
1415
1420
 
@@ -1421,7 +1426,7 @@ Tue, 10 Dec 2019 18:08:56 GMT
1421
1426
  - Updated to addon 9.1.3
1422
1427
  - Added AliCloud tile cache service
1423
1428
  - Added framework to run imodeljs-backend test on ios using appcenter
1424
- - Setup OidcDesktopClient for Electron use cases.
1429
+ - Setup OidcDesktopClient for Electron use cases.
1425
1430
  - fix warnings from static analysis
1426
1431
  - Enabling testing code for updating LR aspects after fix in native side.
1427
1432
  - Addressing typo in a couple of members, making them match the schema properly.
@@ -1477,9 +1482,9 @@ Mon, 30 Sep 2019 22:28:48 GMT
1477
1482
  ### Updates
1478
1483
 
1479
1484
  - added support for blank IModelConnections
1480
- - Setup a way to supply authorization through the backend for frontend requests.
1481
- - Error log when downloading change sets should include iModelId for context.
1482
- - 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.
1483
1488
  - Add IModelDb.Elements.hasSubModel
1484
1489
  - Make ExternalSourceAspect.checksum optional
1485
1490
  - Clear statement cache after schema import
@@ -1494,14 +1499,14 @@ Tue, 10 Sep 2019 12:09:49 GMT
1494
1499
 
1495
1500
  ### Updates
1496
1501
 
1497
- - Setup a way to supply authorization through the backend for frontend requests.
1498
- - Allow attaching change cache file before change summary extraction.
1499
- - 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.
1500
1505
  - Add minimum brep size option to IModelDb.exportGraphics
1501
1506
  - FunctionalSchema.importSchema is now deprecated.
1502
1507
  - Add support for GeometricModel.geometryGuid for detecting whether tiles for a model can be reused across versions
1503
1508
  - Added performance logging for tile upload
1504
- - 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.
1505
1510
  - Add method to create view with camera
1506
1511
  - Fixed misleading logging output in tile upload
1507
1512
 
@@ -1511,14 +1516,14 @@ Tue, 13 Aug 2019 20:25:53 GMT
1511
1516
  ### Updates
1512
1517
 
1513
1518
  - Allow custom tile cache services.
1514
- - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1515
- - 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.
1516
1521
  - Trial code for tile upload errors
1517
1522
  - Fixed changeset performance tests
1518
1523
  - Tile upload logging.
1519
1524
  - Mark ExportGraphics API as public
1520
1525
  - Support for gzip compression of tiles
1521
- - 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.
1522
1527
  - Add IModelDb.isSnapshot
1523
1528
  - Tile upload error catching.
1524
1529
  - Azure tile upload logging
@@ -1530,7 +1535,7 @@ Wed, 24 Jul 2019 11:47:26 GMT
1530
1535
  ### Updates
1531
1536
 
1532
1537
  - Added option to restrict tile cache URLs by client IP address.
1533
- - 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.
1534
1539
  - Add ElementAspect handler methods
1535
1540
  - When deleting a parent element, make sure there are onDelete/onDeleted callbacks for child elements
1536
1541
  - Add support for linework to IModelDb.exportGraphics
@@ -1548,19 +1553,19 @@ Mon, 01 Jul 2019 19:04:29 GMT
1548
1553
 
1549
1554
  ### Updates
1550
1555
 
1551
- - Open fixes when briefcase requires merges.
1556
+ - Open fixes when briefcase requires merges.
1552
1557
  - Catch tile upload errors.
1553
- - Setting up briefcase is always from an older checkpoint.
1558
+ - Setting up briefcase is always from an older checkpoint.
1554
1559
  - Add materialId, subCategory to ExportGraphicsInfo
1555
- - Fix crash in getViewThumbnail for odd number of bytes
1560
+ - Fix crash in getViewThumbnail for odd number of bytes
1556
1561
  - Adding relationship class for GraphicalElement3dRepresentsElement.
1557
1562
  - Initial implementation of the LinearReferencing typescript domain
1558
1563
  - Adding domain classes for all relatinships in the LinearReferencing schema.
1559
1564
  - Exporting relationships module.
1560
- - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1561
- - 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.
1562
1567
  - Add a new method `forceLoadSchemas` to `IModelJsNative.ECPresentationManager`.
1563
- - 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.
1564
1569
  - Properly document ModelSelector.models and CategorySelector.categories as Id64String arrays
1565
1570
  - Made `insertElement` not return Id64.invalid, throws error instead
1566
1571
  - Update to TypeScript 3.5
@@ -1571,7 +1576,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
1571
1576
 
1572
1577
  ### Updates
1573
1578
 
1574
- - Migrated agent applications to the newer client
1579
+ - Migrated agent applications to the newer client
1575
1580
  - RPC system now accepts only basic values (primitives, "interface" objects, and binary).
1576
1581
  - Switched from iModelHub Project API to Context API
1577
1582
  - Fix bug in IModelDb.createSnapshotFromSeed
@@ -1619,12 +1624,12 @@ Mon, 13 May 2019 15:52:05 GMT
1619
1624
  - Cleanup old imodelbank references
1620
1625
  - Add InformationRecordModel.insert, GroupModel.insert
1621
1626
  - Introduce LoggerCategory enum to advertise logger categories used by this package.
1622
- - Limited maximum cache size of the backend PromiseMemoizer.
1627
+ - Limited maximum cache size of the backend PromiseMemoizer.
1623
1628
  - Missing dependency on node-report
1624
- - 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.
1625
1630
  - Reinstated old version of OidcAgentClient
1626
- - Unauthorized open requests should cause a more obvious error.
1627
- - 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.
1628
1633
  - Memoization fix when opening iModels in shared, read-only mode .
1629
1634
  - Fixed setup of application version.
1630
1635
  - Updated Element CRUD perf tests
@@ -1634,7 +1639,7 @@ Mon, 13 May 2019 15:52:05 GMT
1634
1639
  - Remove ElementPropertyFormatter, IModelDb.getElementPropertiesForDisplay (use presentation rules instead)
1635
1640
  - Remove StandaloneIModelRpcImpl
1636
1641
  - Fix for Render Gradient.Symb test
1637
- - 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.
1638
1643
  - Add IModelDb.createSnapshot/openSnapshot/closeSnapshot, deprecate IModelDb.createStandalone/openStandalone/closeStandalone
1639
1644
  - Moved IModelJsExpressServer class into a new package (@itwin/express-server).
1640
1645
  - Simplified tile caching IModelHost config and removed dev flags. Allow
@@ -1661,7 +1666,7 @@ Wed, 06 Mar 2019 15:41:22 GMT
1661
1666
  - Changes package.json to include api-extractor and adds api-extractor.json
1662
1667
  - Use new buildIModelJsBuild script
1663
1668
  - AxisAlignedBox and ElementAlignedBox are now typed to Range3d rather than classes
1664
- - 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.
1665
1670
  - Clone methods are no longer generic
1666
1671
  - Remove unneeded typedoc plugin dependency
1667
1672
  - Added spatial <-> cartographic methods that check/use the geographic coordinate system before using ecef location.
@@ -1706,8 +1711,8 @@ Mon, 14 Jan 2019 23:09:10 GMT
1706
1711
 
1707
1712
  ### Updates
1708
1713
 
1709
- - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1710
- - 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.
1711
1716
  - Renamed RequestProxy->RequestHost. Allowed applications to configure proxy server with HTTPS_PROXY env.
1712
1717
  - Add backend TextureAPI and accompanying test
1713
1718
 
@@ -1812,7 +1817,7 @@ Mon, 03 Dec 2018 18:52:58 GMT
1812
1817
 
1813
1818
  ### Updates
1814
1819
 
1815
- - 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.
1816
1821
  - Add ElementRefersToElements.insert
1817
1822
  - Fixed front end integration tests.
1818
1823
  - Document the intended purpose of IModelJsExpressServer within a deployment environment.
@@ -1881,11 +1886,11 @@ Thu, 08 Nov 2018 17:59:20 GMT
1881
1886
 
1882
1887
  - Fix JSON representation of DisplayStyle.
1883
1888
  - Add IModelImporter as a base class for utility methods needed by all importers
1884
- - Removed assertion when deleting a memoized open call.
1889
+ - Removed assertion when deleting a memoized open call.
1885
1890
  - Add more methods to IModelImporter
1886
1891
  - Fix snapping test
1887
1892
  - OIDC related enhancments (WIP).
1888
- - Re-enabled several backend integration tests.
1893
+ - Re-enabled several backend integration tests.
1889
1894
  - Refactor analysis-importer to use IModelImporter
1890
1895
  - Updated to TypeScript 3.1
1891
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. 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
- }
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. Use `@itwin/object-storage-oss` instead, see https://github.com/iTwin/object-storage for more details.\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"]}