@gitpod/gitpod-protocol 0.1.5-test.9 → 0.1.5-tweak-workspaceconfig-origin-docs-fork.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 +17 -17
- 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 +22 -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 +18 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +49 -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 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +6 -5
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.js +7 -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 +21 -21
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +2 -2
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +31 -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 +31 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +2 -2
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +27 -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 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.js +27 -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 +186 -34
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +239 -116
- 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 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +26 -0
- package/lib/ide-frontend-service.d.ts.map +1 -0
- package/lib/ide-frontend-service.js +8 -0
- package/lib/ide-frontend-service.js.map +1 -0
- package/lib/ide-protocol.d.ts +81 -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 +5 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +25 -12
- package/lib/index.js.map +1 -1
- package/lib/license-protocol.d.ts +1 -1
- package/lib/license-protocol.js +2 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +6 -4
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +188 -48
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +26 -0
- package/lib/messaging/browser/window-connection.d.ts.map +1 -0
- package/lib/messaging/browser/window-connection.js +68 -0
- package/lib/messaging/browser/window-connection.js.map +1 -0
- 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 +12 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +6 -2
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +13 -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/handler.js +1 -0
- package/lib/messaging/handler.js.map +1 -1
- package/lib/messaging/node/connection.js +23 -22
- 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 +75 -169
- package/lib/messaging/proxy-factory.js.map +1 -1
- 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 +14 -12
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +21 -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 +123 -30
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +121 -117
- 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 +103 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +23 -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 +12 -0
- package/lib/typings/globals.d.ts.map +1 -0
- package/lib/typings/globals.js +7 -0
- package/lib/typings/globals.js.map +1 -0
- 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 +57 -134
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +19 -60
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +10 -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 +12 -13
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts +2 -2
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +27 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +59 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -1
- package/lib/util/garbage-collected-cache.js +24 -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 +470 -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 +63 -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 +8 -3
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +106 -76
- 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/logging.d.ts +57 -34
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +119 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.d.ts +1 -1
- package/lib/util/make-link.js +4 -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 -8
- 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 +129 -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 +18 -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 -287
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeater.d.ts +1 -1
- package/lib/util/repeater.js +37 -89
- package/lib/util/repeater.js.map +1 -1
- package/lib/util/safe-promise.d.ts +1 -1
- package/lib/util/safe-promise.js +11 -13
- package/lib/util/safe-promise.js.map +1 -1
- package/lib/util/semaphore.d.ts +1 -1
- package/lib/util/semaphore.js +17 -47
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.js +8 -7
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +1 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +30 -17
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +1 -1
- package/lib/util/timeutil.spec.js +23 -25
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +15 -2
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +86 -51
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/workspace-port-authentication.d.ts +1 -1
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +5 -3
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +74 -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 +10 -4
- 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 +3 -2
- package/lib/wsready.js.map +1 -1
- package/package.json +32 -16
- package/pkg-yarn.lock +18 -9
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +41 -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 +51 -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 +386 -52
- package/src/headless-workspace-log.ts +8 -12
- package/src/ide-frontend-service.ts +28 -0
- package/src/ide-protocol.ts +92 -0
- package/src/index.ts +6 -2
- package/src/license-protocol.ts +1 -1
- package/src/messaging/browser/connection.ts +201 -23
- package/src/messaging/browser/window-connection.ts +72 -0
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +16 -4
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +2 -2
- package/src/messaging/proxy-factory.ts +16 -14
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +9 -8
- package/src/plans.ts +632 -0
- package/src/protocol.ts +204 -61
- 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 +132 -0
- package/src/theia-plugins.ts +1 -1
- package/src/typings/globals.ts +12 -0
- 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 +3 -3
- package/src/util/generate-workspace-id.spec.ts +31 -0
- package/src/util/generate-workspace-id.ts +457 -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 +58 -14
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client.d.ts +1 -1
- 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/repeater.ts +1 -1
- package/src/util/safe-promise.ts +1 -1
- 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.ts +66 -4
- package/src/util/workspace-port-authentication.ts +1 -1
- package/src/workspace-cluster.ts +96 -0
- package/src/workspace-instance.ts +38 -16
- package/src/wsready.ts +2 -2
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020
|
|
3
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
5
|
* See License-AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
@@ -14,46 +14,44 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
14
14
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
TestGitpodFileParser.prototype.before = function () {
|
|
17
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
18
|
+
const chai = require("chai");
|
|
19
|
+
const gitpod_file_parser_1 = require("./gitpod-file-parser");
|
|
20
|
+
const expect = chai.expect;
|
|
21
|
+
const DEFAULT_IMAGE = "default-image";
|
|
22
|
+
const DEFAULT_CONFIG = { image: DEFAULT_IMAGE };
|
|
23
|
+
let TestGitpodFileParser = class TestGitpodFileParser {
|
|
24
|
+
before() {
|
|
27
25
|
this.parser = new gitpod_file_parser_1.GitpodFileParser();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
}
|
|
27
|
+
testOnlyOnePort() {
|
|
28
|
+
const content = `ports:\n` +
|
|
29
|
+
` - port: 5555`;
|
|
30
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
33
31
|
expect(result.config).to.deep.equal({
|
|
34
32
|
ports: [{
|
|
35
33
|
port: 5555
|
|
36
34
|
}],
|
|
37
35
|
image: DEFAULT_IMAGE
|
|
38
36
|
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
}
|
|
38
|
+
testPortRange() {
|
|
39
|
+
const content = `ports:\n` +
|
|
40
|
+
` - port: 5555\n` +
|
|
41
|
+
` - port: 3000-3999`; // should be filtered out by default
|
|
42
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
45
43
|
expect(result.config).to.deep.equal({
|
|
46
44
|
ports: [{
|
|
47
45
|
port: 5555
|
|
48
46
|
}],
|
|
49
47
|
image: DEFAULT_IMAGE
|
|
50
48
|
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
}
|
|
50
|
+
testPortRangeAccepted() {
|
|
51
|
+
const content = `ports:\n` +
|
|
52
|
+
` - port: 5555\n` +
|
|
53
|
+
` - port: 3000-3999`; // should be included if explicitly supported
|
|
54
|
+
const result = this.parser.parse(content, { acceptPortRanges: true }, DEFAULT_CONFIG);
|
|
57
55
|
expect(result.config).to.deep.equal({
|
|
58
56
|
ports: [{
|
|
59
57
|
port: 5555
|
|
@@ -62,123 +60,125 @@ var TestGitpodFileParser = /** @class */ (function () {
|
|
|
62
60
|
}],
|
|
63
61
|
image: DEFAULT_IMAGE
|
|
64
62
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
}
|
|
64
|
+
testSimpleTask() {
|
|
65
|
+
const content = `tasks:\n` +
|
|
66
|
+
` - command: yarn`;
|
|
67
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
70
68
|
expect(result.config).to.deep.equal({
|
|
71
69
|
tasks: [{
|
|
72
70
|
command: "yarn"
|
|
73
71
|
}],
|
|
74
72
|
image: DEFAULT_IMAGE
|
|
75
73
|
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
}
|
|
75
|
+
testSimpleImage() {
|
|
76
|
+
const imageName = "my-test-org/my-test-image:some-tag";
|
|
77
|
+
const content = `image: "${imageName}"\n`;
|
|
78
|
+
const result = this.parser.parse(content);
|
|
81
79
|
expect(result.config).to.deep.equal({
|
|
82
80
|
image: imageName
|
|
83
81
|
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
}
|
|
83
|
+
testComplexImageWithoutContext() {
|
|
84
|
+
const dockerFileName = 'Dockerfile';
|
|
85
|
+
const content = `image:\n file: ${dockerFileName}\n`;
|
|
86
|
+
const result = this.parser.parse(content);
|
|
89
87
|
expect(result.config).to.deep.equal({
|
|
90
88
|
image: {
|
|
91
89
|
file: dockerFileName
|
|
92
90
|
}
|
|
93
91
|
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
}
|
|
93
|
+
testComplexImageWithContext() {
|
|
94
|
+
const dockerFileName = 'Dockerfile';
|
|
95
|
+
const dockerContext = 'docker';
|
|
96
|
+
const content = `image:\n file: ${dockerFileName}\n context: ${dockerContext}\n`;
|
|
97
|
+
const result = this.parser.parse(content);
|
|
100
98
|
expect(result.config).to.deep.equal({
|
|
101
99
|
image: {
|
|
102
100
|
file: dockerFileName,
|
|
103
101
|
context: dockerContext
|
|
104
102
|
}
|
|
105
103
|
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
}
|
|
105
|
+
testGitconfig() {
|
|
106
|
+
const content = `
|
|
107
|
+
gitConfig:
|
|
108
|
+
core.autocrlf: input
|
|
109
|
+
`;
|
|
110
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
110
111
|
expect(result.config).to.deep.equal({
|
|
111
112
|
gitConfig: {
|
|
112
113
|
"core.autocrlf": "input"
|
|
113
114
|
},
|
|
114
115
|
image: DEFAULT_IMAGE
|
|
115
116
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
}
|
|
118
|
+
testBrokenConfig() {
|
|
119
|
+
const content = `image: 42\n`;
|
|
120
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
120
121
|
expect(result.config).to.deep.equal({
|
|
121
122
|
image: DEFAULT_IMAGE
|
|
122
123
|
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}());
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
__decorate([
|
|
127
|
+
mocha_typescript_1.test,
|
|
128
|
+
__metadata("design:type", Function),
|
|
129
|
+
__metadata("design:paramtypes", []),
|
|
130
|
+
__metadata("design:returntype", void 0)
|
|
131
|
+
], TestGitpodFileParser.prototype, "testOnlyOnePort", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
mocha_typescript_1.test,
|
|
134
|
+
__metadata("design:type", Function),
|
|
135
|
+
__metadata("design:paramtypes", []),
|
|
136
|
+
__metadata("design:returntype", void 0)
|
|
137
|
+
], TestGitpodFileParser.prototype, "testPortRange", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
mocha_typescript_1.test,
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", []),
|
|
142
|
+
__metadata("design:returntype", void 0)
|
|
143
|
+
], TestGitpodFileParser.prototype, "testPortRangeAccepted", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
mocha_typescript_1.test,
|
|
146
|
+
__metadata("design:type", Function),
|
|
147
|
+
__metadata("design:paramtypes", []),
|
|
148
|
+
__metadata("design:returntype", void 0)
|
|
149
|
+
], TestGitpodFileParser.prototype, "testSimpleTask", null);
|
|
150
|
+
__decorate([
|
|
151
|
+
mocha_typescript_1.test,
|
|
152
|
+
__metadata("design:type", Function),
|
|
153
|
+
__metadata("design:paramtypes", []),
|
|
154
|
+
__metadata("design:returntype", void 0)
|
|
155
|
+
], TestGitpodFileParser.prototype, "testSimpleImage", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
mocha_typescript_1.test,
|
|
158
|
+
__metadata("design:type", Function),
|
|
159
|
+
__metadata("design:paramtypes", []),
|
|
160
|
+
__metadata("design:returntype", void 0)
|
|
161
|
+
], TestGitpodFileParser.prototype, "testComplexImageWithoutContext", null);
|
|
162
|
+
__decorate([
|
|
163
|
+
mocha_typescript_1.test,
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", []),
|
|
166
|
+
__metadata("design:returntype", void 0)
|
|
167
|
+
], TestGitpodFileParser.prototype, "testComplexImageWithContext", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
mocha_typescript_1.test,
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", []),
|
|
172
|
+
__metadata("design:returntype", void 0)
|
|
173
|
+
], TestGitpodFileParser.prototype, "testGitconfig", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
mocha_typescript_1.test,
|
|
176
|
+
__metadata("design:type", Function),
|
|
177
|
+
__metadata("design:paramtypes", []),
|
|
178
|
+
__metadata("design:returntype", void 0)
|
|
179
|
+
], TestGitpodFileParser.prototype, "testBrokenConfig", null);
|
|
180
|
+
TestGitpodFileParser = __decorate([
|
|
181
|
+
mocha_typescript_1.suite
|
|
182
|
+
], TestGitpodFileParser);
|
|
183
183
|
module.exports = new TestGitpodFileParser(); // Only to circumvent no usage warning :-/
|
|
184
184
|
//# sourceMappingURL=gitpod-file-parser.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.spec.js","sourceRoot":"","sources":["../src/gitpod-file-parser.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"gitpod-file-parser.spec.js","sourceRoot":"","sources":["../src/gitpod-file-parser.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AAEH,uDAA8C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,uBAAI;;;;0DAYJ;AAEK;IAAL,uBAAI;;;;2DASJ;AAEK;IAAL,uBAAI;;;;0EAWJ;AAEK;IAAL,uBAAI;;;;uEAaJ;AAEK;IAAL,uBAAI;;;;yDAcJ;AAEK;IAAL,uBAAI;;;;4DAQJ;AAnIQ,oBAAoB;IAAhC,wBAAK;GAAO,oBAAoB,CAoIhC;AACD,MAAM,CAAC,OAAO,GAAG,IAAI,oBAAoB,EAAE,CAAA,CAAG,0CAA0C"}
|
package/lib/gitpod-service.d.ts
CHANGED
|
@@ -1,32 +1,46 @@
|
|
|
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
|
-
import { User, WorkspaceInfo, WorkspaceCreationResult,
|
|
6
|
+
import { User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser, WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, Branding, CreateWorkspaceMode, Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms, ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType, GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes } from './protocol';
|
|
7
|
+
import { Team, TeamMemberInfo, TeamMembershipInvite, Project, TeamMemberRole, PrebuildWithStatus, StartPrebuildResult } from './teams-projects-protocol';
|
|
7
8
|
import { JsonRpcProxy, JsonRpcServer } from './messaging/proxy-factory';
|
|
8
9
|
import { Disposable } from 'vscode-jsonrpc';
|
|
9
|
-
import {
|
|
10
|
+
import { HeadlessLogUrls } from './headless-workspace-log';
|
|
10
11
|
import { WorkspaceInstance, WorkspaceInstancePort } from './workspace-instance';
|
|
11
12
|
import { AdminServer } from './admin-protocol';
|
|
12
13
|
import { PermissionName } from './permission';
|
|
13
14
|
import { LicenseService } from './license-protocol';
|
|
15
|
+
import { AccountStatement, CreditAlert } from './accounting-protocol';
|
|
16
|
+
import { GithubUpgradeURL, PlanCoupon } from './payment-protocol';
|
|
17
|
+
import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from './team-subscription-protocol';
|
|
18
|
+
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from './analytics';
|
|
19
|
+
import { IDEServer } from './ide-protocol';
|
|
14
20
|
export interface GitpodClient {
|
|
15
21
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
16
22
|
onWorkspaceImageBuildLogs: WorkspaceImageBuild.LogCallback;
|
|
17
|
-
|
|
23
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void;
|
|
24
|
+
onCreditAlert(creditAlert: CreditAlert): void;
|
|
25
|
+
notifyDidOpenConnection(): void;
|
|
26
|
+
notifyDidCloseConnection(): void;
|
|
18
27
|
}
|
|
19
28
|
export declare const GitpodServer: unique symbol;
|
|
20
|
-
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService {
|
|
29
|
+
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
|
|
21
30
|
getLoggedInUser(): Promise<User>;
|
|
31
|
+
getTerms(): Promise<Terms>;
|
|
22
32
|
updateLoggedInUser(user: Partial<User>): Promise<User>;
|
|
23
33
|
getAuthProviders(): Promise<AuthProviderInfo[]>;
|
|
24
34
|
getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
|
|
25
|
-
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<
|
|
35
|
+
updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
|
|
26
36
|
deleteOwnAuthProvider(params: GitpodServer.DeleteOwnAuthProviderParams): Promise<void>;
|
|
27
37
|
getBranding(): Promise<Branding>;
|
|
28
38
|
getConfiguration(): Promise<Configuration>;
|
|
29
39
|
getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
|
|
40
|
+
getGitpodTokenScopes(tokenHash: string): Promise<string[]>;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated
|
|
43
|
+
*/
|
|
30
44
|
getPortAuthenticationToken(workspaceId: string): Promise<Token>;
|
|
31
45
|
deleteAccount(): Promise<void>;
|
|
32
46
|
getClientRegion(): Promise<string | undefined>;
|
|
@@ -43,46 +57,67 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
43
57
|
* @return WorkspaceCreationResult
|
|
44
58
|
*/
|
|
45
59
|
createWorkspace(options: GitpodServer.CreateWorkspaceOptions): Promise<WorkspaceCreationResult>;
|
|
46
|
-
startWorkspace(id: string, options:
|
|
47
|
-
forceDefaultImage: boolean;
|
|
48
|
-
}): Promise<StartWorkspaceResult>;
|
|
60
|
+
startWorkspace(id: string, options: GitpodServer.StartWorkspaceOptions): Promise<StartWorkspaceResult>;
|
|
49
61
|
stopWorkspace(id: string): Promise<void>;
|
|
50
62
|
deleteWorkspace(id: string): Promise<void>;
|
|
51
63
|
setWorkspaceDescription(id: string, desc: string): Promise<void>;
|
|
52
|
-
controlAdmission(id: string, level:
|
|
53
|
-
updateWorkspaceUserPin(id: string, action:
|
|
64
|
+
controlAdmission(id: string, level: GitpodServer.AdmissionLevel): Promise<void>;
|
|
65
|
+
updateWorkspaceUserPin(id: string, action: GitpodServer.PinAction): Promise<void>;
|
|
54
66
|
sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
|
|
55
67
|
watchWorkspaceImageBuildLogs(workspaceId: string): Promise<void>;
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
isPrebuildDone(pwsid: string): Promise<boolean>;
|
|
69
|
+
getHeadlessLog(instanceId: string): Promise<HeadlessLogUrls>;
|
|
58
70
|
setWorkspaceTimeout(workspaceId: string, duration: WorkspaceTimeoutDuration): Promise<SetWorkspaceTimeoutResult>;
|
|
59
71
|
getWorkspaceTimeout(workspaceId: string): Promise<GetWorkspaceTimeoutResult>;
|
|
60
72
|
sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
|
|
61
|
-
updateWorkspaceUserPin(id: string, action:
|
|
73
|
+
updateWorkspaceUserPin(id: string, action: GitpodServer.PinAction): Promise<void>;
|
|
62
74
|
getOpenPorts(workspaceId: string): Promise<WorkspaceInstancePort[]>;
|
|
63
75
|
openPort(workspaceId: string, port: WorkspaceInstancePort): Promise<WorkspaceInstancePort | undefined>;
|
|
64
76
|
closePort(workspaceId: string, port: number): Promise<void>;
|
|
65
|
-
getUserMessages(options: GitpodServer.GetUserMessagesOptions): Promise<UserMessage[]>;
|
|
66
|
-
updateUserMessages(options: GitpodServer.UpdateUserMessagesOptions): Promise<void>;
|
|
67
77
|
getUserStorageResource(options: GitpodServer.GetUserStorageResourceOptions): Promise<string>;
|
|
68
78
|
updateUserStorageResource(options: GitpodServer.UpdateUserStorageResourceOptions): Promise<void>;
|
|
69
79
|
getEnvVars(): Promise<UserEnvVarValue[]>;
|
|
80
|
+
getAllEnvVars(): Promise<UserEnvVarValue[]>;
|
|
70
81
|
setEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
71
82
|
deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
|
|
83
|
+
getTeams(): Promise<Team[]>;
|
|
84
|
+
getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
|
|
85
|
+
createTeam(name: string): Promise<Team>;
|
|
86
|
+
joinTeam(inviteId: string): Promise<Team>;
|
|
87
|
+
setTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
|
|
88
|
+
removeTeamMember(teamId: string, userId: string): Promise<void>;
|
|
89
|
+
getGenericInvite(teamId: string): Promise<TeamMembershipInvite>;
|
|
90
|
+
resetGenericInvite(inviteId: string): Promise<TeamMembershipInvite>;
|
|
91
|
+
deleteTeam(teamId: string, userId: string): Promise<void>;
|
|
92
|
+
getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
|
|
93
|
+
createProject(params: CreateProjectParams): Promise<Project>;
|
|
94
|
+
deleteProject(projectId: string): Promise<void>;
|
|
95
|
+
getTeamProjects(teamId: string): Promise<Project[]>;
|
|
96
|
+
getUserProjects(): Promise<Project[]>;
|
|
97
|
+
getProjectOverview(projectId: string): Promise<Project.Overview | undefined>;
|
|
98
|
+
findPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
|
|
99
|
+
triggerPrebuild(projectId: string, branchName: string | null): Promise<StartPrebuildResult>;
|
|
100
|
+
cancelPrebuild(projectId: string, prebuildId: string): Promise<void>;
|
|
101
|
+
setProjectConfiguration(projectId: string, configString: string): Promise<void>;
|
|
102
|
+
fetchProjectRepositoryConfiguration(projectId: string): Promise<string | undefined>;
|
|
103
|
+
guessProjectConfiguration(projectId: string): Promise<string | undefined>;
|
|
104
|
+
getContentBlobUploadUrl(name: string): Promise<string>;
|
|
105
|
+
getContentBlobDownloadUrl(name: string): Promise<string>;
|
|
72
106
|
getGitpodTokens(): Promise<GitpodToken[]>;
|
|
73
|
-
generateNewGitpodToken(options:
|
|
74
|
-
name?: string;
|
|
75
|
-
type: GitpodTokenType;
|
|
76
|
-
scopes?: [];
|
|
77
|
-
}): Promise<string>;
|
|
107
|
+
generateNewGitpodToken(options: GitpodServer.GenerateNewGitpodTokenOptions): Promise<string>;
|
|
78
108
|
deleteGitpodToken(tokenHash: string): Promise<void>;
|
|
79
109
|
sendFeedback(feedback: string): Promise<string | undefined>;
|
|
80
110
|
registerGithubApp(installationId: string): Promise<void>;
|
|
81
111
|
/**
|
|
82
|
-
* Stores a new snapshot for the given workspace and bucketId
|
|
112
|
+
* Stores a new snapshot for the given workspace and bucketId. Returns _before_ the actual snapshot is done. To wait for that, use `waitForSnapshot`.
|
|
83
113
|
* @return the snapshot id
|
|
84
114
|
*/
|
|
85
115
|
takeSnapshot(options: GitpodServer.TakeSnapshotOptions): Promise<string>;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param snapshotId
|
|
119
|
+
*/
|
|
120
|
+
waitForSnapshot(snapshotId: string): Promise<void>;
|
|
86
121
|
/**
|
|
87
122
|
* Returns the list of snapshots that exist for a workspace.
|
|
88
123
|
*/
|
|
@@ -103,6 +138,85 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
103
138
|
resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
|
|
104
139
|
installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
|
|
105
140
|
uninstallUserPlugin(params: UninstallPluginParams): Promise<boolean>;
|
|
141
|
+
guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
|
|
142
|
+
/**
|
|
143
|
+
* gitpod.io concerns
|
|
144
|
+
*/
|
|
145
|
+
isStudent(): Promise<boolean>;
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
getAccountStatement(options: GitpodServer.GetAccountStatementOptions): Promise<AccountStatement | undefined>;
|
|
150
|
+
getRemainingUsageHours(): Promise<number>;
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
154
|
+
getChargebeeSiteId(): Promise<string>;
|
|
155
|
+
createPortalSession(): Promise<{}>;
|
|
156
|
+
checkout(planId: string, planQuantity?: number): Promise<{}>;
|
|
157
|
+
getAvailableCoupons(): Promise<PlanCoupon[]>;
|
|
158
|
+
getAppliedCoupons(): Promise<PlanCoupon[]>;
|
|
159
|
+
getShowPaymentUI(): Promise<boolean>;
|
|
160
|
+
isChargebeeCustomer(): Promise<boolean>;
|
|
161
|
+
subscriptionUpgradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
162
|
+
subscriptionDowngradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
|
|
163
|
+
subscriptionCancel(subscriptionId: string): Promise<void>;
|
|
164
|
+
subscriptionCancelDowngrade(subscriptionId: string): Promise<void>;
|
|
165
|
+
tsGet(): Promise<TeamSubscription[]>;
|
|
166
|
+
tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
|
|
167
|
+
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
|
|
168
|
+
tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
|
|
169
|
+
tsAssignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, identityStr: string | undefined): Promise<void>;
|
|
170
|
+
tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
|
|
171
|
+
tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
172
|
+
tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
|
|
173
|
+
getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
|
|
174
|
+
/**
|
|
175
|
+
* Analytics
|
|
176
|
+
*/
|
|
177
|
+
trackEvent(event: RemoteTrackMessage): Promise<void>;
|
|
178
|
+
trackLocation(event: RemotePageMessage): Promise<void>;
|
|
179
|
+
identifyUser(event: RemoteIdentifyMessage): Promise<void>;
|
|
180
|
+
}
|
|
181
|
+
export interface CreateProjectParams {
|
|
182
|
+
name: string;
|
|
183
|
+
slug?: string;
|
|
184
|
+
account: string;
|
|
185
|
+
provider: string;
|
|
186
|
+
cloneUrl: string;
|
|
187
|
+
teamId?: string;
|
|
188
|
+
userId?: string;
|
|
189
|
+
appInstallationId: string;
|
|
190
|
+
}
|
|
191
|
+
export interface FindPrebuildsParams {
|
|
192
|
+
projectId: string;
|
|
193
|
+
branch?: string;
|
|
194
|
+
latest?: boolean;
|
|
195
|
+
prebuildId?: string;
|
|
196
|
+
limit?: number;
|
|
197
|
+
}
|
|
198
|
+
export interface GetProviderRepositoriesParams {
|
|
199
|
+
provider: string;
|
|
200
|
+
hints?: {
|
|
201
|
+
installationId: string;
|
|
202
|
+
} | object;
|
|
203
|
+
}
|
|
204
|
+
export interface ProviderRepository {
|
|
205
|
+
name: string;
|
|
206
|
+
path?: string;
|
|
207
|
+
account: string;
|
|
208
|
+
accountAvatarUrl: string;
|
|
209
|
+
cloneUrl: string;
|
|
210
|
+
updatedAt: string;
|
|
211
|
+
installationId?: number;
|
|
212
|
+
installationUpdatedAt?: string;
|
|
213
|
+
inUse?: boolean;
|
|
214
|
+
}
|
|
215
|
+
export interface ClientHeaderFields {
|
|
216
|
+
ip?: string;
|
|
217
|
+
userAgent?: string;
|
|
218
|
+
dnt?: string;
|
|
219
|
+
clientRegion?: string;
|
|
106
220
|
}
|
|
107
221
|
export declare const WorkspaceTimeoutValues: readonly ["30m", "60m", "180m"];
|
|
108
222
|
export declare const createServiceMock: <C extends GitpodClient, S extends GitpodServer>(methods: Partial<JsonRpcProxy<S>>) => GitpodServiceImpl<C, S>;
|
|
@@ -125,6 +239,8 @@ export declare namespace GitpodServer {
|
|
|
125
239
|
limit?: number;
|
|
126
240
|
searchString?: string;
|
|
127
241
|
pinnedOnly?: boolean;
|
|
242
|
+
projectId?: string | string[];
|
|
243
|
+
includeWithoutProject?: boolean;
|
|
128
244
|
}
|
|
129
245
|
interface GetAccountStatementOptions {
|
|
130
246
|
date?: string;
|
|
@@ -132,17 +248,15 @@ export declare namespace GitpodServer {
|
|
|
132
248
|
interface CreateWorkspaceOptions {
|
|
133
249
|
contextUrl: string;
|
|
134
250
|
mode?: CreateWorkspaceMode;
|
|
251
|
+
forceDefaultConfig?: boolean;
|
|
252
|
+
}
|
|
253
|
+
interface StartWorkspaceOptions {
|
|
254
|
+
forceDefaultImage: boolean;
|
|
135
255
|
}
|
|
136
256
|
interface TakeSnapshotOptions {
|
|
137
257
|
workspaceId: string;
|
|
138
258
|
layoutData?: string;
|
|
139
|
-
|
|
140
|
-
interface GetUserMessagesOptions {
|
|
141
|
-
readonly releaseNotes?: boolean;
|
|
142
|
-
readonly workspaceInstanceId: string;
|
|
143
|
-
}
|
|
144
|
-
interface UpdateUserMessagesOptions {
|
|
145
|
-
readonly messageIds: string[];
|
|
259
|
+
dontWait?: boolean;
|
|
146
260
|
}
|
|
147
261
|
interface GetUserStorageResourceOptions {
|
|
148
262
|
readonly uri: string;
|
|
@@ -165,6 +279,13 @@ export declare namespace GitpodServer {
|
|
|
165
279
|
interface DeleteOwnAuthProviderParams {
|
|
166
280
|
readonly id: string;
|
|
167
281
|
}
|
|
282
|
+
type AdmissionLevel = "owner" | "everyone";
|
|
283
|
+
type PinAction = "pin" | "unpin" | "toggle";
|
|
284
|
+
interface GenerateNewGitpodTokenOptions {
|
|
285
|
+
name?: string;
|
|
286
|
+
type: GitpodTokenType;
|
|
287
|
+
scopes?: string[];
|
|
288
|
+
}
|
|
168
289
|
}
|
|
169
290
|
export declare const GitpodServerPath = "/gitpod";
|
|
170
291
|
export declare const GitpodServerProxy: unique symbol;
|
|
@@ -173,17 +294,48 @@ export declare class GitpodCompositeClient<Client extends GitpodClient> implemen
|
|
|
173
294
|
protected clients: Partial<Client>[];
|
|
174
295
|
registerClient(client: Partial<Client>): Disposable;
|
|
175
296
|
onInstanceUpdate(instance: WorkspaceInstance): void;
|
|
297
|
+
onPrebuildUpdate(update: PrebuildWithStatus): void;
|
|
176
298
|
onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void;
|
|
177
|
-
|
|
299
|
+
notifyDidOpenConnection(): void;
|
|
300
|
+
notifyDidCloseConnection(): void;
|
|
301
|
+
onCreditAlert(creditAlert: CreditAlert): void;
|
|
178
302
|
}
|
|
179
|
-
export declare const GitpodService: unique symbol;
|
|
180
303
|
export declare type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
|
|
304
|
+
export declare class WorkspaceInstanceUpdateListener {
|
|
305
|
+
private readonly service;
|
|
306
|
+
private _info;
|
|
307
|
+
private readonly onDidChangeEmitter;
|
|
308
|
+
readonly onDidChange: import("./util/event").Event<void>;
|
|
309
|
+
private source;
|
|
310
|
+
get info(): WorkspaceInfo;
|
|
311
|
+
constructor(service: GitpodService, _info: WorkspaceInfo);
|
|
312
|
+
private syncQueue;
|
|
313
|
+
private syncTokenSource;
|
|
314
|
+
/**
|
|
315
|
+
* Only one sync can be performed at the same time.
|
|
316
|
+
* Any new sync request or instance update cancels all previously scheduled sync requests.
|
|
317
|
+
*/
|
|
318
|
+
private sync;
|
|
319
|
+
private cancelSync;
|
|
320
|
+
/**
|
|
321
|
+
* If sync seen more recent update then ignore all updates with previous phases.
|
|
322
|
+
* Within the same phase still the race can occur but which should be eventually consistent.
|
|
323
|
+
*/
|
|
324
|
+
private isOutOfOrder;
|
|
325
|
+
}
|
|
326
|
+
export interface GitpodServiceOptions {
|
|
327
|
+
onReconnect?: () => (void | Promise<void>);
|
|
328
|
+
}
|
|
181
329
|
export declare class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
|
|
182
330
|
readonly server: JsonRpcProxy<Server>;
|
|
183
|
-
|
|
184
|
-
|
|
331
|
+
private options?;
|
|
332
|
+
private readonly compositeClient;
|
|
333
|
+
constructor(server: JsonRpcProxy<Server>, options?: GitpodServiceOptions | undefined);
|
|
185
334
|
registerClient(client: Partial<Client>): Disposable;
|
|
335
|
+
private readonly instanceListeners;
|
|
336
|
+
listenToInstance(workspaceId: string): Promise<WorkspaceInstanceUpdateListener>;
|
|
337
|
+
reconnect(): Promise<void>;
|
|
186
338
|
}
|
|
187
|
-
export declare function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string): GitpodServiceImpl<C, S>;
|
|
339
|
+
export declare function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>): GitpodServiceImpl<C, S>;
|
|
188
340
|
export {};
|
|
189
341
|
//# sourceMappingURL=gitpod-service.d.ts.map
|