File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import { createConnectTransport , createPromiseClient } from "@bufbuild/connect-web" ;
8
8
import { Project as ProtocolProject , Team as ProtocolTeam } from "@gitpod/gitpod-protocol/lib/teams-projects-protocol" ;
9
+ import { HelloService } from "@gitpod/public-api/lib/gitpod/experimental/v1/dummy_connectweb" ;
9
10
import { TeamsService } from "@gitpod/public-api/lib/gitpod/experimental/v1/teams_connectweb" ;
10
11
import { TokensService } from "@gitpod/public-api/lib/gitpod/experimental/v1/tokens_connectweb" ;
11
12
import { ProjectsService } from "@gitpod/public-api/lib/gitpod/experimental/v1/projects_connectweb" ;
@@ -20,6 +21,7 @@ const transport = createConnectTransport({
20
21
baseUrl : `${ window . location . protocol } //${ window . location . host } /public-api` ,
21
22
} ) ;
22
23
24
+ export const helloService = createPromiseClient ( HelloService , transport ) ;
23
25
export const teamsService = createPromiseClient ( TeamsService , transport ) ;
24
26
export const personalAccessTokensService = createPromiseClient ( TokensService , transport ) ;
25
27
export const projectsService = createPromiseClient ( ProjectsService , transport ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { GitpodHostUrl } from "@gitpod/gitpod-protocol/lib/util/gitpod-host-url"
19
19
import { log } from "@gitpod/gitpod-protocol/lib/util/logging" ;
20
20
import { IDEFrontendDashboardService } from "@gitpod/gitpod-protocol/lib/frontend-dashboard-service" ;
21
21
import { RemoteTrackMessage } from "@gitpod/gitpod-protocol/lib/analytics" ;
22
+ import { helloService } from "./public-api" ;
22
23
23
24
export const gitpodHostUrl = new GitpodHostUrl ( window . location . toString ( ) ) ;
24
25
@@ -57,6 +58,17 @@ export function getGitpodService(): GitpodService {
57
58
return service ;
58
59
}
59
60
const service = _gp . gitpodService || ( _gp . gitpodService = createGitpodService ( ) ) ;
61
+ service . server = new Proxy ( service . server , {
62
+ get ( target , propKey ) {
63
+ return function ( ...args : any [ ] ) {
64
+ if ( propKey === "getWorkspace" ) {
65
+ // TODO(ak) feature flagged
66
+ helloService . sayHello ( { } ) . catch ( console . error ) ;
67
+ }
68
+ return target [ propKey ] ( ...args ) ;
69
+ } ;
70
+ } ,
71
+ } ) ;
60
72
return service ;
61
73
}
62
74
Original file line number Diff line number Diff line change @@ -36,12 +36,7 @@ import * as grpc from "@grpc/grpc-js";
36
36
import { Redis } from "ioredis" ;
37
37
import { createChannel , createClient , createClientFactory } from "nice-grpc" ;
38
38
import { retryMiddleware } from "nice-grpc-client-middleware-retry" ;
39
- import { APIHelloService } from "./api/dummy" ;
40
39
import { API } from "./api/server" ;
41
- import { APIStatsService } from "./api/stats" ;
42
- import { APITeamsService } from "./api/teams" ;
43
- import { APIUserService } from "./api/user" ;
44
- import { APIWorkspacesService } from "./api/workspaces" ;
45
40
import { AuthProviderParams } from "./auth/auth-provider" ;
46
41
import { AuthProviderService } from "./auth/auth-provider-service" ;
47
42
import { Authenticator } from "./auth/authenticator" ;
@@ -333,13 +328,6 @@ export const productionContainerModule = new ContainerModule(
333
328
// grpc / Connect API
334
329
API . contribute ( bind ) ;
335
330
336
- bind ( APIHelloService ) . toSelf ( ) . inSingletonScope ( ) ;
337
- bind ( APIUserService ) . toSelf ( ) . inSingletonScope ( ) ;
338
- bind ( APITeamsService ) . toSelf ( ) . inSingletonScope ( ) ;
339
- bind ( APIWorkspacesService ) . toSelf ( ) . inSingletonScope ( ) ;
340
- bind ( APIStatsService ) . toSelf ( ) . inSingletonScope ( ) ;
341
- bind ( API ) . toSelf ( ) . inSingletonScope ( ) ;
342
-
343
331
bind ( AuthJWT ) . toSelf ( ) . inSingletonScope ( ) ;
344
332
bind ( SignInJWT ) . toSelf ( ) . inSingletonScope ( ) ;
345
333
You can’t perform that action at this time.
0 commit comments