@gitpod/gitpod-protocol 0.1.5-me-ingress.20 → 0.1.5-me-test3.3
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 +175 -2
- package/lib/accounting-protocol.d.ts +10 -10
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +22 -31
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +12 -0
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +4 -5
- package/lib/analytics.d.ts.map +1 -1
- package/lib/analytics.js.map +1 -1
- package/lib/auth.d.ts.map +1 -1
- package/lib/context-url.d.ts +18 -5
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +59 -6
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +2 -0
- package/lib/context-url.spec.d.ts.map +1 -1
- package/lib/context-url.spec.js +40 -4
- package/lib/context-url.spec.js.map +1 -1
- package/lib/email-protocol.d.ts +1 -1
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.d.ts.map +1 -1
- package/lib/encryption/container-module.js +1 -1
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +7 -7
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +2 -3
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +1 -1
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +7 -9
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +0 -5
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +1 -20
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +6 -6
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +42 -39
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +44 -26
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +36 -28
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +18 -0
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +21 -1
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +1 -1
- package/lib/ide-protocol.d.ts +30 -6
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/index.d.ts +16 -15
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -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/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +1 -1
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +19 -19
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +4 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +9 -6
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +2 -2
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +20 -20
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +2 -0
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +4 -0
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/handler.js +1 -1
- package/lib/messaging/node/connection.d.ts +1 -7
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +22 -20
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +1 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +7 -9
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/payment-protocol.d.ts.map +1 -1
- package/lib/payment-protocol.js +1 -1
- package/lib/payment-protocol.js.map +1 -1
- package/lib/permission.d.ts +9 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +34 -25
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +3 -3
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +206 -171
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +104 -72
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +129 -87
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.spec.js.map +1 -1
- package/lib/team-subscription-protocol.d.ts +5 -3
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +4 -4
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +10 -3
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +8 -1
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +2 -2
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/util/analytics.d.ts.map +1 -1
- package/lib/util/analytics.js +12 -3
- package/lib/util/analytics.js.map +1 -1
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +3 -3
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +6 -6
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +2 -2
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +5 -3
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +1 -1
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +5 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +447 -442
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +18 -6
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-cookie.d.ts +1 -1
- package/lib/util/gitpod-cookie.d.ts.map +1 -1
- package/lib/util/gitpod-cookie.js +0 -3
- package/lib/util/gitpod-cookie.js.map +1 -1
- package/lib/util/gitpod-host-url.d.ts +0 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +31 -32
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +15 -5
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts.map +1 -1
- package/lib/util/logging.d.ts +1 -1
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +23 -24
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +5 -5
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +1 -2
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.spec.js +9 -6
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/semaphore.d.ts.map +1 -1
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +2 -2
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +8 -7
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +34 -13
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.js +3 -3
- package/lib/util/tracing.spec.js.map +1 -1
- package/lib/util/workspace-port-authentication.d.ts +7 -7
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +8 -11
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +10 -8
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +16 -1
- package/lib/workspace-cluster.js.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +2 -2
- package/pkg-yarn.lock +2 -2
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +53 -51
- package/src/admin-protocol.ts +35 -18
- package/src/analytics.ts +26 -28
- package/src/auth.ts +2 -2
- package/src/context-url.spec.ts +37 -9
- package/src/context-url.ts +94 -36
- package/src/email-protocol.ts +5 -6
- package/src/encryption/container-module.ts +2 -3
- package/src/encryption/encryption-engine.spec.ts +9 -8
- package/src/encryption/encryption-engine.ts +14 -14
- package/src/encryption/encryption-service.ts +4 -5
- package/src/encryption/key-provider.ts +16 -19
- package/src/env.ts +0 -22
- package/src/gitpod-file-parser.spec.ts +55 -61
- package/src/gitpod-file-parser.ts +16 -17
- package/src/gitpod-service.ts +157 -104
- package/src/headless-workspace-log.ts +27 -1
- package/src/ide-frontend-service.ts +2 -2
- package/src/ide-protocol.ts +33 -6
- package/src/index.ts +16 -15
- package/src/installation-admin-protocol.ts +42 -0
- package/src/license-protocol.ts +5 -6
- package/src/messaging/browser/connection.ts +45 -47
- package/src/messaging/browser/window-connection.ts +39 -29
- package/src/messaging/client-call-metrics.ts +70 -71
- package/src/messaging/error.ts +7 -3
- package/src/messaging/handler.ts +6 -6
- package/src/messaging/node/connection.ts +22 -25
- package/src/messaging/proxy-factory.ts +23 -30
- package/src/oss-allowlist.ts +3 -3
- package/src/payment-protocol.ts +2 -2
- package/src/permission.ts +40 -32
- package/src/plans.ts +236 -189
- package/src/protocol.ts +330 -273
- package/src/snapshot-url.spec.ts +9 -7
- package/src/team-subscription-protocol.ts +33 -23
- package/src/teams-projects-protocol.ts +20 -9
- package/src/typings/globals.ts +4 -4
- package/src/util/analytics.ts +46 -24
- package/src/util/async-iterator.ts +4 -5
- package/src/util/cancelable.ts +3 -3
- package/src/util/date-time.ts +8 -8
- package/src/util/deferred.ts +6 -6
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +3 -6
- package/src/util/generate-workspace-id.spec.ts +26 -15
- package/src/util/generate-workspace-id.ts +460 -453
- package/src/util/gitpod-cookie.ts +8 -9
- package/src/util/gitpod-host-url.spec.ts +40 -13
- package/src/util/gitpod-host-url.ts +38 -39
- package/src/util/grpc.ts +1 -1
- package/src/util/jaeger-client-types.ts +2 -2
- package/src/util/logging.ts +49 -40
- package/src/util/make-link.ts +6 -7
- package/src/util/parse-workspace-id.spec.ts +17 -8
- package/src/util/parse-workspace-id.ts +5 -6
- package/src/util/queue.spec.ts +27 -25
- package/src/util/repeat.ts +1 -1
- package/src/util/semaphore.ts +4 -6
- package/src/util/skip-if.ts +9 -6
- package/src/util/timeutil.spec.ts +14 -15
- package/src/util/timeutil.ts +15 -11
- package/src/util/tracing.spec.ts +28 -23
- package/src/util/tracing.ts +71 -46
- package/src/util/workspace-port-authentication.ts +10 -13
- package/src/workspace-cluster.ts +26 -15
- package/src/workspace-instance.ts +51 -19
- package/src/wsready.ts +3 -3
- package/data/builtin-theia-plugins.json +0 -372
- 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 -34
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/theia-plugins.d.ts +0 -11
- package/lib/theia-plugins.d.ts.map +0 -1
- package/lib/theia-plugins.js +0 -8
- package/lib/theia-plugins.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 -31
- package/lib/util/safe-promise.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/theia-plugins.ts +0 -11
- package/src/util/safe-promise.ts +0 -26
package/src/gitpod-service.ts
CHANGED
|
@@ -5,31 +5,52 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
User,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
User,
|
|
9
|
+
WorkspaceInfo,
|
|
10
|
+
WorkspaceCreationResult,
|
|
11
|
+
WorkspaceInstanceUser,
|
|
12
|
+
WhitelistedRepository,
|
|
13
|
+
WorkspaceImageBuild,
|
|
14
|
+
AuthProviderInfo,
|
|
15
|
+
CreateWorkspaceMode,
|
|
16
|
+
Token,
|
|
17
|
+
UserEnvVarValue,
|
|
18
|
+
Terms,
|
|
19
|
+
Configuration,
|
|
20
|
+
UserInfo,
|
|
21
|
+
GitpodTokenType,
|
|
22
|
+
GitpodToken,
|
|
23
|
+
AuthProviderEntry,
|
|
24
|
+
GuessGitTokenScopesParams,
|
|
25
|
+
GuessedGitTokenScopes,
|
|
26
|
+
ProjectEnvVar,
|
|
27
|
+
} from "./protocol";
|
|
14
28
|
import {
|
|
15
|
-
Team,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
29
|
+
Team,
|
|
30
|
+
TeamMemberInfo,
|
|
31
|
+
TeamMembershipInvite,
|
|
32
|
+
Project,
|
|
33
|
+
TeamMemberRole,
|
|
34
|
+
PrebuildWithStatus,
|
|
35
|
+
StartPrebuildResult,
|
|
36
|
+
PartialProject,
|
|
37
|
+
} from "./teams-projects-protocol";
|
|
38
|
+
import { JsonRpcProxy, JsonRpcServer } from "./messaging/proxy-factory";
|
|
39
|
+
import { Disposable, CancellationTokenSource } from "vscode-jsonrpc";
|
|
40
|
+
import { HeadlessLogUrls } from "./headless-workspace-log";
|
|
41
|
+
import { WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstancePhase } from "./workspace-instance";
|
|
42
|
+
import { AdminServer } from "./admin-protocol";
|
|
43
|
+
import { GitpodHostUrl } from "./util/gitpod-host-url";
|
|
44
|
+
import { WebSocketConnectionProvider } from "./messaging/browser/connection";
|
|
45
|
+
import { PermissionName } from "./permission";
|
|
46
|
+
import { LicenseService } from "./license-protocol";
|
|
47
|
+
import { Emitter } from "./util/event";
|
|
48
|
+
import { AccountStatement, CreditAlert } from "./accounting-protocol";
|
|
49
|
+
import { GithubUpgradeURL, PlanCoupon } from "./payment-protocol";
|
|
50
|
+
import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from "./team-subscription-protocol";
|
|
51
|
+
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from "./analytics";
|
|
52
|
+
import { IDEServer } from "./ide-protocol";
|
|
53
|
+
import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
|
|
33
54
|
|
|
34
55
|
export interface GitpodClient {
|
|
35
56
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
@@ -45,7 +66,7 @@ export interface GitpodClient {
|
|
|
45
66
|
//#endregion
|
|
46
67
|
}
|
|
47
68
|
|
|
48
|
-
export const GitpodServer = Symbol(
|
|
69
|
+
export const GitpodServer = Symbol("GitpodServer");
|
|
49
70
|
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
|
|
50
71
|
// User related API
|
|
51
72
|
getLoggedInUser(): Promise<User>;
|
|
@@ -55,7 +76,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
55
76
|
getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
|
|
56
77
|
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
|
|
57
78
|
deleteOwnAuthProvider(params: GitpodServer.DeleteOwnAuthProviderParams): Promise<void>;
|
|
58
|
-
getBranding(): Promise<Branding>;
|
|
59
79
|
getConfiguration(): Promise<Configuration>;
|
|
60
80
|
getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
|
|
61
81
|
getGitpodTokenScopes(tokenHash: string): Promise<string[]>;
|
|
@@ -72,8 +92,15 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
72
92
|
getWorkspaceOwner(workspaceId: string): Promise<UserInfo | undefined>;
|
|
73
93
|
getWorkspaceUsers(workspaceId: string): Promise<WorkspaceInstanceUser[]>;
|
|
74
94
|
getFeaturedRepositories(): Promise<WhitelistedRepository[]>;
|
|
95
|
+
getSuggestedContextURLs(): Promise<string[]>;
|
|
96
|
+
/**
|
|
97
|
+
* **Security:**
|
|
98
|
+
* Sensitive information like an owner token is erased, since it allows access for all team members.
|
|
99
|
+
* If you need to access an owner token use `getOwnerToken` instead.
|
|
100
|
+
*/
|
|
75
101
|
getWorkspace(id: string): Promise<WorkspaceInfo>;
|
|
76
102
|
isWorkspaceOwner(workspaceId: string): Promise<boolean>;
|
|
103
|
+
getOwnerToken(workspaceId: string): Promise<string>;
|
|
77
104
|
|
|
78
105
|
/**
|
|
79
106
|
* Creates and starts a workspace for the given context URL.
|
|
@@ -126,6 +153,11 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
126
153
|
resetGenericInvite(inviteId: string): Promise<TeamMembershipInvite>;
|
|
127
154
|
deleteTeam(teamId: string, userId: string): Promise<void>;
|
|
128
155
|
|
|
156
|
+
// Admin Settings
|
|
157
|
+
adminGetSettings(): Promise<InstallationAdminSettings>;
|
|
158
|
+
adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
|
|
159
|
+
adminGetTelemetryData(): Promise<TelemetryData>;
|
|
160
|
+
|
|
129
161
|
// Projects
|
|
130
162
|
getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
|
|
131
163
|
createProject(params: CreateProjectParams): Promise<Project>;
|
|
@@ -142,10 +174,13 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
142
174
|
guessRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
143
175
|
setProjectConfiguration(projectId: string, configString: string): Promise<void>;
|
|
144
176
|
updateProjectPartial(partialProject: PartialProject): Promise<void>;
|
|
177
|
+
setProjectEnvironmentVariable(projectId: string, name: string, value: string, censored: boolean): Promise<void>;
|
|
178
|
+
getProjectEnvironmentVariables(projectId: string): Promise<ProjectEnvVar[]>;
|
|
179
|
+
deleteProjectEnvironmentVariable(variableId: string): Promise<void>;
|
|
145
180
|
|
|
146
181
|
// content service
|
|
147
|
-
getContentBlobUploadUrl(name: string): Promise<string
|
|
148
|
-
getContentBlobDownloadUrl(name: string): Promise<string
|
|
182
|
+
getContentBlobUploadUrl(name: string): Promise<string>;
|
|
183
|
+
getContentBlobDownloadUrl(name: string): Promise<string>;
|
|
149
184
|
|
|
150
185
|
// Gitpod token
|
|
151
186
|
getGitpodTokens(): Promise<GitpodToken[]>;
|
|
@@ -154,6 +189,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
154
189
|
|
|
155
190
|
// misc
|
|
156
191
|
sendFeedback(feedback: string): Promise<string | undefined>;
|
|
192
|
+
isGitHubAppEnabled(): Promise<boolean>;
|
|
157
193
|
registerGithubApp(installationId: string): Promise<void>;
|
|
158
194
|
|
|
159
195
|
/**
|
|
@@ -182,15 +218,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
182
218
|
*/
|
|
183
219
|
getLayout(workspaceId: string): Promise<string | undefined>;
|
|
184
220
|
|
|
185
|
-
/**
|
|
186
|
-
* @param params
|
|
187
|
-
* @returns promise resolves to an URL to be used for the upload
|
|
188
|
-
*/
|
|
189
|
-
preparePluginUpload(params: PreparePluginUploadParams): Promise<string>
|
|
190
|
-
resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
|
|
191
|
-
installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
|
|
192
|
-
uninstallUserPlugin(params: UninstallPluginParams): Promise<boolean>;
|
|
193
|
-
|
|
194
221
|
guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
|
|
195
222
|
|
|
196
223
|
/**
|
|
@@ -222,9 +249,13 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
222
249
|
|
|
223
250
|
tsGet(): Promise<TeamSubscription[]>;
|
|
224
251
|
tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
|
|
225
|
-
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined
|
|
252
|
+
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
|
|
226
253
|
tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
|
|
227
|
-
tsAssignSlot(
|
|
254
|
+
tsAssignSlot(
|
|
255
|
+
teamSubscriptionId: string,
|
|
256
|
+
teamSubscriptionSlotId: string,
|
|
257
|
+
identityStr: string | undefined,
|
|
258
|
+
): Promise<void>;
|
|
228
259
|
tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
|
|
229
260
|
tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
230
261
|
tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
@@ -239,6 +270,16 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
239
270
|
identifyUser(event: RemoteIdentifyMessage): Promise<void>;
|
|
240
271
|
}
|
|
241
272
|
|
|
273
|
+
export interface RateLimiterError {
|
|
274
|
+
method?: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Retry after this many seconds, earliest.
|
|
278
|
+
* cmp.: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
|
279
|
+
*/
|
|
280
|
+
retryAfter: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
242
283
|
export interface CreateProjectParams {
|
|
243
284
|
name: string;
|
|
244
285
|
slug?: string;
|
|
@@ -267,7 +308,7 @@ export interface ProviderRepository {
|
|
|
267
308
|
account: string;
|
|
268
309
|
accountAvatarUrl: string;
|
|
269
310
|
cloneUrl: string;
|
|
270
|
-
updatedAt
|
|
311
|
+
updatedAt?: string;
|
|
271
312
|
installationId?: number;
|
|
272
313
|
installationUpdatedAt?: string;
|
|
273
314
|
|
|
@@ -281,15 +322,28 @@ export interface ClientHeaderFields {
|
|
|
281
322
|
clientRegion?: string;
|
|
282
323
|
}
|
|
283
324
|
|
|
284
|
-
export const
|
|
285
|
-
|
|
286
|
-
export const
|
|
325
|
+
export const WORKSPACE_TIMEOUT_DEFAULT_SHORT = "short";
|
|
326
|
+
export const WORKSPACE_TIMEOUT_DEFAULT_LONG = "long";
|
|
327
|
+
export const WORKSPACE_TIMEOUT_EXTENDED = "extended";
|
|
328
|
+
export const WORKSPACE_TIMEOUT_EXTENDED_ALT = "180m"; // for backwards compatibility since the IDE uses this
|
|
329
|
+
export const WorkspaceTimeoutValues = [
|
|
330
|
+
WORKSPACE_TIMEOUT_DEFAULT_SHORT,
|
|
331
|
+
WORKSPACE_TIMEOUT_DEFAULT_LONG,
|
|
332
|
+
WORKSPACE_TIMEOUT_EXTENDED,
|
|
333
|
+
WORKSPACE_TIMEOUT_EXTENDED_ALT,
|
|
334
|
+
] as const;
|
|
335
|
+
|
|
336
|
+
export const createServiceMock = function <C extends GitpodClient, S extends GitpodServer>(
|
|
337
|
+
methods: Partial<JsonRpcProxy<S>>,
|
|
338
|
+
): GitpodServiceImpl<C, S> {
|
|
287
339
|
return new GitpodServiceImpl<C, S>(createServerMock(methods));
|
|
288
|
-
}
|
|
340
|
+
};
|
|
289
341
|
|
|
290
|
-
export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(
|
|
291
|
-
methods
|
|
292
|
-
|
|
342
|
+
export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(
|
|
343
|
+
methods: Partial<JsonRpcProxy<S>>,
|
|
344
|
+
): JsonRpcProxy<S> {
|
|
345
|
+
methods.setClient = methods.setClient || (() => {});
|
|
346
|
+
methods.dispose = methods.dispose || (() => {});
|
|
293
347
|
return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
|
|
294
348
|
// @ts-ignore
|
|
295
349
|
get: (target: S, property: keyof S) => {
|
|
@@ -298,25 +352,25 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
|
|
|
298
352
|
throw new Error(`Method ${property} not implemented`);
|
|
299
353
|
}
|
|
300
354
|
return result;
|
|
301
|
-
}
|
|
355
|
+
},
|
|
302
356
|
});
|
|
303
|
-
}
|
|
357
|
+
};
|
|
304
358
|
|
|
305
359
|
type WorkspaceTimeoutDurationTuple = typeof WorkspaceTimeoutValues;
|
|
306
360
|
export type WorkspaceTimeoutDuration = WorkspaceTimeoutDurationTuple[number];
|
|
307
361
|
|
|
308
362
|
export interface SetWorkspaceTimeoutResult {
|
|
309
|
-
resetTimeoutOnWorkspaces: string[]
|
|
363
|
+
resetTimeoutOnWorkspaces: string[];
|
|
310
364
|
}
|
|
311
365
|
|
|
312
366
|
export interface GetWorkspaceTimeoutResult {
|
|
313
|
-
duration: WorkspaceTimeoutDuration
|
|
314
|
-
canChange: boolean
|
|
367
|
+
duration: WorkspaceTimeoutDuration;
|
|
368
|
+
canChange: boolean;
|
|
315
369
|
}
|
|
316
370
|
|
|
317
371
|
export interface StartWorkspaceResult {
|
|
318
|
-
instanceID: string
|
|
319
|
-
workspaceURL?: string
|
|
372
|
+
instanceID: string;
|
|
373
|
+
workspaceURL?: string;
|
|
320
374
|
}
|
|
321
375
|
|
|
322
376
|
export namespace GitpodServer {
|
|
@@ -360,23 +414,23 @@ export namespace GitpodServer {
|
|
|
360
414
|
readonly roundTripTime?: number;
|
|
361
415
|
}
|
|
362
416
|
export interface UpdateOwnAuthProviderParams {
|
|
363
|
-
readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry
|
|
417
|
+
readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry;
|
|
364
418
|
}
|
|
365
419
|
export interface DeleteOwnAuthProviderParams {
|
|
366
|
-
readonly id: string
|
|
420
|
+
readonly id: string;
|
|
367
421
|
}
|
|
368
422
|
export type AdmissionLevel = "owner" | "everyone";
|
|
369
423
|
export type PinAction = "pin" | "unpin" | "toggle";
|
|
370
424
|
export interface GenerateNewGitpodTokenOptions {
|
|
371
|
-
name?: string
|
|
372
|
-
type: GitpodTokenType
|
|
373
|
-
scopes?: string[]
|
|
425
|
+
name?: string;
|
|
426
|
+
type: GitpodTokenType;
|
|
427
|
+
scopes?: string[];
|
|
374
428
|
}
|
|
375
429
|
}
|
|
376
430
|
|
|
377
|
-
export const GitpodServerPath =
|
|
431
|
+
export const GitpodServerPath = "/gitpod";
|
|
378
432
|
|
|
379
|
-
export const GitpodServerProxy = Symbol(
|
|
433
|
+
export const GitpodServerProxy = Symbol("GitpodServerProxy");
|
|
380
434
|
export type GitpodServerProxy<S extends GitpodServer> = JsonRpcProxy<S>;
|
|
381
435
|
|
|
382
436
|
export class GitpodCompositeClient<Client extends GitpodClient> implements GitpodClient {
|
|
@@ -384,12 +438,14 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
384
438
|
|
|
385
439
|
public registerClient(client: Partial<Client>): Disposable {
|
|
386
440
|
this.clients.push(client);
|
|
387
|
-
const index = this.clients.length;
|
|
388
441
|
return {
|
|
389
442
|
dispose: () => {
|
|
390
|
-
this.clients.
|
|
391
|
-
|
|
392
|
-
|
|
443
|
+
const index = this.clients.indexOf(client);
|
|
444
|
+
if (index > -1) {
|
|
445
|
+
this.clients.splice(index, 1);
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
};
|
|
393
449
|
}
|
|
394
450
|
|
|
395
451
|
onInstanceUpdate(instance: WorkspaceInstance): void {
|
|
@@ -398,7 +454,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
398
454
|
try {
|
|
399
455
|
client.onInstanceUpdate(instance);
|
|
400
456
|
} catch (error) {
|
|
401
|
-
console.error(error)
|
|
457
|
+
console.error(error);
|
|
402
458
|
}
|
|
403
459
|
}
|
|
404
460
|
}
|
|
@@ -410,19 +466,22 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
410
466
|
try {
|
|
411
467
|
client.onPrebuildUpdate(update);
|
|
412
468
|
} catch (error) {
|
|
413
|
-
console.error(error)
|
|
469
|
+
console.error(error);
|
|
414
470
|
}
|
|
415
471
|
}
|
|
416
472
|
}
|
|
417
473
|
}
|
|
418
474
|
|
|
419
|
-
onWorkspaceImageBuildLogs(
|
|
475
|
+
onWorkspaceImageBuildLogs(
|
|
476
|
+
info: WorkspaceImageBuild.StateInfo,
|
|
477
|
+
content: WorkspaceImageBuild.LogContent | undefined,
|
|
478
|
+
): void {
|
|
420
479
|
for (const client of this.clients) {
|
|
421
480
|
if (client.onWorkspaceImageBuildLogs) {
|
|
422
481
|
try {
|
|
423
482
|
client.onWorkspaceImageBuildLogs(info, content);
|
|
424
483
|
} catch (error) {
|
|
425
|
-
console.error(error)
|
|
484
|
+
console.error(error);
|
|
426
485
|
}
|
|
427
486
|
}
|
|
428
487
|
}
|
|
@@ -434,7 +493,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
434
493
|
try {
|
|
435
494
|
client.notifyDidOpenConnection();
|
|
436
495
|
} catch (error) {
|
|
437
|
-
console.error(error)
|
|
496
|
+
console.error(error);
|
|
438
497
|
}
|
|
439
498
|
}
|
|
440
499
|
}
|
|
@@ -446,7 +505,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
446
505
|
try {
|
|
447
506
|
client.notifyDidCloseConnection();
|
|
448
507
|
} catch (error) {
|
|
449
|
-
console.error(error)
|
|
508
|
+
console.error(error);
|
|
450
509
|
}
|
|
451
510
|
}
|
|
452
511
|
}
|
|
@@ -458,17 +517,16 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
458
517
|
try {
|
|
459
518
|
client.onCreditAlert(creditAlert);
|
|
460
519
|
} catch (error) {
|
|
461
|
-
console.error(error)
|
|
520
|
+
console.error(error);
|
|
462
521
|
}
|
|
463
522
|
}
|
|
464
523
|
}
|
|
465
524
|
}
|
|
466
|
-
|
|
467
525
|
}
|
|
468
526
|
|
|
469
527
|
export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
|
|
470
528
|
|
|
471
|
-
const hasWindow =
|
|
529
|
+
const hasWindow = typeof window !== "undefined";
|
|
472
530
|
const phasesOrder: Record<WorkspaceInstancePhase, number> = {
|
|
473
531
|
unknown: 0,
|
|
474
532
|
preparing: 1,
|
|
@@ -478,44 +536,41 @@ const phasesOrder: Record<WorkspaceInstancePhase, number> = {
|
|
|
478
536
|
running: 5,
|
|
479
537
|
interrupted: 6,
|
|
480
538
|
stopping: 7,
|
|
481
|
-
stopped: 8
|
|
539
|
+
stopped: 8,
|
|
482
540
|
};
|
|
483
541
|
export class WorkspaceInstanceUpdateListener {
|
|
484
542
|
private readonly onDidChangeEmitter = new Emitter<void>();
|
|
485
543
|
readonly onDidChange = this.onDidChangeEmitter.event;
|
|
486
544
|
|
|
487
|
-
private source:
|
|
545
|
+
private source: "sync" | "update" = "sync";
|
|
488
546
|
|
|
489
547
|
get info(): WorkspaceInfo {
|
|
490
548
|
return this._info;
|
|
491
549
|
}
|
|
492
550
|
|
|
493
|
-
constructor(
|
|
494
|
-
private readonly service: GitpodService,
|
|
495
|
-
private _info: WorkspaceInfo
|
|
496
|
-
) {
|
|
551
|
+
constructor(private readonly service: GitpodService, private _info: WorkspaceInfo) {
|
|
497
552
|
service.registerClient({
|
|
498
|
-
onInstanceUpdate: instance => {
|
|
553
|
+
onInstanceUpdate: (instance) => {
|
|
499
554
|
if (this.isOutOfOrder(instance)) {
|
|
500
555
|
return;
|
|
501
556
|
}
|
|
502
557
|
this.cancelSync();
|
|
503
558
|
this._info.latestInstance = instance;
|
|
504
|
-
this.source =
|
|
559
|
+
this.source = "update";
|
|
505
560
|
this.onDidChangeEmitter.fire(undefined);
|
|
506
561
|
},
|
|
507
562
|
notifyDidOpenConnection: () => {
|
|
508
563
|
this.sync();
|
|
509
|
-
}
|
|
564
|
+
},
|
|
510
565
|
});
|
|
511
566
|
if (hasWindow) {
|
|
512
567
|
// learn about page lifecycle here: https://developers.google.com/web/updates/2018/07/page-lifecycle-api
|
|
513
|
-
window.document.addEventListener(
|
|
514
|
-
if (window.document.visibilityState ===
|
|
568
|
+
window.document.addEventListener("visibilitychange", async () => {
|
|
569
|
+
if (window.document.visibilityState === "visible") {
|
|
515
570
|
this.sync();
|
|
516
571
|
}
|
|
517
572
|
});
|
|
518
|
-
window.addEventListener(
|
|
573
|
+
window.addEventListener("pageshow", (e) => {
|
|
519
574
|
if (e.persisted) {
|
|
520
575
|
this.sync();
|
|
521
576
|
}
|
|
@@ -543,12 +598,12 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
543
598
|
return;
|
|
544
599
|
}
|
|
545
600
|
this._info = info;
|
|
546
|
-
this.source =
|
|
601
|
+
this.source = "sync";
|
|
547
602
|
this.onDidChangeEmitter.fire(undefined);
|
|
548
603
|
} catch (e) {
|
|
549
|
-
console.error(
|
|
604
|
+
console.error("failed to sync workspace instance:", e);
|
|
550
605
|
}
|
|
551
|
-
})
|
|
606
|
+
});
|
|
552
607
|
}
|
|
553
608
|
private cancelSync(): void {
|
|
554
609
|
if (this.syncTokenSource) {
|
|
@@ -565,7 +620,7 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
565
620
|
if (instance.workspaceId !== this._info.workspace.id) {
|
|
566
621
|
return true;
|
|
567
622
|
}
|
|
568
|
-
if (this.source ===
|
|
623
|
+
if (this.source === "update") {
|
|
569
624
|
return false;
|
|
570
625
|
}
|
|
571
626
|
if (instance.id !== this.info.latestInstance?.id) {
|
|
@@ -573,15 +628,13 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
573
628
|
}
|
|
574
629
|
return phasesOrder[instance.status.phase] < phasesOrder[this.info.latestInstance.status.phase];
|
|
575
630
|
}
|
|
576
|
-
|
|
577
631
|
}
|
|
578
632
|
|
|
579
633
|
export interface GitpodServiceOptions {
|
|
580
|
-
onReconnect?: () =>
|
|
634
|
+
onReconnect?: () => void | Promise<void>;
|
|
581
635
|
}
|
|
582
636
|
|
|
583
637
|
export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
|
|
584
|
-
|
|
585
638
|
private readonly compositeClient = new GitpodCompositeClient<Client>();
|
|
586
639
|
|
|
587
640
|
constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
|
|
@@ -596,7 +649,8 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
|
|
|
596
649
|
|
|
597
650
|
private readonly instanceListeners = new Map<string, Promise<WorkspaceInstanceUpdateListener>>();
|
|
598
651
|
listenToInstance(workspaceId: string): Promise<WorkspaceInstanceUpdateListener> {
|
|
599
|
-
const listener =
|
|
652
|
+
const listener =
|
|
653
|
+
this.instanceListeners.get(workspaceId) ||
|
|
600
654
|
(async () => {
|
|
601
655
|
const info = await this.server.getWorkspace(workspaceId);
|
|
602
656
|
return new WorkspaceInstanceUpdateListener(this, info);
|
|
@@ -612,26 +666,25 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
|
|
|
612
666
|
}
|
|
613
667
|
}
|
|
614
668
|
|
|
615
|
-
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(
|
|
669
|
+
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(
|
|
670
|
+
serverUrl: string | Promise<string>,
|
|
671
|
+
) {
|
|
616
672
|
const toWsUrl = (serverUrl: string) => {
|
|
617
|
-
return new GitpodHostUrl(serverUrl)
|
|
618
|
-
.asWebsocket()
|
|
619
|
-
.withApi({ pathname: GitpodServerPath })
|
|
620
|
-
.toString();
|
|
673
|
+
return new GitpodHostUrl(serverUrl).asWebsocket().withApi({ pathname: GitpodServerPath }).toString();
|
|
621
674
|
};
|
|
622
675
|
let url: string | Promise<string>;
|
|
623
676
|
if (typeof serverUrl === "string") {
|
|
624
677
|
url = toWsUrl(serverUrl);
|
|
625
678
|
} else {
|
|
626
|
-
url = serverUrl.then(url => toWsUrl(url));
|
|
679
|
+
url = serverUrl.then((url) => toWsUrl(url));
|
|
627
680
|
}
|
|
628
681
|
|
|
629
682
|
const connectionProvider = new WebSocketConnectionProvider();
|
|
630
|
-
let onReconnect = () => {
|
|
683
|
+
let onReconnect = () => {};
|
|
631
684
|
const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
|
|
632
|
-
onListening: socket => {
|
|
685
|
+
onListening: (socket) => {
|
|
633
686
|
onReconnect = () => socket.reconnect();
|
|
634
|
-
}
|
|
687
|
+
},
|
|
635
688
|
});
|
|
636
689
|
return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
|
|
637
|
-
}
|
|
690
|
+
}
|
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
export enum HeadlessWorkspaceEventType {
|
|
8
|
+
LogOutput = "log-output",
|
|
9
|
+
FinishedSuccessfully = "finish-success",
|
|
10
|
+
FinishedButFailed = "finish-fail",
|
|
11
|
+
AbortedTimedOut = "aborted-timeout",
|
|
12
|
+
Aborted = "aborted",
|
|
13
|
+
Failed = "failed",
|
|
14
|
+
Started = "started",
|
|
15
|
+
}
|
|
16
|
+
export namespace HeadlessWorkspaceEventType {
|
|
17
|
+
export function isRunning(t: HeadlessWorkspaceEventType) {
|
|
18
|
+
return t === HeadlessWorkspaceEventType.LogOutput;
|
|
19
|
+
}
|
|
20
|
+
export function didFinish(t: HeadlessWorkspaceEventType) {
|
|
21
|
+
return (
|
|
22
|
+
t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface HeadlessWorkspaceEvent {
|
|
28
|
+
workspaceID: string;
|
|
29
|
+
text: string;
|
|
30
|
+
type: HeadlessWorkspaceEventType;
|
|
31
|
+
}
|
|
32
|
+
|
|
7
33
|
export interface HeadlessLogUrls {
|
|
8
34
|
// A map of id to URL
|
|
9
35
|
streams: { [streamID: string]: string };
|
|
@@ -11,4 +37,4 @@ export interface HeadlessLogUrls {
|
|
|
11
37
|
|
|
12
38
|
/** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
|
|
13
39
|
export const HEADLESS_LOG_STREAM_STATUS_CODE = "X-LogStream-StatusCode";
|
|
14
|
-
export const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
|
|
40
|
+
export const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { Event } from "./util/event";
|
|
8
8
|
import { Disposable } from "./util/disposable";
|
|
9
9
|
|
|
10
|
-
export type IDEFrontendState =
|
|
10
|
+
export type IDEFrontendState = "init" | "ready" | "terminated";
|
|
11
11
|
|
|
12
12
|
export interface IDEFrontendService {
|
|
13
13
|
readonly state: IDEFrontendState;
|
|
@@ -25,4 +25,4 @@ export interface IDEFrontendService {
|
|
|
25
25
|
* confirmation dialogs for stopped workspaces.
|
|
26
26
|
*/
|
|
27
27
|
start(): Disposable;
|
|
28
|
-
}
|
|
28
|
+
}
|
package/src/ide-protocol.ts
CHANGED
|
@@ -29,6 +29,28 @@ export interface IDEOptions {
|
|
|
29
29
|
* The default desktop IDE when the user has not specified one.
|
|
30
30
|
*/
|
|
31
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[];
|
|
32
54
|
}
|
|
33
55
|
|
|
34
56
|
export interface IDEOption {
|
|
@@ -45,12 +67,12 @@ export interface IDEOption {
|
|
|
45
67
|
/**
|
|
46
68
|
* The type of the IDE, currently 'browser' or 'desktop'.
|
|
47
69
|
*/
|
|
48
|
-
type:
|
|
70
|
+
type: "browser" | "desktop";
|
|
49
71
|
|
|
50
72
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
73
|
+
* The logo for the IDE. That could be a key in (see
|
|
74
|
+
* components/dashboard/src/images/ideLogos.ts) or a URL.
|
|
75
|
+
*/
|
|
54
76
|
logo: string;
|
|
55
77
|
|
|
56
78
|
/**
|
|
@@ -71,8 +93,8 @@ export interface IDEOption {
|
|
|
71
93
|
notes?: string[];
|
|
72
94
|
|
|
73
95
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
96
|
+
* If `true` this IDE option is not visible in the IDE preferences.
|
|
97
|
+
*/
|
|
76
98
|
hidden?: boolean;
|
|
77
99
|
|
|
78
100
|
/**
|
|
@@ -80,6 +102,11 @@ export interface IDEOption {
|
|
|
80
102
|
*/
|
|
81
103
|
image: string;
|
|
82
104
|
|
|
105
|
+
/**
|
|
106
|
+
* The latest image ref to the IDE image, this image ref always resolve to digest.
|
|
107
|
+
*/
|
|
108
|
+
latestImage?: string;
|
|
109
|
+
|
|
83
110
|
/**
|
|
84
111
|
* When this is `true`, the tag of this image is resolved to the latest
|
|
85
112
|
* image digest regularly.
|