@gitpod/gitpod-protocol 0.1.5-pluggable-workspace-cluster.21 → 0.1.5-port-description-3059-fork.6
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.
- package/data/gitpod-schema.json +13 -24
- package/lib/accounting-protocol.d.ts +3 -6
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +10 -16
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +15 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +15 -0
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +45 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/context-url.d.ts +18 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +49 -0
- package/lib/context-url.js.map +1 -0
- package/lib/{util/context-url.spec.d.ts → context-url.spec.d.ts} +2 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +73 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +1 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +4 -4
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.js +4 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.js +19 -20
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -36
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.js +29 -43
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.js +25 -30
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -2
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +20 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.js +25 -41
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +116 -116
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +97 -19
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +155 -278
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +8 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +4 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-protocol.d.ts +81 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +8 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +4 -6
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +175 -44
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.js +35 -55
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/connection-error-handler.js +11 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +2 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +4 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/node/connection.d.ts +0 -10
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +12 -50
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +2 -0
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -159
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/permission.d.ts +2 -1
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +14 -13
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +570 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +68 -13
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +68 -115
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +4 -4
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +15 -12
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +110 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +23 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +79 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.js +55 -133
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js +17 -59
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +8 -8
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.js +26 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.js +58 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -0
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +26 -46
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +13 -67
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +34 -79
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +98 -98
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +6 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +102 -30
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/{without.js → jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +49 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +107 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +2 -2
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +10 -0
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +31 -7
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +4 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +123 -84
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.js +16 -55
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.js +144 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/safe-promise.js +9 -12
- package/lib/util/safe-promise.js.map +1 -1
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.js +16 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.js +21 -24
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +50 -5
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +171 -63
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.js +2 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +22 -3
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +3 -3
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +5 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +29 -16
- package/pkg-yarn.lock +17 -9
- package/src/accounting-protocol.ts +4 -10
- package/src/admin-protocol.ts +33 -5
- package/src/analytics.ts +54 -0
- package/src/context-url.spec.ts +39 -0
- package/src/context-url.ts +51 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +132 -35
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-protocol.ts +92 -0
- package/src/index.ts +6 -1
- package/src/messaging/browser/connection.ts +184 -23
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +5 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +3 -47
- package/src/messaging/proxy-factory.ts +13 -5
- package/src/oss-allowlist.ts +15 -0
- package/src/permission.ts +2 -1
- package/src/plans.ts +632 -0
- package/src/protocol.ts +91 -18
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +7 -5
- package/src/teams-projects-protocol.ts +141 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/garbage-collected-cache.ts +9 -3
- package/src/util/generate-workspace-id.spec.ts +3 -3
- package/src/util/generate-workspace-id.ts +2 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +24 -0
- package/src/util/gitpod-host-url.ts +23 -10
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +102 -38
- package/src/util/parse-workspace-id.spec.ts +21 -1
- package/src/util/parse-workspace-id.ts +32 -6
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +157 -18
- package/src/workspace-cluster.ts +24 -8
- package/src/workspace-instance.ts +25 -13
- package/src/wsready.ts +2 -2
- package/lib/util/context-url.d.ts +0 -13
- package/lib/util/context-url.d.ts.map +0 -1
- package/lib/util/context-url.js +0 -26
- package/lib/util/context-url.js.map +0 -1
- package/lib/util/context-url.spec.d.ts.map +0 -1
- package/lib/util/context-url.spec.js +0 -52
- package/lib/util/context-url.spec.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -118
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
package/src/gitpod-service.ts
CHANGED
|
@@ -5,15 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
User, WorkspaceInfo, WorkspaceCreationResult,
|
|
8
|
+
User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser,
|
|
9
9
|
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, Branding, CreateWorkspaceMode,
|
|
10
10
|
Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms,
|
|
11
|
-
ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
|
|
11
|
+
ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
|
|
12
12
|
GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes
|
|
13
13
|
} from './protocol';
|
|
14
|
+
import {
|
|
15
|
+
Team, TeamMemberInfo,
|
|
16
|
+
TeamMembershipInvite, Project, TeamMemberRole, PrebuildWithStatus, StartPrebuildResult, PartialProject
|
|
17
|
+
} from './teams-projects-protocol';
|
|
14
18
|
import { JsonRpcProxy, JsonRpcServer } from './messaging/proxy-factory';
|
|
15
19
|
import { Disposable, CancellationTokenSource } from 'vscode-jsonrpc';
|
|
16
|
-
import {
|
|
20
|
+
import { HeadlessLogUrls } from './headless-workspace-log';
|
|
17
21
|
import { WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstancePhase } from './workspace-instance';
|
|
18
22
|
import { AdminServer } from './admin-protocol';
|
|
19
23
|
import { GitpodHostUrl } from './util/gitpod-host-url';
|
|
@@ -24,11 +28,14 @@ import { Emitter } from './util/event';
|
|
|
24
28
|
import { AccountStatement, CreditAlert } from './accounting-protocol';
|
|
25
29
|
import { GithubUpgradeURL, PlanCoupon } from './payment-protocol';
|
|
26
30
|
import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from './team-subscription-protocol';
|
|
31
|
+
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from './analytics';
|
|
32
|
+
import { IDEServer } from './ide-protocol';
|
|
27
33
|
|
|
28
34
|
export interface GitpodClient {
|
|
29
35
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
30
36
|
onWorkspaceImageBuildLogs: WorkspaceImageBuild.LogCallback;
|
|
31
|
-
|
|
37
|
+
|
|
38
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void;
|
|
32
39
|
|
|
33
40
|
onCreditAlert(creditAlert: CreditAlert): void;
|
|
34
41
|
|
|
@@ -39,7 +46,7 @@ export interface GitpodClient {
|
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
export const GitpodServer = Symbol('GitpodServer');
|
|
42
|
-
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService {
|
|
49
|
+
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
|
|
43
50
|
// User related API
|
|
44
51
|
getLoggedInUser(): Promise<User>;
|
|
45
52
|
getTerms(): Promise<Terms>;
|
|
@@ -51,6 +58,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
51
58
|
getBranding(): Promise<Branding>;
|
|
52
59
|
getConfiguration(): Promise<Configuration>;
|
|
53
60
|
getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
|
|
61
|
+
getGitpodTokenScopes(tokenHash: string): Promise<string[]>;
|
|
54
62
|
/**
|
|
55
63
|
* @deprecated
|
|
56
64
|
*/
|
|
@@ -82,8 +90,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
82
90
|
updateWorkspaceUserPin(id: string, action: GitpodServer.PinAction): Promise<void>;
|
|
83
91
|
sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
|
|
84
92
|
watchWorkspaceImageBuildLogs(workspaceId: string): Promise<void>;
|
|
85
|
-
watchHeadlessWorkspaceLogs(workspaceId: string): Promise<void>;
|
|
86
93
|
isPrebuildDone(pwsid: string): Promise<boolean>;
|
|
94
|
+
getHeadlessLog(instanceId: string): Promise<HeadlessLogUrls>;
|
|
87
95
|
|
|
88
96
|
// Workspace timeout
|
|
89
97
|
setWorkspaceTimeout(workspaceId: string, duration: WorkspaceTimeoutDuration): Promise<SetWorkspaceTimeoutResult>;
|
|
@@ -97,19 +105,44 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
97
105
|
openPort(workspaceId: string, port: WorkspaceInstancePort): Promise<WorkspaceInstancePort | undefined>;
|
|
98
106
|
closePort(workspaceId: string, port: number): Promise<void>;
|
|
99
107
|
|
|
100
|
-
// User messages
|
|
101
|
-
getUserMessages(options: GitpodServer.GetUserMessagesOptions): Promise<UserMessage[]>;
|
|
102
|
-
updateUserMessages(options: GitpodServer.UpdateUserMessagesOptions): Promise<void>;
|
|
103
|
-
|
|
104
108
|
// User storage
|
|
105
109
|
getUserStorageResource(options: GitpodServer.GetUserStorageResourceOptions): Promise<string>;
|
|
106
110
|
updateUserStorageResource(options: GitpodServer.UpdateUserStorageResourceOptions): Promise<void>;
|
|
107
111
|
|
|
108
|
-
//
|
|
112
|
+
// User env vars
|
|
109
113
|
getEnvVars(): Promise<UserEnvVarValue[]>;
|
|
114
|
+
getAllEnvVars(): Promise<UserEnvVarValue[]>;
|
|
110
115
|
setEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
111
116
|
deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
112
117
|
|
|
118
|
+
// Teams
|
|
119
|
+
getTeams(): Promise<Team[]>;
|
|
120
|
+
getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
|
|
121
|
+
createTeam(name: string): Promise<Team>;
|
|
122
|
+
joinTeam(inviteId: string): Promise<Team>;
|
|
123
|
+
setTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
|
|
124
|
+
removeTeamMember(teamId: string, userId: string): Promise<void>;
|
|
125
|
+
getGenericInvite(teamId: string): Promise<TeamMembershipInvite>;
|
|
126
|
+
resetGenericInvite(inviteId: string): Promise<TeamMembershipInvite>;
|
|
127
|
+
deleteTeam(teamId: string, userId: string): Promise<void>;
|
|
128
|
+
|
|
129
|
+
// Projects
|
|
130
|
+
getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
|
|
131
|
+
createProject(params: CreateProjectParams): Promise<Project>;
|
|
132
|
+
deleteProject(projectId: string): Promise<void>;
|
|
133
|
+
getTeamProjects(teamId: string): Promise<Project[]>;
|
|
134
|
+
getUserProjects(): Promise<Project[]>;
|
|
135
|
+
getProjectOverview(projectId: string): Promise<Project.Overview | undefined>;
|
|
136
|
+
findPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
|
|
137
|
+
triggerPrebuild(projectId: string, branchName: string | null): Promise<StartPrebuildResult>;
|
|
138
|
+
cancelPrebuild(projectId: string, prebuildId: string): Promise<void>;
|
|
139
|
+
fetchProjectRepositoryConfiguration(projectId: string): Promise<string | undefined>;
|
|
140
|
+
guessProjectConfiguration(projectId: string): Promise<string | undefined>;
|
|
141
|
+
fetchRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
142
|
+
guessRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
143
|
+
setProjectConfiguration(projectId: string, configString: string): Promise<void>;
|
|
144
|
+
updateProjectPartial(partialProject: PartialProject): Promise<void>;
|
|
145
|
+
|
|
113
146
|
// content service
|
|
114
147
|
getContentBlobUploadUrl(name: string): Promise<string>
|
|
115
148
|
getContentBlobDownloadUrl(name: string): Promise<string>
|
|
@@ -124,10 +157,15 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
124
157
|
registerGithubApp(installationId: string): Promise<void>;
|
|
125
158
|
|
|
126
159
|
/**
|
|
127
|
-
* Stores a new snapshot for the given workspace and bucketId
|
|
160
|
+
* Stores a new snapshot for the given workspace and bucketId. Returns _before_ the actual snapshot is done. To wait for that, use `waitForSnapshot`.
|
|
128
161
|
* @return the snapshot id
|
|
129
162
|
*/
|
|
130
163
|
takeSnapshot(options: GitpodServer.TakeSnapshotOptions): Promise<string>;
|
|
164
|
+
/**
|
|
165
|
+
*
|
|
166
|
+
* @param snapshotId
|
|
167
|
+
*/
|
|
168
|
+
waitForSnapshot(snapshotId: string): Promise<void>;
|
|
131
169
|
|
|
132
170
|
/**
|
|
133
171
|
* Returns the list of snapshots that exist for a workspace.
|
|
@@ -159,16 +197,14 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
159
197
|
* gitpod.io concerns
|
|
160
198
|
*/
|
|
161
199
|
isStudent(): Promise<boolean>;
|
|
162
|
-
getPrivateRepoTrialEndDate(): Promise<string | undefined>;
|
|
163
|
-
|
|
164
200
|
/**
|
|
165
|
-
*
|
|
201
|
+
*
|
|
166
202
|
*/
|
|
167
203
|
getAccountStatement(options: GitpodServer.GetAccountStatementOptions): Promise<AccountStatement | undefined>;
|
|
168
204
|
getRemainingUsageHours(): Promise<number>;
|
|
169
205
|
|
|
170
206
|
/**
|
|
171
|
-
*
|
|
207
|
+
*
|
|
172
208
|
*/
|
|
173
209
|
getChargebeeSiteId(): Promise<string>;
|
|
174
210
|
createPortalSession(): Promise<{}>;
|
|
@@ -178,7 +214,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
178
214
|
|
|
179
215
|
getShowPaymentUI(): Promise<boolean>;
|
|
180
216
|
isChargebeeCustomer(): Promise<boolean>;
|
|
181
|
-
mayAccessPrivateRepo(): Promise<boolean>;
|
|
182
217
|
|
|
183
218
|
subscriptionUpgradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
184
219
|
subscriptionDowngradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
@@ -189,13 +224,61 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
189
224
|
tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
|
|
190
225
|
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>
|
|
191
226
|
tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
|
|
192
|
-
tsAssignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, identityStr: string|undefined): Promise<void>
|
|
227
|
+
tsAssignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, identityStr: string | undefined): Promise<void>
|
|
193
228
|
tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
|
|
194
229
|
tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
195
230
|
tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
196
231
|
|
|
197
232
|
getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
|
|
198
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Analytics
|
|
236
|
+
*/
|
|
237
|
+
trackEvent(event: RemoteTrackMessage): Promise<void>;
|
|
238
|
+
trackLocation(event: RemotePageMessage): Promise<void>;
|
|
239
|
+
identifyUser(event: RemoteIdentifyMessage): Promise<void>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface CreateProjectParams {
|
|
243
|
+
name: string;
|
|
244
|
+
slug?: string;
|
|
245
|
+
account: string;
|
|
246
|
+
provider: string;
|
|
247
|
+
cloneUrl: string;
|
|
248
|
+
teamId?: string;
|
|
249
|
+
userId?: string;
|
|
250
|
+
appInstallationId: string;
|
|
251
|
+
}
|
|
252
|
+
export interface FindPrebuildsParams {
|
|
253
|
+
projectId: string;
|
|
254
|
+
branch?: string;
|
|
255
|
+
latest?: boolean;
|
|
256
|
+
prebuildId?: string;
|
|
257
|
+
// default: 30
|
|
258
|
+
limit?: number;
|
|
259
|
+
}
|
|
260
|
+
export interface GetProviderRepositoriesParams {
|
|
261
|
+
provider: string;
|
|
262
|
+
hints?: { installationId: string } | object;
|
|
263
|
+
}
|
|
264
|
+
export interface ProviderRepository {
|
|
265
|
+
name: string;
|
|
266
|
+
path?: string;
|
|
267
|
+
account: string;
|
|
268
|
+
accountAvatarUrl: string;
|
|
269
|
+
cloneUrl: string;
|
|
270
|
+
updatedAt: string;
|
|
271
|
+
installationId?: number;
|
|
272
|
+
installationUpdatedAt?: string;
|
|
273
|
+
|
|
274
|
+
inUse?: boolean;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface ClientHeaderFields {
|
|
278
|
+
ip?: string;
|
|
279
|
+
userAgent?: string;
|
|
280
|
+
dnt?: string;
|
|
281
|
+
clientRegion?: string;
|
|
199
282
|
}
|
|
200
283
|
|
|
201
284
|
export const WorkspaceTimeoutValues = ["30m", "60m", "180m"] as const;
|
|
@@ -208,6 +291,7 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
|
|
|
208
291
|
methods.setClient = methods.setClient || (() => { });
|
|
209
292
|
methods.dispose = methods.dispose || (() => { });
|
|
210
293
|
return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
|
|
294
|
+
// @ts-ignore
|
|
211
295
|
get: (target: S, property: keyof S) => {
|
|
212
296
|
const result = target[property];
|
|
213
297
|
if (!result) {
|
|
@@ -240,6 +324,8 @@ export namespace GitpodServer {
|
|
|
240
324
|
limit?: number;
|
|
241
325
|
searchString?: string;
|
|
242
326
|
pinnedOnly?: boolean;
|
|
327
|
+
projectId?: string | string[];
|
|
328
|
+
includeWithoutProject?: boolean;
|
|
243
329
|
}
|
|
244
330
|
export interface GetAccountStatementOptions {
|
|
245
331
|
date?: string;
|
|
@@ -247,6 +333,7 @@ export namespace GitpodServer {
|
|
|
247
333
|
export interface CreateWorkspaceOptions {
|
|
248
334
|
contextUrl: string;
|
|
249
335
|
mode?: CreateWorkspaceMode;
|
|
336
|
+
forceDefaultConfig?: boolean;
|
|
250
337
|
}
|
|
251
338
|
export interface StartWorkspaceOptions {
|
|
252
339
|
forceDefaultImage: boolean;
|
|
@@ -254,13 +341,8 @@ export namespace GitpodServer {
|
|
|
254
341
|
export interface TakeSnapshotOptions {
|
|
255
342
|
workspaceId: string;
|
|
256
343
|
layoutData?: string;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
readonly releaseNotes?: boolean;
|
|
260
|
-
readonly workspaceInstanceId: string;
|
|
261
|
-
}
|
|
262
|
-
export interface UpdateUserMessagesOptions {
|
|
263
|
-
readonly messageIds: string[];
|
|
344
|
+
/* this is here to enable backwards-compatibility and untangling rollout between workspace, IDE and meta */
|
|
345
|
+
dontWait?: boolean;
|
|
264
346
|
}
|
|
265
347
|
export interface GetUserStorageResourceOptions {
|
|
266
348
|
readonly uri: string;
|
|
@@ -322,11 +404,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
322
404
|
}
|
|
323
405
|
}
|
|
324
406
|
|
|
325
|
-
|
|
407
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void {
|
|
326
408
|
for (const client of this.clients) {
|
|
327
|
-
if (client.
|
|
409
|
+
if (client.onPrebuildUpdate) {
|
|
328
410
|
try {
|
|
329
|
-
client.
|
|
411
|
+
client.onPrebuildUpdate(update);
|
|
330
412
|
} catch (error) {
|
|
331
413
|
console.error(error)
|
|
332
414
|
}
|
|
@@ -334,11 +416,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
334
416
|
}
|
|
335
417
|
}
|
|
336
418
|
|
|
337
|
-
|
|
419
|
+
onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void {
|
|
338
420
|
for (const client of this.clients) {
|
|
339
|
-
if (client.
|
|
421
|
+
if (client.onWorkspaceImageBuildLogs) {
|
|
340
422
|
try {
|
|
341
|
-
client.
|
|
423
|
+
client.onWorkspaceImageBuildLogs(info, content);
|
|
342
424
|
} catch (error) {
|
|
343
425
|
console.error(error)
|
|
344
426
|
}
|
|
@@ -402,7 +484,7 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
402
484
|
private readonly onDidChangeEmitter = new Emitter<void>();
|
|
403
485
|
readonly onDidChange = this.onDidChangeEmitter.event;
|
|
404
486
|
|
|
405
|
-
private source: 'sync'
|
|
487
|
+
private source: 'sync' | 'update' = 'sync';
|
|
406
488
|
|
|
407
489
|
get info(): WorkspaceInfo {
|
|
408
490
|
return this._info;
|
|
@@ -494,11 +576,15 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
494
576
|
|
|
495
577
|
}
|
|
496
578
|
|
|
579
|
+
export interface GitpodServiceOptions {
|
|
580
|
+
onReconnect?: () => (void | Promise<void>)
|
|
581
|
+
}
|
|
582
|
+
|
|
497
583
|
export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
|
|
498
584
|
|
|
499
585
|
private readonly compositeClient = new GitpodCompositeClient<Client>();
|
|
500
586
|
|
|
501
|
-
constructor(public readonly server: JsonRpcProxy<Server
|
|
587
|
+
constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
|
|
502
588
|
server.setClient(this.compositeClient);
|
|
503
589
|
server.onDidOpenConnection(() => this.compositeClient.notifyDidOpenConnection());
|
|
504
590
|
server.onDidCloseConnection(() => this.compositeClient.notifyDidCloseConnection());
|
|
@@ -518,6 +604,12 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
|
|
|
518
604
|
this.instanceListeners.set(workspaceId, listener);
|
|
519
605
|
return listener;
|
|
520
606
|
}
|
|
607
|
+
|
|
608
|
+
async reconnect(): Promise<void> {
|
|
609
|
+
if (this.options?.onReconnect) {
|
|
610
|
+
await this.options.onReconnect();
|
|
611
|
+
}
|
|
612
|
+
}
|
|
521
613
|
}
|
|
522
614
|
|
|
523
615
|
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>) {
|
|
@@ -535,6 +627,11 @@ export function createGitpodService<C extends GitpodClient, S extends GitpodServ
|
|
|
535
627
|
}
|
|
536
628
|
|
|
537
629
|
const connectionProvider = new WebSocketConnectionProvider();
|
|
538
|
-
|
|
539
|
-
|
|
630
|
+
let onReconnect = () => { };
|
|
631
|
+
const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
|
|
632
|
+
onListening: socket => {
|
|
633
|
+
onReconnect = () => socket.reconnect();
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
|
|
540
637
|
}
|
|
@@ -22,21 +22,17 @@ export namespace HeadlessWorkspaceEventType {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export interface
|
|
25
|
+
export interface HeadlessWorkspaceEvent {
|
|
26
26
|
workspaceID: string;
|
|
27
27
|
text: string;
|
|
28
28
|
type: HeadlessWorkspaceEventType;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
TaskSuccessfulLabel = "workspaceTaskDone"
|
|
31
|
+
export interface HeadlessLogUrls {
|
|
32
|
+
// A map of id to URL
|
|
33
|
+
streams: { [streamID: string]: string };
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
error?: string;
|
|
41
|
-
snapshotURL?: string;
|
|
42
|
-
}
|
|
36
|
+
/** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
|
|
37
|
+
export const HEADLESS_LOG_STREAM_STATUS_CODE = "X-LogStream-StatusCode";
|
|
38
|
+
export const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `IDEServer` provides a list of available IDEs.
|
|
9
|
+
*/
|
|
10
|
+
export interface IDEServer {
|
|
11
|
+
/**
|
|
12
|
+
* Returns the IDE preferences.
|
|
13
|
+
*/
|
|
14
|
+
getIDEOptions(): Promise<IDEOptions>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IDEOptions {
|
|
18
|
+
/**
|
|
19
|
+
* A list of available IDEs.
|
|
20
|
+
*/
|
|
21
|
+
options: { [key: string]: IDEOption };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The default (browser) IDE when the user has not specified one.
|
|
25
|
+
*/
|
|
26
|
+
defaultIde: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The default desktop IDE when the user has not specified one.
|
|
30
|
+
*/
|
|
31
|
+
defaultDesktopIde: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IDEOption {
|
|
35
|
+
/**
|
|
36
|
+
* To ensure a stable order one can set an `orderKey`.
|
|
37
|
+
*/
|
|
38
|
+
orderKey?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Human readable title text of the IDE (plain text only).
|
|
42
|
+
*/
|
|
43
|
+
title: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The type of the IDE, currently 'browser' or 'desktop'.
|
|
47
|
+
*/
|
|
48
|
+
type: 'browser' | 'desktop';
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The logo for the IDE. That could be a key in (see
|
|
52
|
+
* components/dashboard/src/images/ideLogos.ts) or a URL.
|
|
53
|
+
*/
|
|
54
|
+
logo: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Text of an optional tooltip (plain text only).
|
|
58
|
+
*/
|
|
59
|
+
tooltip?: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Text of an optional label next to the IDE option like “Insiders” (plain
|
|
63
|
+
* text only).
|
|
64
|
+
*/
|
|
65
|
+
label?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Notes to the IDE option that are renderd in the preferences when a user
|
|
69
|
+
* chooses this IDE.
|
|
70
|
+
*/
|
|
71
|
+
notes?: string[];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* If `true` this IDE option is not visible in the IDE preferences.
|
|
75
|
+
*/
|
|
76
|
+
hidden?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The image ref to the IDE image.
|
|
80
|
+
*/
|
|
81
|
+
image: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* When this is `true`, the tag of this image is resolved to the latest
|
|
85
|
+
* image digest regularly.
|
|
86
|
+
*
|
|
87
|
+
* This is useful if this image points to a tag like `nightly` that will be
|
|
88
|
+
* updated regularly. When `resolveImageDigest` is `true`, we make sure that
|
|
89
|
+
* we resolve the tag regularly to the most recent image version.
|
|
90
|
+
*/
|
|
91
|
+
resolveImageDigest?: boolean;
|
|
92
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,4 +13,9 @@ export * from './license-protocol';
|
|
|
13
13
|
export * from './workspace-instance';
|
|
14
14
|
export * from './permission';
|
|
15
15
|
export * from './admin-protocol';
|
|
16
|
-
export * from './email-protocol';
|
|
16
|
+
export * from './email-protocol';
|
|
17
|
+
export * from './headless-workspace-log';
|
|
18
|
+
export * from './context-url';
|
|
19
|
+
export * from './teams-projects-protocol';
|
|
20
|
+
export * from './snapshot-url';
|
|
21
|
+
export * from './oss-allowlist';
|