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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +221 -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 +116 -44
  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 +12 -4
  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,160 @@
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 Thu, 10 Mar 2022 21:18:13 GMT and should not be manually modified.
4
+
5
+ ## 3.0.2
6
+ Thu, 10 Mar 2022 21:18:13 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.0.1
11
+ Thu, 24 Feb 2022 15:26:55 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.0.0
16
+ Mon, 24 Jan 2022 14:00:52 GMT
17
+
18
+ ### Updates
19
+
20
+ - add briefcaseAlias argument to acquireNewBriefcaseId
21
+ - make one method to acquire both shared and exclusive locks
22
+ - Add GeometryClass to ExportGraphics
23
+ - Update SQLiteDb to public release tag
24
+ - initial support for cloud-based WorkspaceContainers
25
+ - added IModelDb.workspace
26
+ - improve concurrent query changes
27
+ - Skip full schema load that cause OOM error on node backend
28
+ - Do not reopen connection on schema change
29
+ - Remove usage-logging-client
30
+ - Upgrade target to ES2019
31
+ - Entity no longer implements EntityProps.
32
+ - suppress error logging during test that expect errors
33
+ - add test and improved concurrent query support
34
+ - fix flaky test
35
+ - Update BackendHubAccess api to use ChangesetIndexAndId
36
+ - Add new GeoServices class and first method to interpret WKT or complete GCS JSON."
37
+ - getAccessToken always returns a token
38
+ - Fix an exception when attempting to pull changes into a briefcase that already has all the changes.
39
+ - LocalhostIpcHost, display-test-app support for R/W web (via orchestrator)
40
+ - Added ability to convert iModel coordinates to or from any Geographic CRS
41
+ - rename contextId -> iTwinId
42
+ - Tests for solid kernel severe error exceptions.
43
+ - throw rather than returning status from IModelDb.saveFileProperty and IModelDb.deleteFileProperty
44
+ - use db.locks to release all locks
45
+ - rename to @itwin/core-backend
46
+ - export blobdaemon, blobdaemoncommandargs from imodeljs-native
47
+ - Log the error that we catch when v2 checkpoint fails to open
48
+ - use BentleyError.getErrorProps(e) instead of just logging e
49
+ - Introduce no-non-null-assertion lint rule.
50
+ - remove ClientRequestContext and its subclasses
51
+ - Removed config.app usage
52
+ - Remove deprecated APIs for 3.0.
53
+ - allow apps to set safety interval for reattaching deamon
54
+ - removed several previously-deprecated apis
55
+ - remove IModelWriteRpcInterface
56
+ - remove ClientRequestContext.current
57
+ - Renamed all occurrences of the term revision0 to version0.
58
+ - rework locks
59
+ - Removed NativeAppAuthorizationBackend
60
+ - Removed two unit tests for reproj and added one
61
+ - added RpcTrace
62
+ - Bumped dotenv and removed deprecated @types/dotenv
63
+ - Replaced ContextRegistry with generalized ITwinAccess interface
64
+ - Switching to consume new Projects-Client
65
+ - Renamed an iModel's parent container to iTwin
66
+ - Removed references to the deleted config-loader package
67
+ - split imodel-transformer out of imodel-backend package
68
+ - remove use of "any" types in SqliteStatement
69
+ - IModelDb.getTextureImage is async.
70
+ - Support for TypeDoc v0.22.7. Fix various broken docs links.
71
+ - only export necessary schemas during imodel transformation
72
+ - Improved log message when v2 checkpoint downloaded is not for the changeset requested
73
+ - caching options for changed elements processing
74
+ - Adding WebEditServer (test scenarios only for now)
75
+ - add persistent iModel-based settings
76
+ - initial implementation of Workspace and Settings
77
+
78
+ ## 2.19.28
79
+ Wed, 12 Jan 2022 14:52:38 GMT
80
+
81
+ _Version update only_
82
+
83
+ ## 2.19.27
84
+ Wed, 05 Jan 2022 20:07:20 GMT
85
+
86
+ _Version update only_
87
+
88
+ ## 2.19.26
89
+ Wed, 08 Dec 2021 20:54:52 GMT
90
+
91
+ _Version update only_
92
+
93
+ ## 2.19.25
94
+ Fri, 03 Dec 2021 20:05:49 GMT
95
+
96
+ _Version update only_
97
+
98
+ ## 2.19.24
99
+ Mon, 29 Nov 2021 18:44:31 GMT
100
+
101
+ _Version update only_
102
+
103
+ ## 2.19.23
104
+ Mon, 22 Nov 2021 20:41:39 GMT
105
+
106
+ _Version update only_
107
+
108
+ ## 2.19.22
109
+ Wed, 17 Nov 2021 01:23:26 GMT
110
+
111
+ ### Updates
112
+
113
+ - Avoid unnecessarily loading schemas that in extreme cases may exhaust JavaScript heap.
114
+
115
+ ## 2.19.21
116
+ Wed, 10 Nov 2021 10:58:24 GMT
117
+
118
+ _Version update only_
119
+
120
+ ## 2.19.20
121
+ Fri, 29 Oct 2021 16:14:22 GMT
122
+
123
+ ### Updates
124
+
125
+ - Additional test for GCS reprojection
126
+
127
+ ## 2.19.19
128
+ Mon, 25 Oct 2021 16:16:25 GMT
129
+
130
+ _Version update only_
131
+
132
+ ## 2.19.18
133
+ Thu, 21 Oct 2021 20:59:44 GMT
134
+
135
+ ### Updates
136
+
137
+ - Backport from PR#2451 enable reprojection and merge
138
+
139
+ ## 2.19.17
140
+ Thu, 14 Oct 2021 21:19:43 GMT
141
+
142
+ _Version update only_
143
+
144
+ ## 2.19.16
145
+ Mon, 11 Oct 2021 17:37:46 GMT
146
+
147
+ _Version update only_
148
+
149
+ ## 2.19.15
150
+ Fri, 08 Oct 2021 16:44:23 GMT
151
+
152
+ _Version update only_
153
+
154
+ ## 2.19.14
155
+ Fri, 01 Oct 2021 13:07:03 GMT
156
+
157
+ _Version update only_
4
158
 
5
159
  ## 2.19.13
6
160
  Tue, 21 Sep 2021 21:06:40 GMT
@@ -85,7 +239,7 @@ Mon, 26 Jul 2021 12:21:25 GMT
85
239
 
86
240
  - Reactivated test that stopped working when a previous PR for ecef dependency to geographicCRS was reverted
87
241
  - store changesetIndex on IModelDb
88
- - Better error checks when creating SpatialViewDefinition-s.
242
+ - Better error checks when creating SpatialViewDefinition-s.
89
243
  - remove internal barrel-import usage
90
244
  - throw exception when attempting to download a briefcase on top of an existing file
91
245
  - Add case for InterpolationCurve3d
@@ -120,11 +274,11 @@ Fri, 09 Jul 2021 18:11:24 GMT
120
274
  ### Updates
121
275
 
122
276
  - TemplateModelCloner now assigns a new FederationGuid for cloned element instances.
123
- - Accomodated the inability to reverse Changesets when creating change summaries.
277
+ - Accomodated the inability to reverse Changesets when creating change summaries.
124
278
  - fix lint issue
125
279
  - begin api transition to changeset index rather than changeset Id
126
280
  - Use ecef location calculated for projected iModels
127
- - Push refreshes access token if necessary.
281
+ - Push refreshes access token if necessary.
128
282
  - 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
283
  - Add missing SectionDrawing properties.
130
284
 
@@ -145,7 +299,7 @@ Fri, 02 Jul 2021 15:38:31 GMT
145
299
 
146
300
  ### Updates
147
301
 
148
- - Update to @bentley/imodeljs-native@2.17.10
302
+ - Update to @bentley/imodeljs-native@2.17.10
149
303
 
150
304
  ## 2.17.0
151
305
  Mon, 28 Jun 2021 16:20:11 GMT
@@ -411,8 +565,8 @@ Thu, 28 Jan 2021 13:39:27 GMT
411
565
 
412
566
  - Changed storageType from azure to azure?sas=1 for getCommandArgs function
413
567
  - 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.
568
+ - Element geometry creation by brep operations.
569
+ - Reinstated behavior when re-opening files read-write.
416
570
  - enhance BriefcaseManager and BriefcaseDb for edit commands
417
571
  - Improve ElementGeometry documentation.
418
572
  - Add a check to verify, and fix, the DbGuid in the iModel if it is different than the Guid in iModelHub.
@@ -602,8 +756,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
602
756
  ### Updates
603
757
 
604
758
  - 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.
759
+ - Fixes to front end methods to pull, merge and push.
760
+ - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
607
761
  - On iOS download in background
608
762
  - Fix ios hang issue
609
763
  - Modify queryModelRanges to handle non geometric model errors
@@ -694,7 +848,7 @@ Thu, 20 Aug 2020 20:57:09 GMT
694
848
  ### Updates
695
849
 
696
850
  - Update to imodeljs-native 2.5.0
697
- - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
851
+ - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
698
852
  - Fix for a recursive exception while closing a briefcase
699
853
  - Added mobile oidc client
700
854
  - Remove special code handling for mobile.
@@ -758,7 +912,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
758
912
  - Changes to support imodel-bridge
759
913
  - fix spelling mistakes in Device class
760
914
  - Fix typo in comments
761
- - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
915
+ - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
762
916
  - disallow protected operations for missing schemas marked with SchemaHasBehavior custom attribute
763
917
 
764
918
  ## 2.2.1
@@ -799,25 +953,25 @@ Thu, 28 May 2020 22:48:59 GMT
799
953
  - Update to imodeljs-native 2.1.0
800
954
  - Support for finding an ExternalSourceAspect given scope, id, and kind/hash.
801
955
  - ApplyChangeset perf tests updated
802
- - Fixed token expiry check for desktop authorization.
956
+ - Fixed token expiry check for desktop authorization.
803
957
  - Download ChangeSets in chunks
804
958
  - (1) In xy region booleans, support curved edges; (2) ExportGraphicsMeshVisitor class
805
959
  - Add ability to convert ExportGraphicsMesh to Polyface
806
960
  - Fixed validation of Guids (ContextId, IModelId) cached within a briefcase.
807
961
  - Moved iModelBridgeFwk to a separate package
808
- - Simplified logging for monitoring briefcase operations.
962
+ - Simplified logging for monitoring briefcase operations.
809
963
  - Fix transforms for creating and querying part instance geometry in world coordinate.
810
964
  - Fix and improvement to performance tests
811
965
  - Added support for schema XML import to iModelJs backend via the IModelDb.importSchemaStrings method.
812
966
  - channel rules
813
- - Fixed logging usage when opening connections.
967
+ - Fixed logging usage when opening connections.
814
968
 
815
969
  ## 2.0.0
816
970
  Wed, 06 May 2020 13:17:49 GMT
817
971
 
818
972
  ### Updates
819
973
 
820
- - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
974
+ - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
821
975
  - Added RivisionUtility class for debug/testing
822
976
  - node addon 2.0.18
823
977
  - addon 2.0.25
@@ -830,23 +984,23 @@ Wed, 06 May 2020 13:17:49 GMT
830
984
  - Performance tests for Applying Changesets
831
985
  - `IModelHost.startup` is now async.
832
986
  - `IModelHost.shutdown` is now async.
833
- - Refined checks for briefcase id, and fixed failing integration tests.
987
+ - Refined checks for briefcase id, and fixed failing integration tests.
834
988
  - Product Backlog Item 276268: Deleting the briefcase cache if the cache version is incorrect should not attempt to delete the root directory.
835
989
  - Setup initialization of briefcase cache for offline workflows. (VSTS#286489)
836
- - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
990
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
837
991
  - Move briefcase-specific events into BriefcaseIModelDb subclass
838
992
  - 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.
993
+ - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
840
994
  - Changed ChangeSets download API
841
995
  - Added unlink for file handler
842
996
  - Update UlasClient tests to send more detailed feature log data
843
997
  - react to renaming of imodeljs-clients-backend to backend-itwin-client
844
998
  - apply changeset performance tests with local datasets
845
- - BriefcaseManager.delete should work in offline scenarios.
999
+ - BriefcaseManager.delete should work in offline scenarios.
846
1000
  - Remove deprecated members of SectionLocation and downgrade to alpha pending refactor.
847
1001
  - Support for progress/cancel from ios
848
1002
  - Remove deprecated ExportGraphics types etc for 2.0
849
- - Updated docs.
1003
+ - Updated docs.
850
1004
  - IModelDb.findByKey replaces IModelDb.find
851
1005
  - Include model extents with ViewStateProps for drawing views.
852
1006
  - Remove deprecated APIs; see NextVersion.md for details.
@@ -867,29 +1021,29 @@ Wed, 06 May 2020 13:17:49 GMT
867
1021
  - Introduce the BriefcaseIModelDb class, make IModelDb abstract.
868
1022
  - Cleaned up unused async-s in BriefcaseManager
869
1023
  - Avoided casting of BriefcaseProps to IModelRpcProps.
870
- - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1024
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
871
1025
  - Move briefcase property from IModelDb --> BriefcaseIModelDb
872
1026
  - BriefcaseId is now an enum instead of a class
873
1027
  - 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.
1028
+ - VSTS#297017: Update cached briefcase information if changes were applied.
1029
+ - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1030
+ - 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.
1031
+ - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
878
1032
  - Removed BriefcaseDb.create
879
- - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1033
+ - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
880
1034
  - fixed flaky test
881
- - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1035
+ - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
882
1036
  - do not throw exception in NativeAppBackend.startup()
883
- - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1037
+ - VSTS#296110: Setup a way to close briefcases when the native application is offline.
884
1038
  - Move concurrencyControl from IModelDb to BriefcaseIModelDb
885
1039
  - Renamed OIDC constructs for consistency; Removed SAML support.
886
1040
  - Add support for password-protecting snapshot iModels
887
1041
  - Fixed typo for ElementAspect perf tests
888
- - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
1042
+ - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
889
1043
  - Add purge dir method to iModelJsFs
890
1044
  - react to creation of new clients packages from imodeljs-clients
891
1045
  - ; substitute current date for feature usage without any set start/end dates
892
- - Removed deprecated utilities.
1046
+ - Removed deprecated utilities.
893
1047
  - enforce opening Snapshots readonly through StandaloneDb
894
1048
  - Remove the deprecated Entity.clone method
895
1049
  - Adjusted calls to some node addon changes (ECUtils removed)
@@ -901,13 +1055,13 @@ Wed, 06 May 2020 13:17:49 GMT
901
1055
  - Add FileNameResolver class
902
1056
  - Move snapshot methods out of IModelDb and into new SnapshotIModelDb class.
903
1057
  - Add TemplateModelCloner to place instances of a template model
904
- - Renamed TestOidcClient and related constructs for consistency.
1058
+ - Renamed TestOidcClient and related constructs for consistency.
905
1059
  - Add IModelDb.tryPrepareStatement
906
- - Fixed usage logging.
1060
+ - Fixed usage logging.
907
1061
  - fix failing ulas tests due to invalid featureId
908
1062
  - update ULAS test logging & feedback
909
1063
  - Update UlasUtilities to support exception-throwing native functions
910
- - Use standalone briefcases for PullOnly cases.
1064
+ - Use standalone briefcases for PullOnly cases.
911
1065
 
912
1066
  ## 1.14.1
913
1067
  Wed, 22 Apr 2020 19:04:00 GMT
@@ -922,7 +1076,7 @@ Tue, 31 Mar 2020 15:44:19 GMT
922
1076
  ### Updates
923
1077
 
924
1078
  - 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.
1079
+ - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
926
1080
  - Add handling for invalid predecessor ids to IModelTransformer
927
1081
  - Accomodate updated imodeljs-native ULAS functions
928
1082
 
@@ -937,7 +1091,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
937
1091
  ### Updates
938
1092
 
939
1093
  - Fix IGeometry roundtripping issue through ECSql. Fix insert/update binary properties for Element Aspect.
940
- - Separated out routines to download and open briefcases.
1094
+ - Separated out routines to download and open briefcases.
941
1095
  - bulk mode
942
1096
  - Consolidated sign-in for integration tests
943
1097
  - bulkmode
@@ -948,7 +1102,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
948
1102
  - Add ViewDefinition.getAuxiliaryCoordinateSystemId and ViewDefinition.setAuxiliaryCoordinateSystemId methods
949
1103
  - Add SpatialLocationModel.insert
950
1104
  - Add optional isPlantProjection parameter to PhysicalModel.insert
951
- - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1105
+ - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
952
1106
  - Better documentation of OidcDesktopClient
953
1107
  - Fixed changeset perf test by using another iModel on Hub
954
1108
  - Add ViewDetails to ViewDefinition.
@@ -981,7 +1135,7 @@ Tue, 07 Jan 2020 19:44:01 GMT
981
1135
  - Allow events to be sent from backend to frontend
982
1136
  - Add tryGetInstance / tryGetInstanceProps methods to the Relationship class which return undefined rather than throwing an exception when a relationship is not found.
983
1137
  - 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.
1138
+ - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
985
1139
  - Add tryGetElement / tryGetElementProps which return undefined rather than throwing an exception when an element is not found.
986
1140
  - Add tryGetModel, tryGetModelProps, tryGetSubModel which return undefined instead of throwing exceptions when the model is not found.
987
1141
 
@@ -993,7 +1147,7 @@ Tue, 10 Dec 2019 18:08:56 GMT
993
1147
  - Updated to addon 9.1.3
994
1148
  - Added AliCloud tile cache service
995
1149
  - Added framework to run imodeljs-backend test on ios using appcenter
996
- - Setup OidcDesktopClient for Electron use cases.
1150
+ - Setup OidcDesktopClient for Electron use cases.
997
1151
  - fix warnings from static analysis
998
1152
  - Enabling testing code for updating LR aspects after fix in native side.
999
1153
  - Addressing typo in a couple of members, making them match the schema properly.
@@ -1049,9 +1203,9 @@ Mon, 30 Sep 2019 22:28:48 GMT
1049
1203
  ### Updates
1050
1204
 
1051
1205
  - 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.
1206
+ - Setup a way to supply authorization through the backend for frontend requests.
1207
+ - Error log when downloading change sets should include iModelId for context.
1208
+ - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1055
1209
  - Add IModelDb.Elements.hasSubModel
1056
1210
  - Make ExternalSourceAspect.checksum optional
1057
1211
  - Clear statement cache after schema import
@@ -1066,14 +1220,14 @@ Tue, 10 Sep 2019 12:09:49 GMT
1066
1220
 
1067
1221
  ### Updates
1068
1222
 
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.
1223
+ - Setup a way to supply authorization through the backend for frontend requests.
1224
+ - Allow attaching change cache file before change summary extraction.
1225
+ - Added change summary test, and improved doc a little.
1072
1226
  - Add minimum brep size option to IModelDb.exportGraphics
1073
1227
  - FunctionalSchema.importSchema is now deprecated.
1074
1228
  - Add support for GeometricModel.geometryGuid for detecting whether tiles for a model can be reused across versions
1075
1229
  - 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.
1230
+ - 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
1231
  - Add method to create view with camera
1078
1232
  - Fixed misleading logging output in tile upload
1079
1233
 
@@ -1083,14 +1237,14 @@ Tue, 13 Aug 2019 20:25:53 GMT
1083
1237
  ### Updates
1084
1238
 
1085
1239
  - 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.
1240
+ - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1241
+ - Added Change Summary integration test, and fixed documentation.
1088
1242
  - Trial code for tile upload errors
1089
1243
  - Fixed changeset performance tests
1090
1244
  - Tile upload logging.
1091
1245
  - Mark ExportGraphics API as public
1092
1246
  - Support for gzip compression of tiles
1093
- - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1247
+ - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1094
1248
  - Add IModelDb.isSnapshot
1095
1249
  - Tile upload error catching.
1096
1250
  - Azure tile upload logging
@@ -1102,7 +1256,7 @@ Wed, 24 Jul 2019 11:47:26 GMT
1102
1256
  ### Updates
1103
1257
 
1104
1258
  - Added option to restrict tile cache URLs by client IP address.
1105
- - Apply change sets at the backend in a non-blocking worker thread.
1259
+ - Apply change sets at the backend in a non-blocking worker thread.
1106
1260
  - Add ElementAspect handler methods
1107
1261
  - When deleting a parent element, make sure there are onDelete/onDeleted callbacks for child elements
1108
1262
  - Add support for linework to IModelDb.exportGraphics
@@ -1120,19 +1274,19 @@ Mon, 01 Jul 2019 19:04:29 GMT
1120
1274
 
1121
1275
  ### Updates
1122
1276
 
1123
- - Open fixes when briefcase requires merges.
1277
+ - Open fixes when briefcase requires merges.
1124
1278
  - Catch tile upload errors.
1125
- - Setting up briefcase is always from an older checkpoint.
1279
+ - Setting up briefcase is always from an older checkpoint.
1126
1280
  - Add materialId, subCategory to ExportGraphicsInfo
1127
- - Fix crash in getViewThumbnail for odd number of bytes
1281
+ - Fix crash in getViewThumbnail for odd number of bytes
1128
1282
  - Adding relationship class for GraphicalElement3dRepresentsElement.
1129
1283
  - Initial implementation of the LinearReferencing typescript domain
1130
1284
  - Adding domain classes for all relatinships in the LinearReferencing schema.
1131
1285
  - 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.
1286
+ - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1287
+ - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1134
1288
  - Add a new method `forceLoadSchemas` to `IModelJsNative.ECPresentationManager`.
1135
- - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1289
+ - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1136
1290
  - Properly document ModelSelector.models and CategorySelector.categories as Id64String arrays
1137
1291
  - Made `insertElement` not return Id64.invalid, throws error instead
1138
1292
  - Update to TypeScript 3.5
@@ -1143,7 +1297,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
1143
1297
 
1144
1298
  ### Updates
1145
1299
 
1146
- - Migrated agent applications to the newer client
1300
+ - Migrated agent applications to the newer client
1147
1301
  - RPC system now accepts only basic values (primitives, "interface" objects, and binary).
1148
1302
  - Switched from iModelHub Project API to Context API
1149
1303
  - Fix bug in IModelDb.createSnapshotFromSeed
@@ -1191,12 +1345,12 @@ Mon, 13 May 2019 15:52:05 GMT
1191
1345
  - Cleanup old imodelbank references
1192
1346
  - Add InformationRecordModel.insert, GroupModel.insert
1193
1347
  - Introduce LoggerCategory enum to advertise logger categories used by this package.
1194
- - Limited maximum cache size of the backend PromiseMemoizer.
1348
+ - Limited maximum cache size of the backend PromiseMemoizer.
1195
1349
  - Missing dependency on node-report
1196
- - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1350
+ - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1197
1351
  - 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.
1352
+ - Unauthorized open requests should cause a more obvious error.
1353
+ - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1200
1354
  - Memoization fix when opening iModels in shared, read-only mode .
1201
1355
  - Fixed setup of application version.
1202
1356
  - Updated Element CRUD perf tests
@@ -1206,7 +1360,7 @@ Mon, 13 May 2019 15:52:05 GMT
1206
1360
  - Remove ElementPropertyFormatter, IModelDb.getElementPropertiesForDisplay (use presentation rules instead)
1207
1361
  - Remove StandaloneIModelRpcImpl
1208
1362
  - 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.
1363
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1210
1364
  - Add IModelDb.createSnapshot/openSnapshot/closeSnapshot, deprecate IModelDb.createStandalone/openStandalone/closeStandalone
1211
1365
  - Moved IModelJsExpressServer class into a new package (@itwin/express-server).
1212
1366
  - Simplified tile caching IModelHost config and removed dev flags. Allow
@@ -1233,7 +1387,7 @@ Wed, 06 Mar 2019 15:41:22 GMT
1233
1387
  - Changes package.json to include api-extractor and adds api-extractor.json
1234
1388
  - Use new buildIModelJsBuild script
1235
1389
  - 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.
1390
+ - 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
1391
  - Clone methods are no longer generic
1238
1392
  - Remove unneeded typedoc plugin dependency
1239
1393
  - Added spatial <-> cartographic methods that check/use the geographic coordinate system before using ecef location.
@@ -1278,8 +1432,8 @@ Mon, 14 Jan 2019 23:09:10 GMT
1278
1432
 
1279
1433
  ### Updates
1280
1434
 
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.
1435
+ - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1436
+ - 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
1437
  - Renamed RequestProxy->RequestHost. Allowed applications to configure proxy server with HTTPS_PROXY env.
1284
1438
  - Add backend TextureAPI and accompanying test
1285
1439
 
@@ -1384,7 +1538,7 @@ Mon, 03 Dec 2018 18:52:58 GMT
1384
1538
 
1385
1539
  ### Updates
1386
1540
 
1387
- - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1541
+ - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1388
1542
  - Add ElementRefersToElements.insert
1389
1543
  - Fixed front end integration tests.
1390
1544
  - Document the intended purpose of IModelJsExpressServer within a deployment environment.
@@ -1453,11 +1607,11 @@ Thu, 08 Nov 2018 17:59:20 GMT
1453
1607
 
1454
1608
  - Fix JSON representation of DisplayStyle.
1455
1609
  - Add IModelImporter as a base class for utility methods needed by all importers
1456
- - Removed assertion when deleting a memoized open call.
1610
+ - Removed assertion when deleting a memoized open call.
1457
1611
  - Add more methods to IModelImporter
1458
1612
  - Fix snapping test
1459
1613
  - OIDC related enhancments (WIP).
1460
- - Re-enabled several backend integration tests.
1614
+ - Re-enabled several backend integration tests.
1461
1615
  - Refactor analysis-importer to use IModelImporter
1462
1616
  - Updated to TypeScript 3.1
1463
1617
 
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"]}