File tree Expand file tree Collapse file tree 5 files changed +16
-13
lines changed
compass-schema-validation/src Expand file tree Collapse file tree 5 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 6666 "compass-preferences-model" : " ^2.35.0" ,
6767 "hadron-app-registry" : " ^9.4.8" ,
6868 "lodash" : " ^4.17.21" ,
69+ "mongodb" : " ^6.14.1" ,
6970 "mongodb-ns" : " ^2.4.2" ,
7071 "mongodb-schema" : " ^12.5.2" ,
7172 "react" : " ^17.0.2" ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { createLoggerLocator } from '@mongodb-js/compass-logging/provider';
1313import { telemetryLocator } from '@mongodb-js/compass-telemetry/provider' ;
1414import { SchemaValidationTabTitle } from './plugin-title' ;
1515import { workspacesServiceLocator } from '@mongodb-js/compass-workspaces/provider' ;
16+ import type { RequiredDataServiceProps } from './modules' ;
1617
1718const CompassSchemaValidationHadronPlugin = registerHadronPlugin (
1819 {
@@ -23,13 +24,8 @@ const CompassSchemaValidationHadronPlugin = registerHadronPlugin(
2324 activate : onActivated ,
2425 } ,
2526 {
26- dataService : dataServiceLocator as DataServiceLocator <
27- | 'aggregate'
28- | 'collectionInfo'
29- | 'updateCollection'
30- | 'sample'
31- | 'isCancelError'
32- > ,
27+ dataService :
28+ dataServiceLocator as DataServiceLocator < RequiredDataServiceProps > ,
3329 connectionInfoRef : connectionInfoRefLocator ,
3430 instance : mongoDBInstanceLocator ,
3531 preferences : preferencesLocator ,
Original file line number Diff line number Diff line change @@ -67,14 +67,13 @@ export type RootAction =
6767 | EditModeAction
6868 | ResetAction ;
6969
70- export type DataService = Pick <
71- OriginalDataService ,
70+ export type RequiredDataServiceProps =
7271 | 'aggregate'
7372 | 'collectionInfo'
7473 | 'updateCollection'
75- | 'sample '
76- | 'isCancelError'
77- > ;
74+ | 'sampleCursor '
75+ | 'isCancelError' ;
76+ export type DataService = Pick < OriginalDataService , RequiredDataServiceProps > ;
7877
7978export type SchemaValidationExtraArgs = {
8079 dataService : DataService ;
Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ const fakeDataService = {
4242 /* never resolves */
4343 } ) ,
4444 isCancelError : ( ) => false ,
45- sample : ( ) => [ { prop1 : 'abc' } ] ,
45+ sampleCursor : ( ) =>
46+ ( {
47+ * [ Symbol . asyncIterator ] ( ) {
48+ yield * [ { prop1 : 'abc' } ] ;
49+ } ,
50+ } as any ) ,
4651} as any ;
4752
4853const fakeWorkspaces = {
You can’t perform that action at this time.
0 commit comments