@itwin/core-backend 3.1.0-dev.7 → 3.1.1

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 (38) hide show
  1. package/CHANGELOG.md +162 -67
  2. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  3. package/lib/cjs/ClassRegistry.js +58 -5
  4. package/lib/cjs/ClassRegistry.js.map +1 -1
  5. package/lib/cjs/CloudStorageBackend.d.ts +2 -0
  6. package/lib/cjs/CloudStorageBackend.d.ts.map +1 -1
  7. package/lib/cjs/CloudStorageBackend.js +9 -4
  8. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  9. package/lib/cjs/Entity.d.ts +12 -0
  10. package/lib/cjs/Entity.d.ts.map +1 -1
  11. package/lib/cjs/Entity.js +12 -0
  12. package/lib/cjs/Entity.js.map +1 -1
  13. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  14. package/lib/cjs/IModelCloneContext.js +4 -2
  15. package/lib/cjs/IModelCloneContext.js.map +1 -1
  16. package/lib/cjs/IModelDb.d.ts +15 -6
  17. package/lib/cjs/IModelDb.d.ts.map +1 -1
  18. package/lib/cjs/IModelDb.js +24 -6
  19. package/lib/cjs/IModelDb.js.map +1 -1
  20. package/lib/cjs/IModelSchemaLoader.d.ts +3 -3
  21. package/lib/cjs/IModelSchemaLoader.d.ts.map +1 -1
  22. package/lib/cjs/IModelSchemaLoader.js +33 -6
  23. package/lib/cjs/IModelSchemaLoader.js.map +1 -1
  24. package/lib/cjs/LocalhostIpcHost.d.ts +2 -0
  25. package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -1
  26. package/lib/cjs/LocalhostIpcHost.js +14 -7
  27. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  28. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  29. package/lib/cjs/PromiseMemoizer.js +3 -0
  30. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  31. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +4 -2
  32. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  33. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +6 -4
  34. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  35. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  36. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +1 -3
  37. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  38. package/package.json +19 -14
package/CHANGELOG.md CHANGED
@@ -1,6 +1,101 @@
1
1
  # Change Log - @itwin/core-backend
2
2
 
3
- This log was last generated on Wed, 12 Jan 2022 14:52:38 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 31 Mar 2022 15:55:48 GMT and should not be manually modified.
4
+
5
+ ## 3.1.1
6
+ Thu, 31 Mar 2022 15:55:48 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.1.0
11
+ Tue, 29 Mar 2022 20:53:47 GMT
12
+
13
+ ### Updates
14
+
15
+ - Deprecate IModelReadRpcInterface.getViewThumbnail
16
+ - generated element classes now have a default implementation of collectPredecessors returning all set navigation properties
17
+ - Correct return status for processGeometryStream and createBRepGeometry.
18
+ - Remove IModelDb.elementGeometryUpdate.
19
+ - You may specify an element's geometry in terms of an ElementGeometryDataEntry array
20
+ - Web IPC fix (when reloading frontend).
21
+
22
+ ## 3.0.3
23
+ Fri, 25 Mar 2022 15:10:01 GMT
24
+
25
+ _Version update only_
26
+
27
+ ## 3.0.2
28
+ Thu, 10 Mar 2022 21:18:13 GMT
29
+
30
+ _Version update only_
31
+
32
+ ## 3.0.1
33
+ Thu, 24 Feb 2022 15:26:55 GMT
34
+
35
+ _Version update only_
36
+
37
+ ## 3.0.0
38
+ Mon, 24 Jan 2022 14:00:52 GMT
39
+
40
+ ### Updates
41
+
42
+ - add briefcaseAlias argument to acquireNewBriefcaseId
43
+ - make one method to acquire both shared and exclusive locks
44
+ - Add GeometryClass to ExportGraphics
45
+ - Update SQLiteDb to public release tag
46
+ - initial support for cloud-based WorkspaceContainers
47
+ - added IModelDb.workspace
48
+ - improve concurrent query changes
49
+ - Skip full schema load that cause OOM error on node backend
50
+ - Do not reopen connection on schema change
51
+ - Remove usage-logging-client
52
+ - Upgrade target to ES2019
53
+ - Entity no longer implements EntityProps.
54
+ - suppress error logging during test that expect errors
55
+ - add test and improved concurrent query support
56
+ - fix flaky test
57
+ - Update BackendHubAccess api to use ChangesetIndexAndId
58
+ - Add new GeoServices class and first method to interpret WKT or complete GCS JSON."
59
+ - getAccessToken always returns a token
60
+ - Fix an exception when attempting to pull changes into a briefcase that already has all the changes.
61
+ - LocalhostIpcHost, display-test-app support for R/W web (via orchestrator)
62
+ - Added ability to convert iModel coordinates to or from any Geographic CRS
63
+ - rename contextId -> iTwinId
64
+ - Tests for solid kernel severe error exceptions.
65
+ - throw rather than returning status from IModelDb.saveFileProperty and IModelDb.deleteFileProperty
66
+ - use db.locks to release all locks
67
+ - rename to @itwin/core-backend
68
+ - export blobdaemon, blobdaemoncommandargs from imodeljs-native
69
+ - Log the error that we catch when v2 checkpoint fails to open
70
+ - use BentleyError.getErrorProps(e) instead of just logging e
71
+ - Introduce no-non-null-assertion lint rule.
72
+ - remove ClientRequestContext and its subclasses
73
+ - Removed config.app usage
74
+ - Remove deprecated APIs for 3.0.
75
+ - allow apps to set safety interval for reattaching deamon
76
+ - removed several previously-deprecated apis
77
+ - remove IModelWriteRpcInterface
78
+ - remove ClientRequestContext.current
79
+ - Renamed all occurrences of the term revision0 to version0.
80
+ - rework locks
81
+ - Removed NativeAppAuthorizationBackend
82
+ - Removed two unit tests for reproj and added one
83
+ - added RpcTrace
84
+ - Bumped dotenv and removed deprecated @types/dotenv
85
+ - Replaced ContextRegistry with generalized ITwinAccess interface
86
+ - Switching to consume new Projects-Client
87
+ - Renamed an iModel's parent container to iTwin
88
+ - Removed references to the deleted config-loader package
89
+ - split imodel-transformer out of imodel-backend package
90
+ - remove use of "any" types in SqliteStatement
91
+ - IModelDb.getTextureImage is async.
92
+ - Support for TypeDoc v0.22.7. Fix various broken docs links.
93
+ - only export necessary schemas during imodel transformation
94
+ - Improved log message when v2 checkpoint downloaded is not for the changeset requested
95
+ - caching options for changed elements processing
96
+ - Adding WebEditServer (test scenarios only for now)
97
+ - add persistent iModel-based settings
98
+ - initial implementation of Workspace and Settings
4
99
 
5
100
  ## 2.19.28
6
101
  Wed, 12 Jan 2022 14:52:38 GMT
@@ -166,7 +261,7 @@ Mon, 26 Jul 2021 12:21:25 GMT
166
261
 
167
262
  - Reactivated test that stopped working when a previous PR for ecef dependency to geographicCRS was reverted
168
263
  - store changesetIndex on IModelDb
169
- - Better error checks when creating SpatialViewDefinition-s.
264
+ - Better error checks when creating SpatialViewDefinition-s.
170
265
  - remove internal barrel-import usage
171
266
  - throw exception when attempting to download a briefcase on top of an existing file
172
267
  - Add case for InterpolationCurve3d
@@ -201,11 +296,11 @@ Fri, 09 Jul 2021 18:11:24 GMT
201
296
  ### Updates
202
297
 
203
298
  - TemplateModelCloner now assigns a new FederationGuid for cloned element instances.
204
- - Accomodated the inability to reverse Changesets when creating change summaries.
299
+ - Accomodated the inability to reverse Changesets when creating change summaries.
205
300
  - fix lint issue
206
301
  - begin api transition to changeset index rather than changeset Id
207
302
  - Use ecef location calculated for projected iModels
208
- - Push refreshes access token if necessary.
303
+ - Push refreshes access token if necessary.
209
304
  - Do not reuse briefcase ids in ReadWrite workflows when using the RPC interfaces (if the briefcase was not found in the local file system)
210
305
  - Add missing SectionDrawing properties.
211
306
 
@@ -226,7 +321,7 @@ Fri, 02 Jul 2021 15:38:31 GMT
226
321
 
227
322
  ### Updates
228
323
 
229
- - Update to @bentley/imodeljs-native@2.17.10
324
+ - Update to @bentley/imodeljs-native@2.17.10
230
325
 
231
326
  ## 2.17.0
232
327
  Mon, 28 Jun 2021 16:20:11 GMT
@@ -492,8 +587,8 @@ Thu, 28 Jan 2021 13:39:27 GMT
492
587
 
493
588
  - Changed storageType from azure to azure?sas=1 for getCommandArgs function
494
589
  - Fix brep DataProps to/from flatbuffer to account for base64 string header.
495
- - Element geometry creation by brep operations.
496
- - Reinstated behavior when re-opening files read-write.
590
+ - Element geometry creation by brep operations.
591
+ - Reinstated behavior when re-opening files read-write.
497
592
  - enhance BriefcaseManager and BriefcaseDb for edit commands
498
593
  - Improve ElementGeometry documentation.
499
594
  - Add a check to verify, and fix, the DbGuid in the iModel if it is different than the Guid in iModelHub.
@@ -683,8 +778,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
683
778
  ### Updates
684
779
 
685
780
  - Update to @bentley/imodeljs-native@2.7.4
686
- - Fixes to front end methods to pull, merge and push.
687
- - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
781
+ - Fixes to front end methods to pull, merge and push.
782
+ - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
688
783
  - On iOS download in background
689
784
  - Fix ios hang issue
690
785
  - Modify queryModelRanges to handle non geometric model errors
@@ -775,7 +870,7 @@ Thu, 20 Aug 2020 20:57:09 GMT
775
870
  ### Updates
776
871
 
777
872
  - Update to imodeljs-native 2.5.0
778
- - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
873
+ - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
779
874
  - Fix for a recursive exception while closing a briefcase
780
875
  - Added mobile oidc client
781
876
  - Remove special code handling for mobile.
@@ -839,7 +934,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
839
934
  - Changes to support imodel-bridge
840
935
  - fix spelling mistakes in Device class
841
936
  - Fix typo in comments
842
- - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
937
+ - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
843
938
  - disallow protected operations for missing schemas marked with SchemaHasBehavior custom attribute
844
939
 
845
940
  ## 2.2.1
@@ -880,25 +975,25 @@ Thu, 28 May 2020 22:48:59 GMT
880
975
  - Update to imodeljs-native 2.1.0
881
976
  - Support for finding an ExternalSourceAspect given scope, id, and kind/hash.
882
977
  - ApplyChangeset perf tests updated
883
- - Fixed token expiry check for desktop authorization.
978
+ - Fixed token expiry check for desktop authorization.
884
979
  - Download ChangeSets in chunks
885
980
  - (1) In xy region booleans, support curved edges; (2) ExportGraphicsMeshVisitor class
886
981
  - Add ability to convert ExportGraphicsMesh to Polyface
887
982
  - Fixed validation of Guids (ContextId, IModelId) cached within a briefcase.
888
983
  - Moved iModelBridgeFwk to a separate package
889
- - Simplified logging for monitoring briefcase operations.
984
+ - Simplified logging for monitoring briefcase operations.
890
985
  - Fix transforms for creating and querying part instance geometry in world coordinate.
891
986
  - Fix and improvement to performance tests
892
987
  - Added support for schema XML import to iModelJs backend via the IModelDb.importSchemaStrings method.
893
988
  - channel rules
894
- - Fixed logging usage when opening connections.
989
+ - Fixed logging usage when opening connections.
895
990
 
896
991
  ## 2.0.0
897
992
  Wed, 06 May 2020 13:17:49 GMT
898
993
 
899
994
  ### Updates
900
995
 
901
- - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
996
+ - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
902
997
  - Added RivisionUtility class for debug/testing
903
998
  - node addon 2.0.18
904
999
  - addon 2.0.25
@@ -911,23 +1006,23 @@ Wed, 06 May 2020 13:17:49 GMT
911
1006
  - Performance tests for Applying Changesets
912
1007
  - `IModelHost.startup` is now async.
913
1008
  - `IModelHost.shutdown` is now async.
914
- - Refined checks for briefcase id, and fixed failing integration tests.
1009
+ - Refined checks for briefcase id, and fixed failing integration tests.
915
1010
  - Product Backlog Item 276268: Deleting the briefcase cache if the cache version is incorrect should not attempt to delete the root directory.
916
1011
  - Setup initialization of briefcase cache for offline workflows. (VSTS#286489)
917
- - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1012
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
918
1013
  - Move briefcase-specific events into BriefcaseIModelDb subclass
919
1014
  - Fixed param when calling logger so that it is a function as the logger expects
920
- - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
1015
+ - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
921
1016
  - Changed ChangeSets download API
922
1017
  - Added unlink for file handler
923
1018
  - Update UlasClient tests to send more detailed feature log data
924
1019
  - react to renaming of imodeljs-clients-backend to backend-itwin-client
925
1020
  - apply changeset performance tests with local datasets
926
- - BriefcaseManager.delete should work in offline scenarios.
1021
+ - BriefcaseManager.delete should work in offline scenarios.
927
1022
  - Remove deprecated members of SectionLocation and downgrade to alpha pending refactor.
928
1023
  - Support for progress/cancel from ios
929
1024
  - Remove deprecated ExportGraphics types etc for 2.0
930
- - Updated docs.
1025
+ - Updated docs.
931
1026
  - IModelDb.findByKey replaces IModelDb.find
932
1027
  - Include model extents with ViewStateProps for drawing views.
933
1028
  - Remove deprecated APIs; see NextVersion.md for details.
@@ -948,29 +1043,29 @@ Wed, 06 May 2020 13:17:49 GMT
948
1043
  - Introduce the BriefcaseIModelDb class, make IModelDb abstract.
949
1044
  - Cleaned up unused async-s in BriefcaseManager
950
1045
  - Avoided casting of BriefcaseProps to IModelRpcProps.
951
- - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1046
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
952
1047
  - Move briefcase property from IModelDb --> BriefcaseIModelDb
953
1048
  - BriefcaseId is now an enum instead of a class
954
1049
  - Rename BriefcaseId --> ReservedBriefcaseId, introduce BriefcaseId type
955
- - VSTS#297017: Update cached briefcase information if changes were applied.
956
- - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
957
- - 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.
958
- - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
1050
+ - VSTS#297017: Update cached briefcase information if changes were applied.
1051
+ - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1052
+ - 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.
1053
+ - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
959
1054
  - Removed BriefcaseDb.create
960
- - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1055
+ - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
961
1056
  - fixed flaky test
962
- - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1057
+ - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
963
1058
  - do not throw exception in NativeAppBackend.startup()
964
- - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1059
+ - VSTS#296110: Setup a way to close briefcases when the native application is offline.
965
1060
  - Move concurrencyControl from IModelDb to BriefcaseIModelDb
966
1061
  - Renamed OIDC constructs for consistency; Removed SAML support.
967
1062
  - Add support for password-protecting snapshot iModels
968
1063
  - Fixed typo for ElementAspect perf tests
969
- - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
1064
+ - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
970
1065
  - Add purge dir method to iModelJsFs
971
1066
  - react to creation of new clients packages from imodeljs-clients
972
1067
  - ; substitute current date for feature usage without any set start/end dates
973
- - Removed deprecated utilities.
1068
+ - Removed deprecated utilities.
974
1069
  - enforce opening Snapshots readonly through StandaloneDb
975
1070
  - Remove the deprecated Entity.clone method
976
1071
  - Adjusted calls to some node addon changes (ECUtils removed)
@@ -982,13 +1077,13 @@ Wed, 06 May 2020 13:17:49 GMT
982
1077
  - Add FileNameResolver class
983
1078
  - Move snapshot methods out of IModelDb and into new SnapshotIModelDb class.
984
1079
  - Add TemplateModelCloner to place instances of a template model
985
- - Renamed TestOidcClient and related constructs for consistency.
1080
+ - Renamed TestOidcClient and related constructs for consistency.
986
1081
  - Add IModelDb.tryPrepareStatement
987
- - Fixed usage logging.
1082
+ - Fixed usage logging.
988
1083
  - fix failing ulas tests due to invalid featureId
989
1084
  - update ULAS test logging & feedback
990
1085
  - Update UlasUtilities to support exception-throwing native functions
991
- - Use standalone briefcases for PullOnly cases.
1086
+ - Use standalone briefcases for PullOnly cases.
992
1087
 
993
1088
  ## 1.14.1
994
1089
  Wed, 22 Apr 2020 19:04:00 GMT
@@ -1003,7 +1098,7 @@ Tue, 31 Mar 2020 15:44:19 GMT
1003
1098
  ### Updates
1004
1099
 
1005
1100
  - Update to addon 1.14.1
1006
- - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
1101
+ - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
1007
1102
  - Add handling for invalid predecessor ids to IModelTransformer
1008
1103
  - Accomodate updated imodeljs-native ULAS functions
1009
1104
 
@@ -1018,7 +1113,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1018
1113
  ### Updates
1019
1114
 
1020
1115
  - Fix IGeometry roundtripping issue through ECSql. Fix insert/update binary properties for Element Aspect.
1021
- - Separated out routines to download and open briefcases.
1116
+ - Separated out routines to download and open briefcases.
1022
1117
  - bulk mode
1023
1118
  - Consolidated sign-in for integration tests
1024
1119
  - bulkmode
@@ -1029,7 +1124,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1029
1124
  - Add ViewDefinition.getAuxiliaryCoordinateSystemId and ViewDefinition.setAuxiliaryCoordinateSystemId methods
1030
1125
  - Add SpatialLocationModel.insert
1031
1126
  - Add optional isPlantProjection parameter to PhysicalModel.insert
1032
- - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1127
+ - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1033
1128
  - Better documentation of OidcDesktopClient
1034
1129
  - Fixed changeset perf test by using another iModel on Hub
1035
1130
  - Add ViewDetails to ViewDefinition.
@@ -1062,7 +1157,7 @@ Tue, 07 Jan 2020 19:44:01 GMT
1062
1157
  - Allow events to be sent from backend to frontend
1063
1158
  - Add tryGetInstance / tryGetInstanceProps methods to the Relationship class which return undefined rather than throwing an exception when a relationship is not found.
1064
1159
  - Fix webpack for ios test that were failing due to new dependencies
1065
- - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
1160
+ - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
1066
1161
  - Add tryGetElement / tryGetElementProps which return undefined rather than throwing an exception when an element is not found.
1067
1162
  - Add tryGetModel, tryGetModelProps, tryGetSubModel which return undefined instead of throwing exceptions when the model is not found.
1068
1163
 
@@ -1074,7 +1169,7 @@ Tue, 10 Dec 2019 18:08:56 GMT
1074
1169
  - Updated to addon 9.1.3
1075
1170
  - Added AliCloud tile cache service
1076
1171
  - Added framework to run imodeljs-backend test on ios using appcenter
1077
- - Setup OidcDesktopClient for Electron use cases.
1172
+ - Setup OidcDesktopClient for Electron use cases.
1078
1173
  - fix warnings from static analysis
1079
1174
  - Enabling testing code for updating LR aspects after fix in native side.
1080
1175
  - Addressing typo in a couple of members, making them match the schema properly.
@@ -1130,9 +1225,9 @@ Mon, 30 Sep 2019 22:28:48 GMT
1130
1225
  ### Updates
1131
1226
 
1132
1227
  - added support for blank IModelConnections
1133
- - Setup a way to supply authorization through the backend for frontend requests.
1134
- - Error log when downloading change sets should include iModelId for context.
1135
- - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1228
+ - Setup a way to supply authorization through the backend for frontend requests.
1229
+ - Error log when downloading change sets should include iModelId for context.
1230
+ - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1136
1231
  - Add IModelDb.Elements.hasSubModel
1137
1232
  - Make ExternalSourceAspect.checksum optional
1138
1233
  - Clear statement cache after schema import
@@ -1147,14 +1242,14 @@ Tue, 10 Sep 2019 12:09:49 GMT
1147
1242
 
1148
1243
  ### Updates
1149
1244
 
1150
- - Setup a way to supply authorization through the backend for frontend requests.
1151
- - Allow attaching change cache file before change summary extraction.
1152
- - Added change summary test, and improved doc a little.
1245
+ - Setup a way to supply authorization through the backend for frontend requests.
1246
+ - Allow attaching change cache file before change summary extraction.
1247
+ - Added change summary test, and improved doc a little.
1153
1248
  - Add minimum brep size option to IModelDb.exportGraphics
1154
1249
  - FunctionalSchema.importSchema is now deprecated.
1155
1250
  - Add support for GeometricModel.geometryGuid for detecting whether tiles for a model can be reused across versions
1156
1251
  - Added performance logging for tile upload
1157
- - 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.
1252
+ - 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.
1158
1253
  - Add method to create view with camera
1159
1254
  - Fixed misleading logging output in tile upload
1160
1255
 
@@ -1164,14 +1259,14 @@ Tue, 13 Aug 2019 20:25:53 GMT
1164
1259
  ### Updates
1165
1260
 
1166
1261
  - Allow custom tile cache services.
1167
- - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1168
- - Added Change Summary integration test, and fixed documentation.
1262
+ - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1263
+ - Added Change Summary integration test, and fixed documentation.
1169
1264
  - Trial code for tile upload errors
1170
1265
  - Fixed changeset performance tests
1171
1266
  - Tile upload logging.
1172
1267
  - Mark ExportGraphics API as public
1173
1268
  - Support for gzip compression of tiles
1174
- - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1269
+ - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1175
1270
  - Add IModelDb.isSnapshot
1176
1271
  - Tile upload error catching.
1177
1272
  - Azure tile upload logging
@@ -1183,7 +1278,7 @@ Wed, 24 Jul 2019 11:47:26 GMT
1183
1278
  ### Updates
1184
1279
 
1185
1280
  - Added option to restrict tile cache URLs by client IP address.
1186
- - Apply change sets at the backend in a non-blocking worker thread.
1281
+ - Apply change sets at the backend in a non-blocking worker thread.
1187
1282
  - Add ElementAspect handler methods
1188
1283
  - When deleting a parent element, make sure there are onDelete/onDeleted callbacks for child elements
1189
1284
  - Add support for linework to IModelDb.exportGraphics
@@ -1201,19 +1296,19 @@ Mon, 01 Jul 2019 19:04:29 GMT
1201
1296
 
1202
1297
  ### Updates
1203
1298
 
1204
- - Open fixes when briefcase requires merges.
1299
+ - Open fixes when briefcase requires merges.
1205
1300
  - Catch tile upload errors.
1206
- - Setting up briefcase is always from an older checkpoint.
1301
+ - Setting up briefcase is always from an older checkpoint.
1207
1302
  - Add materialId, subCategory to ExportGraphicsInfo
1208
- - Fix crash in getViewThumbnail for odd number of bytes
1303
+ - Fix crash in getViewThumbnail for odd number of bytes
1209
1304
  - Adding relationship class for GraphicalElement3dRepresentsElement.
1210
1305
  - Initial implementation of the LinearReferencing typescript domain
1211
1306
  - Adding domain classes for all relatinships in the LinearReferencing schema.
1212
1307
  - Exporting relationships module.
1213
- - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1214
- - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1308
+ - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1309
+ - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1215
1310
  - Add a new method `forceLoadSchemas` to `IModelJsNative.ECPresentationManager`.
1216
- - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1311
+ - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1217
1312
  - Properly document ModelSelector.models and CategorySelector.categories as Id64String arrays
1218
1313
  - Made `insertElement` not return Id64.invalid, throws error instead
1219
1314
  - Update to TypeScript 3.5
@@ -1224,7 +1319,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
1224
1319
 
1225
1320
  ### Updates
1226
1321
 
1227
- - Migrated agent applications to the newer client
1322
+ - Migrated agent applications to the newer client
1228
1323
  - RPC system now accepts only basic values (primitives, "interface" objects, and binary).
1229
1324
  - Switched from iModelHub Project API to Context API
1230
1325
  - Fix bug in IModelDb.createSnapshotFromSeed
@@ -1272,12 +1367,12 @@ Mon, 13 May 2019 15:52:05 GMT
1272
1367
  - Cleanup old imodelbank references
1273
1368
  - Add InformationRecordModel.insert, GroupModel.insert
1274
1369
  - Introduce LoggerCategory enum to advertise logger categories used by this package.
1275
- - Limited maximum cache size of the backend PromiseMemoizer.
1370
+ - Limited maximum cache size of the backend PromiseMemoizer.
1276
1371
  - Missing dependency on node-report
1277
- - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1372
+ - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1278
1373
  - Reinstated old version of OidcAgentClient
1279
- - Unauthorized open requests should cause a more obvious error.
1280
- - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1374
+ - Unauthorized open requests should cause a more obvious error.
1375
+ - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1281
1376
  - Memoization fix when opening iModels in shared, read-only mode .
1282
1377
  - Fixed setup of application version.
1283
1378
  - Updated Element CRUD perf tests
@@ -1287,7 +1382,7 @@ Mon, 13 May 2019 15:52:05 GMT
1287
1382
  - Remove ElementPropertyFormatter, IModelDb.getElementPropertiesForDisplay (use presentation rules instead)
1288
1383
  - Remove StandaloneIModelRpcImpl
1289
1384
  - Fix for Render Gradient.Symb test
1290
- - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1385
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1291
1386
  - Add IModelDb.createSnapshot/openSnapshot/closeSnapshot, deprecate IModelDb.createStandalone/openStandalone/closeStandalone
1292
1387
  - Moved IModelJsExpressServer class into a new package (@itwin/express-server).
1293
1388
  - Simplified tile caching IModelHost config and removed dev flags. Allow
@@ -1314,7 +1409,7 @@ Wed, 06 Mar 2019 15:41:22 GMT
1314
1409
  - Changes package.json to include api-extractor and adds api-extractor.json
1315
1410
  - Use new buildIModelJsBuild script
1316
1411
  - AxisAlignedBox and ElementAlignedBox are now typed to Range3d rather than classes
1317
- - 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.
1412
+ - 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.
1318
1413
  - Clone methods are no longer generic
1319
1414
  - Remove unneeded typedoc plugin dependency
1320
1415
  - Added spatial <-> cartographic methods that check/use the geographic coordinate system before using ecef location.
@@ -1359,8 +1454,8 @@ Mon, 14 Jan 2019 23:09:10 GMT
1359
1454
 
1360
1455
  ### Updates
1361
1456
 
1362
- - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1363
- - Removed IModelDb's cache of accessToken. For long running operations like AutoPush, the user must explicitly supply an IAccessTokenManager to keep the token current.
1457
+ - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1458
+ - Removed IModelDb's cache of accessToken. For long running operations like AutoPush, the user must explicitly supply an IAccessTokenManager to keep the token current.
1364
1459
  - Renamed RequestProxy->RequestHost. Allowed applications to configure proxy server with HTTPS_PROXY env.
1365
1460
  - Add backend TextureAPI and accompanying test
1366
1461
 
@@ -1465,7 +1560,7 @@ Mon, 03 Dec 2018 18:52:58 GMT
1465
1560
 
1466
1561
  ### Updates
1467
1562
 
1468
- - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1563
+ - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1469
1564
  - Add ElementRefersToElements.insert
1470
1565
  - Fixed front end integration tests.
1471
1566
  - Document the intended purpose of IModelJsExpressServer within a deployment environment.
@@ -1534,11 +1629,11 @@ Thu, 08 Nov 2018 17:59:20 GMT
1534
1629
 
1535
1630
  - Fix JSON representation of DisplayStyle.
1536
1631
  - Add IModelImporter as a base class for utility methods needed by all importers
1537
- - Removed assertion when deleting a memoized open call.
1632
+ - Removed assertion when deleting a memoized open call.
1538
1633
  - Add more methods to IModelImporter
1539
1634
  - Fix snapping test
1540
1635
  - OIDC related enhancments (WIP).
1541
- - Re-enabled several backend integration tests.
1636
+ - Re-enabled several backend integration tests.
1542
1637
  - Refactor analysis-importer to use IModelImporter
1543
1638
  - Updated to TypeScript 3.1
1544
1639
 
@@ -1 +1 @@
1
- {"version":3,"file":"ClassRegistry.d.ts","sourceRoot":"","sources":["../../src/ClassRegistry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAW,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAoC;IACrE,gBAAgB;WACF,eAAe,CAAC,GAAG,EAAE,GAAG;IACtC,gBAAgB;WACF,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW;IACvE,gBAAgB;WACF,QAAQ,CAAC,WAAW,EAAE,OAAO,MAAM,EAAE,MAAM,EAAE,OAAO,MAAM;IAYxE,yEAAyE;IACzE,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAqBlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAgCrC;;;OAGG;WACW,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,MAAM;IAQlE;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAa5B;;;;OAIG;WACW,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,MAAM,GAAG,SAAS;IAInF;;;;OAIG;WACW,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,MAAM;IAM9E;;;;;OAKG;WACW,eAAe,CAAC,aAAa,EAAE,MAAM;IACnD;;;;OAIG;WACW,qBAAqB,CAAC,MAAM,EAAE,OAAO,MAAM;CAM1D;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAkE;IAEnF,wCAAwC;IACjC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAE9D,gCAAgC;IACzB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;CAClE"}
1
+ {"version":3,"file":"ClassRegistry.d.ts","sourceRoot":"","sources":["../../src/ClassRegistry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAW,MAAM,UAAU,CAAC;AAI3C;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAoC;IACrE,gBAAgB;WACF,eAAe,CAAC,GAAG,EAAE,GAAG;IACtC,gBAAgB;WACF,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW;IACvE,gBAAgB;WACF,QAAQ,CAAC,WAAW,EAAE,OAAO,MAAM,EAAE,MAAM,EAAE,OAAO,MAAM;IAYxE,yEAAyE;IACzE,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAqBlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAyFrC;;;OAGG;WACW,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,MAAM;IAQlE;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAa5B;;;;OAIG;WACW,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,MAAM,GAAG,SAAS;IAInF;;;;OAIG;WACW,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,MAAM;IAM9E;;;;;OAKG;WACW,eAAe,CAAC,aAAa,EAAE,MAAM;IACnD;;;;OAIG;WACW,qBAAqB,CAAC,MAAM,EAAE,OAAO,MAAM;CAM1D;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAkE;IAEnF,wCAAwC;IACjC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAE9D,gCAAgC;IACzB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;CAClE"}
@@ -11,7 +11,9 @@ exports.MetaDataRegistry = exports.ClassRegistry = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_common_1 = require("@itwin/core-common");
13
13
  const Entity_1 = require("./Entity");
14
+ const Element_1 = require("./Element");
14
15
  const Schema_1 = require("./Schema");
16
+ const isGeneratedClassTag = Symbol("isGeneratedClassTag");
15
17
  /** The mapping between a BIS class name (in the form "schema:class") and its JavaScript constructor function
16
18
  * @public
17
19
  */
@@ -54,6 +56,7 @@ class ClassRegistry {
54
56
  * @param entityMetaData The Entity metadata that defines the class
55
57
  */
56
58
  static generateClassForEntity(entityMetaData, iModel) {
59
+ var _a, _b;
57
60
  const name = entityMetaData.ecclass.split(":");
58
61
  const domainName = name[0];
59
62
  const className = name[1];
@@ -63,15 +66,65 @@ class ClassRegistry {
63
66
  let schema = Schema_1.Schemas.getRegisteredSchema(domainName);
64
67
  if (undefined === schema)
65
68
  schema = this.generateProxySchema(domainName, iModel); // no schema found, create it too
66
- // this method relies on the caller having previously created/registered all superclasses
67
69
  const superclass = this._classMap.get(entityMetaData.baseClasses[0].toLowerCase());
68
70
  if (undefined === superclass)
69
71
  throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `cannot find superclass for class ${name}`);
70
- const generatedClass = class extends superclass {
71
- static get className() { return className; }
72
- };
73
- // the above line creates an anonymous class. For help debugging, set the "constructor.name" property to be the same as the bisClassName.
72
+ // user defined class hierarchies may skip a class in the hierarchy, and therefore their JS base class cannot
73
+ // be used to tell if there are any generated classes in the hierarchy
74
+ let generatedClassHasNonGeneratedNonCoreAncestor = false;
75
+ let currentSuperclass = superclass;
76
+ const MAX_ITERS = 1000;
77
+ for (let i = 0; i < MAX_ITERS; ++i) {
78
+ if (currentSuperclass.schema.schemaName === "BisCore")
79
+ break;
80
+ if (!currentSuperclass.isGeneratedClass) {
81
+ generatedClassHasNonGeneratedNonCoreAncestor = true;
82
+ break;
83
+ }
84
+ const superclassMetaData = iModel.classMetaDataRegistry.find(currentSuperclass.classFullName);
85
+ if (superclassMetaData === undefined)
86
+ throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadSchema, `could not find the metadata for class '${currentSuperclass.name}', class metadata should be loaded by now`);
87
+ const maybeNextSuperclass = this.getClass(superclassMetaData.baseClasses[0], iModel);
88
+ if (maybeNextSuperclass === undefined)
89
+ throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadSchema, `could not find the base class of '${currentSuperclass.name}', all generated classes must have a base class`);
90
+ currentSuperclass = maybeNextSuperclass;
91
+ }
92
+ const generatedClass = (_b = class extends superclass {
93
+ static get className() { return className; }
94
+ static get isGeneratedClass() { return this.hasOwnProperty(isGeneratedClassTag); }
95
+ },
96
+ _a = isGeneratedClassTag,
97
+ _b[_a] = true,
98
+ _b);
99
+ // the above creates an anonymous class. For help debugging, set the "constructor.name" property to be the same as the bisClassName.
74
100
  Object.defineProperty(generatedClass, "name", { get: () => className }); // this is the (only) way to change that readonly property.
101
+ const navigationProps = Object.entries(entityMetaData.properties)
102
+ .filter(([_propName, prop]) => prop.isNavigation)
103
+ .map(([propName, _prop]) => propName);
104
+ const isElement = (t) => t.is(Element_1.Element); // Entity.is check but with type information to avoid casts later
105
+ // a class only gets an automatic `collectPredecessorIds` implementation if:
106
+ // - it derives from `BisCore:Element`
107
+ // - it is not in the `BisCore` schema
108
+ // - there are no ancestors with manually registered JS implementations, (excluding BisCore base classes)
109
+ if (!generatedClassHasNonGeneratedNonCoreAncestor && isElement(superclass)) {
110
+ Object.defineProperty(generatedClass.prototype, "collectPredecessorIds", {
111
+ // first prototype of `this` is its class
112
+ value(predecessorIds) {
113
+ // eslint-disable-next-line @typescript-eslint/dot-notation
114
+ const superImpl = superclass.prototype["collectPredecessorIds"];
115
+ superImpl.call(this, predecessorIds);
116
+ for (const navProp of navigationProps) {
117
+ const relatedElem = this[navProp]; // cast to any since subclass can have any extensions
118
+ if (!relatedElem || !core_bentley_1.Id64.isValid(relatedElem.id))
119
+ continue;
120
+ predecessorIds.add(relatedElem.id);
121
+ }
122
+ },
123
+ // defaults for methods on a prototype (required for sinon to stub out methods on tests)
124
+ writable: true,
125
+ configurable: true,
126
+ });
127
+ }
75
128
  // if the schema is a proxy for a domain with behavior, throw exceptions for all protected operations
76
129
  if (schema.missingRequiredBehavior) {
77
130
  const throwError = () => { throw new core_common_1.IModelError(core_bentley_1.IModelStatus.WrongHandler, `Schema [${domainName}] not registered, but is marked with SchemaHasBehavior`); };