@gitpod/gitpod-protocol 0.1.5-prs-dazzlev2-test.3 → 0.1.5-release-2022.6.1.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/gitpod-schema.json +181 -4
- package/lib/accounting-protocol.d.ts +17 -10
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +30 -32
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +9 -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 +17 -5
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +57 -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/experiments/always-default.d.ts +8 -0
- package/lib/experiments/always-default.d.ts.map +1 -0
- package/lib/experiments/always-default.js +20 -0
- package/lib/experiments/always-default.js.map +1 -0
- package/lib/experiments/configcat-server.d.ts +8 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +34 -0
- package/lib/experiments/configcat-server.js.map +1 -0
- package/lib/experiments/configcat.d.ts +21 -0
- package/lib/experiments/configcat.d.ts.map +1 -0
- package/lib/experiments/configcat.js +47 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +19 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/{theia-plugins.js → experiments/types.js} +2 -2
- package/lib/experiments/types.js.map +1 -0
- 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 +43 -26
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +39 -32
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +1 -0
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +2 -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 +10 -6
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/index.d.ts +16 -16
- package/lib/installation-admin-protocol.d.ts +9 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -1
- package/lib/installation-admin-protocol.js +3 -2
- package/lib/installation-admin-protocol.js.map +1 -1
- package/lib/license-protocol.d.ts +7 -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 +3 -0
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +6 -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.js +8 -8
- 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 +87 -38
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +166 -88
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.spec.js.map +1 -1
- package/lib/team-subscription-protocol.d.ts +21 -3
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +16 -5
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +11 -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/debug-app.d.ts +25 -0
- package/lib/util/debug-app.d.ts.map +1 -0
- package/lib/util/debug-app.js +100 -0
- package/lib/util/debug-app.js.map +1 -0
- 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 +446 -442
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +18 -7
- 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.map +1 -1
- package/lib/util/gitpod-host-url.js +31 -29
- 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 +1 -0
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +9 -3
- 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 -8
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +19 -20
- 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 +37 -3
- 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 +10 -7
- package/pkg-yarn.lock +8 -6
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +63 -51
- package/src/admin-protocol.ts +33 -20
- 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 +96 -40
- 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/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +37 -0
- package/src/experiments/configcat.ts +53 -0
- package/src/experiments/types.ts +32 -0
- package/src/gitpod-file-parser.spec.ts +55 -61
- package/src/gitpod-file-parser.ts +16 -17
- package/src/gitpod-service.ts +163 -108
- package/src/headless-workspace-log.ts +6 -4
- package/src/ide-frontend-service.ts +2 -2
- package/src/ide-protocol.ts +13 -8
- package/src/index.ts +16 -16
- package/src/installation-admin-protocol.ts +14 -4
- package/src/license-protocol.ts +12 -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 +10 -3
- package/src/messaging/handler.ts +6 -6
- package/src/messaging/node/connection.ts +8 -8
- 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 +350 -241
- package/src/snapshot-url.spec.ts +9 -7
- package/src/team-subscription-protocol.ts +57 -23
- package/src/teams-projects-protocol.ts +21 -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/debug-app.ts +81 -0
- 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 -16
- package/src/util/generate-workspace-id.ts +460 -454
- 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 +37 -34
- 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 +21 -11
- package/src/util/tracing.spec.ts +28 -23
- package/src/util/tracing.ts +58 -54
- package/src/util/workspace-port-authentication.ts +10 -13
- package/src/workspace-cluster.ts +26 -15
- package/src/workspace-instance.ts +68 -20
- 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.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,32 +5,58 @@
|
|
|
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 {
|
|
33
|
-
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 {
|
|
51
|
+
TeamSubscription,
|
|
52
|
+
TeamSubscription2,
|
|
53
|
+
TeamSubscriptionSlot,
|
|
54
|
+
TeamSubscriptionSlotResolved,
|
|
55
|
+
} from "./team-subscription-protocol";
|
|
56
|
+
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from "./analytics";
|
|
57
|
+
import { IDEServer } from "./ide-protocol";
|
|
58
|
+
import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
|
|
59
|
+
import { Currency } from "./plans";
|
|
34
60
|
|
|
35
61
|
export interface GitpodClient {
|
|
36
62
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
@@ -46,7 +72,7 @@ export interface GitpodClient {
|
|
|
46
72
|
//#endregion
|
|
47
73
|
}
|
|
48
74
|
|
|
49
|
-
export const GitpodServer = Symbol(
|
|
75
|
+
export const GitpodServer = Symbol("GitpodServer");
|
|
50
76
|
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
|
|
51
77
|
// User related API
|
|
52
78
|
getLoggedInUser(): Promise<User>;
|
|
@@ -72,6 +98,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
72
98
|
getWorkspaceOwner(workspaceId: string): Promise<UserInfo | undefined>;
|
|
73
99
|
getWorkspaceUsers(workspaceId: string): Promise<WorkspaceInstanceUser[]>;
|
|
74
100
|
getFeaturedRepositories(): Promise<WhitelistedRepository[]>;
|
|
101
|
+
getSuggestedContextURLs(): Promise<string[]>;
|
|
75
102
|
/**
|
|
76
103
|
* **Security:**
|
|
77
104
|
* Sensitive information like an owner token is erased, since it allows access for all team members.
|
|
@@ -135,6 +162,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
135
162
|
// Admin Settings
|
|
136
163
|
adminGetSettings(): Promise<InstallationAdminSettings>;
|
|
137
164
|
adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
|
|
165
|
+
adminGetTelemetryData(): Promise<TelemetryData>;
|
|
138
166
|
|
|
139
167
|
// Projects
|
|
140
168
|
getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
|
|
@@ -157,8 +185,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
157
185
|
deleteProjectEnvironmentVariable(variableId: string): Promise<void>;
|
|
158
186
|
|
|
159
187
|
// content service
|
|
160
|
-
getContentBlobUploadUrl(name: string): Promise<string
|
|
161
|
-
getContentBlobDownloadUrl(name: string): Promise<string
|
|
188
|
+
getContentBlobUploadUrl(name: string): Promise<string>;
|
|
189
|
+
getContentBlobDownloadUrl(name: string): Promise<string>;
|
|
162
190
|
|
|
163
191
|
// Gitpod token
|
|
164
192
|
getGitpodTokens(): Promise<GitpodToken[]>;
|
|
@@ -167,6 +195,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
167
195
|
|
|
168
196
|
// misc
|
|
169
197
|
sendFeedback(feedback: string): Promise<string | undefined>;
|
|
198
|
+
isGitHubAppEnabled(): Promise<boolean>;
|
|
170
199
|
registerGithubApp(installationId: string): Promise<void>;
|
|
171
200
|
|
|
172
201
|
/**
|
|
@@ -195,15 +224,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
195
224
|
*/
|
|
196
225
|
getLayout(workspaceId: string): Promise<string | undefined>;
|
|
197
226
|
|
|
198
|
-
/**
|
|
199
|
-
* @param params
|
|
200
|
-
* @returns promise resolves to an URL to be used for the upload
|
|
201
|
-
*/
|
|
202
|
-
preparePluginUpload(params: PreparePluginUploadParams): Promise<string>
|
|
203
|
-
resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
|
|
204
|
-
installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
|
|
205
|
-
uninstallUserPlugin(params: UninstallPluginParams): Promise<boolean>;
|
|
206
|
-
|
|
207
227
|
guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
|
|
208
228
|
|
|
209
229
|
/**
|
|
@@ -221,7 +241,9 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
221
241
|
*/
|
|
222
242
|
getChargebeeSiteId(): Promise<string>;
|
|
223
243
|
createPortalSession(): Promise<{}>;
|
|
244
|
+
createTeamPortalSession(teamId: string): Promise<{}>;
|
|
224
245
|
checkout(planId: string, planQuantity?: number): Promise<{}>;
|
|
246
|
+
teamCheckout(teamId: string, planId: string): Promise<{}>;
|
|
225
247
|
getAvailableCoupons(): Promise<PlanCoupon[]>;
|
|
226
248
|
getAppliedCoupons(): Promise<PlanCoupon[]>;
|
|
227
249
|
|
|
@@ -233,17 +255,28 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
233
255
|
subscriptionCancel(subscriptionId: string): Promise<void>;
|
|
234
256
|
subscriptionCancelDowngrade(subscriptionId: string): Promise<void>;
|
|
235
257
|
|
|
258
|
+
getTeamSubscription(teamId: string): Promise<TeamSubscription2 | undefined>;
|
|
236
259
|
tsGet(): Promise<TeamSubscription[]>;
|
|
237
260
|
tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
|
|
238
|
-
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined
|
|
261
|
+
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
|
|
239
262
|
tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
|
|
240
|
-
tsAssignSlot(
|
|
263
|
+
tsAssignSlot(
|
|
264
|
+
teamSubscriptionId: string,
|
|
265
|
+
teamSubscriptionSlotId: string,
|
|
266
|
+
identityStr: string | undefined,
|
|
267
|
+
): Promise<void>;
|
|
241
268
|
tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
|
|
242
269
|
tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
243
270
|
tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
244
271
|
|
|
245
272
|
getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
|
|
246
273
|
|
|
274
|
+
getStripePublishableKey(): Promise<string>;
|
|
275
|
+
getStripeSetupIntentClientSecret(): Promise<string>;
|
|
276
|
+
findStripeSubscriptionIdForTeam(teamId: string): Promise<string | undefined>;
|
|
277
|
+
subscribeTeamToStripe(teamId: string, setupIntentId: string, currency: Currency): Promise<void>;
|
|
278
|
+
getStripePortalUrlForTeam(teamId: string): Promise<string>;
|
|
279
|
+
|
|
247
280
|
/**
|
|
248
281
|
* Analytics
|
|
249
282
|
*/
|
|
@@ -252,6 +285,16 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
252
285
|
identifyUser(event: RemoteIdentifyMessage): Promise<void>;
|
|
253
286
|
}
|
|
254
287
|
|
|
288
|
+
export interface RateLimiterError {
|
|
289
|
+
method?: string;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Retry after this many seconds, earliest.
|
|
293
|
+
* cmp.: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
|
294
|
+
*/
|
|
295
|
+
retryAfter: number;
|
|
296
|
+
}
|
|
297
|
+
|
|
255
298
|
export interface CreateProjectParams {
|
|
256
299
|
name: string;
|
|
257
300
|
slug?: string;
|
|
@@ -280,7 +323,7 @@ export interface ProviderRepository {
|
|
|
280
323
|
account: string;
|
|
281
324
|
accountAvatarUrl: string;
|
|
282
325
|
cloneUrl: string;
|
|
283
|
-
updatedAt
|
|
326
|
+
updatedAt?: string;
|
|
284
327
|
installationId?: number;
|
|
285
328
|
installationUpdatedAt?: string;
|
|
286
329
|
|
|
@@ -294,15 +337,28 @@ export interface ClientHeaderFields {
|
|
|
294
337
|
clientRegion?: string;
|
|
295
338
|
}
|
|
296
339
|
|
|
297
|
-
export const
|
|
298
|
-
|
|
299
|
-
export const
|
|
340
|
+
export const WORKSPACE_TIMEOUT_DEFAULT_SHORT = "short";
|
|
341
|
+
export const WORKSPACE_TIMEOUT_DEFAULT_LONG = "long";
|
|
342
|
+
export const WORKSPACE_TIMEOUT_EXTENDED = "extended";
|
|
343
|
+
export const WORKSPACE_TIMEOUT_EXTENDED_ALT = "180m"; // for backwards compatibility since the IDE uses this
|
|
344
|
+
export const WorkspaceTimeoutValues = [
|
|
345
|
+
WORKSPACE_TIMEOUT_DEFAULT_SHORT,
|
|
346
|
+
WORKSPACE_TIMEOUT_DEFAULT_LONG,
|
|
347
|
+
WORKSPACE_TIMEOUT_EXTENDED,
|
|
348
|
+
WORKSPACE_TIMEOUT_EXTENDED_ALT,
|
|
349
|
+
] as const;
|
|
350
|
+
|
|
351
|
+
export const createServiceMock = function <C extends GitpodClient, S extends GitpodServer>(
|
|
352
|
+
methods: Partial<JsonRpcProxy<S>>,
|
|
353
|
+
): GitpodServiceImpl<C, S> {
|
|
300
354
|
return new GitpodServiceImpl<C, S>(createServerMock(methods));
|
|
301
|
-
}
|
|
355
|
+
};
|
|
302
356
|
|
|
303
|
-
export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(
|
|
304
|
-
methods
|
|
305
|
-
|
|
357
|
+
export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(
|
|
358
|
+
methods: Partial<JsonRpcProxy<S>>,
|
|
359
|
+
): JsonRpcProxy<S> {
|
|
360
|
+
methods.setClient = methods.setClient || (() => {});
|
|
361
|
+
methods.dispose = methods.dispose || (() => {});
|
|
306
362
|
return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
|
|
307
363
|
// @ts-ignore
|
|
308
364
|
get: (target: S, property: keyof S) => {
|
|
@@ -311,25 +367,26 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
|
|
|
311
367
|
throw new Error(`Method ${property} not implemented`);
|
|
312
368
|
}
|
|
313
369
|
return result;
|
|
314
|
-
}
|
|
370
|
+
},
|
|
315
371
|
});
|
|
316
|
-
}
|
|
372
|
+
};
|
|
317
373
|
|
|
318
374
|
type WorkspaceTimeoutDurationTuple = typeof WorkspaceTimeoutValues;
|
|
319
375
|
export type WorkspaceTimeoutDuration = WorkspaceTimeoutDurationTuple[number];
|
|
320
376
|
|
|
321
377
|
export interface SetWorkspaceTimeoutResult {
|
|
322
|
-
resetTimeoutOnWorkspaces: string[]
|
|
378
|
+
resetTimeoutOnWorkspaces: string[];
|
|
323
379
|
}
|
|
324
380
|
|
|
325
381
|
export interface GetWorkspaceTimeoutResult {
|
|
326
|
-
duration: WorkspaceTimeoutDuration
|
|
327
|
-
|
|
382
|
+
duration: WorkspaceTimeoutDuration;
|
|
383
|
+
durationRaw: string;
|
|
384
|
+
canChange: boolean;
|
|
328
385
|
}
|
|
329
386
|
|
|
330
387
|
export interface StartWorkspaceResult {
|
|
331
|
-
instanceID: string
|
|
332
|
-
workspaceURL?: string
|
|
388
|
+
instanceID: string;
|
|
389
|
+
workspaceURL?: string;
|
|
333
390
|
}
|
|
334
391
|
|
|
335
392
|
export namespace GitpodServer {
|
|
@@ -373,23 +430,23 @@ export namespace GitpodServer {
|
|
|
373
430
|
readonly roundTripTime?: number;
|
|
374
431
|
}
|
|
375
432
|
export interface UpdateOwnAuthProviderParams {
|
|
376
|
-
readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry
|
|
433
|
+
readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry;
|
|
377
434
|
}
|
|
378
435
|
export interface DeleteOwnAuthProviderParams {
|
|
379
|
-
readonly id: string
|
|
436
|
+
readonly id: string;
|
|
380
437
|
}
|
|
381
438
|
export type AdmissionLevel = "owner" | "everyone";
|
|
382
439
|
export type PinAction = "pin" | "unpin" | "toggle";
|
|
383
440
|
export interface GenerateNewGitpodTokenOptions {
|
|
384
|
-
name?: string
|
|
385
|
-
type: GitpodTokenType
|
|
386
|
-
scopes?: string[]
|
|
441
|
+
name?: string;
|
|
442
|
+
type: GitpodTokenType;
|
|
443
|
+
scopes?: string[];
|
|
387
444
|
}
|
|
388
445
|
}
|
|
389
446
|
|
|
390
|
-
export const GitpodServerPath =
|
|
447
|
+
export const GitpodServerPath = "/gitpod";
|
|
391
448
|
|
|
392
|
-
export const GitpodServerProxy = Symbol(
|
|
449
|
+
export const GitpodServerProxy = Symbol("GitpodServerProxy");
|
|
393
450
|
export type GitpodServerProxy<S extends GitpodServer> = JsonRpcProxy<S>;
|
|
394
451
|
|
|
395
452
|
export class GitpodCompositeClient<Client extends GitpodClient> implements GitpodClient {
|
|
@@ -403,8 +460,8 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
403
460
|
if (index > -1) {
|
|
404
461
|
this.clients.splice(index, 1);
|
|
405
462
|
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
463
|
+
},
|
|
464
|
+
};
|
|
408
465
|
}
|
|
409
466
|
|
|
410
467
|
onInstanceUpdate(instance: WorkspaceInstance): void {
|
|
@@ -413,7 +470,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
413
470
|
try {
|
|
414
471
|
client.onInstanceUpdate(instance);
|
|
415
472
|
} catch (error) {
|
|
416
|
-
console.error(error)
|
|
473
|
+
console.error(error);
|
|
417
474
|
}
|
|
418
475
|
}
|
|
419
476
|
}
|
|
@@ -425,19 +482,22 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
425
482
|
try {
|
|
426
483
|
client.onPrebuildUpdate(update);
|
|
427
484
|
} catch (error) {
|
|
428
|
-
console.error(error)
|
|
485
|
+
console.error(error);
|
|
429
486
|
}
|
|
430
487
|
}
|
|
431
488
|
}
|
|
432
489
|
}
|
|
433
490
|
|
|
434
|
-
onWorkspaceImageBuildLogs(
|
|
491
|
+
onWorkspaceImageBuildLogs(
|
|
492
|
+
info: WorkspaceImageBuild.StateInfo,
|
|
493
|
+
content: WorkspaceImageBuild.LogContent | undefined,
|
|
494
|
+
): void {
|
|
435
495
|
for (const client of this.clients) {
|
|
436
496
|
if (client.onWorkspaceImageBuildLogs) {
|
|
437
497
|
try {
|
|
438
498
|
client.onWorkspaceImageBuildLogs(info, content);
|
|
439
499
|
} catch (error) {
|
|
440
|
-
console.error(error)
|
|
500
|
+
console.error(error);
|
|
441
501
|
}
|
|
442
502
|
}
|
|
443
503
|
}
|
|
@@ -449,7 +509,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
449
509
|
try {
|
|
450
510
|
client.notifyDidOpenConnection();
|
|
451
511
|
} catch (error) {
|
|
452
|
-
console.error(error)
|
|
512
|
+
console.error(error);
|
|
453
513
|
}
|
|
454
514
|
}
|
|
455
515
|
}
|
|
@@ -461,7 +521,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
461
521
|
try {
|
|
462
522
|
client.notifyDidCloseConnection();
|
|
463
523
|
} catch (error) {
|
|
464
|
-
console.error(error)
|
|
524
|
+
console.error(error);
|
|
465
525
|
}
|
|
466
526
|
}
|
|
467
527
|
}
|
|
@@ -473,64 +533,61 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
473
533
|
try {
|
|
474
534
|
client.onCreditAlert(creditAlert);
|
|
475
535
|
} catch (error) {
|
|
476
|
-
console.error(error)
|
|
536
|
+
console.error(error);
|
|
477
537
|
}
|
|
478
538
|
}
|
|
479
539
|
}
|
|
480
540
|
}
|
|
481
|
-
|
|
482
541
|
}
|
|
483
542
|
|
|
484
543
|
export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
|
|
485
544
|
|
|
486
|
-
const hasWindow =
|
|
545
|
+
const hasWindow = typeof window !== "undefined";
|
|
487
546
|
const phasesOrder: Record<WorkspaceInstancePhase, number> = {
|
|
488
547
|
unknown: 0,
|
|
489
548
|
preparing: 1,
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
549
|
+
building: 2,
|
|
550
|
+
pending: 3,
|
|
551
|
+
creating: 4,
|
|
552
|
+
initializing: 5,
|
|
553
|
+
running: 6,
|
|
554
|
+
interrupted: 7,
|
|
555
|
+
stopping: 8,
|
|
556
|
+
stopped: 9,
|
|
497
557
|
};
|
|
498
558
|
export class WorkspaceInstanceUpdateListener {
|
|
499
559
|
private readonly onDidChangeEmitter = new Emitter<void>();
|
|
500
560
|
readonly onDidChange = this.onDidChangeEmitter.event;
|
|
501
561
|
|
|
502
|
-
private source:
|
|
562
|
+
private source: "sync" | "update" = "sync";
|
|
503
563
|
|
|
504
564
|
get info(): WorkspaceInfo {
|
|
505
565
|
return this._info;
|
|
506
566
|
}
|
|
507
567
|
|
|
508
|
-
constructor(
|
|
509
|
-
private readonly service: GitpodService,
|
|
510
|
-
private _info: WorkspaceInfo
|
|
511
|
-
) {
|
|
568
|
+
constructor(private readonly service: GitpodService, private _info: WorkspaceInfo) {
|
|
512
569
|
service.registerClient({
|
|
513
|
-
onInstanceUpdate: instance => {
|
|
570
|
+
onInstanceUpdate: (instance) => {
|
|
514
571
|
if (this.isOutOfOrder(instance)) {
|
|
515
572
|
return;
|
|
516
573
|
}
|
|
517
574
|
this.cancelSync();
|
|
518
575
|
this._info.latestInstance = instance;
|
|
519
|
-
this.source =
|
|
576
|
+
this.source = "update";
|
|
520
577
|
this.onDidChangeEmitter.fire(undefined);
|
|
521
578
|
},
|
|
522
579
|
notifyDidOpenConnection: () => {
|
|
523
580
|
this.sync();
|
|
524
|
-
}
|
|
581
|
+
},
|
|
525
582
|
});
|
|
526
583
|
if (hasWindow) {
|
|
527
584
|
// learn about page lifecycle here: https://developers.google.com/web/updates/2018/07/page-lifecycle-api
|
|
528
|
-
window.document.addEventListener(
|
|
529
|
-
if (window.document.visibilityState ===
|
|
585
|
+
window.document.addEventListener("visibilitychange", async () => {
|
|
586
|
+
if (window.document.visibilityState === "visible") {
|
|
530
587
|
this.sync();
|
|
531
588
|
}
|
|
532
589
|
});
|
|
533
|
-
window.addEventListener(
|
|
590
|
+
window.addEventListener("pageshow", (e) => {
|
|
534
591
|
if (e.persisted) {
|
|
535
592
|
this.sync();
|
|
536
593
|
}
|
|
@@ -558,12 +615,12 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
558
615
|
return;
|
|
559
616
|
}
|
|
560
617
|
this._info = info;
|
|
561
|
-
this.source =
|
|
618
|
+
this.source = "sync";
|
|
562
619
|
this.onDidChangeEmitter.fire(undefined);
|
|
563
620
|
} catch (e) {
|
|
564
|
-
console.error(
|
|
621
|
+
console.error("failed to sync workspace instance:", e);
|
|
565
622
|
}
|
|
566
|
-
})
|
|
623
|
+
});
|
|
567
624
|
}
|
|
568
625
|
private cancelSync(): void {
|
|
569
626
|
if (this.syncTokenSource) {
|
|
@@ -580,7 +637,7 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
580
637
|
if (instance.workspaceId !== this._info.workspace.id) {
|
|
581
638
|
return true;
|
|
582
639
|
}
|
|
583
|
-
if (this.source ===
|
|
640
|
+
if (this.source === "update") {
|
|
584
641
|
return false;
|
|
585
642
|
}
|
|
586
643
|
if (instance.id !== this.info.latestInstance?.id) {
|
|
@@ -588,15 +645,13 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
588
645
|
}
|
|
589
646
|
return phasesOrder[instance.status.phase] < phasesOrder[this.info.latestInstance.status.phase];
|
|
590
647
|
}
|
|
591
|
-
|
|
592
648
|
}
|
|
593
649
|
|
|
594
650
|
export interface GitpodServiceOptions {
|
|
595
|
-
onReconnect?: () =>
|
|
651
|
+
onReconnect?: () => void | Promise<void>;
|
|
596
652
|
}
|
|
597
653
|
|
|
598
654
|
export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
|
|
599
|
-
|
|
600
655
|
private readonly compositeClient = new GitpodCompositeClient<Client>();
|
|
601
656
|
|
|
602
657
|
constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
|
|
@@ -611,7 +666,8 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
|
|
|
611
666
|
|
|
612
667
|
private readonly instanceListeners = new Map<string, Promise<WorkspaceInstanceUpdateListener>>();
|
|
613
668
|
listenToInstance(workspaceId: string): Promise<WorkspaceInstanceUpdateListener> {
|
|
614
|
-
const listener =
|
|
669
|
+
const listener =
|
|
670
|
+
this.instanceListeners.get(workspaceId) ||
|
|
615
671
|
(async () => {
|
|
616
672
|
const info = await this.server.getWorkspace(workspaceId);
|
|
617
673
|
return new WorkspaceInstanceUpdateListener(this, info);
|
|
@@ -627,26 +683,25 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
|
|
|
627
683
|
}
|
|
628
684
|
}
|
|
629
685
|
|
|
630
|
-
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(
|
|
686
|
+
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(
|
|
687
|
+
serverUrl: string | Promise<string>,
|
|
688
|
+
) {
|
|
631
689
|
const toWsUrl = (serverUrl: string) => {
|
|
632
|
-
return new GitpodHostUrl(serverUrl)
|
|
633
|
-
.asWebsocket()
|
|
634
|
-
.withApi({ pathname: GitpodServerPath })
|
|
635
|
-
.toString();
|
|
690
|
+
return new GitpodHostUrl(serverUrl).asWebsocket().withApi({ pathname: GitpodServerPath }).toString();
|
|
636
691
|
};
|
|
637
692
|
let url: string | Promise<string>;
|
|
638
693
|
if (typeof serverUrl === "string") {
|
|
639
694
|
url = toWsUrl(serverUrl);
|
|
640
695
|
} else {
|
|
641
|
-
url = serverUrl.then(url => toWsUrl(url));
|
|
696
|
+
url = serverUrl.then((url) => toWsUrl(url));
|
|
642
697
|
}
|
|
643
698
|
|
|
644
699
|
const connectionProvider = new WebSocketConnectionProvider();
|
|
645
|
-
let onReconnect = () => {
|
|
700
|
+
let onReconnect = () => {};
|
|
646
701
|
const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
|
|
647
|
-
onListening: socket => {
|
|
702
|
+
onListening: (socket) => {
|
|
648
703
|
onReconnect = () => socket.reconnect();
|
|
649
|
-
}
|
|
704
|
+
},
|
|
650
705
|
});
|
|
651
706
|
return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
|
|
652
|
-
}
|
|
707
|
+
}
|
|
@@ -4,21 +4,23 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
export enum HeadlessWorkspaceEventType {
|
|
9
8
|
LogOutput = "log-output",
|
|
10
9
|
FinishedSuccessfully = "finish-success",
|
|
11
10
|
FinishedButFailed = "finish-fail",
|
|
12
11
|
AbortedTimedOut = "aborted-timeout",
|
|
13
12
|
Aborted = "aborted",
|
|
14
|
-
|
|
13
|
+
Failed = "failed",
|
|
14
|
+
Started = "started",
|
|
15
15
|
}
|
|
16
16
|
export namespace HeadlessWorkspaceEventType {
|
|
17
17
|
export function isRunning(t: HeadlessWorkspaceEventType) {
|
|
18
18
|
return t === HeadlessWorkspaceEventType.LogOutput;
|
|
19
19
|
}
|
|
20
20
|
export function didFinish(t: HeadlessWorkspaceEventType) {
|
|
21
|
-
return
|
|
21
|
+
return (
|
|
22
|
+
t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -35,4 +37,4 @@ export interface HeadlessLogUrls {
|
|
|
35
37
|
|
|
36
38
|
/** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
|
|
37
39
|
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})/;
|
|
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
|
@@ -45,12 +45,12 @@ export interface IDEClient {
|
|
|
45
45
|
/**
|
|
46
46
|
* Desktop IDEs supported by the client.
|
|
47
47
|
*/
|
|
48
|
-
desktopIDEs?: string[]
|
|
48
|
+
desktopIDEs?: string[];
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Steps to install the client on user machine.
|
|
52
52
|
*/
|
|
53
|
-
installationSteps?: string[]
|
|
53
|
+
installationSteps?: string[];
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export interface IDEOption {
|
|
@@ -67,12 +67,12 @@ export interface IDEOption {
|
|
|
67
67
|
/**
|
|
68
68
|
* The type of the IDE, currently 'browser' or 'desktop'.
|
|
69
69
|
*/
|
|
70
|
-
type:
|
|
70
|
+
type: "browser" | "desktop";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
76
|
logo: string;
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -93,8 +93,8 @@ export interface IDEOption {
|
|
|
93
93
|
notes?: string[];
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
* If `true` this IDE option is not visible in the IDE preferences.
|
|
97
|
+
*/
|
|
98
98
|
hidden?: boolean;
|
|
99
99
|
|
|
100
100
|
/**
|
|
@@ -102,6 +102,11 @@ export interface IDEOption {
|
|
|
102
102
|
*/
|
|
103
103
|
image: string;
|
|
104
104
|
|
|
105
|
+
/**
|
|
106
|
+
* The latest image ref to the IDE image, this image ref always resolve to digest.
|
|
107
|
+
*/
|
|
108
|
+
latestImage?: string;
|
|
109
|
+
|
|
105
110
|
/**
|
|
106
111
|
* When this is `true`, the tag of this image is resolved to the latest
|
|
107
112
|
* image digest regularly.
|