@gitpod/gitpod-protocol 0.1.5-svenefftinge-patch-1.3 → 0.1.5-tarun-telemetry-users.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.
- package/data/gitpod-schema.json +21 -2
- package/lib/accounting-protocol.d.ts +0 -1
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +10 -11
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +18 -2
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +2 -13
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +13 -1
- package/lib/analytics.d.ts.map +1 -1
- package/lib/context-url.d.ts +1 -0
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +7 -5
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.js +45 -48
- package/lib/context-url.spec.js.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 +68 -20
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +151 -295
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +1 -12
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +1 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-protocol.d.ts +101 -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 +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +25 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/messaging/browser/connection.d.ts +3 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +172 -35
- 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 +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +23 -59
- 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 +4 -2
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +16 -13
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +1 -1
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +38 -57
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +51 -49
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +57 -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/lib/snapshot-url.spec.d.ts +7 -0
- 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.js +13 -13
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +59 -6
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +18 -15
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/util/analytics.d.ts.map +1 -1
- package/lib/util/analytics.js +35 -26
- package/lib/util/analytics.js.map +1 -1
- 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 +1 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +29 -68
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +57 -78
- 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 +93 -103
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +87 -135
- 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/jaeger-client-types.js +8 -0
- 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/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 +51 -5
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +196 -62
- 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 +8 -1
- 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 +24 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.js +1 -1
- package/package.json +24 -13
- package/pkg-yarn.lock +14 -7
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +1 -3
- package/src/admin-protocol.ts +25 -6
- package/src/analytics.ts +16 -1
- package/src/context-url.ts +3 -1
- package/src/email-protocol.ts +1 -1
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +88 -33
- package/src/headless-workspace-log.ts +1 -14
- package/src/ide-frontend-service.ts +1 -1
- package/src/ide-protocol.ts +114 -0
- package/src/index.ts +3 -0
- package/src/installation-admin-protocol.ts +40 -0
- package/src/messaging/browser/connection.ts +176 -10
- 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 +21 -68
- package/src/messaging/proxy-factory.ts +13 -5
- package/src/oss-allowlist.ts +15 -0
- package/src/permission.ts +5 -1
- package/src/protocol.ts +70 -54
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +1 -1
- package/src/teams-projects-protocol.ts +78 -7
- package/src/util/analytics.ts +17 -1
- package/src/util/garbage-collected-cache.ts +7 -1
- package/src/util/generate-workspace-id.spec.ts +17 -0
- package/src/util/generate-workspace-id.ts +20 -2
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.ts +11 -11
- 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/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +183 -18
- package/src/workspace-cluster.ts +3 -1
- package/src/workspace-instance.ts +35 -6
- package/src/wsready.ts +1 -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/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -34
- package/lib/util/safe-promise.js.map +0 -1
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
package/src/gitpod-service.ts
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser,
|
|
9
|
-
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo,
|
|
9
|
+
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, CreateWorkspaceMode,
|
|
10
10
|
Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms,
|
|
11
11
|
ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
|
|
12
|
-
GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes
|
|
12
|
+
GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes, ProjectEnvVar
|
|
13
13
|
} from './protocol';
|
|
14
14
|
import {
|
|
15
15
|
Team, TeamMemberInfo,
|
|
16
|
-
TeamMembershipInvite, Project,
|
|
16
|
+
TeamMembershipInvite, Project, TeamMemberRole, PrebuildWithStatus, StartPrebuildResult, PartialProject
|
|
17
17
|
} from './teams-projects-protocol';
|
|
18
18
|
import { JsonRpcProxy, JsonRpcServer } from './messaging/proxy-factory';
|
|
19
19
|
import { Disposable, CancellationTokenSource } from 'vscode-jsonrpc';
|
|
20
|
-
import {
|
|
20
|
+
import { HeadlessLogUrls } from './headless-workspace-log';
|
|
21
21
|
import { WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstancePhase } from './workspace-instance';
|
|
22
22
|
import { AdminServer } from './admin-protocol';
|
|
23
23
|
import { GitpodHostUrl } from './util/gitpod-host-url';
|
|
@@ -28,12 +28,15 @@ import { Emitter } from './util/event';
|
|
|
28
28
|
import { AccountStatement, CreditAlert } from './accounting-protocol';
|
|
29
29
|
import { GithubUpgradeURL, PlanCoupon } from './payment-protocol';
|
|
30
30
|
import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from './team-subscription-protocol';
|
|
31
|
-
import { RemoteTrackMessage } from './analytics';
|
|
31
|
+
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from './analytics';
|
|
32
|
+
import { IDEServer } from './ide-protocol';
|
|
33
|
+
import { InstallationAdminSettings } from './installation-admin-protocol';
|
|
32
34
|
|
|
33
35
|
export interface GitpodClient {
|
|
34
36
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
35
37
|
onWorkspaceImageBuildLogs: WorkspaceImageBuild.LogCallback;
|
|
36
|
-
|
|
38
|
+
|
|
39
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void;
|
|
37
40
|
|
|
38
41
|
onCreditAlert(creditAlert: CreditAlert): void;
|
|
39
42
|
|
|
@@ -44,7 +47,7 @@ export interface GitpodClient {
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
export const GitpodServer = Symbol('GitpodServer');
|
|
47
|
-
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService {
|
|
50
|
+
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
|
|
48
51
|
// User related API
|
|
49
52
|
getLoggedInUser(): Promise<User>;
|
|
50
53
|
getTerms(): Promise<Terms>;
|
|
@@ -53,9 +56,9 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
53
56
|
getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
|
|
54
57
|
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
|
|
55
58
|
deleteOwnAuthProvider(params: GitpodServer.DeleteOwnAuthProviderParams): Promise<void>;
|
|
56
|
-
getBranding(): Promise<Branding>;
|
|
57
59
|
getConfiguration(): Promise<Configuration>;
|
|
58
60
|
getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
|
|
61
|
+
getGitpodTokenScopes(tokenHash: string): Promise<string[]>;
|
|
59
62
|
/**
|
|
60
63
|
* @deprecated
|
|
61
64
|
*/
|
|
@@ -69,8 +72,14 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
69
72
|
getWorkspaceOwner(workspaceId: string): Promise<UserInfo | undefined>;
|
|
70
73
|
getWorkspaceUsers(workspaceId: string): Promise<WorkspaceInstanceUser[]>;
|
|
71
74
|
getFeaturedRepositories(): Promise<WhitelistedRepository[]>;
|
|
75
|
+
/**
|
|
76
|
+
* **Security:**
|
|
77
|
+
* Sensitive information like an owner token is erased, since it allows access for all team members.
|
|
78
|
+
* If you need to access an owner token use `getOwnerToken` instead.
|
|
79
|
+
*/
|
|
72
80
|
getWorkspace(id: string): Promise<WorkspaceInfo>;
|
|
73
81
|
isWorkspaceOwner(workspaceId: string): Promise<boolean>;
|
|
82
|
+
getOwnerToken(workspaceId: string): Promise<string>;
|
|
74
83
|
|
|
75
84
|
/**
|
|
76
85
|
* Creates and starts a workspace for the given context URL.
|
|
@@ -87,7 +96,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
87
96
|
updateWorkspaceUserPin(id: string, action: GitpodServer.PinAction): Promise<void>;
|
|
88
97
|
sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
|
|
89
98
|
watchWorkspaceImageBuildLogs(workspaceId: string): Promise<void>;
|
|
90
|
-
watchHeadlessWorkspaceLogs(workspaceId: string): Promise<void>;
|
|
91
99
|
isPrebuildDone(pwsid: string): Promise<boolean>;
|
|
92
100
|
getHeadlessLog(instanceId: string): Promise<HeadlessLogUrls>;
|
|
93
101
|
|
|
@@ -107,13 +115,13 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
107
115
|
getUserStorageResource(options: GitpodServer.GetUserStorageResourceOptions): Promise<string>;
|
|
108
116
|
updateUserStorageResource(options: GitpodServer.UpdateUserStorageResourceOptions): Promise<void>;
|
|
109
117
|
|
|
110
|
-
//
|
|
118
|
+
// User env vars
|
|
111
119
|
getEnvVars(): Promise<UserEnvVarValue[]>;
|
|
112
120
|
getAllEnvVars(): Promise<UserEnvVarValue[]>;
|
|
113
121
|
setEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
114
122
|
deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
115
123
|
|
|
116
|
-
//
|
|
124
|
+
// Teams
|
|
117
125
|
getTeams(): Promise<Team[]>;
|
|
118
126
|
getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
|
|
119
127
|
createTeam(name: string): Promise<Team>;
|
|
@@ -122,6 +130,31 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
122
130
|
removeTeamMember(teamId: string, userId: string): Promise<void>;
|
|
123
131
|
getGenericInvite(teamId: string): Promise<TeamMembershipInvite>;
|
|
124
132
|
resetGenericInvite(inviteId: string): Promise<TeamMembershipInvite>;
|
|
133
|
+
deleteTeam(teamId: string, userId: string): Promise<void>;
|
|
134
|
+
|
|
135
|
+
// Admin Settings
|
|
136
|
+
adminGetSettings(): Promise<InstallationAdminSettings>;
|
|
137
|
+
adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
|
|
138
|
+
|
|
139
|
+
// Projects
|
|
140
|
+
getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
|
|
141
|
+
createProject(params: CreateProjectParams): Promise<Project>;
|
|
142
|
+
deleteProject(projectId: string): Promise<void>;
|
|
143
|
+
getTeamProjects(teamId: string): Promise<Project[]>;
|
|
144
|
+
getUserProjects(): Promise<Project[]>;
|
|
145
|
+
getProjectOverview(projectId: string): Promise<Project.Overview | undefined>;
|
|
146
|
+
findPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
|
|
147
|
+
triggerPrebuild(projectId: string, branchName: string | null): Promise<StartPrebuildResult>;
|
|
148
|
+
cancelPrebuild(projectId: string, prebuildId: string): Promise<void>;
|
|
149
|
+
fetchProjectRepositoryConfiguration(projectId: string): Promise<string | undefined>;
|
|
150
|
+
guessProjectConfiguration(projectId: string): Promise<string | undefined>;
|
|
151
|
+
fetchRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
152
|
+
guessRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
153
|
+
setProjectConfiguration(projectId: string, configString: string): Promise<void>;
|
|
154
|
+
updateProjectPartial(partialProject: PartialProject): Promise<void>;
|
|
155
|
+
setProjectEnvironmentVariable(projectId: string, name: string, value: string, censored: boolean): Promise<void>;
|
|
156
|
+
getProjectEnvironmentVariables(projectId: string): Promise<ProjectEnvVar[]>;
|
|
157
|
+
deleteProjectEnvironmentVariable(variableId: string): Promise<void>;
|
|
125
158
|
|
|
126
159
|
// content service
|
|
127
160
|
getContentBlobUploadUrl(name: string): Promise<string>
|
|
@@ -137,10 +170,15 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
137
170
|
registerGithubApp(installationId: string): Promise<void>;
|
|
138
171
|
|
|
139
172
|
/**
|
|
140
|
-
* Stores a new snapshot for the given workspace and bucketId
|
|
173
|
+
* Stores a new snapshot for the given workspace and bucketId. Returns _before_ the actual snapshot is done. To wait for that, use `waitForSnapshot`.
|
|
141
174
|
* @return the snapshot id
|
|
142
175
|
*/
|
|
143
176
|
takeSnapshot(options: GitpodServer.TakeSnapshotOptions): Promise<string>;
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* @param snapshotId
|
|
180
|
+
*/
|
|
181
|
+
waitForSnapshot(snapshotId: string): Promise<void>;
|
|
144
182
|
|
|
145
183
|
/**
|
|
146
184
|
* Returns the list of snapshots that exist for a workspace.
|
|
@@ -172,8 +210,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
172
210
|
* gitpod.io concerns
|
|
173
211
|
*/
|
|
174
212
|
isStudent(): Promise<boolean>;
|
|
175
|
-
getPrivateRepoTrialEndDate(): Promise<string | undefined>;
|
|
176
|
-
|
|
177
213
|
/**
|
|
178
214
|
*
|
|
179
215
|
*/
|
|
@@ -191,7 +227,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
191
227
|
|
|
192
228
|
getShowPaymentUI(): Promise<boolean>;
|
|
193
229
|
isChargebeeCustomer(): Promise<boolean>;
|
|
194
|
-
mayAccessPrivateRepo(): Promise<boolean>;
|
|
195
230
|
|
|
196
231
|
subscriptionUpgradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
197
232
|
subscriptionDowngradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
@@ -209,40 +244,54 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
209
244
|
|
|
210
245
|
getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
|
|
211
246
|
|
|
212
|
-
/**
|
|
213
|
-
* projects
|
|
214
|
-
*/
|
|
215
|
-
getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
|
|
216
|
-
createProject(params: CreateProjectParams): Promise<Project>;
|
|
217
|
-
getProjects(teamId: string): Promise<ProjectInfo[]>;
|
|
218
|
-
getPrebuilds(teamId: string, project: string): Promise<PrebuildInfo[]>;
|
|
219
|
-
|
|
220
247
|
/**
|
|
221
248
|
* Analytics
|
|
222
249
|
*/
|
|
223
250
|
trackEvent(event: RemoteTrackMessage): Promise<void>;
|
|
251
|
+
trackLocation(event: RemotePageMessage): Promise<void>;
|
|
252
|
+
identifyUser(event: RemoteIdentifyMessage): Promise<void>;
|
|
224
253
|
}
|
|
225
254
|
|
|
226
255
|
export interface CreateProjectParams {
|
|
227
256
|
name: string;
|
|
257
|
+
slug?: string;
|
|
228
258
|
account: string;
|
|
229
259
|
provider: string;
|
|
230
260
|
cloneUrl: string;
|
|
231
|
-
teamId
|
|
261
|
+
teamId?: string;
|
|
262
|
+
userId?: string;
|
|
232
263
|
appInstallationId: string;
|
|
233
264
|
}
|
|
265
|
+
export interface FindPrebuildsParams {
|
|
266
|
+
projectId: string;
|
|
267
|
+
branch?: string;
|
|
268
|
+
latest?: boolean;
|
|
269
|
+
prebuildId?: string;
|
|
270
|
+
// default: 30
|
|
271
|
+
limit?: number;
|
|
272
|
+
}
|
|
234
273
|
export interface GetProviderRepositoriesParams {
|
|
235
274
|
provider: string;
|
|
236
275
|
hints?: { installationId: string } | object;
|
|
237
276
|
}
|
|
238
277
|
export interface ProviderRepository {
|
|
239
278
|
name: string;
|
|
279
|
+
path?: string;
|
|
240
280
|
account: string;
|
|
241
281
|
accountAvatarUrl: string;
|
|
242
282
|
cloneUrl: string;
|
|
243
283
|
updatedAt: string;
|
|
244
284
|
installationId?: number;
|
|
245
285
|
installationUpdatedAt?: string;
|
|
286
|
+
|
|
287
|
+
inUse?: { userName: string };
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface ClientHeaderFields {
|
|
291
|
+
ip?: string;
|
|
292
|
+
userAgent?: string;
|
|
293
|
+
dnt?: string;
|
|
294
|
+
clientRegion?: string;
|
|
246
295
|
}
|
|
247
296
|
|
|
248
297
|
export const WorkspaceTimeoutValues = ["30m", "60m", "180m"] as const;
|
|
@@ -288,6 +337,8 @@ export namespace GitpodServer {
|
|
|
288
337
|
limit?: number;
|
|
289
338
|
searchString?: string;
|
|
290
339
|
pinnedOnly?: boolean;
|
|
340
|
+
projectId?: string | string[];
|
|
341
|
+
includeWithoutProject?: boolean;
|
|
291
342
|
}
|
|
292
343
|
export interface GetAccountStatementOptions {
|
|
293
344
|
date?: string;
|
|
@@ -303,6 +354,8 @@ export namespace GitpodServer {
|
|
|
303
354
|
export interface TakeSnapshotOptions {
|
|
304
355
|
workspaceId: string;
|
|
305
356
|
layoutData?: string;
|
|
357
|
+
/* this is here to enable backwards-compatibility and untangling rollout between workspace, IDE and meta */
|
|
358
|
+
dontWait?: boolean;
|
|
306
359
|
}
|
|
307
360
|
export interface GetUserStorageResourceOptions {
|
|
308
361
|
readonly uri: string;
|
|
@@ -344,10 +397,12 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
344
397
|
|
|
345
398
|
public registerClient(client: Partial<Client>): Disposable {
|
|
346
399
|
this.clients.push(client);
|
|
347
|
-
const index = this.clients.length;
|
|
348
400
|
return {
|
|
349
401
|
dispose: () => {
|
|
350
|
-
this.clients.
|
|
402
|
+
const index = this.clients.indexOf(client);
|
|
403
|
+
if (index > -1) {
|
|
404
|
+
this.clients.splice(index, 1);
|
|
405
|
+
}
|
|
351
406
|
}
|
|
352
407
|
}
|
|
353
408
|
}
|
|
@@ -364,11 +419,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
364
419
|
}
|
|
365
420
|
}
|
|
366
421
|
|
|
367
|
-
|
|
422
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void {
|
|
368
423
|
for (const client of this.clients) {
|
|
369
|
-
if (client.
|
|
424
|
+
if (client.onPrebuildUpdate) {
|
|
370
425
|
try {
|
|
371
|
-
client.
|
|
426
|
+
client.onPrebuildUpdate(update);
|
|
372
427
|
} catch (error) {
|
|
373
428
|
console.error(error)
|
|
374
429
|
}
|
|
@@ -376,11 +431,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
376
431
|
}
|
|
377
432
|
}
|
|
378
433
|
|
|
379
|
-
|
|
434
|
+
onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void {
|
|
380
435
|
for (const client of this.clients) {
|
|
381
|
-
if (client.
|
|
436
|
+
if (client.onWorkspaceImageBuildLogs) {
|
|
382
437
|
try {
|
|
383
|
-
client.
|
|
438
|
+
client.onWorkspaceImageBuildLogs(info, content);
|
|
384
439
|
} catch (error) {
|
|
385
440
|
console.error(error)
|
|
386
441
|
}
|
|
@@ -537,7 +592,7 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
537
592
|
}
|
|
538
593
|
|
|
539
594
|
export interface GitpodServiceOptions {
|
|
540
|
-
onReconnect?: () => (void |
|
|
595
|
+
onReconnect?: () => (void | Promise<void>)
|
|
541
596
|
}
|
|
542
597
|
|
|
543
598
|
export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
|
|
@@ -22,25 +22,12 @@ 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 enum TheiaHeadlessLogType {
|
|
32
|
-
TaskLogLabel = "workspaceTaskOutput",
|
|
33
|
-
TaskFailedLabel = "workspaceTaskFailed",
|
|
34
|
-
TaskSuccessfulLabel = "workspaceTaskDone"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface TheiaHeadlessLogMessage {
|
|
38
|
-
type: TheiaHeadlessLogType;
|
|
39
|
-
data?: string;
|
|
40
|
-
error?: string;
|
|
41
|
-
snapshotURL?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
31
|
export interface HeadlessLogUrls {
|
|
45
32
|
// A map of id to URL
|
|
46
33
|
streams: { [streamID: string]: string };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { Event } from "./util/event";
|
|
8
8
|
import { Disposable } from "./util/disposable";
|
|
9
9
|
|
|
10
|
-
export type IDEFrontendState = 'init' | 'ready' |
|
|
10
|
+
export type IDEFrontendState = 'init' | 'ready' | 'terminated';
|
|
11
11
|
|
|
12
12
|
export interface IDEFrontendService {
|
|
13
13
|
readonly state: IDEFrontendState;
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
* Client specific IDE options.
|
|
35
|
+
*/
|
|
36
|
+
clients?: { [id: string]: IDEClient };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IDEClient {
|
|
40
|
+
/**
|
|
41
|
+
* The default desktop IDE when the user has not specified one.
|
|
42
|
+
*/
|
|
43
|
+
defaultDesktopIDE?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Desktop IDEs supported by the client.
|
|
47
|
+
*/
|
|
48
|
+
desktopIDEs?: string[]
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Steps to install the client on user machine.
|
|
52
|
+
*/
|
|
53
|
+
installationSteps?: string[]
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface IDEOption {
|
|
57
|
+
/**
|
|
58
|
+
* To ensure a stable order one can set an `orderKey`.
|
|
59
|
+
*/
|
|
60
|
+
orderKey?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Human readable title text of the IDE (plain text only).
|
|
64
|
+
*/
|
|
65
|
+
title: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The type of the IDE, currently 'browser' or 'desktop'.
|
|
69
|
+
*/
|
|
70
|
+
type: 'browser' | 'desktop';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The logo for the IDE. That could be a key in (see
|
|
74
|
+
* components/dashboard/src/images/ideLogos.ts) or a URL.
|
|
75
|
+
*/
|
|
76
|
+
logo: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Text of an optional tooltip (plain text only).
|
|
80
|
+
*/
|
|
81
|
+
tooltip?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Text of an optional label next to the IDE option like “Insiders” (plain
|
|
85
|
+
* text only).
|
|
86
|
+
*/
|
|
87
|
+
label?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Notes to the IDE option that are renderd in the preferences when a user
|
|
91
|
+
* chooses this IDE.
|
|
92
|
+
*/
|
|
93
|
+
notes?: string[];
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* If `true` this IDE option is not visible in the IDE preferences.
|
|
97
|
+
*/
|
|
98
|
+
hidden?: boolean;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The image ref to the IDE image.
|
|
102
|
+
*/
|
|
103
|
+
image: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* When this is `true`, the tag of this image is resolved to the latest
|
|
107
|
+
* image digest regularly.
|
|
108
|
+
*
|
|
109
|
+
* This is useful if this image points to a tag like `nightly` that will be
|
|
110
|
+
* updated regularly. When `resolveImageDigest` is `true`, we make sure that
|
|
111
|
+
* we resolve the tag regularly to the most recent image version.
|
|
112
|
+
*/
|
|
113
|
+
resolveImageDigest?: boolean;
|
|
114
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -17,3 +17,6 @@ export * from './email-protocol';
|
|
|
17
17
|
export * from './headless-workspace-log';
|
|
18
18
|
export * from './context-url';
|
|
19
19
|
export * from './teams-projects-protocol';
|
|
20
|
+
export * from './snapshot-url';
|
|
21
|
+
export * from './oss-allowlist';
|
|
22
|
+
export * from './installation-admin-protocol';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 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
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
+
|
|
9
|
+
const InstallationAdminSettingsPrototype = {
|
|
10
|
+
sendTelemetry: true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type InstallationAdminSettings = typeof InstallationAdminSettingsPrototype;
|
|
14
|
+
|
|
15
|
+
export namespace InstallationAdminSettings {
|
|
16
|
+
export function fields(): (keyof InstallationAdminSettings)[] {
|
|
17
|
+
return Object.keys(InstallationAdminSettingsPrototype) as (keyof InstallationAdminSettings)[];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface InstallationAdmin {
|
|
22
|
+
id: string;
|
|
23
|
+
settings: InstallationAdminSettings;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Data {
|
|
27
|
+
installationAdmin: InstallationAdmin
|
|
28
|
+
totalUsers: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export namespace InstallationAdmin {
|
|
32
|
+
export function createDefault(): InstallationAdmin {
|
|
33
|
+
return {
|
|
34
|
+
id: uuidv4(),
|
|
35
|
+
settings: {
|
|
36
|
+
...InstallationAdminSettingsPrototype,
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|