@gitpod/gitpod-protocol 0.1.5-to-code-reading.1 → 0.1.5-to-monitor-delete.18
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 +124 -5
- package/lib/accounting-protocol.d.ts +18 -10
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +34 -32
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +19 -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/attribution.d.ts +24 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +54 -0
- package/lib/attribution.js.map +1 -0
- package/lib/auth.d.ts.map +1 -1
- package/lib/billing-mode.d.ts +45 -0
- package/lib/billing-mode.d.ts.map +1 -0
- package/lib/billing-mode.js +44 -0
- package/lib/billing-mode.js.map +1 -0
- package/lib/blocked-repositories-protocol.d.ts +13 -0
- package/lib/blocked-repositories-protocol.d.ts.map +1 -0
- package/lib/blocked-repositories-protocol.js +8 -0
- package/lib/blocked-repositories-protocol.js.map +1 -0
- 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/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 +9 -9
- 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 +10 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +36 -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 +51 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +22 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/experiments/types.js +10 -0
- 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 +83 -45
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +52 -33
- 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 +38 -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 +2 -1
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +30 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +31 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- 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 -18
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +21 -22
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +8 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +17 -3
- 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 +4 -3
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +210 -171
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +192 -59
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +292 -104
- package/lib/protocol.js.map +1 -1
- package/{src/theia-plugins.ts → lib/protocol.spec.d.ts} +2 -6
- package/lib/protocol.spec.d.ts.map +1 -0
- package/lib/protocol.spec.js +127 -0
- package/lib/protocol.spec.js.map +1 -0
- package/lib/snapshot-url.spec.js.map +1 -1
- package/lib/team-subscription-protocol.d.ts +22 -3
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +20 -5
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +29 -5
- 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/usage.d.ts +61 -0
- package/lib/usage.d.ts.map +1 -0
- package/lib/usage.js +14 -0
- package/lib/usage.js.map +1 -0
- 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 +6 -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 +3 -0
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +49 -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 +19 -0
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +73 -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 +31 -25
- package/lib/util/logging.js.map +1 -1
- package/lib/util/logging.spec.d.ts +7 -0
- package/lib/util/logging.spec.d.ts.map +1 -0
- package/lib/util/logging.spec.js +52 -0
- package/lib/util/logging.spec.js.map +1 -0
- package/lib/util/make-link.js +5 -5
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/nice-grpc.d.ts +9 -0
- package/lib/util/nice-grpc.d.ts.map +1 -0
- package/lib/util/nice-grpc.js +119 -0
- package/lib/util/nice-grpc.js.map +1 -0
- 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 +2 -0
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +15 -3
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +2 -0
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +34 -0
- 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/webhook-event.d.ts +44 -0
- package/lib/webhook-event.d.ts.map +1 -0
- package/lib/{theia-plugins.js → webhook-event.js} +2 -2
- package/lib/webhook-event.js.map +1 -0
- package/lib/workspace-class.d.ts +14 -0
- package/lib/workspace-class.d.ts.map +1 -0
- package/lib/workspace-class.js +8 -0
- package/lib/workspace-class.js.map +1 -0
- package/lib/workspace-cluster.d.ts +18 -17
- 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 +39 -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 +15 -7
- package/pkg-yarn.lock +11 -6
- package/provenance-bundle.jsonl +3 -1
- package/src/accounting-protocol.ts +66 -51
- package/src/admin-protocol.ts +45 -18
- package/src/analytics.ts +26 -28
- package/src/attribution.ts +63 -0
- package/src/auth.ts +2 -2
- package/src/billing-mode.ts +84 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +37 -9
- package/src/context-url.ts +94 -36
- package/src/encryption/container-module.ts +2 -3
- package/src/encryption/encryption-engine.spec.ts +9 -8
- package/src/encryption/encryption-engine.ts +20 -16
- 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 +41 -0
- package/src/experiments/configcat.ts +56 -0
- package/src/experiments/types.ts +34 -0
- package/src/gitpod-file-parser.spec.ts +55 -61
- package/src/gitpod-file-parser.ts +16 -17
- package/src/gitpod-service.ts +228 -129
- package/src/headless-workspace-log.ts +6 -4
- package/src/ide-frontend-service.ts +2 -2
- package/src/ide-protocol.ts +43 -6
- package/src/index.ts +16 -15
- package/src/installation-admin-protocol.ts +45 -0
- 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 +62 -82
- package/src/messaging/error.ts +26 -7
- 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 +240 -189
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +556 -258
- package/src/snapshot-url.spec.ts +9 -7
- package/src/team-subscription-protocol.ts +59 -22
- package/src/teams-projects-protocol.ts +43 -12
- package/src/typings/globals.ts +4 -4
- package/src/usage.ts +71 -0
- 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 +8 -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 +57 -33
- package/src/util/grpc.ts +90 -1
- package/src/util/jaeger-client-types.ts +2 -2
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +60 -42
- package/src/util/make-link.ts +6 -7
- package/src/util/nice-grpc.ts +93 -0
- 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 +40 -14
- package/src/util/timeutil.ts +27 -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/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +34 -20
- package/src/workspace-instance.ts +76 -20
- package/src/wsready.ts +3 -3
- package/data/builtin-theia-plugins.json +0 -372
- package/lib/email-protocol.d.ts +0 -49
- package/lib/email-protocol.d.ts.map +0 -1
- package/lib/email-protocol.js +0 -28
- package/lib/email-protocol.js.map +0 -1
- 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/email-protocol.ts +0 -66
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/safe-promise.ts +0 -26
|
@@ -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
|
@@ -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.
|
|
@@ -89,4 +116,14 @@ export interface IDEOption {
|
|
|
89
116
|
* we resolve the tag regularly to the most recent image version.
|
|
90
117
|
*/
|
|
91
118
|
resolveImageDigest?: boolean;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The plugin image ref for the IDE image, this image ref always resolve to digest.
|
|
122
|
+
*/
|
|
123
|
+
pluginImage?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The latest plugin image ref for the latest IDE image, this image ref always resolve to digest.
|
|
127
|
+
*/
|
|
128
|
+
pluginLatestImage?: string;
|
|
92
129
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
7
|
+
export * from "./protocol";
|
|
8
|
+
export * from "./gitpod-service";
|
|
9
|
+
export * from "./util/disposable";
|
|
10
|
+
export * from "./util/event";
|
|
11
|
+
export * from "./util/queue";
|
|
12
|
+
export * from "./license-protocol";
|
|
13
|
+
export * from "./workspace-instance";
|
|
14
|
+
export * from "./permission";
|
|
15
|
+
export * from "./admin-protocol";
|
|
16
|
+
export * from "./headless-workspace-log";
|
|
17
|
+
export * from "./context-url";
|
|
18
|
+
export * from "./teams-projects-protocol";
|
|
19
|
+
export * from "./snapshot-url";
|
|
20
|
+
export * from "./oss-allowlist";
|
|
21
|
+
export * from "./installation-admin-protocol";
|
|
22
|
+
export * from "./webhook-event";
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
sendCustomerID: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type InstallationAdminSettings = typeof InstallationAdminSettingsPrototype;
|
|
15
|
+
|
|
16
|
+
export namespace InstallationAdminSettings {
|
|
17
|
+
export function fields(): (keyof InstallationAdminSettings)[] {
|
|
18
|
+
return Object.keys(InstallationAdminSettingsPrototype) as (keyof InstallationAdminSettings)[];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface InstallationAdmin {
|
|
23
|
+
id: string;
|
|
24
|
+
settings: InstallationAdminSettings;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface TelemetryData {
|
|
28
|
+
installationAdmin: InstallationAdmin;
|
|
29
|
+
totalUsers: number;
|
|
30
|
+
totalWorkspaces: number;
|
|
31
|
+
totalInstances: number;
|
|
32
|
+
licenseType: string;
|
|
33
|
+
customerID?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export namespace InstallationAdmin {
|
|
37
|
+
export function createDefault(): InstallationAdmin {
|
|
38
|
+
return {
|
|
39
|
+
id: uuidv4(),
|
|
40
|
+
settings: {
|
|
41
|
+
...InstallationAdminSettingsPrototype,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/license-protocol.ts
CHANGED
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
export interface LicenseValidationResult {
|
|
9
|
-
valid: boolean
|
|
10
|
-
msg?: string
|
|
11
|
-
issue?: LicenseIssue
|
|
8
|
+
valid: boolean;
|
|
9
|
+
msg?: string;
|
|
10
|
+
issue?: LicenseIssue;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export type LicenseIssue = "seats-exhausted";
|
|
@@ -16,9 +15,15 @@ export type LicenseIssue = "seats-exhausted";
|
|
|
16
15
|
export interface LicenseInfo {
|
|
17
16
|
key: string;
|
|
18
17
|
seats: number;
|
|
18
|
+
userCount?: number;
|
|
19
19
|
valid: boolean;
|
|
20
20
|
validUntil: string;
|
|
21
21
|
plan?: string;
|
|
22
|
+
features?: string[];
|
|
23
|
+
enabledFeatures?: string[];
|
|
24
|
+
type?: string;
|
|
25
|
+
errorMsg?: string;
|
|
26
|
+
fallbackAllowed: boolean;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
export interface GetLicenseInfoResult {
|
|
@@ -34,5 +39,6 @@ export enum LicenseFeature {
|
|
|
34
39
|
export interface LicenseService {
|
|
35
40
|
validateLicense(): Promise<LicenseValidationResult>;
|
|
36
41
|
getLicenseInfo(): Promise<GetLicenseInfoResult>;
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
adminGetLicense(): Promise<LicenseInfo>;
|
|
43
|
+
licenseIncludesFeature(feature: LicenseFeature): Promise<boolean>;
|
|
44
|
+
}
|
|
@@ -11,7 +11,7 @@ import { AbstractMessageWriter } from "vscode-jsonrpc/lib/messageWriter";
|
|
|
11
11
|
import { AbstractMessageReader } from "vscode-jsonrpc/lib/messageReader";
|
|
12
12
|
import { JsonRpcProxyFactory, JsonRpcProxy } from "../proxy-factory";
|
|
13
13
|
import { ConnectionEventHandler, ConnectionHandler } from "../handler";
|
|
14
|
-
import ReconnectingWebSocket, { Event } from
|
|
14
|
+
import ReconnectingWebSocket, { Event } from "reconnecting-websocket";
|
|
15
15
|
|
|
16
16
|
export interface WebSocketOptions {
|
|
17
17
|
onerror?: (event: Event) => void;
|
|
@@ -19,7 +19,6 @@ export interface WebSocketOptions {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export class WebSocketConnectionProvider {
|
|
22
|
-
|
|
23
22
|
/**
|
|
24
23
|
* Create a proxy object to remote interface of T type
|
|
25
24
|
* over a web socket connection for the given path.
|
|
@@ -27,27 +26,33 @@ export class WebSocketConnectionProvider {
|
|
|
27
26
|
* An optional target can be provided to handle
|
|
28
27
|
* notifications and requests from a remote side.
|
|
29
28
|
*/
|
|
30
|
-
createProxy<T extends object>(
|
|
29
|
+
createProxy<T extends object>(
|
|
30
|
+
path: string | Promise<string>,
|
|
31
|
+
target?: object,
|
|
32
|
+
options?: WebSocketOptions,
|
|
33
|
+
): JsonRpcProxy<T> {
|
|
31
34
|
const factory = new JsonRpcProxyFactory<T>(target);
|
|
32
35
|
const startListening = (path: string) => {
|
|
33
|
-
const socket = this.listen(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const socket = this.listen(
|
|
37
|
+
{
|
|
38
|
+
path,
|
|
39
|
+
onConnection: (c) => factory.listen(c),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
onTransportDidClose: () => factory.fireConnectionClosed(),
|
|
43
|
+
onTransportDidOpen: () => factory.fireConnectionOpened(),
|
|
44
|
+
},
|
|
45
|
+
options,
|
|
41
46
|
);
|
|
42
47
|
if (options?.onListening) {
|
|
43
|
-
options.onListening(socket as any as ReconnectingWebSocket)
|
|
48
|
+
options.onListening(socket as any as ReconnectingWebSocket);
|
|
44
49
|
}
|
|
45
50
|
};
|
|
46
51
|
|
|
47
52
|
if (typeof path === "string") {
|
|
48
53
|
startListening(path);
|
|
49
54
|
} else {
|
|
50
|
-
path.then(path => startListening(path));
|
|
55
|
+
path.then((path) => startListening(path));
|
|
51
56
|
}
|
|
52
57
|
return factory.createProxy();
|
|
53
58
|
}
|
|
@@ -62,20 +67,15 @@ export class WebSocketConnectionProvider {
|
|
|
62
67
|
const logger = this.createLogger();
|
|
63
68
|
if (options && options.onerror) {
|
|
64
69
|
const onerror = options.onerror;
|
|
65
|
-
webSocket.addEventListener(
|
|
70
|
+
webSocket.addEventListener("error", (event) => {
|
|
66
71
|
onerror(event);
|
|
67
72
|
});
|
|
68
73
|
} else {
|
|
69
|
-
webSocket.addEventListener(
|
|
74
|
+
webSocket.addEventListener("error", (error: Event) => {
|
|
70
75
|
logger.error(JSON.stringify(error));
|
|
71
76
|
});
|
|
72
77
|
}
|
|
73
|
-
doListen(
|
|
74
|
-
webSocket as any as ReconnectingWebSocket,
|
|
75
|
-
handler,
|
|
76
|
-
eventHandler,
|
|
77
|
-
logger,
|
|
78
|
-
);
|
|
78
|
+
doListen(webSocket as any as ReconnectingWebSocket, handler, eventHandler, logger);
|
|
79
79
|
return webSocket;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -93,10 +93,9 @@ export class WebSocketConnectionProvider {
|
|
|
93
93
|
reconnectionDelayGrowFactor: 1.3,
|
|
94
94
|
maxRetries: Infinity,
|
|
95
95
|
debug: false,
|
|
96
|
-
WebSocket: WebSocket
|
|
96
|
+
WebSocket: WebSocket,
|
|
97
97
|
}) as any;
|
|
98
98
|
}
|
|
99
|
-
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
// The following was extracted from vscode-ws-jsonrpc to make these changes:
|
|
@@ -104,7 +103,12 @@ export class WebSocketConnectionProvider {
|
|
|
104
103
|
// - webSocket.onopen: making sure it's only ever called once so we're re-using MessageConnection
|
|
105
104
|
// - WebSocketMessageWriter: buffer and re-try messages instead of throwing an error immidiately
|
|
106
105
|
// - WebSocketMessageReader: don't close MessageConnection on 'socket.onclose'
|
|
107
|
-
function doListen(
|
|
106
|
+
function doListen(
|
|
107
|
+
resocket: ReconnectingWebSocket,
|
|
108
|
+
handler: ConnectionHandler,
|
|
109
|
+
eventHandler: ConnectionEventHandler,
|
|
110
|
+
logger: Logger,
|
|
111
|
+
) {
|
|
108
112
|
resocket.addEventListener("close", () => eventHandler.onTransportDidClose());
|
|
109
113
|
|
|
110
114
|
let alreadyOpened = false;
|
|
@@ -169,7 +173,7 @@ class BufferingWebSocketMessageWriter extends AbstractMessageWriter {
|
|
|
169
173
|
|
|
170
174
|
protected flushBuffer() {
|
|
171
175
|
if (this.buffer.length === 0) {
|
|
172
|
-
return
|
|
176
|
+
return;
|
|
173
177
|
}
|
|
174
178
|
|
|
175
179
|
const buffer = [...this.buffer];
|
|
@@ -186,26 +190,25 @@ class BufferingWebSocketMessageWriter extends AbstractMessageWriter {
|
|
|
186
190
|
}
|
|
187
191
|
}
|
|
188
192
|
|
|
189
|
-
|
|
190
193
|
/**
|
|
191
194
|
* This takes vscode-ws-jsonrpc/lib/socket/reader/WebSocketMessageReader and removes the "onClose -> fireClose" connection
|
|
192
195
|
*/
|
|
193
196
|
class NonClosingWebSocketMessageReader extends AbstractMessageReader {
|
|
194
197
|
protected readonly socket: IWebSocket;
|
|
195
198
|
protected readonly events: any[] = [];
|
|
196
|
-
protected state:
|
|
199
|
+
protected state: "initial" | "listening" | "closed" = "initial";
|
|
197
200
|
protected callback: (message: any) => void = () => {};
|
|
198
201
|
|
|
199
202
|
constructor(socket: IWebSocket) {
|
|
200
203
|
super();
|
|
201
204
|
this.socket = socket;
|
|
202
|
-
this.socket.onMessage(message => this.readMessage(message));
|
|
203
|
-
this.socket.onError(error => this.fireError(error));
|
|
205
|
+
this.socket.onMessage((message) => this.readMessage(message));
|
|
206
|
+
this.socket.onError((error) => this.fireError(error));
|
|
204
207
|
this.socket.onClose((code, reason) => {
|
|
205
208
|
if (code !== 1000) {
|
|
206
209
|
const error = {
|
|
207
|
-
name:
|
|
208
|
-
message: `Error during socket reconnect: code = ${code}, reason = ${reason}
|
|
210
|
+
name: "" + code,
|
|
211
|
+
message: `Error during socket reconnect: code = ${code}, reason = ${reason}`,
|
|
209
212
|
};
|
|
210
213
|
this.fireError(error);
|
|
211
214
|
}
|
|
@@ -213,47 +216,42 @@ class NonClosingWebSocketMessageReader extends AbstractMessageReader {
|
|
|
213
216
|
});
|
|
214
217
|
}
|
|
215
218
|
listen(callback: (message: any) => void) {
|
|
216
|
-
if (this.state ===
|
|
217
|
-
this.state =
|
|
219
|
+
if (this.state === "initial") {
|
|
220
|
+
this.state = "listening";
|
|
218
221
|
this.callback = callback;
|
|
219
222
|
while (this.events.length !== 0) {
|
|
220
223
|
const event = this.events.pop();
|
|
221
224
|
if (event.message) {
|
|
222
225
|
this.readMessage(event.message);
|
|
223
|
-
}
|
|
224
|
-
else if (event.error) {
|
|
226
|
+
} else if (event.error) {
|
|
225
227
|
this.fireError(event.error);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
+
} else {
|
|
228
229
|
this.fireClose();
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
readMessage(message: any) {
|
|
234
|
-
if (this.state ===
|
|
235
|
+
if (this.state === "initial") {
|
|
235
236
|
this.events.splice(0, 0, { message });
|
|
236
|
-
}
|
|
237
|
-
else if (this.state === 'listening') {
|
|
237
|
+
} else if (this.state === "listening") {
|
|
238
238
|
const data = JSON.parse(message);
|
|
239
239
|
this.callback(data);
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
fireError(error: any) {
|
|
243
|
-
if (this.state ===
|
|
243
|
+
if (this.state === "initial") {
|
|
244
244
|
this.events.splice(0, 0, { error });
|
|
245
|
-
}
|
|
246
|
-
else if (this.state === 'listening') {
|
|
245
|
+
} else if (this.state === "listening") {
|
|
247
246
|
super.fireError(error);
|
|
248
247
|
}
|
|
249
248
|
}
|
|
250
249
|
fireClose() {
|
|
251
|
-
if (this.state ===
|
|
250
|
+
if (this.state === "initial") {
|
|
252
251
|
this.events.splice(0, 0, {});
|
|
253
|
-
}
|
|
254
|
-
else if (this.state === 'listening') {
|
|
252
|
+
} else if (this.state === "listening") {
|
|
255
253
|
super.fireClose();
|
|
256
254
|
}
|
|
257
|
-
this.state =
|
|
255
|
+
this.state = "closed";
|
|
258
256
|
}
|
|
259
257
|
}
|
|
@@ -4,23 +4,27 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Message } from
|
|
8
|
-
import { AbstractMessageWriter, MessageWriter } from
|
|
9
|
-
import { AbstractMessageReader, MessageReader, DataCallback } from
|
|
10
|
-
import { MessageConnection, createMessageConnection } from
|
|
11
|
-
import { ConsoleLogger } from
|
|
7
|
+
import { Message } from "vscode-jsonrpc/lib/messages";
|
|
8
|
+
import { AbstractMessageWriter, MessageWriter } from "vscode-jsonrpc/lib/messageWriter";
|
|
9
|
+
import { AbstractMessageReader, MessageReader, DataCallback } from "vscode-jsonrpc/lib/messageReader";
|
|
10
|
+
import { MessageConnection, createMessageConnection } from "vscode-jsonrpc/lib/main";
|
|
11
|
+
import { ConsoleLogger } from "vscode-ws-jsonrpc";
|
|
12
12
|
|
|
13
13
|
interface WindowMessage extends Message {
|
|
14
|
-
serviceId: string
|
|
14
|
+
serviceId: string;
|
|
15
15
|
}
|
|
16
16
|
function isWindowMessage(value: any): value is WindowMessage {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
return (
|
|
18
|
+
!!value &&
|
|
19
|
+
typeof value === "object" &&
|
|
20
|
+
"jsonrpc" in value &&
|
|
21
|
+
typeof value["jsonrpc"] === "string" &&
|
|
22
|
+
"serviceId" in value &&
|
|
23
|
+
typeof value["serviceId"] === "string"
|
|
24
|
+
);
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export class WindowMessageWriter extends AbstractMessageWriter implements MessageWriter {
|
|
23
|
-
|
|
24
28
|
constructor(readonly serviceId: string, readonly window: Window, readonly targetOrigin: string) {
|
|
25
29
|
super();
|
|
26
30
|
}
|
|
@@ -29,44 +33,50 @@ export class WindowMessageWriter extends AbstractMessageWriter implements Messag
|
|
|
29
33
|
const { serviceId } = this;
|
|
30
34
|
this.window.postMessage(Object.assign(msg, { serviceId }), this.targetOrigin);
|
|
31
35
|
}
|
|
32
|
-
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
export class WindowMessageReader extends AbstractMessageReader implements MessageReader {
|
|
36
|
-
|
|
37
39
|
protected callback?: DataCallback;
|
|
38
40
|
protected readonly buffer: Message[] = [];
|
|
39
41
|
|
|
40
42
|
constructor(readonly serviceId: string, readonly sourceOrigin: string) {
|
|
41
43
|
super();
|
|
42
|
-
window.addEventListener(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
window.addEventListener(
|
|
45
|
+
"message",
|
|
46
|
+
(event) => {
|
|
47
|
+
if (this.sourceOrigin !== "*" && event.origin !== this.sourceOrigin) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (!isWindowMessage(event.data) || event.data.serviceId !== this.serviceId) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (this.callback) {
|
|
54
|
+
this.callback(event.data);
|
|
55
|
+
} else {
|
|
56
|
+
this.buffer.push(event.data);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
false,
|
|
60
|
+
);
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
listen(callback: DataCallback): void {
|
|
58
64
|
let message;
|
|
59
|
-
while (message = this.buffer.pop()) {
|
|
65
|
+
while ((message = this.buffer.pop())) {
|
|
60
66
|
callback(message);
|
|
61
67
|
}
|
|
62
68
|
Object.freeze(this.buffer);
|
|
63
69
|
this.callback = callback;
|
|
64
70
|
}
|
|
65
|
-
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
export function createWindowMessageConnection(
|
|
73
|
+
export function createWindowMessageConnection(
|
|
74
|
+
serviceId: string,
|
|
75
|
+
window: Window,
|
|
76
|
+
sourceOrigin: string,
|
|
77
|
+
targetOrigin = sourceOrigin,
|
|
78
|
+
): MessageConnection {
|
|
69
79
|
const reader = new WindowMessageReader(serviceId, sourceOrigin);
|
|
70
80
|
const writer = new WindowMessageWriter(serviceId, window, targetOrigin);
|
|
71
81
|
return createMessageConnection(reader, writer, new ConsoleLogger());
|
|
72
|
-
}
|
|
82
|
+
}
|