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