@gitpod/gitpod-protocol 0.1.5-v0.6.0-beta4 → 0.1.5-vn-implement-jetbrains-terminals.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.
- package/data/builtin-theia-plugins.json +9 -9
- package/data/gitpod-schema.json +25 -24
- package/lib/accounting-protocol.d.ts +155 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +109 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +31 -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/auth.d.ts +25 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +16 -0
- package/lib/auth.js.map +1 -0
- package/lib/context-url.d.ts +31 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +102 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +14 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +94 -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 +5 -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 +162 -20
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +170 -256
- 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-frontend-service.d.ts +4 -0
- package/lib/ide-frontend-service.d.ts.map +1 -1
- package/lib/ide-protocol.d.ts +105 -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 +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +21 -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 +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +183 -33
- 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/error.d.ts +5 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +10 -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/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +5 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +18 -17
- 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 +120 -58
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +116 -130
- 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 +73 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +63 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +113 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +30 -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 +4 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +487 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/{without.d.ts → generate-workspace-id.spec.d.ts} +2 -2
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +87 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -0
- 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 +2 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +96 -95
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +8 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +104 -22
- 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 +13 -3
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +38 -8
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +8 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +127 -47
- 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 +28 -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 +197 -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 +3 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +71 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +16 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +26 -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 +33 -17
- package/pkg-yarn.lock +18 -9
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +53 -5
- package/src/analytics.ts +54 -0
- package/src/auth.ts +27 -0
- package/src/context-url.spec.ts +53 -0
- package/src/context-url.ts +107 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +237 -38
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +5 -1
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +7 -1
- package/src/installation-admin-protocol.ts +35 -0
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +14 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +7 -6
- package/src/plans.ts +632 -0
- package/src/protocol.ts +194 -87
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +113 -0
- package/src/teams-projects-protocol.ts +147 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +9 -3
- package/src/util/generate-workspace-id.spec.ts +48 -0
- package/src/util/generate-workspace-id.ts +475 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +30 -1
- package/src/util/gitpod-host-url.ts +27 -13
- 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 +45 -4
- package/src/util/parse-workspace-id.ts +38 -7
- package/src/util/queue.spec.ts +1 -1
- 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 +183 -17
- package/src/workspace-cluster.ts +91 -0
- package/src/workspace-instance.ts +51 -13
- package/src/wsready.ts +2 -2
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -46
- package/lib/messaging/connection-error-handler.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/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/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- 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
|
@@ -5,14 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
User, WorkspaceInfo, WorkspaceCreationResult,
|
|
9
|
-
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo,
|
|
8
|
+
User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser,
|
|
9
|
+
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, CreateWorkspaceMode,
|
|
10
10
|
Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms,
|
|
11
|
-
ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
|
|
11
|
+
ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
|
|
12
|
+
GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes, ProjectEnvVar
|
|
12
13
|
} from './protocol';
|
|
14
|
+
import {
|
|
15
|
+
Team, TeamMemberInfo,
|
|
16
|
+
TeamMembershipInvite, Project, TeamMemberRole, PrebuildWithStatus, StartPrebuildResult, PartialProject
|
|
17
|
+
} from './teams-projects-protocol';
|
|
13
18
|
import { JsonRpcProxy, JsonRpcServer } from './messaging/proxy-factory';
|
|
14
19
|
import { Disposable, CancellationTokenSource } from 'vscode-jsonrpc';
|
|
15
|
-
import {
|
|
20
|
+
import { HeadlessLogUrls } from './headless-workspace-log';
|
|
16
21
|
import { WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstancePhase } from './workspace-instance';
|
|
17
22
|
import { AdminServer } from './admin-protocol';
|
|
18
23
|
import { GitpodHostUrl } from './util/gitpod-host-url';
|
|
@@ -20,11 +25,20 @@ import { WebSocketConnectionProvider } from './messaging/browser/connection';
|
|
|
20
25
|
import { PermissionName } from './permission';
|
|
21
26
|
import { LicenseService } from './license-protocol';
|
|
22
27
|
import { Emitter } from './util/event';
|
|
28
|
+
import { AccountStatement, CreditAlert } from './accounting-protocol';
|
|
29
|
+
import { GithubUpgradeURL, PlanCoupon } from './payment-protocol';
|
|
30
|
+
import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from './team-subscription-protocol';
|
|
31
|
+
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from './analytics';
|
|
32
|
+
import { IDEServer } from './ide-protocol';
|
|
33
|
+
import { InstallationAdminSettings } from './installation-admin-protocol';
|
|
23
34
|
|
|
24
35
|
export interface GitpodClient {
|
|
25
36
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
26
37
|
onWorkspaceImageBuildLogs: WorkspaceImageBuild.LogCallback;
|
|
27
|
-
|
|
38
|
+
|
|
39
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void;
|
|
40
|
+
|
|
41
|
+
onCreditAlert(creditAlert: CreditAlert): void;
|
|
28
42
|
|
|
29
43
|
//#region propagating reconnection to iframe
|
|
30
44
|
notifyDidOpenConnection(): void;
|
|
@@ -33,18 +47,18 @@ export interface GitpodClient {
|
|
|
33
47
|
}
|
|
34
48
|
|
|
35
49
|
export const GitpodServer = Symbol('GitpodServer');
|
|
36
|
-
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService {
|
|
50
|
+
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
|
|
37
51
|
// User related API
|
|
38
52
|
getLoggedInUser(): Promise<User>;
|
|
39
53
|
getTerms(): Promise<Terms>;
|
|
40
54
|
updateLoggedInUser(user: Partial<User>): Promise<User>;
|
|
41
55
|
getAuthProviders(): Promise<AuthProviderInfo[]>;
|
|
42
56
|
getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
|
|
43
|
-
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<
|
|
57
|
+
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
|
|
44
58
|
deleteOwnAuthProvider(params: GitpodServer.DeleteOwnAuthProviderParams): Promise<void>;
|
|
45
|
-
getBranding(): Promise<Branding>;
|
|
46
59
|
getConfiguration(): Promise<Configuration>;
|
|
47
60
|
getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
|
|
61
|
+
getGitpodTokenScopes(tokenHash: string): Promise<string[]>;
|
|
48
62
|
/**
|
|
49
63
|
* @deprecated
|
|
50
64
|
*/
|
|
@@ -58,8 +72,15 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
58
72
|
getWorkspaceOwner(workspaceId: string): Promise<UserInfo | undefined>;
|
|
59
73
|
getWorkspaceUsers(workspaceId: string): Promise<WorkspaceInstanceUser[]>;
|
|
60
74
|
getFeaturedRepositories(): Promise<WhitelistedRepository[]>;
|
|
75
|
+
getSuggestedContextURLs(): Promise<string[]>;
|
|
76
|
+
/**
|
|
77
|
+
* **Security:**
|
|
78
|
+
* Sensitive information like an owner token is erased, since it allows access for all team members.
|
|
79
|
+
* If you need to access an owner token use `getOwnerToken` instead.
|
|
80
|
+
*/
|
|
61
81
|
getWorkspace(id: string): Promise<WorkspaceInfo>;
|
|
62
82
|
isWorkspaceOwner(workspaceId: string): Promise<boolean>;
|
|
83
|
+
getOwnerToken(workspaceId: string): Promise<string>;
|
|
63
84
|
|
|
64
85
|
/**
|
|
65
86
|
* Creates and starts a workspace for the given context URL.
|
|
@@ -76,8 +97,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
76
97
|
updateWorkspaceUserPin(id: string, action: GitpodServer.PinAction): Promise<void>;
|
|
77
98
|
sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
|
|
78
99
|
watchWorkspaceImageBuildLogs(workspaceId: string): Promise<void>;
|
|
79
|
-
watchHeadlessWorkspaceLogs(workspaceId: string): Promise<void>;
|
|
80
100
|
isPrebuildDone(pwsid: string): Promise<boolean>;
|
|
101
|
+
getHeadlessLog(instanceId: string): Promise<HeadlessLogUrls>;
|
|
81
102
|
|
|
82
103
|
// Workspace timeout
|
|
83
104
|
setWorkspaceTimeout(workspaceId: string, duration: WorkspaceTimeoutDuration): Promise<SetWorkspaceTimeoutResult>;
|
|
@@ -91,19 +112,55 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
91
112
|
openPort(workspaceId: string, port: WorkspaceInstancePort): Promise<WorkspaceInstancePort | undefined>;
|
|
92
113
|
closePort(workspaceId: string, port: number): Promise<void>;
|
|
93
114
|
|
|
94
|
-
// User messages
|
|
95
|
-
getUserMessages(options: GitpodServer.GetUserMessagesOptions): Promise<UserMessage[]>;
|
|
96
|
-
updateUserMessages(options: GitpodServer.UpdateUserMessagesOptions): Promise<void>;
|
|
97
|
-
|
|
98
115
|
// User storage
|
|
99
116
|
getUserStorageResource(options: GitpodServer.GetUserStorageResourceOptions): Promise<string>;
|
|
100
117
|
updateUserStorageResource(options: GitpodServer.UpdateUserStorageResourceOptions): Promise<void>;
|
|
101
118
|
|
|
102
|
-
//
|
|
119
|
+
// User env vars
|
|
103
120
|
getEnvVars(): Promise<UserEnvVarValue[]>;
|
|
121
|
+
getAllEnvVars(): Promise<UserEnvVarValue[]>;
|
|
104
122
|
setEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
105
123
|
deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
106
124
|
|
|
125
|
+
// Teams
|
|
126
|
+
getTeams(): Promise<Team[]>;
|
|
127
|
+
getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
|
|
128
|
+
createTeam(name: string): Promise<Team>;
|
|
129
|
+
joinTeam(inviteId: string): Promise<Team>;
|
|
130
|
+
setTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
|
|
131
|
+
removeTeamMember(teamId: string, userId: string): Promise<void>;
|
|
132
|
+
getGenericInvite(teamId: string): Promise<TeamMembershipInvite>;
|
|
133
|
+
resetGenericInvite(inviteId: string): Promise<TeamMembershipInvite>;
|
|
134
|
+
deleteTeam(teamId: string, userId: string): Promise<void>;
|
|
135
|
+
|
|
136
|
+
// Admin Settings
|
|
137
|
+
adminGetSettings(): Promise<InstallationAdminSettings>;
|
|
138
|
+
adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
|
|
139
|
+
|
|
140
|
+
// Projects
|
|
141
|
+
getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
|
|
142
|
+
createProject(params: CreateProjectParams): Promise<Project>;
|
|
143
|
+
deleteProject(projectId: string): Promise<void>;
|
|
144
|
+
getTeamProjects(teamId: string): Promise<Project[]>;
|
|
145
|
+
getUserProjects(): Promise<Project[]>;
|
|
146
|
+
getProjectOverview(projectId: string): Promise<Project.Overview | undefined>;
|
|
147
|
+
findPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
|
|
148
|
+
triggerPrebuild(projectId: string, branchName: string | null): Promise<StartPrebuildResult>;
|
|
149
|
+
cancelPrebuild(projectId: string, prebuildId: string): Promise<void>;
|
|
150
|
+
fetchProjectRepositoryConfiguration(projectId: string): Promise<string | undefined>;
|
|
151
|
+
guessProjectConfiguration(projectId: string): Promise<string | undefined>;
|
|
152
|
+
fetchRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
153
|
+
guessRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
154
|
+
setProjectConfiguration(projectId: string, configString: string): Promise<void>;
|
|
155
|
+
updateProjectPartial(partialProject: PartialProject): Promise<void>;
|
|
156
|
+
setProjectEnvironmentVariable(projectId: string, name: string, value: string, censored: boolean): Promise<void>;
|
|
157
|
+
getProjectEnvironmentVariables(projectId: string): Promise<ProjectEnvVar[]>;
|
|
158
|
+
deleteProjectEnvironmentVariable(variableId: string): Promise<void>;
|
|
159
|
+
|
|
160
|
+
// content service
|
|
161
|
+
getContentBlobUploadUrl(name: string): Promise<string>
|
|
162
|
+
getContentBlobDownloadUrl(name: string): Promise<string>
|
|
163
|
+
|
|
107
164
|
// Gitpod token
|
|
108
165
|
getGitpodTokens(): Promise<GitpodToken[]>;
|
|
109
166
|
generateNewGitpodToken(options: GitpodServer.GenerateNewGitpodTokenOptions): Promise<string>;
|
|
@@ -114,10 +171,15 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
114
171
|
registerGithubApp(installationId: string): Promise<void>;
|
|
115
172
|
|
|
116
173
|
/**
|
|
117
|
-
* Stores a new snapshot for the given workspace and bucketId
|
|
174
|
+
* Stores a new snapshot for the given workspace and bucketId. Returns _before_ the actual snapshot is done. To wait for that, use `waitForSnapshot`.
|
|
118
175
|
* @return the snapshot id
|
|
119
176
|
*/
|
|
120
177
|
takeSnapshot(options: GitpodServer.TakeSnapshotOptions): Promise<string>;
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @param snapshotId
|
|
181
|
+
*/
|
|
182
|
+
waitForSnapshot(snapshotId: string): Promise<void>;
|
|
121
183
|
|
|
122
184
|
/**
|
|
123
185
|
* Returns the list of snapshots that exist for a workspace.
|
|
@@ -142,6 +204,105 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
142
204
|
resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
|
|
143
205
|
installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
|
|
144
206
|
uninstallUserPlugin(params: UninstallPluginParams): Promise<boolean>;
|
|
207
|
+
|
|
208
|
+
guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* gitpod.io concerns
|
|
212
|
+
*/
|
|
213
|
+
isStudent(): Promise<boolean>;
|
|
214
|
+
/**
|
|
215
|
+
*
|
|
216
|
+
*/
|
|
217
|
+
getAccountStatement(options: GitpodServer.GetAccountStatementOptions): Promise<AccountStatement | undefined>;
|
|
218
|
+
getRemainingUsageHours(): Promise<number>;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
*
|
|
222
|
+
*/
|
|
223
|
+
getChargebeeSiteId(): Promise<string>;
|
|
224
|
+
createPortalSession(): Promise<{}>;
|
|
225
|
+
checkout(planId: string, planQuantity?: number): Promise<{}>;
|
|
226
|
+
getAvailableCoupons(): Promise<PlanCoupon[]>;
|
|
227
|
+
getAppliedCoupons(): Promise<PlanCoupon[]>;
|
|
228
|
+
|
|
229
|
+
getShowPaymentUI(): Promise<boolean>;
|
|
230
|
+
isChargebeeCustomer(): Promise<boolean>;
|
|
231
|
+
|
|
232
|
+
subscriptionUpgradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
233
|
+
subscriptionDowngradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
234
|
+
subscriptionCancel(subscriptionId: string): Promise<void>;
|
|
235
|
+
subscriptionCancelDowngrade(subscriptionId: string): Promise<void>;
|
|
236
|
+
|
|
237
|
+
tsGet(): Promise<TeamSubscription[]>;
|
|
238
|
+
tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
|
|
239
|
+
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>
|
|
240
|
+
tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
|
|
241
|
+
tsAssignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, identityStr: string | undefined): Promise<void>
|
|
242
|
+
tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
|
|
243
|
+
tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
244
|
+
tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
245
|
+
|
|
246
|
+
getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Analytics
|
|
250
|
+
*/
|
|
251
|
+
trackEvent(event: RemoteTrackMessage): Promise<void>;
|
|
252
|
+
trackLocation(event: RemotePageMessage): Promise<void>;
|
|
253
|
+
identifyUser(event: RemoteIdentifyMessage): Promise<void>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface RateLimiterError {
|
|
257
|
+
method?: string,
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Retry after this many seconds, earliest.
|
|
261
|
+
* cmp.: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
|
262
|
+
*/
|
|
263
|
+
retryAfter: number,
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface CreateProjectParams {
|
|
267
|
+
name: string;
|
|
268
|
+
slug?: string;
|
|
269
|
+
account: string;
|
|
270
|
+
provider: string;
|
|
271
|
+
cloneUrl: string;
|
|
272
|
+
teamId?: string;
|
|
273
|
+
userId?: string;
|
|
274
|
+
appInstallationId: string;
|
|
275
|
+
}
|
|
276
|
+
export interface FindPrebuildsParams {
|
|
277
|
+
projectId: string;
|
|
278
|
+
branch?: string;
|
|
279
|
+
latest?: boolean;
|
|
280
|
+
prebuildId?: string;
|
|
281
|
+
// default: 30
|
|
282
|
+
limit?: number;
|
|
283
|
+
}
|
|
284
|
+
export interface GetProviderRepositoriesParams {
|
|
285
|
+
provider: string;
|
|
286
|
+
hints?: { installationId: string } | object;
|
|
287
|
+
}
|
|
288
|
+
export interface ProviderRepository {
|
|
289
|
+
name: string;
|
|
290
|
+
path?: string;
|
|
291
|
+
account: string;
|
|
292
|
+
accountAvatarUrl: string;
|
|
293
|
+
cloneUrl: string;
|
|
294
|
+
updatedAt: string;
|
|
295
|
+
installationId?: number;
|
|
296
|
+
installationUpdatedAt?: string;
|
|
297
|
+
|
|
298
|
+
inUse?: { userName: string };
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface ClientHeaderFields {
|
|
302
|
+
ip?: string;
|
|
303
|
+
userAgent?: string;
|
|
304
|
+
dnt?: string;
|
|
305
|
+
clientRegion?: string;
|
|
145
306
|
}
|
|
146
307
|
|
|
147
308
|
export const WorkspaceTimeoutValues = ["30m", "60m", "180m"] as const;
|
|
@@ -154,6 +315,7 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
|
|
|
154
315
|
methods.setClient = methods.setClient || (() => { });
|
|
155
316
|
methods.dispose = methods.dispose || (() => { });
|
|
156
317
|
return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
|
|
318
|
+
// @ts-ignore
|
|
157
319
|
get: (target: S, property: keyof S) => {
|
|
158
320
|
const result = target[property];
|
|
159
321
|
if (!result) {
|
|
@@ -186,6 +348,8 @@ export namespace GitpodServer {
|
|
|
186
348
|
limit?: number;
|
|
187
349
|
searchString?: string;
|
|
188
350
|
pinnedOnly?: boolean;
|
|
351
|
+
projectId?: string | string[];
|
|
352
|
+
includeWithoutProject?: boolean;
|
|
189
353
|
}
|
|
190
354
|
export interface GetAccountStatementOptions {
|
|
191
355
|
date?: string;
|
|
@@ -193,6 +357,7 @@ export namespace GitpodServer {
|
|
|
193
357
|
export interface CreateWorkspaceOptions {
|
|
194
358
|
contextUrl: string;
|
|
195
359
|
mode?: CreateWorkspaceMode;
|
|
360
|
+
forceDefaultConfig?: boolean;
|
|
196
361
|
}
|
|
197
362
|
export interface StartWorkspaceOptions {
|
|
198
363
|
forceDefaultImage: boolean;
|
|
@@ -200,13 +365,8 @@ export namespace GitpodServer {
|
|
|
200
365
|
export interface TakeSnapshotOptions {
|
|
201
366
|
workspaceId: string;
|
|
202
367
|
layoutData?: string;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
readonly releaseNotes?: boolean;
|
|
206
|
-
readonly workspaceInstanceId: string;
|
|
207
|
-
}
|
|
208
|
-
export interface UpdateUserMessagesOptions {
|
|
209
|
-
readonly messageIds: string[];
|
|
368
|
+
/* this is here to enable backwards-compatibility and untangling rollout between workspace, IDE and meta */
|
|
369
|
+
dontWait?: boolean;
|
|
210
370
|
}
|
|
211
371
|
export interface GetUserStorageResourceOptions {
|
|
212
372
|
readonly uri: string;
|
|
@@ -248,10 +408,12 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
248
408
|
|
|
249
409
|
public registerClient(client: Partial<Client>): Disposable {
|
|
250
410
|
this.clients.push(client);
|
|
251
|
-
const index = this.clients.length;
|
|
252
411
|
return {
|
|
253
412
|
dispose: () => {
|
|
254
|
-
this.clients.
|
|
413
|
+
const index = this.clients.indexOf(client);
|
|
414
|
+
if (index > -1) {
|
|
415
|
+
this.clients.splice(index, 1);
|
|
416
|
+
}
|
|
255
417
|
}
|
|
256
418
|
}
|
|
257
419
|
}
|
|
@@ -268,11 +430,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
268
430
|
}
|
|
269
431
|
}
|
|
270
432
|
|
|
271
|
-
|
|
433
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void {
|
|
272
434
|
for (const client of this.clients) {
|
|
273
|
-
if (client.
|
|
435
|
+
if (client.onPrebuildUpdate) {
|
|
274
436
|
try {
|
|
275
|
-
client.
|
|
437
|
+
client.onPrebuildUpdate(update);
|
|
276
438
|
} catch (error) {
|
|
277
439
|
console.error(error)
|
|
278
440
|
}
|
|
@@ -280,11 +442,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
280
442
|
}
|
|
281
443
|
}
|
|
282
444
|
|
|
283
|
-
|
|
445
|
+
onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void {
|
|
284
446
|
for (const client of this.clients) {
|
|
285
|
-
if (client.
|
|
447
|
+
if (client.onWorkspaceImageBuildLogs) {
|
|
286
448
|
try {
|
|
287
|
-
client.
|
|
449
|
+
client.onWorkspaceImageBuildLogs(info, content);
|
|
288
450
|
} catch (error) {
|
|
289
451
|
console.error(error)
|
|
290
452
|
}
|
|
@@ -316,6 +478,18 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
316
478
|
}
|
|
317
479
|
}
|
|
318
480
|
|
|
481
|
+
onCreditAlert(creditAlert: CreditAlert): void {
|
|
482
|
+
for (const client of this.clients) {
|
|
483
|
+
if (client.onCreditAlert) {
|
|
484
|
+
try {
|
|
485
|
+
client.onCreditAlert(creditAlert);
|
|
486
|
+
} catch (error) {
|
|
487
|
+
console.error(error)
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
319
493
|
}
|
|
320
494
|
|
|
321
495
|
export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
|
|
@@ -336,7 +510,7 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
336
510
|
private readonly onDidChangeEmitter = new Emitter<void>();
|
|
337
511
|
readonly onDidChange = this.onDidChangeEmitter.event;
|
|
338
512
|
|
|
339
|
-
private source: 'sync'
|
|
513
|
+
private source: 'sync' | 'update' = 'sync';
|
|
340
514
|
|
|
341
515
|
get info(): WorkspaceInfo {
|
|
342
516
|
return this._info;
|
|
@@ -428,11 +602,15 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
428
602
|
|
|
429
603
|
}
|
|
430
604
|
|
|
605
|
+
export interface GitpodServiceOptions {
|
|
606
|
+
onReconnect?: () => (void | Promise<void>)
|
|
607
|
+
}
|
|
608
|
+
|
|
431
609
|
export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
|
|
432
610
|
|
|
433
611
|
private readonly compositeClient = new GitpodCompositeClient<Client>();
|
|
434
612
|
|
|
435
|
-
constructor(public readonly server: JsonRpcProxy<Server
|
|
613
|
+
constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
|
|
436
614
|
server.setClient(this.compositeClient);
|
|
437
615
|
server.onDidOpenConnection(() => this.compositeClient.notifyDidOpenConnection());
|
|
438
616
|
server.onDidCloseConnection(() => this.compositeClient.notifyDidCloseConnection());
|
|
@@ -452,13 +630,34 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
|
|
|
452
630
|
this.instanceListeners.set(workspaceId, listener);
|
|
453
631
|
return listener;
|
|
454
632
|
}
|
|
633
|
+
|
|
634
|
+
async reconnect(): Promise<void> {
|
|
635
|
+
if (this.options?.onReconnect) {
|
|
636
|
+
await this.options.onReconnect();
|
|
637
|
+
}
|
|
638
|
+
}
|
|
455
639
|
}
|
|
456
640
|
|
|
457
|
-
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string) {
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
641
|
+
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>) {
|
|
642
|
+
const toWsUrl = (serverUrl: string) => {
|
|
643
|
+
return new GitpodHostUrl(serverUrl)
|
|
644
|
+
.asWebsocket()
|
|
645
|
+
.withApi({ pathname: GitpodServerPath })
|
|
646
|
+
.toString();
|
|
647
|
+
};
|
|
648
|
+
let url: string | Promise<string>;
|
|
649
|
+
if (typeof serverUrl === "string") {
|
|
650
|
+
url = toWsUrl(serverUrl);
|
|
651
|
+
} else {
|
|
652
|
+
url = serverUrl.then(url => toWsUrl(url));
|
|
653
|
+
}
|
|
654
|
+
|
|
461
655
|
const connectionProvider = new WebSocketConnectionProvider();
|
|
462
|
-
|
|
463
|
-
|
|
656
|
+
let onReconnect = () => { };
|
|
657
|
+
const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
|
|
658
|
+
onListening: socket => {
|
|
659
|
+
onReconnect = () => socket.reconnect();
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
|
|
464
663
|
}
|
|
@@ -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})/;
|
|
@@ -7,10 +7,14 @@
|
|
|
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;
|
|
14
|
+
/**
|
|
15
|
+
* A cause of the ide frontend application failure when state is terminated.
|
|
16
|
+
*/
|
|
17
|
+
readonly failureCause?: Error;
|
|
14
18
|
readonly onDidChange: Event<void>;
|
|
15
19
|
/**
|
|
16
20
|
* Starts the ide frontend application.
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
* The latest image ref to the IDE image, this image ref always resolve to digest.
|
|
107
|
+
*/
|
|
108
|
+
latestImage?: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* When this is `true`, the tag of this image is resolved to the latest
|
|
112
|
+
* image digest regularly.
|
|
113
|
+
*
|
|
114
|
+
* This is useful if this image points to a tag like `nightly` that will be
|
|
115
|
+
* updated regularly. When `resolveImageDigest` is `true`, we make sure that
|
|
116
|
+
* we resolve the tag regularly to the most recent image version.
|
|
117
|
+
*/
|
|
118
|
+
resolveImageDigest?: boolean;
|
|
119
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,4 +13,10 @@ 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';
|
|
22
|
+
export * from './installation-admin-protocol';
|
|
@@ -0,0 +1,35 @@
|
|
|
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 namespace InstallationAdmin {
|
|
27
|
+
export function createDefault(): InstallationAdmin {
|
|
28
|
+
return {
|
|
29
|
+
id: uuidv4(),
|
|
30
|
+
settings: {
|
|
31
|
+
...InstallationAdminSettingsPrototype,
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|