@gitpod/gitpod-protocol 0.1.5-me-test04251.0 → 0.1.5-me-fixheader.1
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 +73 -115
- package/lib/accounting-protocol.d.ts +9 -1
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +13 -2
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +8 -1
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +1 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +1 -1
- package/lib/analytics.js +1 -1
- package/lib/attribution.d.ts +23 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +50 -0
- package/lib/attribution.js.map +1 -0
- package/lib/auth.d.ts +1 -1
- package/lib/auth.js +1 -1
- package/lib/billing-mode.d.ts +41 -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 +1 -1
- package/lib/context-url.js +2 -2
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +1 -1
- package/lib/context-url.spec.js +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.js +1 -1
- package/lib/encryption/encryption-engine.d.ts +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +4 -4
- 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 +2 -2
- 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 +1 -1
- package/lib/encryption/key-provider.d.ts +1 -1
- package/lib/encryption/key-provider.js +2 -2
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -1
- package/lib/env.js +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 +1 -1
- package/lib/gitpod-file-parser.js +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +1 -1
- package/lib/gitpod-service.d.ts +40 -22
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +22 -9
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +1 -1
- package/lib/headless-workspace-log.js +1 -1
- package/lib/ide-frontend-service.d.ts +1 -1
- package/lib/ide-frontend-service.js +1 -1
- package/lib/ide-protocol.d.ts +9 -1
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/ide-protocol.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +4 -1
- package/lib/installation-admin-protocol.d.ts.map +1 -1
- package/lib/installation-admin-protocol.js +2 -1
- package/lib/installation-admin-protocol.js.map +1 -1
- package/lib/license-protocol.d.ts +8 -1
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +1 -1
- package/lib/messaging/browser/window-connection.js +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 +2 -3
- package/lib/messaging/client-call-metrics.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/oss-allowlist.d.ts +1 -1
- package/lib/oss-allowlist.js +1 -1
- package/lib/payment-protocol.d.ts +1 -1
- package/lib/payment-protocol.js +1 -1
- package/lib/permission.d.ts +1 -1
- package/lib/permission.js +1 -1
- package/lib/plans.d.ts +2 -1
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +7 -3
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +112 -21
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +175 -12
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.spec.d.ts +7 -0
- 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.d.ts +1 -1
- package/lib/snapshot-url.js +1 -1
- package/lib/snapshot-url.spec.d.ts +1 -1
- package/lib/snapshot-url.spec.js +1 -1
- package/lib/team-subscription-protocol.d.ts +18 -1
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +17 -2
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +15 -2
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +1 -1
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +1 -1
- package/lib/typings/globals.js +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 +1 -1
- package/lib/util/analytics.js +1 -1
- package/lib/util/async-iterator.d.ts +1 -1
- package/lib/util/async-iterator.js +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +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/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 +1 -1
- package/lib/util/garbage-collected-cache.d.ts +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 +1 -1
- package/lib/util/generate-workspace-id.js +1 -1
- package/lib/util/generate-workspace-id.spec.d.ts +1 -1
- package/lib/util/generate-workspace-id.spec.js +1 -1
- package/lib/util/gitpod-cookie.d.ts +1 -1
- package/lib/util/gitpod-cookie.js +1 -1
- package/lib/util/gitpod-host-url.d.ts +4 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +19 -1
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +1 -1
- package/lib/util/gitpod-host-url.spec.js +1 -1
- package/lib/util/grpc.d.ts +20 -1
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +74 -2
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts +1 -1
- package/lib/util/jaeger-client-types.js +1 -1
- package/lib/util/logging.d.ts +1 -1
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +9 -2
- 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.d.ts +1 -1
- package/lib/util/make-link.js +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 +1 -1
- package/lib/util/parse-workspace-id.js +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +1 -1
- package/lib/util/parse-workspace-id.spec.js +1 -1
- package/lib/util/queue.d.ts +1 -1
- package/lib/util/queue.js +1 -1
- package/lib/util/queue.spec.d.ts +1 -1
- package/lib/util/queue.spec.js +1 -1
- package/lib/util/repeat.d.ts +1 -1
- package/lib/util/repeat.js +1 -1
- package/lib/util/semaphore.d.ts +1 -1
- package/lib/util/semaphore.js +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.js +1 -1
- package/lib/util/timeutil.d.ts +3 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +14 -2
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +3 -1
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +35 -1
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +1 -1
- package/lib/util/tracing.js +1 -1
- package/lib/util/tracing.spec.d.ts +1 -1
- package/lib/util/tracing.spec.js +1 -1
- package/lib/util/workspace-port-authentication.d.ts +1 -1
- package/lib/util/workspace-port-authentication.js +1 -1
- package/lib/webhook-event.d.ts +44 -0
- package/lib/webhook-event.d.ts.map +1 -0
- package/lib/webhook-event.js +8 -0
- 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 +7 -8
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +1 -1
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +14 -2
- 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 +14 -6
- package/pkg-yarn.lock +10 -5
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +14 -1
- package/src/admin-protocol.ts +11 -1
- package/src/analytics.ts +1 -1
- package/src/attribution.ts +59 -0
- package/src/auth.ts +1 -1
- package/src/billing-mode.ts +77 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +1 -1
- package/src/context-url.ts +2 -2
- package/src/encryption/container-module.ts +1 -1
- package/src/encryption/encryption-engine.spec.ts +2 -2
- package/src/encryption/encryption-engine.ts +8 -4
- package/src/encryption/encryption-service.ts +1 -1
- package/src/encryption/key-provider.ts +2 -2
- package/src/env.ts +1 -1
- 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 +1 -1
- package/src/gitpod-file-parser.ts +1 -1
- package/src/gitpod-service.ts +76 -30
- package/src/headless-workspace-log.ts +1 -1
- package/src/ide-frontend-service.ts +1 -1
- package/src/ide-protocol.ts +11 -1
- package/src/index.ts +2 -2
- package/src/installation-admin-protocol.ts +4 -1
- package/src/license-protocol.ts +8 -1
- package/src/messaging/browser/window-connection.ts +1 -1
- package/src/messaging/client-call-metrics.ts +2 -21
- package/src/messaging/error.ts +20 -5
- package/src/oss-allowlist.ts +1 -1
- package/src/payment-protocol.ts +1 -1
- package/src/permission.ts +1 -1
- package/src/plans.ts +7 -3
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +270 -27
- package/src/snapshot-url.spec.ts +1 -1
- package/src/snapshot-url.ts +1 -1
- package/src/team-subscription-protocol.ts +28 -1
- package/src/teams-projects-protocol.ts +16 -2
- package/src/typings/globals.ts +1 -1
- package/src/usage.ts +71 -0
- package/src/util/analytics.ts +1 -1
- 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/debug-app.ts +81 -0
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +6 -1
- package/src/util/generate-workspace-id.spec.ts +1 -1
- package/src/util/generate-workspace-id.ts +1 -1
- package/src/util/gitpod-cookie.ts +1 -1
- package/src/util/gitpod-host-url.spec.ts +1 -1
- package/src/util/gitpod-host-url.ts +22 -1
- package/src/util/grpc.ts +90 -1
- package/src/util/jaeger-client-types.ts +1 -1
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +12 -3
- package/src/util/make-link.ts +1 -1
- package/src/util/nice-grpc.ts +93 -0
- package/src/util/parse-workspace-id.spec.ts +1 -1
- package/src/util/parse-workspace-id.ts +1 -1
- package/src/util/queue.spec.ts +1 -1
- package/src/util/queue.ts +1 -1
- package/src/util/repeat.ts +1 -1
- package/src/util/semaphore.ts +1 -1
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.spec.ts +29 -2
- package/src/util/timeutil.ts +13 -1
- package/src/util/tracing.spec.ts +1 -1
- package/src/util/tracing.ts +1 -1
- package/src/util/workspace-port-authentication.ts +1 -1
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +7 -5
- package/src/workspace-instance.ts +26 -2
- package/src/wsready.ts +2 -2
- 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/src/email-protocol.ts +0 -65
package/src/context-url.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Workspace } from ".";
|
|
@@ -38,7 +38,7 @@ export namespace ContextURL {
|
|
|
38
38
|
try {
|
|
39
39
|
return new URL(normalized);
|
|
40
40
|
} catch (err) {
|
|
41
|
-
console.
|
|
41
|
+
console.debug(`unable to parse URL from normalized contextURL: '${normalized}'`);
|
|
42
42
|
}
|
|
43
43
|
return undefined;
|
|
44
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { interfaces } from "inversify";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { suite, test } from "mocha-typescript";
|
|
@@ -24,7 +24,7 @@ class TestEncryptionEngineImpl {
|
|
|
24
24
|
|
|
25
25
|
@test basicSymmetry() {
|
|
26
26
|
const plaintext = "12345678901234567890";
|
|
27
|
-
const key =
|
|
27
|
+
const key = Buffer.from(this.testkey, "base64");
|
|
28
28
|
|
|
29
29
|
const cut = new EncryptionEngineImpl();
|
|
30
30
|
const encryptedData = cut.encrypt(plaintext, key);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as crypto from "crypto";
|
|
@@ -40,7 +40,7 @@ export class EncryptionEngineImpl {
|
|
|
40
40
|
encrypt(data: string, key: Buffer): EncryptedData {
|
|
41
41
|
const iv = crypto.randomBytes(16);
|
|
42
42
|
const cipher = crypto.createCipheriv(this.algorithm, key, iv);
|
|
43
|
-
const encrypted = cipher.update(
|
|
43
|
+
const encrypted = cipher.update(Buffer.from(data, "utf8"));
|
|
44
44
|
const finalEncrypted = Buffer.concat([encrypted, cipher.final()]);
|
|
45
45
|
return {
|
|
46
46
|
data: finalEncrypted.toString(this.enc),
|
|
@@ -51,8 +51,12 @@ export class EncryptionEngineImpl {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
decrypt(encryptedData: EncryptedData, key: Buffer): string {
|
|
54
|
-
const decipher = crypto.createDecipheriv(
|
|
55
|
-
|
|
54
|
+
const decipher = crypto.createDecipheriv(
|
|
55
|
+
this.algorithm,
|
|
56
|
+
key,
|
|
57
|
+
Buffer.from(encryptedData.keyParams.iv, this.enc),
|
|
58
|
+
);
|
|
59
|
+
let decrypted = decipher.update(Buffer.from(encryptedData.data, this.enc));
|
|
56
60
|
const finalDecrypted = Buffer.concat([decrypted, decipher.final()]);
|
|
57
61
|
return finalDecrypted.toString("utf8");
|
|
58
62
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { injectable, inject } from "inversify";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { injectable, inject } from "inversify";
|
|
@@ -71,7 +71,7 @@ export class KeyProviderImpl implements KeyProvider {
|
|
|
71
71
|
name: config.name,
|
|
72
72
|
version: config.version,
|
|
73
73
|
},
|
|
74
|
-
material:
|
|
74
|
+
material: Buffer.from(config.material, "base64"),
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
}
|
package/src/env.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { injectable } from "inversify";
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
import { Attributes, Client } from "./types";
|
|
7
|
+
|
|
8
|
+
// AlwaysReturningDefaultValueClient is an implemention of an experiments.Client which performs no lookup/network operation
|
|
9
|
+
// and always returns the default value for a given experimentName.
|
|
10
|
+
// This client is used for non-SaaS version of Gitpod, in particular for self-hosted installations where external
|
|
11
|
+
// network connections are not desirable or even possible.
|
|
12
|
+
class AlwaysReturningDefaultValueClient implements Client {
|
|
13
|
+
getValueAsync<T>(experimentName: string, defaultValue: T, attributes: Attributes): Promise<T> {
|
|
14
|
+
return Promise.resolve(defaultValue);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dispose(): void {
|
|
18
|
+
// there is nothing to dispose, no-op.
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function newAlwaysReturningDefaultValueClient(): Client {
|
|
23
|
+
return new AlwaysReturningDefaultValueClient();
|
|
24
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { Client } from "./types";
|
|
8
|
+
import * as configcat from "configcat-node";
|
|
9
|
+
import { LogLevel } from "configcat-common";
|
|
10
|
+
import { ConfigCatClient } from "./configcat";
|
|
11
|
+
import { newAlwaysReturningDefaultValueClient } from "./always-default";
|
|
12
|
+
|
|
13
|
+
let client: Client | undefined;
|
|
14
|
+
|
|
15
|
+
export type ConfigCatClientFactory = () => Client;
|
|
16
|
+
export const ConfigCatClientFactory = Symbol("ConfigCatClientFactory");
|
|
17
|
+
|
|
18
|
+
export function getExperimentsClientForBackend(): Client {
|
|
19
|
+
// We have already instantiated a client, we can just re-use it.
|
|
20
|
+
if (client !== undefined) {
|
|
21
|
+
return client;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Retrieve SDK key from ENV Variable
|
|
25
|
+
const sdkKey = process.env.CONFIGCAT_SDK_KEY;
|
|
26
|
+
|
|
27
|
+
// Self-hosted installations do not set the ConfigCat SDK key, so always use a client which returns the default value.
|
|
28
|
+
if (sdkKey === undefined || sdkKey === "") {
|
|
29
|
+
client = newAlwaysReturningDefaultValueClient();
|
|
30
|
+
return client;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const configCatClient = configcat.createClient(sdkKey, {
|
|
34
|
+
pollIntervalSeconds: 3 * 60, // 3 minutes
|
|
35
|
+
logger: configcat.createConsoleLogger(LogLevel.Error),
|
|
36
|
+
maxInitWaitTimeSeconds: 0,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
client = new ConfigCatClient(configCatClient);
|
|
40
|
+
return client;
|
|
41
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { Attributes, Client } from "./types";
|
|
8
|
+
import { User as ConfigCatUser } from "configcat-common/lib/RolloutEvaluator";
|
|
9
|
+
import { IConfigCatClient } from "configcat-common/lib/ConfigCatClient";
|
|
10
|
+
import { User } from "../protocol";
|
|
11
|
+
|
|
12
|
+
export const USER_ID_ATTRIBUTE = "user_id";
|
|
13
|
+
export const PROJECT_ID_ATTRIBUTE = "project_id";
|
|
14
|
+
export const TEAM_ID_ATTRIBUTE = "team_id";
|
|
15
|
+
export const TEAM_NAME_ATTRIBUTE = "team_name";
|
|
16
|
+
export const BILLING_TIER_ATTRIBUTE = "billing_tier";
|
|
17
|
+
|
|
18
|
+
export class ConfigCatClient implements Client {
|
|
19
|
+
private client: IConfigCatClient;
|
|
20
|
+
|
|
21
|
+
constructor(cc: IConfigCatClient) {
|
|
22
|
+
this.client = cc;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getValueAsync<T>(experimentName: string, defaultValue: T, attributes: Attributes): Promise<T> {
|
|
26
|
+
return this.client.getValueAsync(experimentName, defaultValue, attributesToUser(attributes));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
dispose(): void {
|
|
30
|
+
return this.client.dispose();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function attributesToUser(attributes: Attributes): ConfigCatUser {
|
|
35
|
+
const userId = attributes.user?.id || "";
|
|
36
|
+
const email = User.is(attributes.user) ? User.getPrimaryEmail(attributes.user) : attributes.user?.email || "";
|
|
37
|
+
|
|
38
|
+
const custom: { [key: string]: string } = {};
|
|
39
|
+
if (userId) {
|
|
40
|
+
custom[USER_ID_ATTRIBUTE] = userId;
|
|
41
|
+
}
|
|
42
|
+
if (attributes.projectId) {
|
|
43
|
+
custom[PROJECT_ID_ATTRIBUTE] = attributes.projectId;
|
|
44
|
+
}
|
|
45
|
+
if (attributes.teamId) {
|
|
46
|
+
custom[TEAM_ID_ATTRIBUTE] = attributes.teamId;
|
|
47
|
+
}
|
|
48
|
+
if (attributes.teamName) {
|
|
49
|
+
custom[TEAM_NAME_ATTRIBUTE] = attributes.teamName;
|
|
50
|
+
}
|
|
51
|
+
if (attributes.billingTier) {
|
|
52
|
+
custom[BILLING_TIER_ATTRIBUTE] = attributes.billingTier;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return new ConfigCatUser(userId, email, "", custom);
|
|
56
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { BillingTier, User } from "../protocol";
|
|
8
|
+
|
|
9
|
+
export const Client = Symbol("Client");
|
|
10
|
+
|
|
11
|
+
// Attributes define attributes which can be used to segment audiences.
|
|
12
|
+
// Set the attributes which you want to use to group audiences into.
|
|
13
|
+
export interface Attributes {
|
|
14
|
+
// user.id is mapped to ConfigCat's "identifier" + "custom.user_id"
|
|
15
|
+
user?: User | { id: string; email?: string };
|
|
16
|
+
|
|
17
|
+
// The BillingTier of this particular user
|
|
18
|
+
billingTier?: BillingTier;
|
|
19
|
+
|
|
20
|
+
// Currently selected Gitpod Project ID (mapped to "custom.project_id")
|
|
21
|
+
projectId?: string;
|
|
22
|
+
|
|
23
|
+
// Currently selected Gitpod Team ID (mapped to "custom.team_id")
|
|
24
|
+
teamId?: string;
|
|
25
|
+
// Currently selected Gitpod Team Name (mapped to "custom.team_name")
|
|
26
|
+
teamName?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Client {
|
|
30
|
+
getValueAsync<T>(experimentName: string, defaultValue: T, attributes: Attributes): Promise<T>;
|
|
31
|
+
|
|
32
|
+
// dispose will dispose of the client, no longer retrieving flags
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { suite, test } from "mocha-typescript";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { injectable } from "inversify";
|
package/src/gitpod-service.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {
|
|
@@ -24,6 +24,9 @@ import {
|
|
|
24
24
|
GuessGitTokenScopesParams,
|
|
25
25
|
GuessedGitTokenScopes,
|
|
26
26
|
ProjectEnvVar,
|
|
27
|
+
PrebuiltWorkspace,
|
|
28
|
+
UserSSHPublicKeyValue,
|
|
29
|
+
SSHPublicKeyValue,
|
|
27
30
|
} from "./protocol";
|
|
28
31
|
import {
|
|
29
32
|
Team,
|
|
@@ -34,6 +37,7 @@ import {
|
|
|
34
37
|
PrebuildWithStatus,
|
|
35
38
|
StartPrebuildResult,
|
|
36
39
|
PartialProject,
|
|
40
|
+
PrebuildEvent,
|
|
37
41
|
} from "./teams-projects-protocol";
|
|
38
42
|
import { JsonRpcProxy, JsonRpcServer } from "./messaging/proxy-factory";
|
|
39
43
|
import { Disposable, CancellationTokenSource } from "vscode-jsonrpc";
|
|
@@ -47,10 +51,18 @@ import { LicenseService } from "./license-protocol";
|
|
|
47
51
|
import { Emitter } from "./util/event";
|
|
48
52
|
import { AccountStatement, CreditAlert } from "./accounting-protocol";
|
|
49
53
|
import { GithubUpgradeURL, PlanCoupon } from "./payment-protocol";
|
|
50
|
-
import {
|
|
54
|
+
import {
|
|
55
|
+
TeamSubscription,
|
|
56
|
+
TeamSubscription2,
|
|
57
|
+
TeamSubscriptionSlot,
|
|
58
|
+
TeamSubscriptionSlotResolved,
|
|
59
|
+
} from "./team-subscription-protocol";
|
|
51
60
|
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from "./analytics";
|
|
52
61
|
import { IDEServer } from "./ide-protocol";
|
|
53
62
|
import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
|
|
63
|
+
import { ListUsageRequest, ListUsageResponse } from "./usage";
|
|
64
|
+
import { SupportedWorkspaceClass } from "./workspace-class";
|
|
65
|
+
import { BillingMode } from "./billing-mode";
|
|
54
66
|
|
|
55
67
|
export interface GitpodClient {
|
|
56
68
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
@@ -58,6 +70,8 @@ export interface GitpodClient {
|
|
|
58
70
|
|
|
59
71
|
onPrebuildUpdate(update: PrebuildWithStatus): void;
|
|
60
72
|
|
|
73
|
+
onNotificationUpdated(): void;
|
|
74
|
+
|
|
61
75
|
onCreditAlert(creditAlert: CreditAlert): void;
|
|
62
76
|
|
|
63
77
|
//#region propagating reconnection to iframe
|
|
@@ -72,6 +86,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
72
86
|
getLoggedInUser(): Promise<User>;
|
|
73
87
|
getTerms(): Promise<Terms>;
|
|
74
88
|
updateLoggedInUser(user: Partial<User>): Promise<User>;
|
|
89
|
+
sendPhoneNumberVerificationToken(phoneNumber: string): Promise<void>;
|
|
90
|
+
verifyPhoneNumberVerificationToken(phoneNumber: string, token: string): Promise<boolean>;
|
|
75
91
|
getAuthProviders(): Promise<AuthProviderInfo[]>;
|
|
76
92
|
getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
|
|
77
93
|
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
|
|
@@ -142,6 +158,12 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
142
158
|
setEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
143
159
|
deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
144
160
|
|
|
161
|
+
// User SSH Keys
|
|
162
|
+
hasSSHPublicKey(): Promise<boolean>;
|
|
163
|
+
getSSHPublicKeys(): Promise<UserSSHPublicKeyValue[]>;
|
|
164
|
+
addSSHPublicKey(value: SSHPublicKeyValue): Promise<UserSSHPublicKeyValue>;
|
|
165
|
+
deleteSSHPublicKey(id: string): Promise<void>;
|
|
166
|
+
|
|
145
167
|
// Teams
|
|
146
168
|
getTeams(): Promise<Team[]>;
|
|
147
169
|
getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
|
|
@@ -165,14 +187,12 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
165
187
|
getTeamProjects(teamId: string): Promise<Project[]>;
|
|
166
188
|
getUserProjects(): Promise<Project[]>;
|
|
167
189
|
getProjectOverview(projectId: string): Promise<Project.Overview | undefined>;
|
|
190
|
+
getPrebuildEvents(projectId: string): Promise<PrebuildEvent[]>;
|
|
168
191
|
findPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
|
|
192
|
+
findPrebuildByWorkspaceID(workspaceId: string): Promise<PrebuiltWorkspace | undefined>;
|
|
193
|
+
getPrebuild(prebuildId: string): Promise<PrebuildWithStatus | undefined>;
|
|
169
194
|
triggerPrebuild(projectId: string, branchName: string | null): Promise<StartPrebuildResult>;
|
|
170
195
|
cancelPrebuild(projectId: string, prebuildId: string): Promise<void>;
|
|
171
|
-
fetchProjectRepositoryConfiguration(projectId: string): Promise<string | undefined>;
|
|
172
|
-
guessProjectConfiguration(projectId: string): Promise<string | undefined>;
|
|
173
|
-
fetchRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
174
|
-
guessRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
|
|
175
|
-
setProjectConfiguration(projectId: string, configString: string): Promise<void>;
|
|
176
196
|
updateProjectPartial(partialProject: PartialProject): Promise<void>;
|
|
177
197
|
setProjectEnvironmentVariable(projectId: string, name: string, value: string, censored: boolean): Promise<void>;
|
|
178
198
|
getProjectEnvironmentVariables(projectId: string): Promise<ProjectEnvVar[]>;
|
|
@@ -188,7 +208,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
188
208
|
deleteGitpodToken(tokenHash: string): Promise<void>;
|
|
189
209
|
|
|
190
210
|
// misc
|
|
191
|
-
sendFeedback(feedback: string): Promise<string | undefined>;
|
|
192
211
|
isGitHubAppEnabled(): Promise<boolean>;
|
|
193
212
|
registerGithubApp(installationId: string): Promise<void>;
|
|
194
213
|
|
|
@@ -208,16 +227,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
208
227
|
*/
|
|
209
228
|
getSnapshots(workspaceID: string): Promise<string[]>;
|
|
210
229
|
|
|
211
|
-
/**
|
|
212
|
-
* stores/updates layout information for the given workspace
|
|
213
|
-
*/
|
|
214
|
-
storeLayout(workspaceId: string, layoutData: string): Promise<void>;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* retrieves layout information for the given workspace
|
|
218
|
-
*/
|
|
219
|
-
getLayout(workspaceId: string): Promise<string | undefined>;
|
|
220
|
-
|
|
221
230
|
guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
|
|
222
231
|
|
|
223
232
|
/**
|
|
@@ -235,7 +244,9 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
235
244
|
*/
|
|
236
245
|
getChargebeeSiteId(): Promise<string>;
|
|
237
246
|
createPortalSession(): Promise<{}>;
|
|
247
|
+
createTeamPortalSession(teamId: string): Promise<{}>;
|
|
238
248
|
checkout(planId: string, planQuantity?: number): Promise<{}>;
|
|
249
|
+
teamCheckout(teamId: string, planId: string): Promise<{}>;
|
|
239
250
|
getAvailableCoupons(): Promise<PlanCoupon[]>;
|
|
240
251
|
getAppliedCoupons(): Promise<PlanCoupon[]>;
|
|
241
252
|
|
|
@@ -247,6 +258,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
247
258
|
subscriptionCancel(subscriptionId: string): Promise<void>;
|
|
248
259
|
subscriptionCancelDowngrade(subscriptionId: string): Promise<void>;
|
|
249
260
|
|
|
261
|
+
getTeamSubscription(teamId: string): Promise<TeamSubscription2 | undefined>;
|
|
250
262
|
tsGet(): Promise<TeamSubscription[]>;
|
|
251
263
|
tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
|
|
252
264
|
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
|
|
@@ -262,12 +274,35 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
262
274
|
|
|
263
275
|
getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
|
|
264
276
|
|
|
277
|
+
getStripePublishableKey(): Promise<string>;
|
|
278
|
+
getStripeSetupIntentClientSecret(): Promise<string>;
|
|
279
|
+
findStripeSubscriptionId(attributionId: string): Promise<string | undefined>;
|
|
280
|
+
createStripeCustomerIfNeeded(attributionId: string, currency: string): Promise<void>;
|
|
281
|
+
subscribeToStripe(attributionId: string, setupIntentId: string, usageLimit: number): Promise<number | undefined>;
|
|
282
|
+
getStripePortalUrl(attributionId: string): Promise<string>;
|
|
283
|
+
getUsageLimit(attributionId: string): Promise<number | undefined>;
|
|
284
|
+
setUsageLimit(attributionId: string, usageLimit: number): Promise<void>;
|
|
285
|
+
|
|
286
|
+
listUsage(req: ListUsageRequest): Promise<ListUsageResponse>;
|
|
287
|
+
|
|
288
|
+
setUsageAttribution(usageAttribution: string): Promise<void>;
|
|
289
|
+
|
|
290
|
+
getBillingModeForUser(): Promise<BillingMode>;
|
|
291
|
+
getBillingModeForTeam(teamId: string): Promise<BillingMode>;
|
|
292
|
+
|
|
265
293
|
/**
|
|
266
294
|
* Analytics
|
|
267
295
|
*/
|
|
268
296
|
trackEvent(event: RemoteTrackMessage): Promise<void>;
|
|
269
297
|
trackLocation(event: RemotePageMessage): Promise<void>;
|
|
270
298
|
identifyUser(event: RemoteIdentifyMessage): Promise<void>;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Frontend notifications
|
|
302
|
+
*/
|
|
303
|
+
getNotifications(): Promise<string[]>;
|
|
304
|
+
|
|
305
|
+
getSupportedWorkspaceClasses(): Promise<SupportedWorkspaceClass[]>;
|
|
271
306
|
}
|
|
272
307
|
|
|
273
308
|
export interface RateLimiterError {
|
|
@@ -282,9 +317,7 @@ export interface RateLimiterError {
|
|
|
282
317
|
|
|
283
318
|
export interface CreateProjectParams {
|
|
284
319
|
name: string;
|
|
285
|
-
slug
|
|
286
|
-
account: string;
|
|
287
|
-
provider: string;
|
|
320
|
+
slug: string;
|
|
288
321
|
cloneUrl: string;
|
|
289
322
|
teamId?: string;
|
|
290
323
|
userId?: string;
|
|
@@ -349,7 +382,7 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
|
|
|
349
382
|
get: (target: S, property: keyof S) => {
|
|
350
383
|
const result = target[property];
|
|
351
384
|
if (!result) {
|
|
352
|
-
throw new Error(`Method ${property} not implemented`);
|
|
385
|
+
throw new Error(`Method ${String(property)} not implemented`);
|
|
353
386
|
}
|
|
354
387
|
return result;
|
|
355
388
|
},
|
|
@@ -365,6 +398,7 @@ export interface SetWorkspaceTimeoutResult {
|
|
|
365
398
|
|
|
366
399
|
export interface GetWorkspaceTimeoutResult {
|
|
367
400
|
duration: WorkspaceTimeoutDuration;
|
|
401
|
+
durationRaw: string;
|
|
368
402
|
canChange: boolean;
|
|
369
403
|
}
|
|
370
404
|
|
|
@@ -394,7 +428,6 @@ export namespace GitpodServer {
|
|
|
394
428
|
}
|
|
395
429
|
export interface TakeSnapshotOptions {
|
|
396
430
|
workspaceId: string;
|
|
397
|
-
layoutData?: string;
|
|
398
431
|
/* this is here to enable backwards-compatibility and untangling rollout between workspace, IDE and meta */
|
|
399
432
|
dontWait?: boolean;
|
|
400
433
|
}
|
|
@@ -522,6 +555,18 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
|
|
|
522
555
|
}
|
|
523
556
|
}
|
|
524
557
|
}
|
|
558
|
+
|
|
559
|
+
onNotificationUpdated(): void {
|
|
560
|
+
for (const client of this.clients) {
|
|
561
|
+
if (client.onNotificationUpdated) {
|
|
562
|
+
try {
|
|
563
|
+
client.onNotificationUpdated();
|
|
564
|
+
} catch (error) {
|
|
565
|
+
console.error(error);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
525
570
|
}
|
|
526
571
|
|
|
527
572
|
export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
|
|
@@ -530,13 +575,14 @@ const hasWindow = typeof window !== "undefined";
|
|
|
530
575
|
const phasesOrder: Record<WorkspaceInstancePhase, number> = {
|
|
531
576
|
unknown: 0,
|
|
532
577
|
preparing: 1,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
578
|
+
building: 2,
|
|
579
|
+
pending: 3,
|
|
580
|
+
creating: 4,
|
|
581
|
+
initializing: 5,
|
|
582
|
+
running: 6,
|
|
583
|
+
interrupted: 7,
|
|
584
|
+
stopping: 8,
|
|
585
|
+
stopped: 9,
|
|
540
586
|
};
|
|
541
587
|
export class WorkspaceInstanceUpdateListener {
|
|
542
588
|
private readonly onDidChangeEmitter = new Emitter<void>();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export enum HeadlessWorkspaceEventType {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Event } from "./util/event";
|
package/src/ide-protocol.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -116,4 +116,14 @@ export interface IDEOption {
|
|
|
116
116
|
* we resolve the tag regularly to the most recent image version.
|
|
117
117
|
*/
|
|
118
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;
|
|
119
129
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export * from "./protocol";
|
|
@@ -13,10 +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";
|
|
17
16
|
export * from "./headless-workspace-log";
|
|
18
17
|
export * from "./context-url";
|
|
19
18
|
export * from "./teams-projects-protocol";
|
|
20
19
|
export * from "./snapshot-url";
|
|
21
20
|
export * from "./oss-allowlist";
|
|
22
21
|
export * from "./installation-admin-protocol";
|
|
22
|
+
export * from "./webhook-event";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { v4 as uuidv4 } from "uuid";
|
|
8
8
|
|
|
9
9
|
const InstallationAdminSettingsPrototype = {
|
|
10
10
|
sendTelemetry: true,
|
|
11
|
+
sendCustomerID: true,
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export type InstallationAdminSettings = typeof InstallationAdminSettingsPrototype;
|
|
@@ -28,6 +29,8 @@ export interface TelemetryData {
|
|
|
28
29
|
totalUsers: number;
|
|
29
30
|
totalWorkspaces: number;
|
|
30
31
|
totalInstances: number;
|
|
32
|
+
licenseType: string;
|
|
33
|
+
customerID?: string;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export namespace InstallationAdmin {
|
package/src/license-protocol.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export interface LicenseValidationResult {
|
|
@@ -15,9 +15,15 @@ export type LicenseIssue = "seats-exhausted";
|
|
|
15
15
|
export interface LicenseInfo {
|
|
16
16
|
key: string;
|
|
17
17
|
seats: number;
|
|
18
|
+
userCount?: number;
|
|
18
19
|
valid: boolean;
|
|
19
20
|
validUntil: string;
|
|
20
21
|
plan?: string;
|
|
22
|
+
features?: string[];
|
|
23
|
+
enabledFeatures?: string[];
|
|
24
|
+
type?: string;
|
|
25
|
+
errorMsg?: string;
|
|
26
|
+
fallbackAllowed: boolean;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
export interface GetLicenseInfoResult {
|
|
@@ -33,5 +39,6 @@ export enum LicenseFeature {
|
|
|
33
39
|
export interface LicenseService {
|
|
34
40
|
validateLicense(): Promise<LicenseValidationResult>;
|
|
35
41
|
getLicenseInfo(): Promise<GetLicenseInfoResult>;
|
|
42
|
+
adminGetLicense(): Promise<LicenseInfo>;
|
|
36
43
|
licenseIncludesFeature(feature: LicenseFeature): Promise<boolean>;
|
|
37
44
|
}
|