@gitpod/gitpod-protocol 0.1.5-me-version.1 → 0.1.5-me-image.2
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 +23 -4
- package/lib/accounting-protocol.d.ts +3 -6
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +10 -16
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +19 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +2 -13
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +44 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/context-url.d.ts +31 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +102 -0
- package/lib/context-url.js.map +1 -0
- package/lib/{util/context-url.spec.d.ts → context-url.spec.d.ts} +4 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +94 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +1 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +4 -4
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.js +4 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.js +19 -20
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -36
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.js +29 -43
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.js +25 -30
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -2
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +20 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.js +25 -41
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +116 -116
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +108 -10
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +152 -295
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +8 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +4 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-protocol.d.ts +105 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +8 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/messaging/browser/connection.d.ts +3 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +172 -35
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.js +35 -55
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +3 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +6 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +23 -59
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +2 -0
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -159
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/permission.d.ts +7 -2
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +34 -15
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +1 -1
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +38 -57
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +72 -87
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +70 -115
- 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} +2 -3
- 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 +3 -3
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +15 -12
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +113 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +30 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/util/analytics.d.ts +1 -26
- package/lib/util/analytics.d.ts.map +1 -1
- package/lib/util/analytics.js +36 -28
- package/lib/util/analytics.js.map +1 -1
- package/lib/util/async-iterator.js +55 -133
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js +17 -59
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +8 -8
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.js +26 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.js +58 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -0
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +26 -46
- 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.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +30 -68
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +57 -78
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- 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 +1 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +93 -103
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +87 -135
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/{without.js → jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +49 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +107 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +2 -2
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +10 -0
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +31 -7
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +4 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +123 -84
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.js +16 -55
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.js +144 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.js +16 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.js +21 -24
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +51 -5
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +197 -62
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.js +2 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +15 -4
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +21 -4
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +24 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.js +1 -1
- package/package.json +24 -13
- package/pkg-yarn.lock +14 -7
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +4 -10
- package/src/admin-protocol.ts +25 -7
- package/src/analytics.ts +52 -0
- package/src/context-url.spec.ts +53 -0
- package/src/context-url.ts +107 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +133 -22
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +1 -1
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +5 -0
- package/src/installation-admin-protocol.ts +42 -0
- package/src/messaging/browser/connection.ts +176 -10
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +8 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/messaging/proxy-factory.ts +13 -5
- package/src/oss-allowlist.ts +15 -0
- package/src/permission.ts +22 -4
- package/src/protocol.ts +105 -99
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +6 -4
- package/src/teams-projects-protocol.ts +147 -0
- package/src/util/analytics.ts +17 -30
- package/src/util/garbage-collected-cache.ts +7 -1
- package/src/util/generate-workspace-id.spec.ts +17 -0
- package/src/util/generate-workspace-id.ts +21 -2
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.ts +11 -11
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +102 -38
- package/src/util/parse-workspace-id.spec.ts +21 -1
- package/src/util/parse-workspace-id.ts +32 -6
- package/src/util/repeat.ts +45 -0
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +183 -17
- package/src/workspace-cluster.ts +19 -5
- package/src/workspace-instance.ts +38 -6
- package/src/wsready.ts +1 -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 -46
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/util/context-url.d.ts +0 -13
- package/lib/util/context-url.d.ts.map +0 -1
- package/lib/util/context-url.js +0 -26
- package/lib/util/context-url.js.map +0 -1
- package/lib/util/context-url.spec.d.ts.map +0 -1
- package/lib/util/context-url.spec.js +0 -52
- package/lib/util/context-url.spec.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -118
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -34
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.GitpodHostUrl = void 0;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const URL = require('url').URL || window.URL;
|
|
10
|
+
const logging_1 = require("./logging");
|
|
11
|
+
const baseWorkspaceIDRegex = "(([a-f][0-9a-f]{7}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|([0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}))";
|
|
12
12
|
// this pattern matches v4 UUIDs as well as the new generated workspace ids (e.g. pink-panda-ns35kd21)
|
|
13
|
-
|
|
13
|
+
const workspaceIDRegex = RegExp(`^${baseWorkspaceIDRegex}$`);
|
|
14
14
|
// this pattern matches URL prefixes of workspaces
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const workspaceUrlPrefixRegex = RegExp(`^([0-9]{4,6}-)?${baseWorkspaceIDRegex}\\.`);
|
|
16
|
+
class GitpodHostUrl {
|
|
17
|
+
constructor(urlParam) {
|
|
18
18
|
if (urlParam === undefined || typeof urlParam === 'string') {
|
|
19
19
|
this.url = new URL(urlParam || 'https://gitpod.io');
|
|
20
20
|
this.url.search = '';
|
|
@@ -25,125 +25,115 @@ var GitpodHostUrl = /** @class */ (function () {
|
|
|
25
25
|
this.url = urlParam;
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
logging_1.log.error('Unexpected urlParam', { urlParam
|
|
28
|
+
logging_1.log.error('Unexpected urlParam', { urlParam });
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
static fromWorkspaceUrl(url) {
|
|
32
32
|
return new GitpodHostUrl(new URL(url));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return this.withDomainPrefix(workspaceId
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return this.with(
|
|
33
|
+
}
|
|
34
|
+
withWorkspacePrefix(workspaceId, region) {
|
|
35
|
+
return this.withDomainPrefix(`${workspaceId}.ws-${region}.`);
|
|
36
|
+
}
|
|
37
|
+
withDomainPrefix(prefix) {
|
|
38
|
+
return this.with(url => ({ host: prefix + url.host }));
|
|
39
39
|
;
|
|
40
|
-
}
|
|
41
|
-
|
|
40
|
+
}
|
|
41
|
+
withoutWorkspacePrefix() {
|
|
42
42
|
if (!this.url.host.match(workspaceUrlPrefixRegex)) {
|
|
43
43
|
// URL has no workspace prefix
|
|
44
44
|
return this;
|
|
45
45
|
}
|
|
46
46
|
return this.withoutDomainPrefix(2);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return this.with(
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
}
|
|
48
|
+
withoutDomainPrefix(removeSegmentsCount) {
|
|
49
|
+
return this.with(url => ({ host: url.host.split('.').splice(removeSegmentsCount).join('.') }));
|
|
50
|
+
}
|
|
51
|
+
with(urlUpdate) {
|
|
52
|
+
const update = typeof urlUpdate === 'function' ? urlUpdate(this.url) : urlUpdate;
|
|
53
|
+
const addSlashToPath = update.pathname && update.pathname.length > 0 && !update.pathname.startsWith('/');
|
|
54
54
|
if (addSlashToPath) {
|
|
55
55
|
update.pathname = '/' + update.pathname;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
const result = Object.assign(new URL(this.toString()), update);
|
|
58
58
|
return new GitpodHostUrl(result);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return updated.with(
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return this.with(
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return this.with(
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return this.with(
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return this.with(
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return this.with(
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return this.with(
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return this.with(
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return this.with(
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (workspaceId === void 0) { workspaceId = this.workspaceId; }
|
|
59
|
+
}
|
|
60
|
+
withApi(urlUpdate) {
|
|
61
|
+
const updated = urlUpdate ? this.with(urlUpdate) : this;
|
|
62
|
+
return updated.with(url => ({ pathname: `/api${url.pathname}` }));
|
|
63
|
+
}
|
|
64
|
+
withContext(contextUrl) {
|
|
65
|
+
return this.with(url => ({ hash: contextUrl }));
|
|
66
|
+
}
|
|
67
|
+
asWebsocket() {
|
|
68
|
+
return this.with(url => ({ protocol: url.protocol === 'https:' ? 'wss:' : 'ws:' }));
|
|
69
|
+
}
|
|
70
|
+
asDashboard() {
|
|
71
|
+
return this.with(url => ({ pathname: '/' }));
|
|
72
|
+
}
|
|
73
|
+
asLogin() {
|
|
74
|
+
return this.with(url => ({ pathname: '/login' }));
|
|
75
|
+
}
|
|
76
|
+
asUpgradeSubscription() {
|
|
77
|
+
return this.with(url => ({ pathname: '/plans' }));
|
|
78
|
+
}
|
|
79
|
+
asAccessControl() {
|
|
80
|
+
return this.with(url => ({ pathname: '/integrations' }));
|
|
81
|
+
}
|
|
82
|
+
asSettings() {
|
|
83
|
+
return this.with(url => ({ pathname: '/settings' }));
|
|
84
|
+
}
|
|
85
|
+
asPreferences() {
|
|
86
|
+
return this.with(url => ({ pathname: '/preferences' }));
|
|
87
|
+
}
|
|
88
|
+
asStart(workspaceId = this.workspaceId) {
|
|
90
89
|
return this.withoutWorkspacePrefix().with({
|
|
91
90
|
pathname: '/start/',
|
|
92
91
|
hash: '#' + workspaceId
|
|
93
92
|
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return this.with(
|
|
97
|
-
}
|
|
98
|
-
|
|
93
|
+
}
|
|
94
|
+
asWorkspaceAuth(instanceID, redirect) {
|
|
95
|
+
return this.with(url => ({ pathname: `/api/auth/workspace-cookie/${instanceID}`, search: redirect ? "redirect" : "" }));
|
|
96
|
+
}
|
|
97
|
+
toString() {
|
|
99
98
|
return this.url.toString();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
}
|
|
100
|
+
toStringWoRootSlash() {
|
|
101
|
+
let result = this.toString();
|
|
103
102
|
if (result.endsWith('/')) {
|
|
104
103
|
result = result.slice(0, result.length - 1);
|
|
105
104
|
}
|
|
106
105
|
return result;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return matchResults[0];
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
var pathSegs = this.url.pathname.split("/");
|
|
120
|
-
if (pathSegs.length > 3 && pathSegs[1] === "workspace") {
|
|
121
|
-
return pathSegs[2];
|
|
122
|
-
}
|
|
123
|
-
return undefined;
|
|
124
|
-
},
|
|
125
|
-
enumerable: false,
|
|
126
|
-
configurable: true
|
|
127
|
-
});
|
|
128
|
-
Object.defineProperty(GitpodHostUrl.prototype, "blobServe", {
|
|
129
|
-
get: function () {
|
|
130
|
-
var hostSegments = this.url.host.split(".");
|
|
131
|
-
if (hostSegments[0] === 'blobserve') {
|
|
132
|
-
return true;
|
|
106
|
+
}
|
|
107
|
+
get workspaceId() {
|
|
108
|
+
const hostSegs = this.url.host.split(".");
|
|
109
|
+
if (hostSegs.length > 1) {
|
|
110
|
+
const matchResults = hostSegs[0].match(workspaceIDRegex);
|
|
111
|
+
if (matchResults) {
|
|
112
|
+
// URL has a workspace prefix
|
|
113
|
+
// port prefixes are excluded
|
|
114
|
+
return matchResults[0];
|
|
133
115
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
116
|
+
}
|
|
117
|
+
const pathSegs = this.url.pathname.split("/");
|
|
118
|
+
if (pathSegs.length > 3 && pathSegs[1] === "workspace") {
|
|
119
|
+
return pathSegs[2];
|
|
120
|
+
}
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
get blobServe() {
|
|
124
|
+
const hostSegments = this.url.host.split(".");
|
|
125
|
+
if (hostSegments[0] === 'blobserve') {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
const pathSegments = this.url.pathname.split("/");
|
|
129
|
+
return pathSegments[0] === "blobserve";
|
|
130
|
+
}
|
|
131
|
+
asSorry(message) {
|
|
141
132
|
return this.with({ pathname: '/sorry', hash: message });
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return this.withApi(
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
}());
|
|
133
|
+
}
|
|
134
|
+
asApiLogout() {
|
|
135
|
+
return this.withApi(url => ({ pathname: '/logout/' }));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
148
138
|
exports.GitpodHostUrl = GitpodHostUrl;
|
|
149
139
|
//# sourceMappingURL=gitpod-host-url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-host-url.js","sourceRoot":"","sources":["../../src/util/gitpod-host-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"gitpod-host-url.js","sourceRoot":"","sources":["../../src/util/gitpod-host-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC;AAC7C,uCAAgC;AAOhC,MAAM,oBAAoB,GAAG,sHAAsH,CAAC;AAEpJ,sGAAsG;AACtG,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,oBAAoB,GAAG,CAAC,CAAC;AAE7D,kDAAkD;AAClD,MAAM,uBAAuB,GAAG,MAAM,CAAC,kBAAkB,oBAAoB,KAAK,CAAC,CAAC;AAEpF,MAAa,aAAa;IAGtB,YAAY,QAAuB;QAC/B,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YACxD,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,IAAI,mBAAmB,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;SAC1B;aAAM,IAAI,QAAQ,YAAY,GAAG,EAAE;YAChC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;SACvB;aAAM;YACH,aAAG,CAAC,KAAK,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;SAClD;IACL,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,GAAW;QAC/B,OAAO,IAAI,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IA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,CAAC;CAEJ;AApJD,sCAoJC"}
|
|
@@ -22,151 +22,103 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
26
|
exports.GitpodHostUrlTest = void 0;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
GitpodHostUrlTest.prototype.parseWorkspaceId_pathBased = function () {
|
|
62
|
-
var actual = gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("http://35.223.201.195/workspace/bc77e03d-c781-4235-bca0-e24087f5e472/").workspaceId;
|
|
27
|
+
const chai = require("chai");
|
|
28
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
29
|
+
const gitpod_host_url_1 = require("./gitpod-host-url");
|
|
30
|
+
const expect = chai.expect;
|
|
31
|
+
let GitpodHostUrlTest = class GitpodHostUrlTest {
|
|
32
|
+
parseWorkspaceId_pathBased() {
|
|
33
|
+
const actual = gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("http://35.223.201.195/workspace/bc77e03d-c781-4235-bca0-e24087f5e472/").workspaceId;
|
|
63
34
|
expect(actual).to.equal("bc77e03d-c781-4235-bca0-e24087f5e472");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
35
|
+
}
|
|
36
|
+
parseWorkspaceId_hosts_withEnvVarsInjected() {
|
|
37
|
+
const actual = gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-grasshopper-nfbitfia.ws-eu02.gitpod-staging.com/#passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo").workspaceId;
|
|
67
38
|
expect(actual).to.equal("gray-grasshopper-nfbitfia");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
-
|
|
72
|
-
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://3000-moccasin-ferret-155799b3.ws-eu02.gitpod-staging.com/").withoutWorkspacePrefix().toString()).to.equal("https://gitpod-staging.com/");
|
|
73
|
-
return [2 /*return*/];
|
|
74
|
-
});
|
|
39
|
+
}
|
|
40
|
+
testWithoutWorkspacePrefix() {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://3000-moccasin-ferret-155799b3.ws-eu02.gitpod-staging.com/").withoutWorkspacePrefix().toString()).to.equal("https://gitpod-staging.com/");
|
|
75
43
|
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
-
|
|
80
|
-
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gitpod-staging.com/").withoutWorkspacePrefix().toString()).to.equal("https://gitpod-staging.com/");
|
|
81
|
-
return [2 /*return*/];
|
|
82
|
-
});
|
|
44
|
+
}
|
|
45
|
+
testWithoutWorkspacePrefix2() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gitpod-staging.com/").withoutWorkspacePrefix().toString()).to.equal("https://gitpod-staging.com/");
|
|
83
48
|
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
|
|
88
|
-
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-rook-5523v5d8.ws-dev.my-branch-1234.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://my-branch-1234.staging.gitpod-dev.com/");
|
|
89
|
-
return [2 /*return*/];
|
|
90
|
-
});
|
|
49
|
+
}
|
|
50
|
+
testWithoutWorkspacePrefix3() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-rook-5523v5d8.ws-dev.my-branch-1234.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://my-branch-1234.staging.gitpod-dev.com/");
|
|
91
53
|
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
-
|
|
96
|
-
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://my-branch-1234.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://my-branch-1234.staging.gitpod-dev.com/");
|
|
97
|
-
return [2 /*return*/];
|
|
98
|
-
});
|
|
54
|
+
}
|
|
55
|
+
testWithoutWorkspacePrefix4() {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://my-branch-1234.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://my-branch-1234.staging.gitpod-dev.com/");
|
|
99
58
|
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
-
|
|
104
|
-
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://abc-nice-brunch-4224.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://abc-nice-brunch-4224.staging.gitpod-dev.com/");
|
|
105
|
-
return [2 /*return*/];
|
|
106
|
-
});
|
|
59
|
+
}
|
|
60
|
+
testWithoutWorkspacePrefix5() {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://abc-nice-brunch-4224.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://abc-nice-brunch-4224.staging.gitpod-dev.com/");
|
|
107
63
|
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
111
|
-
|
|
112
|
-
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-rook-5523v5d8.ws-dev.abc-nice-brunch-4224.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://abc-nice-brunch-4224.staging.gitpod-dev.com/");
|
|
113
|
-
return [2 /*return*/];
|
|
114
|
-
});
|
|
64
|
+
}
|
|
65
|
+
testWithoutWorkspacePrefix6() {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-rook-5523v5d8.ws-dev.abc-nice-brunch-4224.staging.gitpod-dev.com/").withoutWorkspacePrefix().toString()).to.equal("https://abc-nice-brunch-4224.staging.gitpod-dev.com/");
|
|
115
68
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
}());
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
__decorate([
|
|
72
|
+
mocha_typescript_1.test,
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", []),
|
|
75
|
+
__metadata("design:returntype", void 0)
|
|
76
|
+
], GitpodHostUrlTest.prototype, "parseWorkspaceId_pathBased", null);
|
|
77
|
+
__decorate([
|
|
78
|
+
mocha_typescript_1.test,
|
|
79
|
+
__metadata("design:type", Function),
|
|
80
|
+
__metadata("design:paramtypes", []),
|
|
81
|
+
__metadata("design:returntype", void 0)
|
|
82
|
+
], GitpodHostUrlTest.prototype, "parseWorkspaceId_hosts_withEnvVarsInjected", null);
|
|
83
|
+
__decorate([
|
|
84
|
+
mocha_typescript_1.test,
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", []),
|
|
87
|
+
__metadata("design:returntype", Promise)
|
|
88
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
mocha_typescript_1.test,
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", []),
|
|
93
|
+
__metadata("design:returntype", Promise)
|
|
94
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix2", null);
|
|
95
|
+
__decorate([
|
|
96
|
+
mocha_typescript_1.test,
|
|
97
|
+
__metadata("design:type", Function),
|
|
98
|
+
__metadata("design:paramtypes", []),
|
|
99
|
+
__metadata("design:returntype", Promise)
|
|
100
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix3", null);
|
|
101
|
+
__decorate([
|
|
102
|
+
mocha_typescript_1.test,
|
|
103
|
+
__metadata("design:type", Function),
|
|
104
|
+
__metadata("design:paramtypes", []),
|
|
105
|
+
__metadata("design:returntype", Promise)
|
|
106
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix4", null);
|
|
107
|
+
__decorate([
|
|
108
|
+
mocha_typescript_1.test,
|
|
109
|
+
__metadata("design:type", Function),
|
|
110
|
+
__metadata("design:paramtypes", []),
|
|
111
|
+
__metadata("design:returntype", Promise)
|
|
112
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix5", null);
|
|
113
|
+
__decorate([
|
|
114
|
+
mocha_typescript_1.test,
|
|
115
|
+
__metadata("design:type", Function),
|
|
116
|
+
__metadata("design:paramtypes", []),
|
|
117
|
+
__metadata("design:returntype", Promise)
|
|
118
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix6", null);
|
|
119
|
+
GitpodHostUrlTest = __decorate([
|
|
120
|
+
mocha_typescript_1.suite
|
|
121
|
+
], GitpodHostUrlTest);
|
|
170
122
|
exports.GitpodHostUrlTest = GitpodHostUrlTest;
|
|
171
123
|
module.exports = new GitpodHostUrlTest();
|
|
172
124
|
//# sourceMappingURL=gitpod-host-url.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-host-url.spec.js","sourceRoot":"","sources":["../../src/util/gitpod-host-url.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"gitpod-host-url.spec.js","sourceRoot":"","sources":["../../src/util/gitpod-host-url.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;AAEH,6BAA6B;AAC7B,uDAA+C;AAC/C,uDAAkD;AAClD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAEb,0BAA0B;QACnC,MAAM,MAAM,GAAG,+BAAa,CAAC,gBAAgB,CAAC,uEAAuE,CAAC,CAAC,WAAW,CAAC;QACnI,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACpE,CAAC;IAEY,0CAA0C;QACnD,MAAM,MAAM,GAAG,+BAAa,CAAC,gBAAgB,CAAC,mIAAmI,CAAC,CAAC,WAAW,CAAC;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;QAClO,CAAC;KAAA;CACJ,CAAA;AAjCS;IAAL,uBAAI;;;;mEAGJ;AAEK;IAAL,uBAAI;;;;mFAGJ;AAEK;IAAL,uBAAI;;;;mEAEJ;AAEK;IAAL,uBAAI;;;;oEAEJ;AAEK;IAAL,uBAAI;;;;oEAEJ;AAEK;IAAL,uBAAI;;;;oEAEJ;AAEK;IAAL,uBAAI;;;;oEAEJ;AAEK;IAAL,uBAAI;;;;oEAEJ;AAlCQ,iBAAiB;IAD7B,wBAAK;GACO,iBAAiB,CAmC7B;AAnCY,8CAAiB;AAoC9B,MAAM,CAAC,OAAO,GAAG,IAAI,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
export declare const defaultGRPCOptions: {
|
|
7
|
+
"grpc.keepalive_timeout_ms": number;
|
|
8
|
+
"grpc.keepalive_time_ms": number;
|
|
9
|
+
"grpc.http2.min_time_between_pings_ms": number;
|
|
10
|
+
"grpc.keepalive_permit_without_calls": number;
|
|
11
|
+
"grpc-node.max_session_memory": number;
|
|
12
|
+
"grpc.max_reconnect_backoff_ms": number;
|
|
13
|
+
"grpc.max_receive_message_length": number;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=grpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc.d.ts","sourceRoot":"","sources":["../../src/util/grpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;CAQ/B,CAAC"}
|
package/lib/util/grpc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
4
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
+
* See License-AGPL.txt in the project root for license information.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.defaultGRPCOptions = void 0;
|
|
9
|
+
exports.defaultGRPCOptions = {
|
|
10
|
+
"grpc.keepalive_timeout_ms": 10000,
|
|
11
|
+
"grpc.keepalive_time_ms": 60000,
|
|
12
|
+
"grpc.http2.min_time_between_pings_ms": 10000,
|
|
13
|
+
"grpc.keepalive_permit_without_calls": 1,
|
|
14
|
+
"grpc-node.max_session_memory": 50,
|
|
15
|
+
"grpc.max_reconnect_backoff_ms": 5000,
|
|
16
|
+
"grpc.max_receive_message_length": 1024 * 1024 * 16,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=grpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc.js","sourceRoot":"","sources":["../../src/util/grpc.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEW,QAAA,kBAAkB,GAAG;IAC/B,2BAA2B,EAAE,KAAK;IAClC,wBAAwB,EAAE,KAAK;IAC/B,sCAAsC,EAAE,KAAK;IAC7C,qCAAqC,EAAE,CAAC;IACxC,8BAA8B,EAAE,EAAE;IAClC,+BAA+B,EAAE,IAAI;IACrC,iCAAiC,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE;CACtD,CAAC"}
|