@gitpod/gitpod-protocol 0.1.5-svenefftinge-dashboard-invalid-2274.4 → 0.1.5-tar-telemetry-data-settings.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 +28 -18
- 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 +32 -5
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +16 -1
- 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 +19 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +51 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +12 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +73 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +2 -3
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +5 -5
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.js +6 -5
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +1 -1
- package/lib/encryption/encryption-engine.js +20 -21
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +1 -1
- package/lib/encryption/encryption-engine.spec.js +30 -37
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +1 -1
- package/lib/encryption/encryption-service.js +30 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +1 -1
- package/lib/encryption/key-provider.js +26 -31
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +2 -3
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +21 -22
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.js +26 -42
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +117 -117
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +156 -21
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +171 -257
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +9 -12
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +5 -8
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +5 -1
- package/lib/ide-frontend-service.d.ts.map +1 -1
- package/lib/ide-frontend-service.js +1 -1
- package/lib/ide-protocol.d.ts +101 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/{util/without.js → ide-protocol.js} +2 -2
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -2
- 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 +1 -1
- package/lib/license-protocol.js +1 -1
- 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.d.ts +1 -1
- package/lib/messaging/browser/window-connection.js +36 -56
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/connection-error-handler.js +11 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +7 -2
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +14 -4
- 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 +7 -5
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +20 -19
- 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 +133 -59
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +129 -118
- 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} +3 -4
- 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/theia-plugins.d.ts +1 -1
- package/lib/theia-plugins.js +1 -1
- package/lib/typings/globals.d.ts +1 -1
- package/lib/typings/globals.js +1 -1
- 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.d.ts +1 -1
- package/lib/util/async-iterator.js +56 -134
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +18 -60
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +9 -9
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deep-partial.d.ts +1 -1
- package/lib/util/deep-partial.js +1 -1
- package/lib/util/deferred.d.ts +1 -1
- package/lib/util/deferred.js +11 -13
- 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 +2 -1
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +27 -47
- 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/generate-workspace-id.spec.d.ts +7 -0
- 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 +5 -3
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +99 -92
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +16 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
- package/lib/util/gitpod-host-url.spec.js +124 -0
- package/lib/util/gitpod-host-url.spec.js.map +1 -0
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/jaeger-client-types.js +8 -0
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +57 -34
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +119 -111
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.d.ts +1 -1
- package/lib/util/make-link.js +3 -3
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +14 -4
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +39 -9
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +9 -1
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +128 -48
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +1 -1
- package/lib/util/queue.js +17 -56
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.d.ts +1 -1
- package/lib/util/queue.spec.js +145 -289
- 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.d.ts +1 -1
- package/lib/util/semaphore.js +16 -47
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.js +7 -7
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +1 -1
- package/lib/util/timeutil.js +29 -17
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +1 -1
- package/lib/util/timeutil.spec.js +22 -25
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +52 -6
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +197 -63
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.d.ts +1 -1
- package/lib/util/workspace-port-authentication.js +4 -3
- 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 +27 -3
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +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 +54 -6
- package/src/analytics.ts +54 -0
- package/src/auth.ts +27 -0
- package/src/context-url.spec.ts +39 -0
- package/src/context-url.ts +53 -0
- package/src/email-protocol.ts +3 -4
- package/src/encryption/container-module.ts +1 -1
- package/src/encryption/encryption-engine.spec.ts +1 -1
- package/src/encryption/encryption-engine.ts +1 -1
- package/src/encryption/encryption-service.ts +1 -1
- package/src/encryption/key-provider.ts +1 -1
- package/src/env.ts +11 -11
- package/src/gitpod-file-parser.spec.ts +1 -1
- package/src/gitpod-file-parser.ts +1 -1
- package/src/gitpod-service.ts +230 -40
- package/src/headless-workspace-log.ts +8 -12
- package/src/ide-frontend-service.ts +6 -2
- package/src/ide-protocol.ts +114 -0
- package/src/index.ts +8 -2
- package/src/installation-admin-protocol.ts +42 -0
- package/src/license-protocol.ts +1 -1
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/browser/window-connection.ts +1 -1
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +19 -4
- 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 +9 -8
- package/src/plans.ts +632 -0
- package/src/protocol.ts +222 -88
- 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/theia-plugins.ts +1 -1
- package/src/typings/globals.ts +1 -1
- package/src/util/analytics.ts +87 -0
- package/src/util/async-iterator.ts +1 -1
- package/src/util/cancelable.ts +1 -1
- package/src/util/date-time.ts +1 -1
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +2 -2
- package/src/util/garbage-collected-cache.ts +10 -4
- 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 +49 -0
- package/src/util/gitpod-host-url.ts +36 -14
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +111 -39
- package/src/util/make-link.ts +1 -1
- package/src/util/parse-workspace-id.spec.ts +46 -5
- package/src/util/parse-workspace-id.ts +39 -8
- package/src/util/queue.spec.ts +2 -2
- package/src/util/queue.ts +1 -1
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +3 -3
- package/src/util/skip-if.ts +2 -2
- package/src/util/timeutil.spec.ts +1 -1
- package/src/util/timeutil.ts +5 -5
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +184 -19
- package/src/util/workspace-port-authentication.ts +1 -1
- package/src/workspace-cluster.ts +91 -0
- package/src/workspace-instance.ts +52 -14
- package/src/wsready.ts +2 -2
- 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 +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
package/src/gitpod-service.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
User, WorkspaceInfo, WorkspaceCreationResult,
|
|
9
|
-
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo,
|
|
10
|
-
Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams,
|
|
11
|
-
ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
|
|
8
|
+
User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser,
|
|
9
|
+
WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, CreateWorkspaceMode,
|
|
10
|
+
Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms,
|
|
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, Data } 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,17 +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>;
|
|
53
|
+
getTerms(): Promise<Terms>;
|
|
39
54
|
updateLoggedInUser(user: Partial<User>): Promise<User>;
|
|
40
55
|
getAuthProviders(): Promise<AuthProviderInfo[]>;
|
|
41
56
|
getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
|
|
42
|
-
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<
|
|
57
|
+
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
|
|
43
58
|
deleteOwnAuthProvider(params: GitpodServer.DeleteOwnAuthProviderParams): Promise<void>;
|
|
44
|
-
getBranding(): Promise<Branding>;
|
|
45
59
|
getConfiguration(): Promise<Configuration>;
|
|
46
60
|
getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
|
|
61
|
+
getGitpodTokenScopes(tokenHash: string): Promise<string[]>;
|
|
47
62
|
/**
|
|
48
63
|
* @deprecated
|
|
49
64
|
*/
|
|
@@ -57,8 +72,14 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
57
72
|
getWorkspaceOwner(workspaceId: string): Promise<UserInfo | undefined>;
|
|
58
73
|
getWorkspaceUsers(workspaceId: string): Promise<WorkspaceInstanceUser[]>;
|
|
59
74
|
getFeaturedRepositories(): Promise<WhitelistedRepository[]>;
|
|
75
|
+
/**
|
|
76
|
+
* **Security:**
|
|
77
|
+
* Sensitive information like an owner token is erased, since it allows access for all team members.
|
|
78
|
+
* If you need to access an owner token use `getOwnerToken` instead.
|
|
79
|
+
*/
|
|
60
80
|
getWorkspace(id: string): Promise<WorkspaceInfo>;
|
|
61
81
|
isWorkspaceOwner(workspaceId: string): Promise<boolean>;
|
|
82
|
+
getOwnerToken(workspaceId: string): Promise<string>;
|
|
62
83
|
|
|
63
84
|
/**
|
|
64
85
|
* Creates and starts a workspace for the given context URL.
|
|
@@ -75,8 +96,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
75
96
|
updateWorkspaceUserPin(id: string, action: GitpodServer.PinAction): Promise<void>;
|
|
76
97
|
sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
|
|
77
98
|
watchWorkspaceImageBuildLogs(workspaceId: string): Promise<void>;
|
|
78
|
-
watchHeadlessWorkspaceLogs(workspaceId: string): Promise<void>;
|
|
79
99
|
isPrebuildDone(pwsid: string): Promise<boolean>;
|
|
100
|
+
getHeadlessLog(instanceId: string): Promise<HeadlessLogUrls>;
|
|
80
101
|
|
|
81
102
|
// Workspace timeout
|
|
82
103
|
setWorkspaceTimeout(workspaceId: string, duration: WorkspaceTimeoutDuration): Promise<SetWorkspaceTimeoutResult>;
|
|
@@ -90,19 +111,56 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
90
111
|
openPort(workspaceId: string, port: WorkspaceInstancePort): Promise<WorkspaceInstancePort | undefined>;
|
|
91
112
|
closePort(workspaceId: string, port: number): Promise<void>;
|
|
92
113
|
|
|
93
|
-
// User messages
|
|
94
|
-
getUserMessages(options: GitpodServer.GetUserMessagesOptions): Promise<UserMessage[]>;
|
|
95
|
-
updateUserMessages(options: GitpodServer.UpdateUserMessagesOptions): Promise<void>;
|
|
96
|
-
|
|
97
114
|
// User storage
|
|
98
115
|
getUserStorageResource(options: GitpodServer.GetUserStorageResourceOptions): Promise<string>;
|
|
99
116
|
updateUserStorageResource(options: GitpodServer.UpdateUserStorageResourceOptions): Promise<void>;
|
|
100
117
|
|
|
101
|
-
//
|
|
118
|
+
// User env vars
|
|
102
119
|
getEnvVars(): Promise<UserEnvVarValue[]>;
|
|
120
|
+
getAllEnvVars(): Promise<UserEnvVarValue[]>;
|
|
103
121
|
setEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
104
122
|
deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
105
123
|
|
|
124
|
+
// Teams
|
|
125
|
+
getTeams(): Promise<Team[]>;
|
|
126
|
+
getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
|
|
127
|
+
createTeam(name: string): Promise<Team>;
|
|
128
|
+
joinTeam(inviteId: string): Promise<Team>;
|
|
129
|
+
setTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
|
|
130
|
+
removeTeamMember(teamId: string, userId: string): Promise<void>;
|
|
131
|
+
getGenericInvite(teamId: string): Promise<TeamMembershipInvite>;
|
|
132
|
+
resetGenericInvite(inviteId: string): Promise<TeamMembershipInvite>;
|
|
133
|
+
deleteTeam(teamId: string, userId: string): Promise<void>;
|
|
134
|
+
|
|
135
|
+
// Admin Settings
|
|
136
|
+
adminGetSettings(): Promise<InstallationAdminSettings>;
|
|
137
|
+
adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
|
|
138
|
+
adminGetTelemetryData(): Promise<Data>;
|
|
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
|
+
|
|
106
164
|
// Gitpod token
|
|
107
165
|
getGitpodTokens(): Promise<GitpodToken[]>;
|
|
108
166
|
generateNewGitpodToken(options: GitpodServer.GenerateNewGitpodTokenOptions): Promise<string>;
|
|
@@ -113,10 +171,15 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
113
171
|
registerGithubApp(installationId: string): Promise<void>;
|
|
114
172
|
|
|
115
173
|
/**
|
|
116
|
-
* 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`.
|
|
117
175
|
* @return the snapshot id
|
|
118
176
|
*/
|
|
119
177
|
takeSnapshot(options: GitpodServer.TakeSnapshotOptions): Promise<string>;
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @param snapshotId
|
|
181
|
+
*/
|
|
182
|
+
waitForSnapshot(snapshotId: string): Promise<void>;
|
|
120
183
|
|
|
121
184
|
/**
|
|
122
185
|
* Returns the list of snapshots that exist for a workspace.
|
|
@@ -141,6 +204,95 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
141
204
|
resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
|
|
142
205
|
installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
|
|
143
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 CreateProjectParams {
|
|
257
|
+
name: string;
|
|
258
|
+
slug?: string;
|
|
259
|
+
account: string;
|
|
260
|
+
provider: string;
|
|
261
|
+
cloneUrl: string;
|
|
262
|
+
teamId?: string;
|
|
263
|
+
userId?: string;
|
|
264
|
+
appInstallationId: string;
|
|
265
|
+
}
|
|
266
|
+
export interface FindPrebuildsParams {
|
|
267
|
+
projectId: string;
|
|
268
|
+
branch?: string;
|
|
269
|
+
latest?: boolean;
|
|
270
|
+
prebuildId?: string;
|
|
271
|
+
// default: 30
|
|
272
|
+
limit?: number;
|
|
273
|
+
}
|
|
274
|
+
export interface GetProviderRepositoriesParams {
|
|
275
|
+
provider: string;
|
|
276
|
+
hints?: { installationId: string } | object;
|
|
277
|
+
}
|
|
278
|
+
export interface ProviderRepository {
|
|
279
|
+
name: string;
|
|
280
|
+
path?: string;
|
|
281
|
+
account: string;
|
|
282
|
+
accountAvatarUrl: string;
|
|
283
|
+
cloneUrl: string;
|
|
284
|
+
updatedAt: string;
|
|
285
|
+
installationId?: number;
|
|
286
|
+
installationUpdatedAt?: string;
|
|
287
|
+
|
|
288
|
+
inUse?: { userName: string };
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface ClientHeaderFields {
|
|
292
|
+
ip?: string;
|
|
293
|
+
userAgent?: string;
|
|
294
|
+
dnt?: string;
|
|
295
|
+
clientRegion?: string;
|
|
144
296
|
}
|
|
145
297
|
|
|
146
298
|
export const WorkspaceTimeoutValues = ["30m", "60m", "180m"] as const;
|
|
@@ -153,6 +305,7 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
|
|
|
153
305
|
methods.setClient = methods.setClient || (() => { });
|
|
154
306
|
methods.dispose = methods.dispose || (() => { });
|
|
155
307
|
return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
|
|
308
|
+
// @ts-ignore
|
|
156
309
|
get: (target: S, property: keyof S) => {
|
|
157
310
|
const result = target[property];
|
|
158
311
|
if (!result) {
|
|
@@ -185,6 +338,8 @@ export namespace GitpodServer {
|
|
|
185
338
|
limit?: number;
|
|
186
339
|
searchString?: string;
|
|
187
340
|
pinnedOnly?: boolean;
|
|
341
|
+
projectId?: string | string[];
|
|
342
|
+
includeWithoutProject?: boolean;
|
|
188
343
|
}
|
|
189
344
|
export interface GetAccountStatementOptions {
|
|
190
345
|
date?: string;
|
|
@@ -192,6 +347,7 @@ export namespace GitpodServer {
|
|
|
192
347
|
export interface CreateWorkspaceOptions {
|
|
193
348
|
contextUrl: string;
|
|
194
349
|
mode?: CreateWorkspaceMode;
|
|
350
|
+
forceDefaultConfig?: boolean;
|
|
195
351
|
}
|
|
196
352
|
export interface StartWorkspaceOptions {
|
|
197
353
|
forceDefaultImage: boolean;
|
|
@@ -199,13 +355,8 @@ export namespace GitpodServer {
|
|
|
199
355
|
export interface TakeSnapshotOptions {
|
|
200
356
|
workspaceId: string;
|
|
201
357
|
layoutData?: string;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
readonly releaseNotes?: boolean;
|
|
205
|
-
readonly workspaceInstanceId: string;
|
|
206
|
-
}
|
|
207
|
-
export interface UpdateUserMessagesOptions {
|
|
208
|
-
readonly messageIds: string[];
|
|
358
|
+
/* this is here to enable backwards-compatibility and untangling rollout between workspace, IDE and meta */
|
|
359
|
+
dontWait?: boolean;
|
|
209
360
|
}
|
|
210
361
|
export interface GetUserStorageResourceOptions {
|
|
211
362
|
readonly uri: string;
|
|
@@ -247,10 +398,12 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
247
398
|
|
|
248
399
|
public registerClient(client: Partial<Client>): Disposable {
|
|
249
400
|
this.clients.push(client);
|
|
250
|
-
const index = this.clients.length;
|
|
251
401
|
return {
|
|
252
402
|
dispose: () => {
|
|
253
|
-
this.clients.
|
|
403
|
+
const index = this.clients.indexOf(client);
|
|
404
|
+
if (index > -1) {
|
|
405
|
+
this.clients.splice(index, 1);
|
|
406
|
+
}
|
|
254
407
|
}
|
|
255
408
|
}
|
|
256
409
|
}
|
|
@@ -267,11 +420,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
267
420
|
}
|
|
268
421
|
}
|
|
269
422
|
|
|
270
|
-
|
|
423
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void {
|
|
271
424
|
for (const client of this.clients) {
|
|
272
|
-
if (client.
|
|
425
|
+
if (client.onPrebuildUpdate) {
|
|
273
426
|
try {
|
|
274
|
-
client.
|
|
427
|
+
client.onPrebuildUpdate(update);
|
|
275
428
|
} catch (error) {
|
|
276
429
|
console.error(error)
|
|
277
430
|
}
|
|
@@ -279,11 +432,11 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
279
432
|
}
|
|
280
433
|
}
|
|
281
434
|
|
|
282
|
-
|
|
435
|
+
onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void {
|
|
283
436
|
for (const client of this.clients) {
|
|
284
|
-
if (client.
|
|
437
|
+
if (client.onWorkspaceImageBuildLogs) {
|
|
285
438
|
try {
|
|
286
|
-
client.
|
|
439
|
+
client.onWorkspaceImageBuildLogs(info, content);
|
|
287
440
|
} catch (error) {
|
|
288
441
|
console.error(error)
|
|
289
442
|
}
|
|
@@ -315,6 +468,18 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
315
468
|
}
|
|
316
469
|
}
|
|
317
470
|
|
|
471
|
+
onCreditAlert(creditAlert: CreditAlert): void {
|
|
472
|
+
for (const client of this.clients) {
|
|
473
|
+
if (client.onCreditAlert) {
|
|
474
|
+
try {
|
|
475
|
+
client.onCreditAlert(creditAlert);
|
|
476
|
+
} catch (error) {
|
|
477
|
+
console.error(error)
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
318
483
|
}
|
|
319
484
|
|
|
320
485
|
export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
|
|
@@ -335,7 +500,7 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
335
500
|
private readonly onDidChangeEmitter = new Emitter<void>();
|
|
336
501
|
readonly onDidChange = this.onDidChangeEmitter.event;
|
|
337
502
|
|
|
338
|
-
private source: 'sync'
|
|
503
|
+
private source: 'sync' | 'update' = 'sync';
|
|
339
504
|
|
|
340
505
|
get info(): WorkspaceInfo {
|
|
341
506
|
return this._info;
|
|
@@ -427,11 +592,15 @@ export class WorkspaceInstanceUpdateListener {
|
|
|
427
592
|
|
|
428
593
|
}
|
|
429
594
|
|
|
595
|
+
export interface GitpodServiceOptions {
|
|
596
|
+
onReconnect?: () => (void | Promise<void>)
|
|
597
|
+
}
|
|
598
|
+
|
|
430
599
|
export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
|
|
431
600
|
|
|
432
601
|
private readonly compositeClient = new GitpodCompositeClient<Client>();
|
|
433
602
|
|
|
434
|
-
constructor(public readonly server: JsonRpcProxy<Server
|
|
603
|
+
constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
|
|
435
604
|
server.setClient(this.compositeClient);
|
|
436
605
|
server.onDidOpenConnection(() => this.compositeClient.notifyDidOpenConnection());
|
|
437
606
|
server.onDidCloseConnection(() => this.compositeClient.notifyDidCloseConnection());
|
|
@@ -451,13 +620,34 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
|
|
|
451
620
|
this.instanceListeners.set(workspaceId, listener);
|
|
452
621
|
return listener;
|
|
453
622
|
}
|
|
623
|
+
|
|
624
|
+
async reconnect(): Promise<void> {
|
|
625
|
+
if (this.options?.onReconnect) {
|
|
626
|
+
await this.options.onReconnect();
|
|
627
|
+
}
|
|
628
|
+
}
|
|
454
629
|
}
|
|
455
630
|
|
|
456
|
-
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string) {
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
631
|
+
export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>) {
|
|
632
|
+
const toWsUrl = (serverUrl: string) => {
|
|
633
|
+
return new GitpodHostUrl(serverUrl)
|
|
634
|
+
.asWebsocket()
|
|
635
|
+
.withApi({ pathname: GitpodServerPath })
|
|
636
|
+
.toString();
|
|
637
|
+
};
|
|
638
|
+
let url: string | Promise<string>;
|
|
639
|
+
if (typeof serverUrl === "string") {
|
|
640
|
+
url = toWsUrl(serverUrl);
|
|
641
|
+
} else {
|
|
642
|
+
url = serverUrl.then(url => toWsUrl(url));
|
|
643
|
+
}
|
|
644
|
+
|
|
460
645
|
const connectionProvider = new WebSocketConnectionProvider();
|
|
461
|
-
|
|
462
|
-
|
|
646
|
+
let onReconnect = () => { };
|
|
647
|
+
const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
|
|
648
|
+
onListening: socket => {
|
|
649
|
+
onReconnect = () => socket.reconnect();
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
|
|
463
653
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
@@ -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})/;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
@@ -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,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `IDEServer` provides a list of available IDEs.
|
|
9
|
+
*/
|
|
10
|
+
export interface IDEServer {
|
|
11
|
+
/**
|
|
12
|
+
* Returns the IDE preferences.
|
|
13
|
+
*/
|
|
14
|
+
getIDEOptions(): Promise<IDEOptions>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IDEOptions {
|
|
18
|
+
/**
|
|
19
|
+
* A list of available IDEs.
|
|
20
|
+
*/
|
|
21
|
+
options: { [key: string]: IDEOption };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The default (browser) IDE when the user has not specified one.
|
|
25
|
+
*/
|
|
26
|
+
defaultIde: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The default desktop IDE when the user has not specified one.
|
|
30
|
+
*/
|
|
31
|
+
defaultDesktopIde: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Client specific IDE options.
|
|
35
|
+
*/
|
|
36
|
+
clients?: { [id: string]: IDEClient };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IDEClient {
|
|
40
|
+
/**
|
|
41
|
+
* The default desktop IDE when the user has not specified one.
|
|
42
|
+
*/
|
|
43
|
+
defaultDesktopIDE?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Desktop IDEs supported by the client.
|
|
47
|
+
*/
|
|
48
|
+
desktopIDEs?: string[]
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Steps to install the client on user machine.
|
|
52
|
+
*/
|
|
53
|
+
installationSteps?: string[]
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface IDEOption {
|
|
57
|
+
/**
|
|
58
|
+
* To ensure a stable order one can set an `orderKey`.
|
|
59
|
+
*/
|
|
60
|
+
orderKey?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Human readable title text of the IDE (plain text only).
|
|
64
|
+
*/
|
|
65
|
+
title: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The type of the IDE, currently 'browser' or 'desktop'.
|
|
69
|
+
*/
|
|
70
|
+
type: 'browser' | 'desktop';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The logo for the IDE. That could be a key in (see
|
|
74
|
+
* components/dashboard/src/images/ideLogos.ts) or a URL.
|
|
75
|
+
*/
|
|
76
|
+
logo: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Text of an optional tooltip (plain text only).
|
|
80
|
+
*/
|
|
81
|
+
tooltip?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Text of an optional label next to the IDE option like “Insiders” (plain
|
|
85
|
+
* text only).
|
|
86
|
+
*/
|
|
87
|
+
label?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Notes to the IDE option that are renderd in the preferences when a user
|
|
91
|
+
* chooses this IDE.
|
|
92
|
+
*/
|
|
93
|
+
notes?: string[];
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* If `true` this IDE option is not visible in the IDE preferences.
|
|
97
|
+
*/
|
|
98
|
+
hidden?: boolean;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The image ref to the IDE image.
|
|
102
|
+
*/
|
|
103
|
+
image: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* When this is `true`, the tag of this image is resolved to the latest
|
|
107
|
+
* image digest regularly.
|
|
108
|
+
*
|
|
109
|
+
* This is useful if this image points to a tag like `nightly` that will be
|
|
110
|
+
* updated regularly. When `resolveImageDigest` is `true`, we make sure that
|
|
111
|
+
* we resolve the tag regularly to the most recent image version.
|
|
112
|
+
*/
|
|
113
|
+
resolveImageDigest?: boolean;
|
|
114
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
@@ -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,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
+
|
|
9
|
+
const InstallationAdminSettingsPrototype = {
|
|
10
|
+
sendTelemetry: true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type InstallationAdminSettings = typeof InstallationAdminSettingsPrototype;
|
|
14
|
+
|
|
15
|
+
export namespace InstallationAdminSettings {
|
|
16
|
+
export function fields(): (keyof InstallationAdminSettings)[] {
|
|
17
|
+
return Object.keys(InstallationAdminSettingsPrototype) as (keyof InstallationAdminSettings)[];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface InstallationAdmin {
|
|
22
|
+
id: string;
|
|
23
|
+
settings: InstallationAdminSettings;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Data {
|
|
27
|
+
installationAdmin: InstallationAdmin
|
|
28
|
+
totalUsers: number
|
|
29
|
+
totalWorkspaces: number
|
|
30
|
+
totalInstances: number
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export namespace InstallationAdmin {
|
|
34
|
+
export function createDefault(): InstallationAdmin {
|
|
35
|
+
return {
|
|
36
|
+
id: uuidv4(),
|
|
37
|
+
settings: {
|
|
38
|
+
...InstallationAdminSettingsPrototype,
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
package/src/license-protocol.ts
CHANGED