@itwin/core-backend 3.1.0-dev.6 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +157 -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,96 @@
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 Tue, 29 Mar 2022 20:53:47 GMT and should not be manually modified.
4
+
5
+ ## 3.1.0
6
+ Tue, 29 Mar 2022 20:53:47 GMT
7
+
8
+ ### Updates
9
+
10
+ - Deprecate IModelReadRpcInterface.getViewThumbnail
11
+ - generated element classes now have a default implementation of collectPredecessors returning all set navigation properties
12
+ - Correct return status for processGeometryStream and createBRepGeometry.
13
+ - Remove IModelDb.elementGeometryUpdate.
14
+ - You may specify an element's geometry in terms of an ElementGeometryDataEntry array
15
+ - Web IPC fix (when reloading frontend).
16
+
17
+ ## 3.0.3
18
+ Fri, 25 Mar 2022 15:10:01 GMT
19
+
20
+ _Version update only_
21
+
22
+ ## 3.0.2
23
+ Thu, 10 Mar 2022 21:18:13 GMT
24
+
25
+ _Version update only_
26
+
27
+ ## 3.0.1
28
+ Thu, 24 Feb 2022 15:26:55 GMT
29
+
30
+ _Version update only_
31
+
32
+ ## 3.0.0
33
+ Mon, 24 Jan 2022 14:00:52 GMT
34
+
35
+ ### Updates
36
+
37
+ - add briefcaseAlias argument to acquireNewBriefcaseId
38
+ - make one method to acquire both shared and exclusive locks
39
+ - Add GeometryClass to ExportGraphics
40
+ - Update SQLiteDb to public release tag
41
+ - initial support for cloud-based WorkspaceContainers
42
+ - added IModelDb.workspace
43
+ - improve concurrent query changes
44
+ - Skip full schema load that cause OOM error on node backend
45
+ - Do not reopen connection on schema change
46
+ - Remove usage-logging-client
47
+ - Upgrade target to ES2019
48
+ - Entity no longer implements EntityProps.
49
+ - suppress error logging during test that expect errors
50
+ - add test and improved concurrent query support
51
+ - fix flaky test
52
+ - Update BackendHubAccess api to use ChangesetIndexAndId
53
+ - Add new GeoServices class and first method to interpret WKT or complete GCS JSON."
54
+ - getAccessToken always returns a token
55
+ - Fix an exception when attempting to pull changes into a briefcase that already has all the changes.
56
+ - LocalhostIpcHost, display-test-app support for R/W web (via orchestrator)
57
+ - Added ability to convert iModel coordinates to or from any Geographic CRS
58
+ - rename contextId -> iTwinId
59
+ - Tests for solid kernel severe error exceptions.
60
+ - throw rather than returning status from IModelDb.saveFileProperty and IModelDb.deleteFileProperty
61
+ - use db.locks to release all locks
62
+ - rename to @itwin/core-backend
63
+ - export blobdaemon, blobdaemoncommandargs from imodeljs-native
64
+ - Log the error that we catch when v2 checkpoint fails to open
65
+ - use BentleyError.getErrorProps(e) instead of just logging e
66
+ - Introduce no-non-null-assertion lint rule.
67
+ - remove ClientRequestContext and its subclasses
68
+ - Removed config.app usage
69
+ - Remove deprecated APIs for 3.0.
70
+ - allow apps to set safety interval for reattaching deamon
71
+ - removed several previously-deprecated apis
72
+ - remove IModelWriteRpcInterface
73
+ - remove ClientRequestContext.current
74
+ - Renamed all occurrences of the term revision0 to version0.
75
+ - rework locks
76
+ - Removed NativeAppAuthorizationBackend
77
+ - Removed two unit tests for reproj and added one
78
+ - added RpcTrace
79
+ - Bumped dotenv and removed deprecated @types/dotenv
80
+ - Replaced ContextRegistry with generalized ITwinAccess interface
81
+ - Switching to consume new Projects-Client
82
+ - Renamed an iModel's parent container to iTwin
83
+ - Removed references to the deleted config-loader package
84
+ - split imodel-transformer out of imodel-backend package
85
+ - remove use of "any" types in SqliteStatement
86
+ - IModelDb.getTextureImage is async.
87
+ - Support for TypeDoc v0.22.7. Fix various broken docs links.
88
+ - only export necessary schemas during imodel transformation
89
+ - Improved log message when v2 checkpoint downloaded is not for the changeset requested
90
+ - caching options for changed elements processing
91
+ - Adding WebEditServer (test scenarios only for now)
92
+ - add persistent iModel-based settings
93
+ - initial implementation of Workspace and Settings
4
94
 
5
95
  ## 2.19.28
6
96
  Wed, 12 Jan 2022 14:52:38 GMT
@@ -166,7 +256,7 @@ Mon, 26 Jul 2021 12:21:25 GMT
166
256
 
167
257
  - Reactivated test that stopped working when a previous PR for ecef dependency to geographicCRS was reverted
168
258
  - store changesetIndex on IModelDb
169
- - Better error checks when creating SpatialViewDefinition-s.
259
+ - Better error checks when creating SpatialViewDefinition-s.
170
260
  - remove internal barrel-import usage
171
261
  - throw exception when attempting to download a briefcase on top of an existing file
172
262
  - Add case for InterpolationCurve3d
@@ -201,11 +291,11 @@ Fri, 09 Jul 2021 18:11:24 GMT
201
291
  ### Updates
202
292
 
203
293
  - TemplateModelCloner now assigns a new FederationGuid for cloned element instances.
204
- - Accomodated the inability to reverse Changesets when creating change summaries.
294
+ - Accomodated the inability to reverse Changesets when creating change summaries.
205
295
  - fix lint issue
206
296
  - begin api transition to changeset index rather than changeset Id
207
297
  - Use ecef location calculated for projected iModels
208
- - Push refreshes access token if necessary.
298
+ - Push refreshes access token if necessary.
209
299
  - 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
300
  - Add missing SectionDrawing properties.
211
301
 
@@ -226,7 +316,7 @@ Fri, 02 Jul 2021 15:38:31 GMT
226
316
 
227
317
  ### Updates
228
318
 
229
- - Update to @bentley/imodeljs-native@2.17.10
319
+ - Update to @bentley/imodeljs-native@2.17.10
230
320
 
231
321
  ## 2.17.0
232
322
  Mon, 28 Jun 2021 16:20:11 GMT
@@ -492,8 +582,8 @@ Thu, 28 Jan 2021 13:39:27 GMT
492
582
 
493
583
  - Changed storageType from azure to azure?sas=1 for getCommandArgs function
494
584
  - 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.
585
+ - Element geometry creation by brep operations.
586
+ - Reinstated behavior when re-opening files read-write.
497
587
  - enhance BriefcaseManager and BriefcaseDb for edit commands
498
588
  - Improve ElementGeometry documentation.
499
589
  - Add a check to verify, and fix, the DbGuid in the iModel if it is different than the Guid in iModelHub.
@@ -683,8 +773,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
683
773
  ### Updates
684
774
 
685
775
  - 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.
776
+ - Fixes to front end methods to pull, merge and push.
777
+ - Setup IModelHost.startup() to use proxy servers if configured/available - this is valuable for debugging agents, backends and electron applications.
688
778
  - On iOS download in background
689
779
  - Fix ios hang issue
690
780
  - Modify queryModelRanges to handle non geometric model errors
@@ -775,7 +865,7 @@ Thu, 20 Aug 2020 20:57:09 GMT
775
865
  ### Updates
776
866
 
777
867
  - Update to imodeljs-native 2.5.0
778
- - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
868
+ - VSTS#419723: Accomodated "bad" checkpoints that may have serialized transactions preventing their use in ReadWrite cases.
779
869
  - Fix for a recursive exception while closing a briefcase
780
870
  - Added mobile oidc client
781
871
  - Remove special code handling for mobile.
@@ -839,7 +929,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
839
929
  - Changes to support imodel-bridge
840
930
  - fix spelling mistakes in Device class
841
931
  - Fix typo in comments
842
- - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
932
+ - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
843
933
  - disallow protected operations for missing schemas marked with SchemaHasBehavior custom attribute
844
934
 
845
935
  ## 2.2.1
@@ -880,25 +970,25 @@ Thu, 28 May 2020 22:48:59 GMT
880
970
  - Update to imodeljs-native 2.1.0
881
971
  - Support for finding an ExternalSourceAspect given scope, id, and kind/hash.
882
972
  - ApplyChangeset perf tests updated
883
- - Fixed token expiry check for desktop authorization.
973
+ - Fixed token expiry check for desktop authorization.
884
974
  - Download ChangeSets in chunks
885
975
  - (1) In xy region booleans, support curved edges; (2) ExportGraphicsMeshVisitor class
886
976
  - Add ability to convert ExportGraphicsMesh to Polyface
887
977
  - Fixed validation of Guids (ContextId, IModelId) cached within a briefcase.
888
978
  - Moved iModelBridgeFwk to a separate package
889
- - Simplified logging for monitoring briefcase operations.
979
+ - Simplified logging for monitoring briefcase operations.
890
980
  - Fix transforms for creating and querying part instance geometry in world coordinate.
891
981
  - Fix and improvement to performance tests
892
982
  - Added support for schema XML import to iModelJs backend via the IModelDb.importSchemaStrings method.
893
983
  - channel rules
894
- - Fixed logging usage when opening connections.
984
+ - Fixed logging usage when opening connections.
895
985
 
896
986
  ## 2.0.0
897
987
  Wed, 06 May 2020 13:17:49 GMT
898
988
 
899
989
  ### Updates
900
990
 
901
- - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
991
+ - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
902
992
  - Added RivisionUtility class for debug/testing
903
993
  - node addon 2.0.18
904
994
  - addon 2.0.25
@@ -911,23 +1001,23 @@ Wed, 06 May 2020 13:17:49 GMT
911
1001
  - Performance tests for Applying Changesets
912
1002
  - `IModelHost.startup` is now async.
913
1003
  - `IModelHost.shutdown` is now async.
914
- - Refined checks for briefcase id, and fixed failing integration tests.
1004
+ - Refined checks for briefcase id, and fixed failing integration tests.
915
1005
  - Product Backlog Item 276268: Deleting the briefcase cache if the cache version is incorrect should not attempt to delete the root directory.
916
1006
  - Setup initialization of briefcase cache for offline workflows. (VSTS#286489)
917
- - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1007
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
918
1008
  - Move briefcase-specific events into BriefcaseIModelDb subclass
919
1009
  - 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.
1010
+ - Setup a common cache locaton for iModel.js, with briefcases taking up a sub-folder.
921
1011
  - Changed ChangeSets download API
922
1012
  - Added unlink for file handler
923
1013
  - Update UlasClient tests to send more detailed feature log data
924
1014
  - react to renaming of imodeljs-clients-backend to backend-itwin-client
925
1015
  - apply changeset performance tests with local datasets
926
- - BriefcaseManager.delete should work in offline scenarios.
1016
+ - BriefcaseManager.delete should work in offline scenarios.
927
1017
  - Remove deprecated members of SectionLocation and downgrade to alpha pending refactor.
928
1018
  - Support for progress/cancel from ios
929
1019
  - Remove deprecated ExportGraphics types etc for 2.0
930
- - Updated docs.
1020
+ - Updated docs.
931
1021
  - IModelDb.findByKey replaces IModelDb.find
932
1022
  - Include model extents with ViewStateProps for drawing views.
933
1023
  - Remove deprecated APIs; see NextVersion.md for details.
@@ -948,29 +1038,29 @@ Wed, 06 May 2020 13:17:49 GMT
948
1038
  - Introduce the BriefcaseIModelDb class, make IModelDb abstract.
949
1039
  - Cleaned up unused async-s in BriefcaseManager
950
1040
  - Avoided casting of BriefcaseProps to IModelRpcProps.
951
- - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1041
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
952
1042
  - Move briefcase property from IModelDb --> BriefcaseIModelDb
953
1043
  - BriefcaseId is now an enum instead of a class
954
1044
  - 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.
1045
+ - VSTS#297017: Update cached briefcase information if changes were applied.
1046
+ - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1047
+ - 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.
1048
+ - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
959
1049
  - Removed BriefcaseDb.create
960
- - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1050
+ - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
961
1051
  - fixed flaky test
962
- - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1052
+ - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
963
1053
  - do not throw exception in NativeAppBackend.startup()
964
- - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1054
+ - VSTS#296110: Setup a way to close briefcases when the native application is offline.
965
1055
  - Move concurrencyControl from IModelDb to BriefcaseIModelDb
966
1056
  - Renamed OIDC constructs for consistency; Removed SAML support.
967
1057
  - Add support for password-protecting snapshot iModels
968
1058
  - Fixed typo for ElementAspect perf tests
969
- - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
1059
+ - VSTS#217447, VSTS#162382: Reinstated option to open briefcases with SyncMode = PullOnly.
970
1060
  - Add purge dir method to iModelJsFs
971
1061
  - react to creation of new clients packages from imodeljs-clients
972
1062
  - ; substitute current date for feature usage without any set start/end dates
973
- - Removed deprecated utilities.
1063
+ - Removed deprecated utilities.
974
1064
  - enforce opening Snapshots readonly through StandaloneDb
975
1065
  - Remove the deprecated Entity.clone method
976
1066
  - Adjusted calls to some node addon changes (ECUtils removed)
@@ -982,13 +1072,13 @@ Wed, 06 May 2020 13:17:49 GMT
982
1072
  - Add FileNameResolver class
983
1073
  - Move snapshot methods out of IModelDb and into new SnapshotIModelDb class.
984
1074
  - Add TemplateModelCloner to place instances of a template model
985
- - Renamed TestOidcClient and related constructs for consistency.
1075
+ - Renamed TestOidcClient and related constructs for consistency.
986
1076
  - Add IModelDb.tryPrepareStatement
987
- - Fixed usage logging.
1077
+ - Fixed usage logging.
988
1078
  - fix failing ulas tests due to invalid featureId
989
1079
  - update ULAS test logging & feedback
990
1080
  - Update UlasUtilities to support exception-throwing native functions
991
- - Use standalone briefcases for PullOnly cases.
1081
+ - Use standalone briefcases for PullOnly cases.
992
1082
 
993
1083
  ## 1.14.1
994
1084
  Wed, 22 Apr 2020 19:04:00 GMT
@@ -1003,7 +1093,7 @@ Tue, 31 Mar 2020 15:44:19 GMT
1003
1093
  ### Updates
1004
1094
 
1005
1095
  - 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.
1096
+ - Fixed downloading of files using https/streaming to resolve when the filestream is closed instead of when the input stream is exhausted.
1007
1097
  - Add handling for invalid predecessor ids to IModelTransformer
1008
1098
  - Accomodate updated imodeljs-native ULAS functions
1009
1099
 
@@ -1018,7 +1108,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1018
1108
  ### Updates
1019
1109
 
1020
1110
  - Fix IGeometry roundtripping issue through ECSql. Fix insert/update binary properties for Element Aspect.
1021
- - Separated out routines to download and open briefcases.
1111
+ - Separated out routines to download and open briefcases.
1022
1112
  - bulk mode
1023
1113
  - Consolidated sign-in for integration tests
1024
1114
  - bulkmode
@@ -1029,7 +1119,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1029
1119
  - Add ViewDefinition.getAuxiliaryCoordinateSystemId and ViewDefinition.setAuxiliaryCoordinateSystemId methods
1030
1120
  - Add SpatialLocationModel.insert
1031
1121
  - Add optional isPlantProjection parameter to PhysicalModel.insert
1032
- - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1122
+ - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1033
1123
  - Better documentation of OidcDesktopClient
1034
1124
  - Fixed changeset perf test by using another iModel on Hub
1035
1125
  - Add ViewDetails to ViewDefinition.
@@ -1062,7 +1152,7 @@ Tue, 07 Jan 2020 19:44:01 GMT
1062
1152
  - Allow events to be sent from backend to frontend
1063
1153
  - Add tryGetInstance / tryGetInstanceProps methods to the Relationship class which return undefined rather than throwing an exception when a relationship is not found.
1064
1154
  - 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.
1155
+ - VSTS#225894 - Allowed agents to bypass usage logging calls. These cause usage logging errors.
1066
1156
  - Add tryGetElement / tryGetElementProps which return undefined rather than throwing an exception when an element is not found.
1067
1157
  - Add tryGetModel, tryGetModelProps, tryGetSubModel which return undefined instead of throwing exceptions when the model is not found.
1068
1158
 
@@ -1074,7 +1164,7 @@ Tue, 10 Dec 2019 18:08:56 GMT
1074
1164
  - Updated to addon 9.1.3
1075
1165
  - Added AliCloud tile cache service
1076
1166
  - Added framework to run imodeljs-backend test on ios using appcenter
1077
- - Setup OidcDesktopClient for Electron use cases.
1167
+ - Setup OidcDesktopClient for Electron use cases.
1078
1168
  - fix warnings from static analysis
1079
1169
  - Enabling testing code for updating LR aspects after fix in native side.
1080
1170
  - Addressing typo in a couple of members, making them match the schema properly.
@@ -1130,9 +1220,9 @@ Mon, 30 Sep 2019 22:28:48 GMT
1130
1220
  ### Updates
1131
1221
 
1132
1222
  - 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.
1223
+ - Setup a way to supply authorization through the backend for frontend requests.
1224
+ - Error log when downloading change sets should include iModelId for context.
1225
+ - Fixed the iModelHub client to properly dispose a file handle after upload to the iModelHub.
1136
1226
  - Add IModelDb.Elements.hasSubModel
1137
1227
  - Make ExternalSourceAspect.checksum optional
1138
1228
  - Clear statement cache after schema import
@@ -1147,14 +1237,14 @@ Tue, 10 Sep 2019 12:09:49 GMT
1147
1237
 
1148
1238
  ### Updates
1149
1239
 
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.
1240
+ - Setup a way to supply authorization through the backend for frontend requests.
1241
+ - Allow attaching change cache file before change summary extraction.
1242
+ - Added change summary test, and improved doc a little.
1153
1243
  - Add minimum brep size option to IModelDb.exportGraphics
1154
1244
  - FunctionalSchema.importSchema is now deprecated.
1155
1245
  - Add support for GeometricModel.geometryGuid for detecting whether tiles for a model can be reused across versions
1156
1246
  - 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.
1247
+ - 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
1248
  - Add method to create view with camera
1159
1249
  - Fixed misleading logging output in tile upload
1160
1250
 
@@ -1164,14 +1254,14 @@ Tue, 13 Aug 2019 20:25:53 GMT
1164
1254
  ### Updates
1165
1255
 
1166
1256
  - 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.
1257
+ - Always acquire a briefcase when creating a new backend instance for PullAndPush workflows.
1258
+ - Added Change Summary integration test, and fixed documentation.
1169
1259
  - Trial code for tile upload errors
1170
1260
  - Fixed changeset performance tests
1171
1261
  - Tile upload logging.
1172
1262
  - Mark ExportGraphics API as public
1173
1263
  - Support for gzip compression of tiles
1174
- - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1264
+ - Fixed issue with opening iModels with names that are invalid on Unix or Windows.
1175
1265
  - Add IModelDb.isSnapshot
1176
1266
  - Tile upload error catching.
1177
1267
  - Azure tile upload logging
@@ -1183,7 +1273,7 @@ Wed, 24 Jul 2019 11:47:26 GMT
1183
1273
  ### Updates
1184
1274
 
1185
1275
  - Added option to restrict tile cache URLs by client IP address.
1186
- - Apply change sets at the backend in a non-blocking worker thread.
1276
+ - Apply change sets at the backend in a non-blocking worker thread.
1187
1277
  - Add ElementAspect handler methods
1188
1278
  - When deleting a parent element, make sure there are onDelete/onDeleted callbacks for child elements
1189
1279
  - Add support for linework to IModelDb.exportGraphics
@@ -1201,19 +1291,19 @@ Mon, 01 Jul 2019 19:04:29 GMT
1201
1291
 
1202
1292
  ### Updates
1203
1293
 
1204
- - Open fixes when briefcase requires merges.
1294
+ - Open fixes when briefcase requires merges.
1205
1295
  - Catch tile upload errors.
1206
- - Setting up briefcase is always from an older checkpoint.
1296
+ - Setting up briefcase is always from an older checkpoint.
1207
1297
  - Add materialId, subCategory to ExportGraphicsInfo
1208
- - Fix crash in getViewThumbnail for odd number of bytes
1298
+ - Fix crash in getViewThumbnail for odd number of bytes
1209
1299
  - Adding relationship class for GraphicalElement3dRepresentsElement.
1210
1300
  - Initial implementation of the LinearReferencing typescript domain
1211
1301
  - Adding domain classes for all relatinships in the LinearReferencing schema.
1212
1302
  - 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.
1303
+ - Fixes to opening iModel-s ReadWrite from mutiple IModelConnection-s.
1304
+ - Fixed issues with deleting briefcases if there were errors with preparing briefcases.
1215
1305
  - Add a new method `forceLoadSchemas` to `IModelJsNative.ECPresentationManager`.
1216
- - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1306
+ - Introduced AsyncMutex - a utility to run async blocks of code in sequence.
1217
1307
  - Properly document ModelSelector.models and CategorySelector.categories as Id64String arrays
1218
1308
  - Made `insertElement` not return Id64.invalid, throws error instead
1219
1309
  - Update to TypeScript 3.5
@@ -1224,7 +1314,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
1224
1314
 
1225
1315
  ### Updates
1226
1316
 
1227
- - Migrated agent applications to the newer client
1317
+ - Migrated agent applications to the newer client
1228
1318
  - RPC system now accepts only basic values (primitives, "interface" objects, and binary).
1229
1319
  - Switched from iModelHub Project API to Context API
1230
1320
  - Fix bug in IModelDb.createSnapshotFromSeed
@@ -1272,12 +1362,12 @@ Mon, 13 May 2019 15:52:05 GMT
1272
1362
  - Cleanup old imodelbank references
1273
1363
  - Add InformationRecordModel.insert, GroupModel.insert
1274
1364
  - Introduce LoggerCategory enum to advertise logger categories used by this package.
1275
- - Limited maximum cache size of the backend PromiseMemoizer.
1365
+ - Limited maximum cache size of the backend PromiseMemoizer.
1276
1366
  - Missing dependency on node-report
1277
- - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1367
+ - Fixed memoization problem that caused an endless stream of 404 NotFound errors.
1278
1368
  - 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.
1369
+ - Unauthorized open requests should cause a more obvious error.
1370
+ - Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by-one to prevent hogging the event loop.
1281
1371
  - Memoization fix when opening iModels in shared, read-only mode .
1282
1372
  - Fixed setup of application version.
1283
1373
  - Updated Element CRUD perf tests
@@ -1287,7 +1377,7 @@ Mon, 13 May 2019 15:52:05 GMT
1287
1377
  - Remove ElementPropertyFormatter, IModelDb.getElementPropertiesForDisplay (use presentation rules instead)
1288
1378
  - Remove StandaloneIModelRpcImpl
1289
1379
  - 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.
1380
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1291
1381
  - Add IModelDb.createSnapshot/openSnapshot/closeSnapshot, deprecate IModelDb.createStandalone/openStandalone/closeStandalone
1292
1382
  - Moved IModelJsExpressServer class into a new package (@itwin/express-server).
1293
1383
  - Simplified tile caching IModelHost config and removed dev flags. Allow
@@ -1314,7 +1404,7 @@ Wed, 06 Mar 2019 15:41:22 GMT
1314
1404
  - Changes package.json to include api-extractor and adds api-extractor.json
1315
1405
  - Use new buildIModelJsBuild script
1316
1406
  - 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.
1407
+ - 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
1408
  - Clone methods are no longer generic
1319
1409
  - Remove unneeded typedoc plugin dependency
1320
1410
  - Added spatial <-> cartographic methods that check/use the geographic coordinate system before using ecef location.
@@ -1359,8 +1449,8 @@ Mon, 14 Jan 2019 23:09:10 GMT
1359
1449
 
1360
1450
  ### Updates
1361
1451
 
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.
1452
+ - More logging of HTTP requests, and enabled use of fiddler for backend diagnostics.
1453
+ - 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
1454
  - Renamed RequestProxy->RequestHost. Allowed applications to configure proxy server with HTTPS_PROXY env.
1365
1455
  - Add backend TextureAPI and accompanying test
1366
1456
 
@@ -1465,7 +1555,7 @@ Mon, 03 Dec 2018 18:52:58 GMT
1465
1555
 
1466
1556
  ### Updates
1467
1557
 
1468
- - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1558
+ - More information logged from BriefcaseManager.\nFixed deletion/cleanup of invalid briefcases.\nAdded OIDC support for simpleviewtest application.
1469
1559
  - Add ElementRefersToElements.insert
1470
1560
  - Fixed front end integration tests.
1471
1561
  - Document the intended purpose of IModelJsExpressServer within a deployment environment.
@@ -1534,11 +1624,11 @@ Thu, 08 Nov 2018 17:59:20 GMT
1534
1624
 
1535
1625
  - Fix JSON representation of DisplayStyle.
1536
1626
  - Add IModelImporter as a base class for utility methods needed by all importers
1537
- - Removed assertion when deleting a memoized open call.
1627
+ - Removed assertion when deleting a memoized open call.
1538
1628
  - Add more methods to IModelImporter
1539
1629
  - Fix snapping test
1540
1630
  - OIDC related enhancments (WIP).
1541
- - Re-enabled several backend integration tests.
1631
+ - Re-enabled several backend integration tests.
1542
1632
  - Refactor analysis-importer to use IModelImporter
1543
1633
  - Updated to TypeScript 3.1
1544
1634
 
@@ -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`); };