@itwin/core-backend 3.0.0-extension.1 → 3.0.0

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 (163) hide show
  1. package/CHANGELOG.md +211 -67
  2. package/LICENSE.md +1 -1
  3. package/lib/cjs/AliCloudStorageService.d.ts +8 -2
  4. package/lib/cjs/AliCloudStorageService.d.ts.map +1 -1
  5. package/lib/cjs/AliCloudStorageService.js +4 -5
  6. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  7. package/lib/cjs/BackendHubAccess.d.ts +9 -9
  8. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  9. package/lib/cjs/BackendHubAccess.js.map +1 -1
  10. package/lib/cjs/BriefcaseManager.js +4 -3
  11. package/lib/cjs/BriefcaseManager.js.map +1 -1
  12. package/lib/cjs/Category.d.ts +1 -1
  13. package/lib/cjs/Category.d.ts.map +1 -1
  14. package/lib/cjs/Category.js +6 -6
  15. package/lib/cjs/Category.js.map +1 -1
  16. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  17. package/lib/cjs/ChangeSummaryManager.js +2 -0
  18. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  19. package/lib/cjs/ChangedElementsDb.d.ts +2 -0
  20. package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
  21. package/lib/cjs/ChangedElementsDb.js +1 -1
  22. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  23. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  24. package/lib/cjs/CheckpointManager.js +10 -7
  25. package/lib/cjs/CheckpointManager.js.map +1 -1
  26. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  27. package/lib/cjs/ClassRegistry.js +10 -3
  28. package/lib/cjs/ClassRegistry.js.map +1 -1
  29. package/lib/cjs/CloudStorageBackend.d.ts +2 -3
  30. package/lib/cjs/CloudStorageBackend.d.ts.map +1 -1
  31. package/lib/cjs/CloudStorageBackend.js +5 -2
  32. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  33. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  34. package/lib/cjs/ConcurrentQuery.js +7 -0
  35. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  36. package/lib/cjs/DevTools.d.ts +2 -2
  37. package/lib/cjs/DevTools.d.ts.map +1 -1
  38. package/lib/cjs/DevTools.js +2 -2
  39. package/lib/cjs/DevTools.js.map +1 -1
  40. package/lib/cjs/DisplayStyle.d.ts +2 -2
  41. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  42. package/lib/cjs/DisplayStyle.js +15 -47
  43. package/lib/cjs/DisplayStyle.js.map +1 -1
  44. package/lib/cjs/ECDb.d.ts +5 -9
  45. package/lib/cjs/ECDb.d.ts.map +1 -1
  46. package/lib/cjs/ECDb.js +11 -14
  47. package/lib/cjs/ECDb.js.map +1 -1
  48. package/lib/cjs/ECSchemaXmlContext.d.ts +1 -0
  49. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -1
  50. package/lib/cjs/ECSchemaXmlContext.js +10 -4
  51. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  52. package/lib/cjs/ECSqlStatement.d.ts +8 -8
  53. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  54. package/lib/cjs/ECSqlStatement.js +24 -15
  55. package/lib/cjs/ECSqlStatement.js.map +1 -1
  56. package/lib/cjs/Element.d.ts +16 -16
  57. package/lib/cjs/Element.d.ts.map +1 -1
  58. package/lib/cjs/Element.js +9 -9
  59. package/lib/cjs/Element.js.map +1 -1
  60. package/lib/cjs/ElementAspect.d.ts +2 -2
  61. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  62. package/lib/cjs/ElementAspect.js +2 -2
  63. package/lib/cjs/ElementAspect.js.map +1 -1
  64. package/lib/cjs/ElementGraphics.js +1 -1
  65. package/lib/cjs/ElementGraphics.js.map +1 -1
  66. package/lib/cjs/Entity.d.ts +11 -3
  67. package/lib/cjs/Entity.d.ts.map +1 -1
  68. package/lib/cjs/Entity.js +10 -2
  69. package/lib/cjs/Entity.js.map +1 -1
  70. package/lib/cjs/ExportGraphics.d.ts +1 -1
  71. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  72. package/lib/cjs/ExportGraphics.js +3 -0
  73. package/lib/cjs/ExportGraphics.js.map +1 -1
  74. package/lib/cjs/GeometrySummary.d.ts.map +1 -1
  75. package/lib/cjs/GeometrySummary.js +5 -2
  76. package/lib/cjs/GeometrySummary.js.map +1 -1
  77. package/lib/cjs/IModelDb.d.ts +44 -26
  78. package/lib/cjs/IModelDb.d.ts.map +1 -1
  79. package/lib/cjs/IModelDb.js +114 -42
  80. package/lib/cjs/IModelDb.js.map +1 -1
  81. package/lib/cjs/IModelHost.d.ts +40 -19
  82. package/lib/cjs/IModelHost.d.ts.map +1 -1
  83. package/lib/cjs/IModelHost.js +70 -20
  84. package/lib/cjs/IModelHost.js.map +1 -1
  85. package/lib/cjs/IModelJsFs.js +1 -1
  86. package/lib/cjs/IModelJsFs.js.map +1 -1
  87. package/lib/cjs/IpcHost.js +2 -1
  88. package/lib/cjs/IpcHost.js.map +1 -1
  89. package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -1
  90. package/lib/cjs/LocalhostIpcHost.js +10 -3
  91. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  92. package/lib/cjs/Material.d.ts +1 -1
  93. package/lib/cjs/Material.d.ts.map +1 -1
  94. package/lib/cjs/Material.js +1 -1
  95. package/lib/cjs/Material.js.map +1 -1
  96. package/lib/cjs/Model.d.ts +4 -4
  97. package/lib/cjs/Model.d.ts.map +1 -1
  98. package/lib/cjs/Model.js +3 -3
  99. package/lib/cjs/Model.js.map +1 -1
  100. package/lib/cjs/NativeHost.d.ts +4 -22
  101. package/lib/cjs/NativeHost.d.ts.map +1 -1
  102. package/lib/cjs/NativeHost.js +4 -56
  103. package/lib/cjs/NativeHost.js.map +1 -1
  104. package/lib/cjs/Relationship.d.ts +10 -9
  105. package/lib/cjs/Relationship.d.ts.map +1 -1
  106. package/lib/cjs/Relationship.js +14 -8
  107. package/lib/cjs/Relationship.js.map +1 -1
  108. package/lib/cjs/RpcBackend.d.ts +4 -0
  109. package/lib/cjs/RpcBackend.d.ts.map +1 -1
  110. package/lib/cjs/RpcBackend.js +7 -0
  111. package/lib/cjs/RpcBackend.js.map +1 -1
  112. package/lib/cjs/SQLiteDb.js +1 -1
  113. package/lib/cjs/SQLiteDb.js.map +1 -1
  114. package/lib/cjs/ServerBasedLocks.d.ts +4 -10
  115. package/lib/cjs/ServerBasedLocks.d.ts.map +1 -1
  116. package/lib/cjs/ServerBasedLocks.js +12 -20
  117. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  118. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  119. package/lib/cjs/SqliteStatement.js.map +1 -1
  120. package/lib/cjs/Texture.js +1 -1
  121. package/lib/cjs/Texture.js.map +1 -1
  122. package/lib/cjs/TxnManager.js +1 -1
  123. package/lib/cjs/TxnManager.js.map +1 -1
  124. package/lib/cjs/ViewDefinition.d.ts +11 -11
  125. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  126. package/lib/cjs/ViewDefinition.js +5 -5
  127. package/lib/cjs/ViewDefinition.js.map +1 -1
  128. package/lib/cjs/assets/Settings.schema.json +25 -0
  129. package/lib/cjs/core-backend.d.ts +8 -1
  130. package/lib/cjs/core-backend.d.ts.map +1 -1
  131. package/lib/cjs/core-backend.js +9 -1
  132. package/lib/cjs/core-backend.js.map +1 -1
  133. package/lib/cjs/domains/FunctionalElements.d.ts +1 -1
  134. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  135. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  136. package/lib/cjs/domains/GenericElements.d.ts +2 -2
  137. package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
  138. package/lib/cjs/domains/GenericElements.js.map +1 -1
  139. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  140. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +33 -24
  141. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  142. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  143. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +10 -7
  144. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  145. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  146. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +11 -1
  147. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  148. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts.map +1 -1
  149. package/lib/cjs/rpc-impl/WipRpcImpl.js +3 -0
  150. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  151. package/lib/cjs/workspace/Settings.d.ts +182 -0
  152. package/lib/cjs/workspace/Settings.d.ts.map +1 -0
  153. package/lib/cjs/workspace/Settings.js +144 -0
  154. package/lib/cjs/workspace/Settings.js.map +1 -0
  155. package/lib/cjs/workspace/SettingsSpecRegistry.d.ts +68 -0
  156. package/lib/cjs/workspace/SettingsSpecRegistry.d.ts.map +1 -0
  157. package/lib/cjs/workspace/SettingsSpecRegistry.js +122 -0
  158. package/lib/cjs/workspace/SettingsSpecRegistry.js.map +1 -0
  159. package/lib/cjs/workspace/Workspace.d.ts +306 -0
  160. package/lib/cjs/workspace/Workspace.d.ts.map +1 -0
  161. package/lib/cjs/workspace/Workspace.js +372 -0
  162. package/lib/cjs/workspace/Workspace.js.map +1 -0
  163. package/package.json +32 -18
package/CHANGELOG.md CHANGED
@@ -1,6 +1,150 @@
1
1
  # Change Log - @itwin/core-backend
2
2
 
3
- This log was last generated on Tue, 21 Sep 2021 21:06:40 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 24 Jan 2022 14:00:52 GMT and should not be manually modified.
4
+
5
+ ## 3.0.0
6
+ Mon, 24 Jan 2022 14:00:52 GMT
7
+
8
+ ### Updates
9
+
10
+ - add briefcaseAlias argument to acquireNewBriefcaseId
11
+ - make one method to acquire both shared and exclusive locks
12
+ - Add GeometryClass to ExportGraphics
13
+ - Update SQLiteDb to public release tag
14
+ - initial support for cloud-based WorkspaceContainers
15
+ - added IModelDb.workspace
16
+ - improve concurrent query changes
17
+ - Skip full schema load that cause OOM error on node backend
18
+ - Do not reopen connection on schema change
19
+ - Remove usage-logging-client
20
+ - Upgrade target to ES2019
21
+ - Entity no longer implements EntityProps.
22
+ - suppress error logging during test that expect errors
23
+ - add test and improved concurrent query support
24
+ - fix flaky test
25
+ - Update BackendHubAccess api to use ChangesetIndexAndId
26
+ - Add new GeoServices class and first method to interpret WKT or complete GCS JSON."
27
+ - getAccessToken always returns a token
28
+ - Fix an exception when attempting to pull changes into a briefcase that already has all the changes.
29
+ - LocalhostIpcHost, display-test-app support for R/W web (via orchestrator)
30
+ - Added ability to convert iModel coordinates to or from any Geographic CRS
31
+ - rename contextId -> iTwinId
32
+ - Tests for solid kernel severe error exceptions.
33
+ - throw rather than returning status from IModelDb.saveFileProperty and IModelDb.deleteFileProperty
34
+ - use db.locks to release all locks
35
+ - rename to @itwin/core-backend
36
+ - export blobdaemon, blobdaemoncommandargs from imodeljs-native
37
+ - Log the error that we catch when v2 checkpoint fails to open
38
+ - use BentleyError.getErrorProps(e) instead of just logging e
39
+ - Introduce no-non-null-assertion lint rule.
40
+ - remove ClientRequestContext and its subclasses
41
+ - Removed config.app usage
42
+ - Remove deprecated APIs for 3.0.
43
+ - allow apps to set safety interval for reattaching deamon
44
+ - removed several previously-deprecated apis
45
+ - remove IModelWriteRpcInterface
46
+ - remove ClientRequestContext.current
47
+ - Renamed all occurrences of the term revision0 to version0.
48
+ - rework locks
49
+ - Removed NativeAppAuthorizationBackend
50
+ - Removed two unit tests for reproj and added one
51
+ - added RpcTrace
52
+ - Bumped dotenv and removed deprecated @types/dotenv
53
+ - Replaced ContextRegistry with generalized ITwinAccess interface
54
+ - Switching to consume new Projects-Client
55
+ - Renamed an iModel's parent container to iTwin
56
+ - Removed references to the deleted config-loader package
57
+ - split imodel-transformer out of imodel-backend package
58
+ - remove use of "any" types in SqliteStatement
59
+ - IModelDb.getTextureImage is async.
60
+ - Support for TypeDoc v0.22.7. Fix various broken docs links.
61
+ - only export necessary schemas during imodel transformation
62
+ - Improved log message when v2 checkpoint downloaded is not for the changeset requested
63
+ - caching options for changed elements processing
64
+ - Adding WebEditServer (test scenarios only for now)
65
+ - add persistent iModel-based settings
66
+ - initial implementation of Workspace and Settings
67
+
68
+ ## 2.19.28
69
+ Wed, 12 Jan 2022 14:52:38 GMT
70
+
71
+ _Version update only_
72
+
73
+ ## 2.19.27
74
+ Wed, 05 Jan 2022 20:07:20 GMT
75
+
76
+ _Version update only_
77
+
78
+ ## 2.19.26
79
+ Wed, 08 Dec 2021 20:54:52 GMT
80
+
81
+ _Version update only_
82
+
83
+ ## 2.19.25
84
+ Fri, 03 Dec 2021 20:05:49 GMT
85
+
86
+ _Version update only_
87
+
88
+ ## 2.19.24
89
+ Mon, 29 Nov 2021 18:44:31 GMT
90
+
91
+ _Version update only_
92
+
93
+ ## 2.19.23
94
+ Mon, 22 Nov 2021 20:41:39 GMT
95
+
96
+ _Version update only_
97
+
98
+ ## 2.19.22
99
+ Wed, 17 Nov 2021 01:23:26 GMT
100
+
101
+ ### Updates
102
+
103
+ - Avoid unnecessarily loading schemas that in extreme cases may exhaust JavaScript heap.
104
+
105
+ ## 2.19.21
106
+ Wed, 10 Nov 2021 10:58:24 GMT
107
+
108
+ _Version update only_
109
+
110
+ ## 2.19.20
111
+ Fri, 29 Oct 2021 16:14:22 GMT
112
+
113
+ ### Updates
114
+
115
+ - Additional test for GCS reprojection
116
+
117
+ ## 2.19.19
118
+ Mon, 25 Oct 2021 16:16:25 GMT
119
+
120
+ _Version update only_
121
+
122
+ ## 2.19.18
123
+ Thu, 21 Oct 2021 20:59:44 GMT
124
+
125
+ ### Updates
126
+
127
+ - Backport from PR#2451 enable reprojection and merge
128
+
129
+ ## 2.19.17
130
+ Thu, 14 Oct 2021 21:19:43 GMT
131
+
132
+ _Version update only_
133
+
134
+ ## 2.19.16
135
+ Mon, 11 Oct 2021 17:37:46 GMT
136
+
137
+ _Version update only_
138
+
139
+ ## 2.19.15
140
+ Fri, 08 Oct 2021 16:44:23 GMT
141
+
142
+ _Version update only_
143
+
144
+ ## 2.19.14
145
+ Fri, 01 Oct 2021 13:07:03 GMT
146
+
147
+ _Version update only_
4
148
 
5
149
  ## 2.19.13
6
150
  Tue, 21 Sep 2021 21:06:40 GMT
@@ -85,7 +229,7 @@ Mon, 26 Jul 2021 12:21:25 GMT
85
229
 
86
230
  - Reactivated test that stopped working when a previous PR for ecef dependency to geographicCRS was reverted
87
231
  - store changesetIndex on IModelDb
88
- - Better error checks when creating SpatialViewDefinition-s.
232
+ - Better error checks when creating SpatialViewDefinition-s.
89
233
  - remove internal barrel-import usage
90
234
  - throw exception when attempting to download a briefcase on top of an existing file
91
235
  - Add case for InterpolationCurve3d
@@ -120,11 +264,11 @@ Fri, 09 Jul 2021 18:11:24 GMT
120
264
  ### Updates
121
265
 
122
266
  - TemplateModelCloner now assigns a new FederationGuid for cloned element instances.
123
- - Accomodated the inability to reverse Changesets when creating change summaries.
267
+ - Accomodated the inability to reverse Changesets when creating change summaries.
124
268
  - fix lint issue
125
269
  - begin api transition to changeset index rather than changeset Id
126
270
  - Use ecef location calculated for projected iModels
127
- - Push refreshes access token if necessary.
271
+ - Push refreshes access token if necessary.
128
272
  - Do not reuse briefcase ids in ReadWrite workflows when using the RPC interfaces (if the briefcase was not found in the local file system)
129
273
  - Add missing SectionDrawing properties.
130
274
 
@@ -145,7 +289,7 @@ Fri, 02 Jul 2021 15:38:31 GMT
145
289
 
146
290
  ### Updates
147
291
 
148
- - Update to @bentley/imodeljs-native@2.17.10
292
+ - Update to @bentley/imodeljs-native@2.17.10
149
293
 
150
294
  ## 2.17.0
151
295
  Mon, 28 Jun 2021 16:20:11 GMT
@@ -411,8 +555,8 @@ Thu, 28 Jan 2021 13:39:27 GMT
411
555
 
412
556
  - Changed storageType from azure to azure?sas=1 for getCommandArgs function
413
557
  - Fix brep DataProps to/from flatbuffer to account for base64 string header.
414
- - Element geometry creation by brep operations.
415
- - Reinstated behavior when re-opening files read-write.
558
+ - Element geometry creation by brep operations.
559
+ - Reinstated behavior when re-opening files read-write.
416
560
  - enhance BriefcaseManager and BriefcaseDb for edit commands
417
561
  - Improve ElementGeometry documentation.
418
562
  - Add a check to verify, and fix, the DbGuid in the iModel if it is different than the Guid in iModelHub.
@@ -602,8 +746,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
602
746
  ### Updates
603
747
 
604
748
  - Update to @bentley/imodeljs-native@2.7.4
605
- - Fixes to front end methods to pull, merge and push.
606
- - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
749
+ - Fixes to front end methods to pull, merge and push.
750
+ - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
607
751
  - On iOS download in background
608
752
  - Fix ios hang issue
609
753
  - Modify queryModelRanges to handle non geometric model errors
@@ -694,7 +838,7 @@ Thu, 20 Aug 2020 20:57:09 GMT
694
838
  ### Updates
695
839
 
696
840
  - Update to imodeljs-native 2.5.0
697
- - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
841
+ - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
698
842
  - Fix for a recursive exception while closing a briefcase
699
843
  - Added mobile oidc client
700
844
  - Remove special code handling for mobile.
@@ -758,7 +902,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
758
902
  - Changes to support imodel-bridge
759
903
  - fix spelling mistakes in Device class
760
904
  - Fix typo in comments
761
- - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
905
+ - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
762
906
  - disallow protected operations for missing schemas marked with SchemaHasBehavior custom attribute
763
907
 
764
908
  ## 2.2.1
@@ -799,25 +943,25 @@ Thu, 28 May 2020 22:48:59 GMT
799
943
  - Update to imodeljs-native 2.1.0
800
944
  - Support for finding an ExternalSourceAspect given scope, id, and kind/hash.
801
945
  - ApplyChangeset perf tests updated
802
- - Fixed token expiry check for desktop authorization.
946
+ - Fixed token expiry check for desktop authorization.
803
947
  - Download ChangeSets in chunks
804
948
  - (1) In xy region booleans, support curved edges; (2) ExportGraphicsMeshVisitor class
805
949
  - Add ability to convert ExportGraphicsMesh to Polyface
806
950
  - Fixed validation of Guids (ContextId, IModelId) cached within a briefcase.
807
951
  - Moved iModelBridgeFwk to a separate package
808
- - Simplified logging for monitoring briefcase operations.
952
+ - Simplified logging for monitoring briefcase operations.
809
953
  - Fix transforms for creating and querying part instance geometry in world coordinate.
810
954
  - Fix and improvement to performance tests
811
955
  - Added support for schema XML import to iModelJs backend via the IModelDb.importSchemaStrings method.
812
956
  - channel rules
813
- - Fixed logging usage when opening connections.
957
+ - Fixed logging usage when opening connections.
814
958
 
815
959
  ## 2.0.0
816
960
  Wed, 06 May 2020 13:17:49 GMT
817
961
 
818
962
  ### Updates
819
963
 
820
- - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
964
+ - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
821
965
  - Added RivisionUtility class for debug/testing
822
966
  - node addon 2.0.18
823
967
  - addon 2.0.25
@@ -830,23 +974,23 @@ Wed, 06 May 2020 13:17:49 GMT
830
974
  - Performance tests for Applying Changesets
831
975
  - `IModelHost.startup` is now async.
832
976
  - `IModelHost.shutdown` is now async.
833
- - Refined checks for briefcase id, and fixed failing integration tests.
977
+ - Refined checks for briefcase id, and fixed failing integration tests.
834
978
  - Product Backlog Item 276268: Deleting the briefcase cache if the cache version is incorrect should not attempt to delete the root directory.
835
979
  - Setup initialization of briefcase cache for offline workflows. (VSTS#286489)
836
- - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
980
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
837
981
  - Move briefcase-specific events into BriefcaseIModelDb subclass
838
982
  - Fixed param when calling logger so that it is a function as the logger expects
839
- - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
983
+ - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
840
984
  - Changed ChangeSets download API
841
985
  - Added unlink for file handler
842
986
  - Update UlasClient tests to send more detailed feature log data
843
987
  - react to renaming of imodeljs-clients-backend to backend-itwin-client
844
988
  - apply changeset performance tests with local datasets
845
- - BriefcaseManager.delete should work in offline scenarios.
989
+ - BriefcaseManager.delete should work in offline scenarios.
846
990
  - Remove deprecated members of SectionLocation and downgrade to alpha pending refactor.
847
991
  - Support for progress/cancel from ios
848
992
  - Remove deprecated ExportGraphics types etc for 2.0
849
- - Updated docs.
993
+ - Updated docs.
850
994
  - IModelDb.findByKey replaces IModelDb.find
851
995
  - Include model extents with ViewStateProps for drawing views.
852
996
  - Remove deprecated APIs; see NextVersion.md for details.
@@ -867,29 +1011,29 @@ Wed, 06 May 2020 13:17:49 GMT
867
1011
  - Introduce the BriefcaseIModelDb class, make IModelDb abstract.
868
1012
  - Cleaned up unused async-s in BriefcaseManager
869
1013
  - Avoided casting of BriefcaseProps to IModelRpcProps.
870
- - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1014
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
871
1015
  - Move briefcase property from IModelDb --> BriefcaseIModelDb
872
1016
  - BriefcaseId is now an enum instead of a class
873
1017
  - Rename BriefcaseId --> ReservedBriefcaseId, introduce BriefcaseId type
874
- - VSTS#297017: Update cached briefcase information if changes were applied.
875
- - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
876
- - 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.
877
- - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
1018
+ - VSTS#297017: Update cached briefcase information if changes were applied.
1019
+ - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1020
+ - 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.
1021
+ - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
878
1022
  - Removed BriefcaseDb.create
879
- - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1023
+ - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
880
1024
  - fixed flaky test
881
- - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1025
+ - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
882
1026
  - do not throw exception in NativeAppBackend.startup()
883
- - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1027
+ - VSTS#296110: Setup a way to close briefcases when the native application is offline.
884
1028
  - Move concurrencyControl from IModelDb to BriefcaseIModelDb
885
1029
  - Renamed OIDC constructs for consistency; Removed SAML support.
886
1030
  - Add support for password-protecting snapshot iModels
887
1031
  - Fixed typo for ElementAspect perf tests
888
- - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
1032
+ - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
889
1033
  - Add purge dir method to iModelJsFs
890
1034
  - react to creation of new clients packages from imodeljs-clients
891
1035
  - ; substitute current date for feature usage without any set start/end dates
892
- - Removed deprecated utilities.
1036
+ - Removed deprecated utilities.
893
1037
  - enforce opening Snapshots readonly through StandaloneDb
894
1038
  - Remove the deprecated Entity.clone method
895
1039
  - Adjusted calls to some node addon changes (ECUtils removed)
@@ -901,13 +1045,13 @@ Wed, 06 May 2020 13:17:49 GMT
901
1045
  - Add FileNameResolver class
902
1046
  - Move snapshot methods out of IModelDb and into new SnapshotIModelDb class.
903
1047
  - Add TemplateModelCloner to place instances of a template model
904
- - Renamed TestOidcClient and related constructs for consistency.
1048
+ - Renamed TestOidcClient and related constructs for consistency.
905
1049
  - Add IModelDb.tryPrepareStatement
906
- - Fixed usage logging.
1050
+ - Fixed usage logging.
907
1051
  - fix failing ulas tests due to invalid featureId
908
1052
  - update ULAS test logging & feedback
909
1053
  - Update UlasUtilities to support exception-throwing native functions
910
- - Use standalone briefcases for PullOnly cases.
1054
+ - Use standalone briefcases for PullOnly cases.
911
1055
 
912
1056
  ## 1.14.1
913
1057
  Wed, 22 Apr 2020 19:04:00 GMT
@@ -922,7 +1066,7 @@ Tue, 31 Mar 2020 15:44:19 GMT
922
1066
  ### Updates
923
1067
 
924
1068
  - Update to addon 1.14.1
925
- - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
1069
+ - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
926
1070
  - Add handling for invalid predecessor ids to IModelTransformer
927
1071
  - Accomodate updated imodeljs-native ULAS functions
928
1072
 
@@ -937,7 +1081,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
937
1081
  ### Updates
938
1082
 
939
1083
  - Fix IGeometry roundtripping issue through ECSql. Fix insert/update binary properties for Element Aspect.
940
- - Separated out routines to download and open briefcases.
1084
+ - Separated out routines to download and open briefcases.
941
1085
  - bulk mode
942
1086
  - Consolidated sign-in for integration tests
943
1087
  - bulkmode
@@ -948,7 +1092,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
948
1092
  - Add ViewDefinition.getAuxiliaryCoordinateSystemId and ViewDefinition.setAuxiliaryCoordinateSystemId methods
949
1093
  - Add SpatialLocationModel.insert
950
1094
  - Add optional isPlantProjection parameter to PhysicalModel.insert
951
- - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1095
+ - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
952
1096
  - Better documentation of OidcDesktopClient
953
1097
  - Fixed changeset perf test by using another iModel on Hub
954
1098
  - Add ViewDetails to ViewDefinition.
@@ -981,7 +1125,7 @@ Tue, 07 Jan 2020 19:44:01 GMT
981
1125
  - Allow events to be sent from backend to frontend
982
1126
  - Add tryGetInstance / tryGetInstanceProps methods to the Relationship class which return undefined rather than throwing an exception when a relationship is not found.
983
1127
  - Fix webpack for ios test that were failing due to new dependencies
984
- - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
1128
+ - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
985
1129
  - Add tryGetElement / tryGetElementProps which return undefined rather than throwing an exception when an element is not found.
986
1130
  - Add tryGetModel, tryGetModelProps, tryGetSubModel which return undefined instead of throwing exceptions when the model is not found.
987
1131
 
@@ -993,7 +1137,7 @@ Tue, 10 Dec 2019 18:08:56 GMT
993
1137
  - Updated to addon 9.1.3
994
1138
  - Added AliCloud tile cache service
995
1139
  - Added framework to run imodeljs-backend test on ios using appcenter
996
- - Setup OidcDesktopClient for Electron use cases.
1140
+ - Setup OidcDesktopClient for Electron use cases.
997
1141
  - fix warnings from static analysis
998
1142
  - Enabling testing code for updating LR aspects after fix in native side.
999
1143
  - Addressing typo in a couple of members, making them match the schema properly.
@@ -1049,9 +1193,9 @@ Mon, 30 Sep 2019 22:28:48 GMT
1049
1193
  ### Updates
1050
1194
 
1051
1195
  - added support for blank IModelConnections
1052
- - Setup a way to supply authorization through the backend for frontend requests.
1053
- - Error log when downloading change sets should include iModelId for context.
1054
- - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1196
+ - Setup a way to supply authorization through the backend for frontend requests.
1197
+ - Error log when downloading change sets should include iModelId for context.
1198
+ - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1055
1199
  - Add IModelDb.Elements.hasSubModel
1056
1200
  - Make ExternalSourceAspect.checksum optional
1057
1201
  - Clear statement cache after schema import
@@ -1066,14 +1210,14 @@ Tue, 10 Sep 2019 12:09:49 GMT
1066
1210
 
1067
1211
  ### Updates
1068
1212
 
1069
- - Setup a way to supply authorization through the backend for frontend requests.
1070
- - Allow attaching change cache file before change summary extraction.
1071
- - Added change summary test, and improved doc a little.
1213
+ - Setup a way to supply authorization through the backend for frontend requests.
1214
+ - Allow attaching change cache file before change summary extraction.
1215
+ - Added change summary test, and improved doc a little.
1072
1216
  - Add minimum brep size option to IModelDb.exportGraphics
1073
1217
  - FunctionalSchema.importSchema is now deprecated.
1074
1218
  - Add support for GeometricModel.geometryGuid for detecting whether tiles for a model can be reused across versions
1075
1219
  - Added performance logging for tile upload
1076
- - 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.
1220
+ - 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.
1077
1221
  - Add method to create view with camera
1078
1222
  - Fixed misleading logging output in tile upload
1079
1223
 
@@ -1083,14 +1227,14 @@ Tue, 13 Aug 2019 20:25:53 GMT
1083
1227
  ### Updates
1084
1228
 
1085
1229
  - Allow custom tile cache services.
1086
- - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1087
- - Added Change Summary integration test, and fixed documentation.
1230
+ - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1231
+ - Added Change Summary integration test, and fixed documentation.
1088
1232
  - Trial code for tile upload errors
1089
1233
  - Fixed changeset performance tests
1090
1234
  - Tile upload logging.
1091
1235
  - Mark ExportGraphics API as public
1092
1236
  - Support for gzip compression of tiles
1093
- - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1237
+ - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1094
1238
  - Add IModelDb.isSnapshot
1095
1239
  - Tile upload error catching.
1096
1240
  - Azure tile upload logging
@@ -1102,7 +1246,7 @@ Wed, 24 Jul 2019 11:47:26 GMT
1102
1246
  ### Updates
1103
1247
 
1104
1248
  - Added option to restrict tile cache URLs by client IP address.
1105
- - Apply change sets at the backend in a non-blocking worker thread.
1249
+ - Apply change sets at the backend in a non-blocking worker thread.
1106
1250
  - Add ElementAspect handler methods
1107
1251
  - When deleting a parent element, make sure there are onDelete/onDeleted callbacks for child elements
1108
1252
  - Add support for linework to IModelDb.exportGraphics
@@ -1120,19 +1264,19 @@ Mon, 01 Jul 2019 19:04:29 GMT
1120
1264
 
1121
1265
  ### Updates
1122
1266
 
1123
- - Open fixes when briefcase requires merges.
1267
+ - Open fixes when briefcase requires merges.
1124
1268
  - Catch tile upload errors.
1125
- - Setting up briefcase is always from an older checkpoint.
1269
+ - Setting up briefcase is always from an older checkpoint.
1126
1270
  - Add materialId, subCategory to ExportGraphicsInfo
1127
- - Fix crash in getViewThumbnail for odd number of bytes
1271
+ - Fix crash in getViewThumbnail for odd number of bytes
1128
1272
  - Adding relationship class for GraphicalElement3dRepresentsElement.
1129
1273
  - Initial implementation of the LinearReferencing typescript domain
1130
1274
  - Adding domain classes for all relatinships in the LinearReferencing schema.
1131
1275
  - Exporting relationships module.
1132
- - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1133
- - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1276
+ - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1277
+ - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1134
1278
  - Add a new method `forceLoadSchemas` to `IModelJsNative.ECPresentationManager`.
1135
- - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1279
+ - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1136
1280
  - Properly document ModelSelector.models and CategorySelector.categories as Id64String arrays
1137
1281
  - Made `insertElement` not return Id64.invalid, throws error instead
1138
1282
  - Update to TypeScript 3.5
@@ -1143,7 +1287,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
1143
1287
 
1144
1288
  ### Updates
1145
1289
 
1146
- - Migrated agent applications to the newer client
1290
+ - Migrated agent applications to the newer client
1147
1291
  - RPC system now accepts only basic values (primitives, "interface" objects, and binary).
1148
1292
  - Switched from iModelHub Project API to Context API
1149
1293
  - Fix bug in IModelDb.createSnapshotFromSeed
@@ -1191,12 +1335,12 @@ Mon, 13 May 2019 15:52:05 GMT
1191
1335
  - Cleanup old imodelbank references
1192
1336
  - Add InformationRecordModel.insert, GroupModel.insert
1193
1337
  - Introduce LoggerCategory enum to advertise logger categories used by this package.
1194
- - Limited maximum cache size of the backend PromiseMemoizer.
1338
+ - Limited maximum cache size of the backend PromiseMemoizer.
1195
1339
  - Missing dependency on node-report
1196
- - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1340
+ - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1197
1341
  - Reinstated old version of OidcAgentClient
1198
- - Unauthorized open requests should cause a more obvious error.
1199
- - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1342
+ - Unauthorized open requests should cause a more obvious error.
1343
+ - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1200
1344
  - Memoization fix when opening iModels in shared, read-only mode .
1201
1345
  - Fixed setup of application version.
1202
1346
  - Updated Element CRUD perf tests
@@ -1206,7 +1350,7 @@ Mon, 13 May 2019 15:52:05 GMT
1206
1350
  - Remove ElementPropertyFormatter, IModelDb.getElementPropertiesForDisplay (use presentation rules instead)
1207
1351
  - Remove StandaloneIModelRpcImpl
1208
1352
  - Fix for Render Gradient.Symb test
1209
- - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1353
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1210
1354
  - Add IModelDb.createSnapshot/openSnapshot/closeSnapshot, deprecate IModelDb.createStandalone/openStandalone/closeStandalone
1211
1355
  - Moved IModelJsExpressServer class into a new package (@itwin/express-server).
1212
1356
  - Simplified tile caching IModelHost config and removed dev flags. Allow
@@ -1233,7 +1377,7 @@ Wed, 06 Mar 2019 15:41:22 GMT
1233
1377
  - Changes package.json to include api-extractor and adds api-extractor.json
1234
1378
  - Use new buildIModelJsBuild script
1235
1379
  - AxisAlignedBox and ElementAlignedBox are now typed to Range3d rather than classes
1236
- - 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.
1380
+ - 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.
1237
1381
  - Clone methods are no longer generic
1238
1382
  - Remove unneeded typedoc plugin dependency
1239
1383
  - Added spatial <-> cartographic methods that check/use the geographic coordinate system before using ecef location.
@@ -1278,8 +1422,8 @@ Mon, 14 Jan 2019 23:09:10 GMT
1278
1422
 
1279
1423
  ### Updates
1280
1424
 
1281
- - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1282
- - Removed IModelDb's cache of accessToken. For long running operations like AutoPush, the user must explicitly supply an IAccessTokenManager to keep the token current.
1425
+ - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1426
+ - Removed IModelDb's cache of accessToken. For long running operations like AutoPush, the user must explicitly supply an IAccessTokenManager to keep the token current.
1283
1427
  - Renamed RequestProxy->RequestHost. Allowed applications to configure proxy server with HTTPS_PROXY env.
1284
1428
  - Add backend TextureAPI and accompanying test
1285
1429
 
@@ -1384,7 +1528,7 @@ Mon, 03 Dec 2018 18:52:58 GMT
1384
1528
 
1385
1529
  ### Updates
1386
1530
 
1387
- - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1531
+ - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1388
1532
  - Add ElementRefersToElements.insert
1389
1533
  - Fixed front end integration tests.
1390
1534
  - Document the intended purpose of IModelJsExpressServer within a deployment environment.
@@ -1453,11 +1597,11 @@ Thu, 08 Nov 2018 17:59:20 GMT
1453
1597
 
1454
1598
  - Fix JSON representation of DisplayStyle.
1455
1599
  - Add IModelImporter as a base class for utility methods needed by all importers
1456
- - Removed assertion when deleting a memoized open call.
1600
+ - Removed assertion when deleting a memoized open call.
1457
1601
  - Add more methods to IModelImporter
1458
1602
  - Fix snapping test
1459
1603
  - OIDC related enhancments (WIP).
1460
- - Re-enabled several backend integration tests.
1604
+ - Re-enabled several backend integration tests.
1461
1605
  - Refactor analysis-importer to use IModelImporter
1462
1606
  - Updated to TypeScript 3.1
1463
1607
 
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright © 2017-2021 Bentley Systems, Incorporated. All rights reserved.
3
+ Copyright © 2017-2022 Bentley Systems, Incorporated. All rights reserved.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -1,10 +1,16 @@
1
1
  import { CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from "@itwin/core-common";
2
- import { CloudStorageService, CloudStorageServiceCredentials, CloudStorageUploadOptions } from "./CloudStorageBackend";
2
+ import { CloudStorageService, CloudStorageUploadOptions } from "./CloudStorageBackend";
3
+ /** @beta */
4
+ export interface AliCloudStorageServiceCredentials {
5
+ region: string;
6
+ accessKeyId: string;
7
+ accessKeySecret: string;
8
+ }
3
9
  /** @beta */
4
10
  export declare class AliCloudStorageService extends CloudStorageService {
5
11
  private _client;
6
12
  id: CloudStorageProvider;
7
- constructor(credentials: CloudStorageServiceCredentials);
13
+ constructor(credentials: AliCloudStorageServiceCredentials);
8
14
  obtainContainerUrl(id: CloudStorageContainerDescriptor, expiry: Date, _clientIp?: string): CloudStorageContainerUrl;
9
15
  listContainer(name: string, marker: string, count: number): Promise<string[]>;
10
16
  upload(container: string, name: string, data: Uint8Array, options?: CloudStorageUploadOptions): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"AliCloudStorageService.d.ts","sourceRoot":"","sources":["../../src/AliCloudStorageService.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACrH,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAuBvH,YAAY;AACZ,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,OAAO,CAAM;IAEd,EAAE,uBAAiC;gBAEvB,WAAW,EAAE,8BAA8B;IAUvD,kBAAkB,CAAC,EAAE,EAAE,+BAA+B,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,wBAAwB;IAoB7G,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAM7E,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC;CA4B7H"}
1
+ {"version":3,"file":"AliCloudStorageService.d.ts","sourceRoot":"","sources":["../../src/AliCloudStorageService.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,oBAAoB,EAAe,MAAM,oBAAoB,CAAC;AAClI,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEvF,YAAY;AACZ,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB;AAuBD,YAAY;AACZ,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,OAAO,CAAM;IAEd,EAAE,uBAAiC;gBAEvB,WAAW,EAAE,iCAAiC;IAM1D,kBAAkB,CAAC,EAAE,EAAE,+BAA+B,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,wBAAwB;IAuB7G,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAM7E,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC;CA4B7H"}
@@ -7,6 +7,7 @@ exports.AliCloudStorageService = void 0;
7
7
  *--------------------------------------------------------------------------------------------*/
8
8
  const stream_1 = require("stream");
9
9
  const zlib = require("zlib");
10
+ const core_bentley_1 = require("@itwin/core-bentley");
10
11
  const core_common_1 = require("@itwin/core-common");
11
12
  const CloudStorageBackend_1 = require("./CloudStorageBackend");
12
13
  /** @beta */
@@ -14,11 +15,7 @@ class AliCloudStorageService extends CloudStorageBackend_1.CloudStorageService {
14
15
  constructor(credentials) {
15
16
  super();
16
17
  this.id = core_common_1.CloudStorageProvider.AliCloud;
17
- this._client = new OSS({
18
- region: "oss-cn-hangzhou",
19
- accessKeyId: credentials.account,
20
- accessKeySecret: credentials.accessKey,
21
- });
18
+ this._client = new OSS(credentials);
22
19
  }
23
20
  obtainContainerUrl(id, expiry, _clientIp) {
24
21
  const now = new Date().getTime();
@@ -26,6 +23,8 @@ class AliCloudStorageService extends CloudStorageBackend_1.CloudStorageService {
26
23
  expires: expiry.getTime() - now,
27
24
  };
28
25
  this._client.useBucket(id.name);
26
+ if (undefined === id.resource)
27
+ throw new core_common_1.IModelError(core_bentley_1.BentleyStatus.ERROR, "Attribute 'resource' on CloudStorageContainerDescriptor object is undefined.");
29
28
  const url = {
30
29
  descriptor: this.makeDescriptor(id),
31
30
  valid: 0,
@@ -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 { CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from \"@itwin/core-common\";\r\nimport { CloudStorageService, CloudStorageServiceCredentials, CloudStorageUploadOptions } from \"./CloudStorageBackend\";\r\n\r\ndeclare class OSS {\r\n constructor(params: { region: string, accessKeyId: string, accessKeySecret: string })\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/** @beta */\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: CloudStorageServiceCredentials) {\r\n super();\r\n\r\n this._client = new OSS({\r\n region: \"oss-cn-hangzhou\",\r\n accessKeyId: credentials.account,\r\n accessKeySecret: credentials.accessKey,\r\n });\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 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":["/*---------------------------------------------------------------------------------------------\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/** @beta */\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/** @beta */\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"]}