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

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