@gitpod/gitpod-protocol 0.1.5-server-vscode-ouath2.17 → 0.1.5-server-vscode-oauth2.14
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 +49 -4
- package/lib/accounting-protocol.d.ts +10 -11
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +31 -41
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +20 -2
- 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 +12 -1
- package/lib/analytics.d.ts.map +1 -1
- package/lib/analytics.js.map +1 -1
- package/lib/auth.d.ts.map +1 -1
- package/lib/context-url.d.ts +18 -5
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +63 -10
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +2 -0
- package/lib/context-url.spec.d.ts.map +1 -1
- package/lib/context-url.spec.js +81 -48
- package/lib/context-url.spec.js.map +1 -1
- package/lib/email-protocol.d.ts +1 -1
- 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.d.ts.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.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +25 -26
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -37
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +30 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +31 -38
- 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 +17 -19
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +26 -42
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +145 -142
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +67 -31
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +162 -309
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +1 -0
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +2 -1
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +1 -1
- package/lib/ide-protocol.d.ts +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 +16 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -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/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js.map +1 -1
- 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 +173 -36
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +4 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +42 -59
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +2 -2
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +37 -38
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +2 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +4 -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/handler.js +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 +24 -60
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +3 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -163
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/payment-protocol.d.ts.map +1 -1
- package/lib/payment-protocol.js +1 -1
- package/lib/payment-protocol.js.map +1 -1
- package/lib/permission.d.ts +9 -4
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +39 -31
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +4 -4
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +225 -209
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +83 -78
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +131 -190
- 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/theia-plugins.ts → lib/snapshot-url.spec.d.ts} +2 -6
- 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 +5 -3
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +17 -17
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +16 -3
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +11 -15
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +2 -2
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/util/analytics.d.ts.map +1 -1
- package/lib/util/analytics.js +44 -26
- package/lib/util/analytics.js.map +1 -1
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +57 -135
- 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 +11 -11
- 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.d.ts.map +1 -1
- package/lib/util/disposable.js +27 -40
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +63 -77
- 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 +27 -47
- 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 +460 -499
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +61 -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 +41 -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 +106 -114
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +97 -135
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +3 -3
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +33 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +87 -129
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +5 -5
- 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 +30 -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 +147 -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.d.ts.map +1 -1
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +16 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts.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 +52 -6
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +199 -64
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.d.ts +7 -7
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +9 -12
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +15 -3
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +19 -4
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +25 -4
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +22 -13
- package/pkg-yarn.lock +12 -7
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +53 -53
- package/src/admin-protocol.ts +43 -20
- package/src/analytics.ts +28 -15
- package/src/auth.ts +2 -2
- package/src/context-url.spec.ts +37 -9
- package/src/context-url.ts +94 -36
- package/src/email-protocol.ts +5 -6
- package/src/encryption/container-module.ts +2 -3
- package/src/encryption/encryption-engine.spec.ts +9 -8
- package/src/encryption/encryption-engine.ts +14 -14
- package/src/encryption/encryption-service.ts +4 -5
- package/src/encryption/key-provider.ts +16 -19
- package/src/env.ts +9 -10
- package/src/gitpod-file-parser.spec.ts +55 -61
- package/src/gitpod-file-parser.ts +16 -17
- package/src/gitpod-service.ts +174 -109
- package/src/headless-workspace-log.ts +6 -4
- package/src/ide-frontend-service.ts +2 -2
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +16 -13
- package/src/installation-admin-protocol.ts +42 -0
- package/src/license-protocol.ts +5 -6
- package/src/messaging/browser/connection.ts +185 -21
- package/src/messaging/browser/window-connection.ts +39 -29
- package/src/messaging/client-call-metrics.ts +70 -71
- package/src/messaging/error.ts +6 -5
- package/src/messaging/handler.ts +13 -1
- package/src/messaging/node/connection.ts +23 -70
- package/src/messaging/proxy-factory.ts +32 -33
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +2 -2
- package/src/permission.ts +40 -33
- package/src/plans.ts +236 -189
- package/src/protocol.ts +280 -277
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +33 -23
- package/src/teams-projects-protocol.ts +27 -9
- package/src/typings/globals.ts +4 -4
- package/src/util/analytics.ts +56 -18
- package/src/util/async-iterator.ts +4 -5
- package/src/util/cancelable.ts +3 -3
- package/src/util/date-time.ts +8 -8
- package/src/util/deferred.ts +6 -6
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +9 -6
- package/src/util/generate-workspace-id.spec.ts +26 -6
- package/src/util/generate-workspace-id.ts +458 -440
- package/src/util/gitpod-cookie.ts +38 -0
- package/src/util/gitpod-host-url.spec.ts +40 -13
- package/src/util/gitpod-host-url.ts +41 -38
- package/src/util/grpc.ts +4 -4
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +109 -86
- package/src/util/make-link.ts +6 -7
- package/src/util/parse-workspace-id.spec.ts +37 -8
- package/src/util/parse-workspace-id.ts +32 -7
- package/src/util/queue.spec.ts +27 -25
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +4 -6
- package/src/util/skip-if.ts +9 -6
- package/src/util/timeutil.spec.ts +14 -15
- package/src/util/timeutil.ts +15 -11
- package/src/util/tracing.spec.ts +88 -0
- package/src/util/tracing.ts +202 -31
- package/src/util/workspace-port-authentication.ts +10 -13
- package/src/workspace-cluster.ts +26 -8
- package/src/workspace-instance.ts +53 -23
- package/src/wsready.ts +3 -3
- package/data/builtin-theia-plugins.json +0 -372
- 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/theia-plugins.d.ts +0 -11
- package/lib/theia-plugins.d.ts.map +0 -1
- package/lib/theia-plugins.js.map +0 -1
- package/lib/util/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/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
package/lib/protocol.js
CHANGED
|
@@ -4,101 +4,51 @@
|
|
|
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
|
*/
|
|
7
|
-
var __assign = (this && this.__assign) || function () {
|
|
8
|
-
__assign = Object.assign || function(t) {
|
|
9
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
-
s = arguments[i];
|
|
11
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
-
t[p] = s[p];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
|
-
return __assign.apply(this, arguments);
|
|
17
|
-
};
|
|
18
|
-
var __values = (this && this.__values) || function(o) {
|
|
19
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
20
|
-
if (m) return m.call(o);
|
|
21
|
-
if (o && typeof o.length === "number") return {
|
|
22
|
-
next: function () {
|
|
23
|
-
if (o && i >= o.length) o = void 0;
|
|
24
|
-
return { value: o && o[i++], done: !o };
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
28
|
-
};
|
|
29
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
30
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
31
|
-
if (!m) return o;
|
|
32
|
-
var i = m.call(o), r, ar = [], e;
|
|
33
|
-
try {
|
|
34
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
35
|
-
}
|
|
36
|
-
catch (error) { e = { error: error }; }
|
|
37
|
-
finally {
|
|
38
|
-
try {
|
|
39
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
40
|
-
}
|
|
41
|
-
finally { if (e) throw e.error; }
|
|
42
|
-
}
|
|
43
|
-
return ar;
|
|
44
|
-
};
|
|
45
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.TheiaPlugin = exports.AuthProviderEntry = exports.WorkspaceCreationResult = exports.CreateWorkspaceMode = exports.WorkspaceInfo = exports.WorkspaceInstancePortsChangedEvent = exports.Repository = exports.NavigatorContext = exports.IssueContext = exports.PullRequestContext = exports.CommitContext = exports.AdditionalContentContext = exports.RefType = exports.WorkspaceProbeContext = exports.WithEnvvarsContext = exports.PrebuiltWorkspaceContext = exports.StartPrebuildContext = exports.SnapshotContext = exports.WithDefaultConfig = exports.WithPrebuild = exports.WithSnapshot = exports.WorkspaceContext = exports.ExternalImageConfigFile = exports.ImageConfigFile = exports.ImageConfigString = exports.WorkspaceImageBuild = exports.TaskConfig = exports.PortRangeConfig = exports.PortConfig = exports.PrebuiltWorkspace = exports.WorkspaceImageSourceReference = exports.WorkspaceImageSourceDocker = exports.GithubAppPrebuildConfig = exports.Workspace = exports.Identity = exports.GitpodTokenType = exports.UserEnvVar = exports.WorkspaceFeatureFlags = exports.User = void 0;
|
|
8
|
+
exports.TheiaPlugin = exports.AuthProviderEntry = exports.AuthProviderInfo = exports.WorkspaceCreationResult = exports.CreateWorkspaceMode = exports.WorkspaceInfo = exports.WorkspaceInstancePortsChangedEvent = exports.Repository = exports.NavigatorContext = exports.IssueContext = exports.PullRequestContext = exports.CommitContext = exports.AdditionalContentContext = exports.RefType = exports.WorkspaceProbeContext = exports.WithEnvvarsContext = exports.WithReferrerContext = exports.PrebuiltWorkspaceContext = exports.StartPrebuildContext = exports.SnapshotContext = exports.WithDefaultConfig = exports.WithPrebuild = exports.WithSnapshot = exports.WorkspaceContext = exports.ExternalImageConfigFile = exports.ImageConfigFile = exports.ImageConfigString = exports.WorkspaceImageBuild = exports.TaskConfig = exports.PortRangeConfig = exports.PortConfig = exports.PrebuiltWorkspace = exports.WorkspaceImageSourceReference = exports.WorkspaceImageSourceDocker = exports.GithubAppPrebuildConfig = exports.Workspace = exports.Identity = exports.GitpodTokenType = exports.UserEnvVar = exports.WorkspaceFeatureFlags = exports.User = void 0;
|
|
9
|
+
const crypto_1 = require("crypto");
|
|
47
10
|
var User;
|
|
48
11
|
(function (User) {
|
|
49
12
|
function is(data) {
|
|
50
|
-
return data
|
|
51
|
-
&& data.hasOwnProperty('id')
|
|
52
|
-
&& data.hasOwnProperty('identities');
|
|
13
|
+
return data && data.hasOwnProperty("id") && data.hasOwnProperty("identities");
|
|
53
14
|
}
|
|
54
15
|
User.is = is;
|
|
55
16
|
function getIdentity(user, authProviderId) {
|
|
56
|
-
return user.identities.find(
|
|
17
|
+
return user.identities.find((id) => id.authProviderId === authProviderId);
|
|
57
18
|
}
|
|
58
19
|
User.getIdentity = getIdentity;
|
|
59
20
|
function censor(user) {
|
|
60
|
-
|
|
61
|
-
delete
|
|
62
|
-
res.identities = res.identities.map(
|
|
63
|
-
delete
|
|
21
|
+
const res = Object.assign({}, user);
|
|
22
|
+
delete res.additionalData;
|
|
23
|
+
res.identities = res.identities.map((i) => {
|
|
24
|
+
delete i.tokens;
|
|
64
25
|
// The user field is not in the Identity shape, but actually exists on DBIdentity.
|
|
65
26
|
// Trying to push this object out via JSON RPC will fail because of the cyclic nature
|
|
66
27
|
// of this field.
|
|
67
|
-
delete
|
|
28
|
+
delete i.user;
|
|
68
29
|
return i;
|
|
69
30
|
});
|
|
70
31
|
return res;
|
|
71
32
|
}
|
|
72
33
|
User.censor = censor;
|
|
73
34
|
function getPrimaryEmail(user) {
|
|
74
|
-
|
|
35
|
+
const identities = user.identities.filter((i) => !!i.primaryEmail);
|
|
75
36
|
if (identities.length <= 0) {
|
|
76
|
-
throw new Error(
|
|
37
|
+
throw new Error(`No identity with primary email for user: ${user.id}!`);
|
|
77
38
|
}
|
|
78
39
|
return identities[0].primaryEmail;
|
|
79
40
|
}
|
|
80
41
|
User.getPrimaryEmail = getPrimaryEmail;
|
|
81
42
|
function getName(user) {
|
|
82
|
-
|
|
83
|
-
var name = user.fullName || user.name;
|
|
43
|
+
const name = user.fullName || user.name;
|
|
84
44
|
if (name) {
|
|
85
45
|
return name;
|
|
86
46
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (id.authName !== "") {
|
|
91
|
-
return id.authName;
|
|
92
|
-
}
|
|
47
|
+
for (const id of user.identities) {
|
|
48
|
+
if (id.authName !== "") {
|
|
49
|
+
return id.authName;
|
|
93
50
|
}
|
|
94
51
|
}
|
|
95
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
96
|
-
finally {
|
|
97
|
-
try {
|
|
98
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
99
|
-
}
|
|
100
|
-
finally { if (e_1) throw e_1.error; }
|
|
101
|
-
}
|
|
102
52
|
return undefined;
|
|
103
53
|
}
|
|
104
54
|
User.getName = getName;
|
|
@@ -107,13 +57,19 @@ var User;
|
|
|
107
57
|
* The values of this type MUST MATCH enum values in WorkspaceFeatureFlag from ws-manager/client/core_pb.d.ts
|
|
108
58
|
* If they don't we'll break things during workspace startup.
|
|
109
59
|
*/
|
|
110
|
-
exports.WorkspaceFeatureFlags = {
|
|
60
|
+
exports.WorkspaceFeatureFlags = {
|
|
61
|
+
full_workspace_backup: undefined,
|
|
62
|
+
fixed_resources: undefined,
|
|
63
|
+
persistent_volume_claim: undefined,
|
|
64
|
+
};
|
|
111
65
|
var UserEnvVar;
|
|
112
66
|
(function (UserEnvVar) {
|
|
67
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
113
68
|
function normalizeRepoPattern(pattern) {
|
|
114
69
|
return pattern.toLocaleLowerCase();
|
|
115
70
|
}
|
|
116
71
|
UserEnvVar.normalizeRepoPattern = normalizeRepoPattern;
|
|
72
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
117
73
|
function score(value) {
|
|
118
74
|
// We use a score to enforce precedence:
|
|
119
75
|
// value/value = 0
|
|
@@ -122,12 +78,12 @@ var UserEnvVar;
|
|
|
122
78
|
// */* = 3
|
|
123
79
|
// #/# = 4 (used for env vars passed through the URL)
|
|
124
80
|
// the lower the score, the higher the precedence.
|
|
125
|
-
|
|
126
|
-
|
|
81
|
+
const [ownerPattern, repoPattern] = splitRepositoryPattern(value.repositoryPattern);
|
|
82
|
+
let score = 0;
|
|
127
83
|
if (repoPattern == "*") {
|
|
128
84
|
score += 1;
|
|
129
85
|
}
|
|
130
|
-
if (ownerPattern ==
|
|
86
|
+
if (ownerPattern == "*") {
|
|
131
87
|
score += 2;
|
|
132
88
|
}
|
|
133
89
|
if (ownerPattern == "#" || repoPattern == "#") {
|
|
@@ -136,73 +92,54 @@ var UserEnvVar;
|
|
|
136
92
|
return score;
|
|
137
93
|
}
|
|
138
94
|
UserEnvVar.score = score;
|
|
95
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
139
96
|
function filter(vars, owner, repo) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (ownerPattern !== '*' && ownerPattern !== '#' && (!!owner && ownerPattern !== owner.toLocaleLowerCase())) {
|
|
97
|
+
let result = vars.filter((e) => {
|
|
98
|
+
const [ownerPattern, repoPattern] = splitRepositoryPattern(e.repositoryPattern);
|
|
99
|
+
if (ownerPattern !== "*" && ownerPattern !== "#" && !!owner && ownerPattern !== owner.toLocaleLowerCase()) {
|
|
144
100
|
return false;
|
|
145
101
|
}
|
|
146
|
-
if (repoPattern !==
|
|
102
|
+
if (repoPattern !== "*" && repoPattern !== "#" && !!repo && repoPattern !== repo.toLocaleLowerCase()) {
|
|
147
103
|
return false;
|
|
148
104
|
}
|
|
149
105
|
return true;
|
|
150
106
|
});
|
|
151
|
-
|
|
152
|
-
result.forEach(
|
|
153
|
-
|
|
107
|
+
const resmap = new Map();
|
|
108
|
+
result.forEach((e) => {
|
|
109
|
+
const l = resmap.get(e.name) || [];
|
|
154
110
|
l.push(e);
|
|
155
111
|
resmap.set(e.name, l);
|
|
156
112
|
});
|
|
157
113
|
result = [];
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// not sure how this can happen, but so be it
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
if (candidates.length == 1) {
|
|
167
|
-
result.push(candidates[0]);
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
var minscore = 10;
|
|
171
|
-
var bestCandidate = void 0;
|
|
172
|
-
try {
|
|
173
|
-
for (var candidates_1 = (e_3 = void 0, __values(candidates)), candidates_1_1 = candidates_1.next(); !candidates_1_1.done; candidates_1_1 = candidates_1.next()) {
|
|
174
|
-
var e = candidates_1_1.value;
|
|
175
|
-
var score_1 = UserEnvVar.score(e);
|
|
176
|
-
if (!bestCandidate || score_1 < minscore) {
|
|
177
|
-
minscore = score_1;
|
|
178
|
-
bestCandidate = e;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
183
|
-
finally {
|
|
184
|
-
try {
|
|
185
|
-
if (candidates_1_1 && !candidates_1_1.done && (_b = candidates_1.return)) _b.call(candidates_1);
|
|
186
|
-
}
|
|
187
|
-
finally { if (e_3) throw e_3.error; }
|
|
188
|
-
}
|
|
189
|
-
result.push(bestCandidate);
|
|
114
|
+
for (const name of resmap.keys()) {
|
|
115
|
+
const candidates = resmap.get(name);
|
|
116
|
+
if (!candidates) {
|
|
117
|
+
// not sure how this can happen, but so be it
|
|
118
|
+
continue;
|
|
190
119
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
try {
|
|
195
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
120
|
+
if (candidates.length == 1) {
|
|
121
|
+
result.push(candidates[0]);
|
|
122
|
+
continue;
|
|
196
123
|
}
|
|
197
|
-
|
|
124
|
+
let minscore = 10;
|
|
125
|
+
let bestCandidate;
|
|
126
|
+
for (const e of candidates) {
|
|
127
|
+
const score = UserEnvVar.score(e);
|
|
128
|
+
if (!bestCandidate || score < minscore) {
|
|
129
|
+
minscore = score;
|
|
130
|
+
bestCandidate = e;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
result.push(bestCandidate);
|
|
198
134
|
}
|
|
199
135
|
return result;
|
|
200
136
|
}
|
|
201
137
|
UserEnvVar.filter = filter;
|
|
138
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
202
139
|
function splitRepositoryPattern(repositoryPattern) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
140
|
+
const patterns = repositoryPattern.split("/");
|
|
141
|
+
const repoPattern = patterns.slice(1).join("/");
|
|
142
|
+
const ownerPattern = patterns[0];
|
|
206
143
|
return [ownerPattern, repoPattern];
|
|
207
144
|
}
|
|
208
145
|
UserEnvVar.splitRepositoryPattern = splitRepositoryPattern;
|
|
@@ -215,14 +152,11 @@ var GitpodTokenType;
|
|
|
215
152
|
var Identity;
|
|
216
153
|
(function (Identity) {
|
|
217
154
|
function is(data) {
|
|
218
|
-
return data.hasOwnProperty(
|
|
219
|
-
&& data.hasOwnProperty('authId')
|
|
220
|
-
&& data.hasOwnProperty('authName');
|
|
155
|
+
return (data.hasOwnProperty("authProviderId") && data.hasOwnProperty("authId") && data.hasOwnProperty("authName"));
|
|
221
156
|
}
|
|
222
157
|
Identity.is = is;
|
|
223
158
|
function equals(id1, id2) {
|
|
224
|
-
return id1.authProviderId === id2.authProviderId
|
|
225
|
-
&& id1.authId === id2.authId;
|
|
159
|
+
return id1.authProviderId === id2.authProviderId && id1.authId === id2.authId;
|
|
226
160
|
}
|
|
227
161
|
Identity.equals = equals;
|
|
228
162
|
})(Identity = exports.Identity || (exports.Identity = {}));
|
|
@@ -230,14 +164,14 @@ var Workspace;
|
|
|
230
164
|
(function (Workspace) {
|
|
231
165
|
function getFullRepositoryName(ws) {
|
|
232
166
|
if (CommitContext.is(ws.context)) {
|
|
233
|
-
return ws.context.repository.owner +
|
|
167
|
+
return ws.context.repository.owner + "/" + ws.context.repository.name;
|
|
234
168
|
}
|
|
235
169
|
return undefined;
|
|
236
170
|
}
|
|
237
171
|
Workspace.getFullRepositoryName = getFullRepositoryName;
|
|
238
172
|
function getFullRepositoryUrl(ws) {
|
|
239
173
|
if (CommitContext.is(ws.context)) {
|
|
240
|
-
return
|
|
174
|
+
return `https://${ws.context.repository.host}/${getFullRepositoryName(ws)}`;
|
|
241
175
|
}
|
|
242
176
|
return undefined;
|
|
243
177
|
}
|
|
@@ -274,29 +208,28 @@ var Workspace;
|
|
|
274
208
|
var GithubAppPrebuildConfig;
|
|
275
209
|
(function (GithubAppPrebuildConfig) {
|
|
276
210
|
function is(obj) {
|
|
277
|
-
return !(typeof obj ===
|
|
211
|
+
return !(typeof obj === "boolean");
|
|
278
212
|
}
|
|
279
213
|
GithubAppPrebuildConfig.is = is;
|
|
280
214
|
})(GithubAppPrebuildConfig = exports.GithubAppPrebuildConfig || (exports.GithubAppPrebuildConfig = {}));
|
|
281
215
|
var WorkspaceImageSourceDocker;
|
|
282
216
|
(function (WorkspaceImageSourceDocker) {
|
|
283
217
|
function is(obj) {
|
|
284
|
-
return
|
|
285
|
-
&& 'dockerFilePath' in obj;
|
|
218
|
+
return "dockerFileHash" in obj && "dockerFilePath" in obj;
|
|
286
219
|
}
|
|
287
220
|
WorkspaceImageSourceDocker.is = is;
|
|
288
221
|
})(WorkspaceImageSourceDocker = exports.WorkspaceImageSourceDocker || (exports.WorkspaceImageSourceDocker = {}));
|
|
289
222
|
var WorkspaceImageSourceReference;
|
|
290
223
|
(function (WorkspaceImageSourceReference) {
|
|
291
224
|
function is(obj) {
|
|
292
|
-
return
|
|
225
|
+
return "baseImageResolved" in obj;
|
|
293
226
|
}
|
|
294
227
|
WorkspaceImageSourceReference.is = is;
|
|
295
228
|
})(WorkspaceImageSourceReference = exports.WorkspaceImageSourceReference || (exports.WorkspaceImageSourceReference = {}));
|
|
296
229
|
var PrebuiltWorkspace;
|
|
297
230
|
(function (PrebuiltWorkspace) {
|
|
298
231
|
function isDone(pws) {
|
|
299
|
-
return pws.state === "available" || pws.state === "timeout" || pws.state ===
|
|
232
|
+
return pws.state === "available" || pws.state === "timeout" || pws.state === "aborted";
|
|
300
233
|
}
|
|
301
234
|
PrebuiltWorkspace.isDone = isDone;
|
|
302
235
|
function isAvailable(pws) {
|
|
@@ -311,142 +244,130 @@ var PrebuiltWorkspace;
|
|
|
311
244
|
var PortConfig;
|
|
312
245
|
(function (PortConfig) {
|
|
313
246
|
function is(config) {
|
|
314
|
-
return config &&
|
|
247
|
+
return config && "port" in config && typeof config.port === "number";
|
|
315
248
|
}
|
|
316
249
|
PortConfig.is = is;
|
|
317
250
|
})(PortConfig = exports.PortConfig || (exports.PortConfig = {}));
|
|
318
251
|
var PortRangeConfig;
|
|
319
252
|
(function (PortRangeConfig) {
|
|
320
253
|
function is(config) {
|
|
321
|
-
return config &&
|
|
254
|
+
return config && "port" in config && (typeof config.port === "string" || config.port instanceof String);
|
|
322
255
|
}
|
|
323
256
|
PortRangeConfig.is = is;
|
|
324
257
|
})(PortRangeConfig = exports.PortRangeConfig || (exports.PortRangeConfig = {}));
|
|
325
258
|
var TaskConfig;
|
|
326
259
|
(function (TaskConfig) {
|
|
327
260
|
function is(config) {
|
|
328
|
-
return config
|
|
329
|
-
&& ('command' in config || 'init' in config || 'before' in config);
|
|
261
|
+
return config && ("command" in config || "init" in config || "before" in config);
|
|
330
262
|
}
|
|
331
263
|
TaskConfig.is = is;
|
|
332
264
|
})(TaskConfig = exports.TaskConfig || (exports.TaskConfig = {}));
|
|
333
265
|
var WorkspaceImageBuild;
|
|
334
266
|
(function (WorkspaceImageBuild) {
|
|
335
|
-
|
|
267
|
+
let LogLine;
|
|
336
268
|
(function (LogLine) {
|
|
337
|
-
LogLine.DELIMITER =
|
|
269
|
+
LogLine.DELIMITER = "\r\n";
|
|
338
270
|
LogLine.DELIMITER_REGEX = /\r?\n/;
|
|
339
271
|
})(LogLine = WorkspaceImageBuild.LogLine || (WorkspaceImageBuild.LogLine = {}));
|
|
340
272
|
})(WorkspaceImageBuild = exports.WorkspaceImageBuild || (exports.WorkspaceImageBuild = {}));
|
|
341
273
|
var ImageConfigString;
|
|
342
274
|
(function (ImageConfigString) {
|
|
343
275
|
function is(config) {
|
|
344
|
-
return typeof config ===
|
|
276
|
+
return typeof config === "string";
|
|
345
277
|
}
|
|
346
278
|
ImageConfigString.is = is;
|
|
347
279
|
})(ImageConfigString = exports.ImageConfigString || (exports.ImageConfigString = {}));
|
|
348
280
|
var ImageConfigFile;
|
|
349
281
|
(function (ImageConfigFile) {
|
|
350
282
|
function is(config) {
|
|
351
|
-
return typeof config ===
|
|
352
|
-
&& 'file' in config;
|
|
283
|
+
return typeof config === "object" && "file" in config;
|
|
353
284
|
}
|
|
354
285
|
ImageConfigFile.is = is;
|
|
355
286
|
})(ImageConfigFile = exports.ImageConfigFile || (exports.ImageConfigFile = {}));
|
|
356
287
|
var ExternalImageConfigFile;
|
|
357
288
|
(function (ExternalImageConfigFile) {
|
|
358
289
|
function is(config) {
|
|
359
|
-
return typeof config ===
|
|
360
|
-
&& 'file' in config
|
|
361
|
-
&& 'externalSource' in config;
|
|
290
|
+
return typeof config === "object" && "file" in config && "externalSource" in config;
|
|
362
291
|
}
|
|
363
292
|
ExternalImageConfigFile.is = is;
|
|
364
293
|
})(ExternalImageConfigFile = exports.ExternalImageConfigFile || (exports.ExternalImageConfigFile = {}));
|
|
365
294
|
var WorkspaceContext;
|
|
366
295
|
(function (WorkspaceContext) {
|
|
367
296
|
function is(context) {
|
|
368
|
-
return context
|
|
369
|
-
&& 'title' in context;
|
|
297
|
+
return context && "title" in context;
|
|
370
298
|
}
|
|
371
299
|
WorkspaceContext.is = is;
|
|
372
300
|
})(WorkspaceContext = exports.WorkspaceContext || (exports.WorkspaceContext = {}));
|
|
373
301
|
var WithSnapshot;
|
|
374
302
|
(function (WithSnapshot) {
|
|
375
303
|
function is(context) {
|
|
376
|
-
return context
|
|
377
|
-
&& 'snapshotBucketId' in context;
|
|
304
|
+
return context && "snapshotBucketId" in context;
|
|
378
305
|
}
|
|
379
306
|
WithSnapshot.is = is;
|
|
380
307
|
})(WithSnapshot = exports.WithSnapshot || (exports.WithSnapshot = {}));
|
|
381
308
|
var WithPrebuild;
|
|
382
309
|
(function (WithPrebuild) {
|
|
383
310
|
function is(context) {
|
|
384
|
-
return context
|
|
385
|
-
&& 'snapshotBucketId' in context
|
|
386
|
-
&& 'prebuildWorkspaceId' in context
|
|
387
|
-
&& 'wasPrebuilt' in context;
|
|
311
|
+
return context && WithSnapshot.is(context) && "prebuildWorkspaceId" in context && "wasPrebuilt" in context;
|
|
388
312
|
}
|
|
389
313
|
WithPrebuild.is = is;
|
|
390
314
|
})(WithPrebuild = exports.WithPrebuild || (exports.WithPrebuild = {}));
|
|
391
315
|
var WithDefaultConfig;
|
|
392
316
|
(function (WithDefaultConfig) {
|
|
393
317
|
function is(context) {
|
|
394
|
-
return context
|
|
395
|
-
&& 'withDefaultConfig' in context
|
|
396
|
-
&& context.withDefaultConfig;
|
|
318
|
+
return context && "withDefaultConfig" in context && context.withDefaultConfig;
|
|
397
319
|
}
|
|
398
320
|
WithDefaultConfig.is = is;
|
|
399
321
|
function mark(ctx) {
|
|
400
|
-
return
|
|
322
|
+
return Object.assign(Object.assign({}, ctx), { withDefaultConfig: true });
|
|
401
323
|
}
|
|
402
324
|
WithDefaultConfig.mark = mark;
|
|
403
325
|
})(WithDefaultConfig = exports.WithDefaultConfig || (exports.WithDefaultConfig = {}));
|
|
404
326
|
var SnapshotContext;
|
|
405
327
|
(function (SnapshotContext) {
|
|
406
328
|
function is(context) {
|
|
407
|
-
return context
|
|
408
|
-
&& WithSnapshot.is(context)
|
|
409
|
-
&& 'snapshotId' in context;
|
|
329
|
+
return context && WithSnapshot.is(context) && "snapshotId" in context;
|
|
410
330
|
}
|
|
411
331
|
SnapshotContext.is = is;
|
|
412
332
|
})(SnapshotContext = exports.SnapshotContext || (exports.SnapshotContext = {}));
|
|
413
333
|
var StartPrebuildContext;
|
|
414
334
|
(function (StartPrebuildContext) {
|
|
415
335
|
function is(context) {
|
|
416
|
-
return context
|
|
417
|
-
&& 'actual' in context;
|
|
336
|
+
return context && "actual" in context;
|
|
418
337
|
}
|
|
419
338
|
StartPrebuildContext.is = is;
|
|
420
339
|
})(StartPrebuildContext = exports.StartPrebuildContext || (exports.StartPrebuildContext = {}));
|
|
421
340
|
var PrebuiltWorkspaceContext;
|
|
422
341
|
(function (PrebuiltWorkspaceContext) {
|
|
423
342
|
function is(context) {
|
|
424
|
-
return context
|
|
425
|
-
&& 'originalContext' in context
|
|
426
|
-
&& 'prebuiltWorkspace' in context;
|
|
343
|
+
return context && "originalContext" in context && "prebuiltWorkspace" in context;
|
|
427
344
|
}
|
|
428
345
|
PrebuiltWorkspaceContext.is = is;
|
|
429
346
|
})(PrebuiltWorkspaceContext = exports.PrebuiltWorkspaceContext || (exports.PrebuiltWorkspaceContext = {}));
|
|
347
|
+
var WithReferrerContext;
|
|
348
|
+
(function (WithReferrerContext) {
|
|
349
|
+
function is(context) {
|
|
350
|
+
return context && "referrer" in context;
|
|
351
|
+
}
|
|
352
|
+
WithReferrerContext.is = is;
|
|
353
|
+
})(WithReferrerContext = exports.WithReferrerContext || (exports.WithReferrerContext = {}));
|
|
430
354
|
var WithEnvvarsContext;
|
|
431
355
|
(function (WithEnvvarsContext) {
|
|
432
356
|
function is(context) {
|
|
433
|
-
return context
|
|
434
|
-
&& 'envvars' in context;
|
|
357
|
+
return context && "envvars" in context;
|
|
435
358
|
}
|
|
436
359
|
WithEnvvarsContext.is = is;
|
|
437
360
|
})(WithEnvvarsContext = exports.WithEnvvarsContext || (exports.WithEnvvarsContext = {}));
|
|
438
361
|
var WorkspaceProbeContext;
|
|
439
362
|
(function (WorkspaceProbeContext) {
|
|
440
363
|
function is(context) {
|
|
441
|
-
return context
|
|
442
|
-
&& 'responseURL' in context
|
|
443
|
-
&& 'responseToken' in context;
|
|
364
|
+
return context && "responseURL" in context && "responseToken" in context;
|
|
444
365
|
}
|
|
445
366
|
WorkspaceProbeContext.is = is;
|
|
446
367
|
})(WorkspaceProbeContext = exports.WorkspaceProbeContext || (exports.WorkspaceProbeContext = {}));
|
|
447
368
|
var RefType;
|
|
448
369
|
(function (RefType) {
|
|
449
|
-
RefType.getRefType =
|
|
370
|
+
RefType.getRefType = (commit) => {
|
|
450
371
|
if (!commit.ref) {
|
|
451
372
|
return "revision";
|
|
452
373
|
}
|
|
@@ -457,7 +378,7 @@ var RefType;
|
|
|
457
378
|
var AdditionalContentContext;
|
|
458
379
|
(function (AdditionalContentContext) {
|
|
459
380
|
function is(ctx) {
|
|
460
|
-
return
|
|
381
|
+
return "additionalFiles" in ctx;
|
|
461
382
|
}
|
|
462
383
|
AdditionalContentContext.is = is;
|
|
463
384
|
function hasDockerConfig(ctx, config) {
|
|
@@ -466,47 +387,59 @@ var AdditionalContentContext;
|
|
|
466
387
|
AdditionalContentContext.hasDockerConfig = hasDockerConfig;
|
|
467
388
|
})(AdditionalContentContext = exports.AdditionalContentContext || (exports.AdditionalContentContext = {}));
|
|
468
389
|
var CommitContext;
|
|
390
|
+
(function (CommitContext) {
|
|
391
|
+
/**
|
|
392
|
+
* Creates a hash for all the commits of the CommitContext and all sub-repo commit infos.
|
|
393
|
+
* The hash is max 255 chars long.
|
|
394
|
+
* @param commitContext
|
|
395
|
+
* @returns hash for commitcontext
|
|
396
|
+
*/
|
|
397
|
+
function computeHash(commitContext) {
|
|
398
|
+
// for single commits we use the revision to be backward compatible.
|
|
399
|
+
if (!commitContext.additionalRepositoryCheckoutInfo ||
|
|
400
|
+
commitContext.additionalRepositoryCheckoutInfo.length === 0) {
|
|
401
|
+
return commitContext.revision;
|
|
402
|
+
}
|
|
403
|
+
const hasher = (0, crypto_1.createHash)("sha256");
|
|
404
|
+
hasher.update(commitContext.revision);
|
|
405
|
+
for (const info of commitContext.additionalRepositoryCheckoutInfo) {
|
|
406
|
+
hasher.update(info.revision);
|
|
407
|
+
}
|
|
408
|
+
return hasher.digest("hex");
|
|
409
|
+
}
|
|
410
|
+
CommitContext.computeHash = computeHash;
|
|
411
|
+
})(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
|
|
469
412
|
(function (CommitContext) {
|
|
470
413
|
function is(commit) {
|
|
471
|
-
return WorkspaceContext.is(commit)
|
|
472
|
-
&& 'repository' in commit
|
|
473
|
-
&& 'revision' in commit;
|
|
414
|
+
return WorkspaceContext.is(commit) && "repository" in commit && "revision" in commit;
|
|
474
415
|
}
|
|
475
416
|
CommitContext.is = is;
|
|
476
417
|
})(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
|
|
477
418
|
var PullRequestContext;
|
|
478
419
|
(function (PullRequestContext) {
|
|
479
420
|
function is(ctx) {
|
|
480
|
-
return CommitContext.is(ctx)
|
|
481
|
-
&& 'nr' in ctx
|
|
482
|
-
&& 'ref' in ctx
|
|
483
|
-
&& 'base' in ctx;
|
|
421
|
+
return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "base" in ctx;
|
|
484
422
|
}
|
|
485
423
|
PullRequestContext.is = is;
|
|
486
424
|
})(PullRequestContext = exports.PullRequestContext || (exports.PullRequestContext = {}));
|
|
487
425
|
var IssueContext;
|
|
488
426
|
(function (IssueContext) {
|
|
489
427
|
function is(ctx) {
|
|
490
|
-
return CommitContext.is(ctx)
|
|
491
|
-
&& 'nr' in ctx
|
|
492
|
-
&& 'ref' in ctx
|
|
493
|
-
&& 'localBranch' in ctx;
|
|
428
|
+
return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "localBranch" in ctx;
|
|
494
429
|
}
|
|
495
430
|
IssueContext.is = is;
|
|
496
431
|
})(IssueContext = exports.IssueContext || (exports.IssueContext = {}));
|
|
497
432
|
var NavigatorContext;
|
|
498
433
|
(function (NavigatorContext) {
|
|
499
434
|
function is(ctx) {
|
|
500
|
-
return CommitContext.is(ctx)
|
|
501
|
-
&& 'path' in ctx
|
|
502
|
-
&& 'isFile' in ctx;
|
|
435
|
+
return CommitContext.is(ctx) && "path" in ctx && "isFile" in ctx;
|
|
503
436
|
}
|
|
504
437
|
NavigatorContext.is = is;
|
|
505
438
|
})(NavigatorContext = exports.NavigatorContext || (exports.NavigatorContext = {}));
|
|
506
439
|
var Repository;
|
|
507
440
|
(function (Repository) {
|
|
508
441
|
function fullRepoName(repo) {
|
|
509
|
-
return repo.host
|
|
442
|
+
return `${repo.host}/${repo.owner}/${repo.name}`;
|
|
510
443
|
}
|
|
511
444
|
Repository.fullRepoName = fullRepoName;
|
|
512
445
|
})(Repository = exports.Repository || (exports.Repository = {}));
|
|
@@ -539,23 +472,31 @@ var CreateWorkspaceMode;
|
|
|
539
472
|
var WorkspaceCreationResult;
|
|
540
473
|
(function (WorkspaceCreationResult) {
|
|
541
474
|
function is(data) {
|
|
542
|
-
return data &&
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
475
|
+
return (data &&
|
|
476
|
+
("createdWorkspaceId" in data ||
|
|
477
|
+
"existingWorkspaces" in data ||
|
|
478
|
+
"runningWorkspacePrebuild" in data ||
|
|
479
|
+
"runningPrebuildWorkspaceID" in data));
|
|
546
480
|
}
|
|
547
481
|
WorkspaceCreationResult.is = is;
|
|
548
482
|
})(WorkspaceCreationResult = exports.WorkspaceCreationResult || (exports.WorkspaceCreationResult = {}));
|
|
483
|
+
var AuthProviderInfo;
|
|
484
|
+
(function (AuthProviderInfo) {
|
|
485
|
+
function isGitHubEnterprise(info) {
|
|
486
|
+
return !!info && info.authProviderType === "GitHub" && info.host !== "github.com";
|
|
487
|
+
}
|
|
488
|
+
AuthProviderInfo.isGitHubEnterprise = isGitHubEnterprise;
|
|
489
|
+
})(AuthProviderInfo = exports.AuthProviderInfo || (exports.AuthProviderInfo = {}));
|
|
549
490
|
var AuthProviderEntry;
|
|
550
491
|
(function (AuthProviderEntry) {
|
|
551
492
|
function redact(entry) {
|
|
552
|
-
return
|
|
493
|
+
return Object.assign(Object.assign({}, entry), { oauth: Object.assign(Object.assign({}, entry.oauth), { clientSecret: "redacted" }) });
|
|
553
494
|
}
|
|
554
495
|
AuthProviderEntry.redact = redact;
|
|
555
496
|
})(AuthProviderEntry = exports.AuthProviderEntry || (exports.AuthProviderEntry = {}));
|
|
556
497
|
var TheiaPlugin;
|
|
557
498
|
(function (TheiaPlugin) {
|
|
558
|
-
|
|
499
|
+
let State;
|
|
559
500
|
(function (State) {
|
|
560
501
|
State["Uploading"] = "uploading";
|
|
561
502
|
State["Uploaded"] = "uploaded";
|