@gitpod/gitpod-protocol 0.1.5-upgrade-code.5 → 0.1.5-vn-implement-jetbrains-terminals.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/builtin-theia-plugins.json +9 -9
- package/data/gitpod-schema.json +25 -24
- package/lib/accounting-protocol.d.ts +155 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +109 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +31 -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 +45 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/auth.d.ts +25 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +16 -0
- package/lib/auth.js.map +1 -0
- package/lib/context-url.d.ts +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 +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 +5 -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 +162 -20
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +170 -256
- 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-frontend-service.d.ts +4 -0
- package/lib/ide-frontend-service.d.ts.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 +6 -0
- 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 +21 -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 +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +183 -33
- 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 +5 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +10 -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/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +5 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +18 -17
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +570 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +120 -58
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +116 -130
- 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 +73 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +63 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +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 +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +79 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.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 +4 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +487 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/{without.d.ts → generate-workspace-id.spec.d.ts} +2 -2
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +87 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -0
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +96 -98
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +8 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +104 -22
- 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 +13 -3
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +38 -8
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +8 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +127 -47
- 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 +28 -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 +3 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +71 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +16 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +26 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +33 -17
- package/pkg-yarn.lock +18 -9
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +53 -5
- package/src/analytics.ts +54 -0
- package/src/auth.ts +27 -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 +237 -38
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +5 -1
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +7 -1
- package/src/installation-admin-protocol.ts +35 -0
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +14 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +7 -6
- package/src/plans.ts +632 -0
- package/src/protocol.ts +194 -87
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +113 -0
- package/src/teams-projects-protocol.ts +147 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +9 -3
- package/src/util/generate-workspace-id.spec.ts +48 -0
- package/src/util/generate-workspace-id.ts +475 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +30 -1
- package/src/util/gitpod-host-url.ts +23 -13
- 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 +45 -4
- package/src/util/parse-workspace-id.ts +38 -7
- package/src/util/queue.spec.ts +1 -1
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +183 -17
- package/src/workspace-cluster.ts +91 -0
- package/src/workspace-instance.ts +51 -13
- package/src/wsready.ts +2 -2
- 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/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.map +0 -1
- package/lib/util/without.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/gitpod-service.js
CHANGED
|
@@ -13,204 +13,126 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
17
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
18
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
19
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
20
|
-
function step(op) {
|
|
21
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
22
|
-
while (_) try {
|
|
23
|
-
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;
|
|
24
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
25
|
-
switch (op[0]) {
|
|
26
|
-
case 0: case 1: t = op; break;
|
|
27
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
28
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
29
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
30
|
-
default:
|
|
31
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
32
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
33
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
34
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
35
|
-
if (t[2]) _.ops.pop();
|
|
36
|
-
_.trys.pop(); continue;
|
|
37
|
-
}
|
|
38
|
-
op = body.call(thisArg, _);
|
|
39
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
40
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var __values = (this && this.__values) || function(o) {
|
|
44
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
45
|
-
if (m) return m.call(o);
|
|
46
|
-
if (o && typeof o.length === "number") return {
|
|
47
|
-
next: function () {
|
|
48
|
-
if (o && i >= o.length) o = void 0;
|
|
49
|
-
return { value: o && o[i++], done: !o };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
53
|
-
};
|
|
54
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
17
|
exports.createGitpodService = exports.GitpodServiceImpl = exports.WorkspaceInstanceUpdateListener = exports.GitpodCompositeClient = exports.GitpodServerProxy = exports.GitpodServerPath = exports.createServerMock = exports.createServiceMock = exports.WorkspaceTimeoutValues = exports.GitpodServer = void 0;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
18
|
+
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
|
|
19
|
+
const gitpod_host_url_1 = require("./util/gitpod-host-url");
|
|
20
|
+
const connection_1 = require("./messaging/browser/connection");
|
|
21
|
+
const event_1 = require("./util/event");
|
|
60
22
|
exports.GitpodServer = Symbol('GitpodServer');
|
|
61
23
|
exports.WorkspaceTimeoutValues = ["30m", "60m", "180m"];
|
|
62
|
-
|
|
63
|
-
return new GitpodServiceImpl(exports.createServerMock(methods));
|
|
24
|
+
const createServiceMock = function (methods) {
|
|
25
|
+
return new GitpodServiceImpl((0, exports.createServerMock)(methods));
|
|
64
26
|
};
|
|
65
|
-
exports.
|
|
66
|
-
|
|
67
|
-
methods.
|
|
27
|
+
exports.createServiceMock = createServiceMock;
|
|
28
|
+
const createServerMock = function (methods) {
|
|
29
|
+
methods.setClient = methods.setClient || (() => { });
|
|
30
|
+
methods.dispose = methods.dispose || (() => { });
|
|
68
31
|
return new Proxy(methods, {
|
|
69
|
-
|
|
70
|
-
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
get: (target, property) => {
|
|
34
|
+
const result = target[property];
|
|
71
35
|
if (!result) {
|
|
72
|
-
throw new Error(
|
|
36
|
+
throw new Error(`Method ${property} not implemented`);
|
|
73
37
|
}
|
|
74
38
|
return result;
|
|
75
39
|
}
|
|
76
40
|
});
|
|
77
41
|
};
|
|
42
|
+
exports.createServerMock = createServerMock;
|
|
78
43
|
exports.GitpodServerPath = '/gitpod';
|
|
79
44
|
exports.GitpodServerProxy = Symbol('GitpodServerProxy');
|
|
80
|
-
|
|
81
|
-
|
|
45
|
+
class GitpodCompositeClient {
|
|
46
|
+
constructor() {
|
|
82
47
|
this.clients = [];
|
|
83
48
|
}
|
|
84
|
-
|
|
85
|
-
var _this = this;
|
|
49
|
+
registerClient(client) {
|
|
86
50
|
this.clients.push(client);
|
|
87
|
-
var index = this.clients.length;
|
|
88
51
|
return {
|
|
89
|
-
dispose:
|
|
90
|
-
|
|
52
|
+
dispose: () => {
|
|
53
|
+
const index = this.clients.indexOf(client);
|
|
54
|
+
if (index > -1) {
|
|
55
|
+
this.clients.splice(index, 1);
|
|
56
|
+
}
|
|
91
57
|
}
|
|
92
58
|
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (client.onInstanceUpdate) {
|
|
100
|
-
try {
|
|
101
|
-
client.onInstanceUpdate(instance);
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
console.error(error);
|
|
105
|
-
}
|
|
59
|
+
}
|
|
60
|
+
onInstanceUpdate(instance) {
|
|
61
|
+
for (const client of this.clients) {
|
|
62
|
+
if (client.onInstanceUpdate) {
|
|
63
|
+
try {
|
|
64
|
+
client.onInstanceUpdate(instance);
|
|
106
65
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
110
|
-
finally {
|
|
111
|
-
try {
|
|
112
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
113
|
-
}
|
|
114
|
-
finally { if (e_1) throw e_1.error; }
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
GitpodCompositeClient.prototype.onWorkspaceImageBuildLogs = function (info, content) {
|
|
118
|
-
var e_2, _a;
|
|
119
|
-
try {
|
|
120
|
-
for (var _b = __values(this.clients), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
121
|
-
var client = _c.value;
|
|
122
|
-
if (client.onWorkspaceImageBuildLogs) {
|
|
123
|
-
try {
|
|
124
|
-
client.onWorkspaceImageBuildLogs(info, content);
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
console.error(error);
|
|
128
|
-
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.error(error);
|
|
129
68
|
}
|
|
130
69
|
}
|
|
131
70
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
var e_3, _a;
|
|
142
|
-
try {
|
|
143
|
-
for (var _b = __values(this.clients), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
144
|
-
var client = _c.value;
|
|
145
|
-
if (client.onHeadlessWorkspaceLogs) {
|
|
146
|
-
try {
|
|
147
|
-
client.onHeadlessWorkspaceLogs(evt);
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
console.error(error);
|
|
151
|
-
}
|
|
71
|
+
}
|
|
72
|
+
onPrebuildUpdate(update) {
|
|
73
|
+
for (const client of this.clients) {
|
|
74
|
+
if (client.onPrebuildUpdate) {
|
|
75
|
+
try {
|
|
76
|
+
client.onPrebuildUpdate(update);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.error(error);
|
|
152
80
|
}
|
|
153
81
|
}
|
|
154
82
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var e_4, _a;
|
|
165
|
-
try {
|
|
166
|
-
for (var _b = __values(this.clients), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
167
|
-
var client = _c.value;
|
|
168
|
-
if (client.notifyDidOpenConnection) {
|
|
169
|
-
try {
|
|
170
|
-
client.notifyDidOpenConnection();
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
console.error(error);
|
|
174
|
-
}
|
|
83
|
+
}
|
|
84
|
+
onWorkspaceImageBuildLogs(info, content) {
|
|
85
|
+
for (const client of this.clients) {
|
|
86
|
+
if (client.onWorkspaceImageBuildLogs) {
|
|
87
|
+
try {
|
|
88
|
+
client.onWorkspaceImageBuildLogs(info, content);
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.error(error);
|
|
175
92
|
}
|
|
176
93
|
}
|
|
177
94
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
95
|
+
}
|
|
96
|
+
notifyDidOpenConnection() {
|
|
97
|
+
for (const client of this.clients) {
|
|
98
|
+
if (client.notifyDidOpenConnection) {
|
|
99
|
+
try {
|
|
100
|
+
client.notifyDidOpenConnection();
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
console.error(error);
|
|
104
|
+
}
|
|
182
105
|
}
|
|
183
|
-
finally { if (e_4) throw e_4.error; }
|
|
184
106
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
catch (error) {
|
|
196
|
-
console.error(error);
|
|
197
|
-
}
|
|
107
|
+
}
|
|
108
|
+
notifyDidCloseConnection() {
|
|
109
|
+
for (const client of this.clients) {
|
|
110
|
+
if (client.notifyDidCloseConnection) {
|
|
111
|
+
try {
|
|
112
|
+
client.notifyDidCloseConnection();
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error(error);
|
|
198
116
|
}
|
|
199
117
|
}
|
|
200
118
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
119
|
+
}
|
|
120
|
+
onCreditAlert(creditAlert) {
|
|
121
|
+
for (const client of this.clients) {
|
|
122
|
+
if (client.onCreditAlert) {
|
|
123
|
+
try {
|
|
124
|
+
client.onCreditAlert(creditAlert);
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
console.error(error);
|
|
128
|
+
}
|
|
205
129
|
}
|
|
206
|
-
finally { if (e_5) throw e_5.error; }
|
|
207
130
|
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
}());
|
|
131
|
+
}
|
|
132
|
+
}
|
|
211
133
|
exports.GitpodCompositeClient = GitpodCompositeClient;
|
|
212
|
-
|
|
213
|
-
|
|
134
|
+
const hasWindow = (typeof window !== 'undefined');
|
|
135
|
+
const phasesOrder = {
|
|
214
136
|
unknown: 0,
|
|
215
137
|
preparing: 1,
|
|
216
138
|
pending: 2,
|
|
@@ -221,9 +143,8 @@ var phasesOrder = {
|
|
|
221
143
|
stopping: 7,
|
|
222
144
|
stopped: 8
|
|
223
145
|
};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
var _this = this;
|
|
146
|
+
class WorkspaceInstanceUpdateListener {
|
|
147
|
+
constructor(service, _info) {
|
|
227
148
|
this.service = service;
|
|
228
149
|
this._info = _info;
|
|
229
150
|
this.onDidChangeEmitter = new event_1.Emitter();
|
|
@@ -231,93 +152,73 @@ var WorkspaceInstanceUpdateListener = /** @class */ (function () {
|
|
|
231
152
|
this.source = 'sync';
|
|
232
153
|
this.syncQueue = Promise.resolve();
|
|
233
154
|
service.registerClient({
|
|
234
|
-
onInstanceUpdate:
|
|
235
|
-
if (
|
|
155
|
+
onInstanceUpdate: instance => {
|
|
156
|
+
if (this.isOutOfOrder(instance)) {
|
|
236
157
|
return;
|
|
237
158
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
159
|
+
this.cancelSync();
|
|
160
|
+
this._info.latestInstance = instance;
|
|
161
|
+
this.source = 'update';
|
|
162
|
+
this.onDidChangeEmitter.fire(undefined);
|
|
242
163
|
},
|
|
243
|
-
notifyDidOpenConnection:
|
|
244
|
-
|
|
164
|
+
notifyDidOpenConnection: () => {
|
|
165
|
+
this.sync();
|
|
245
166
|
}
|
|
246
167
|
});
|
|
247
168
|
if (hasWindow) {
|
|
248
169
|
// learn about page lifecycle here: https://developers.google.com/web/updates/2018/07/page-lifecycle-api
|
|
249
|
-
window.document.addEventListener('visibilitychange',
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
});
|
|
256
|
-
}); });
|
|
257
|
-
window.addEventListener('pageshow', function (e) {
|
|
170
|
+
window.document.addEventListener('visibilitychange', () => __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
if (window.document.visibilityState === 'visible') {
|
|
172
|
+
this.sync();
|
|
173
|
+
}
|
|
174
|
+
}));
|
|
175
|
+
window.addEventListener('pageshow', e => {
|
|
258
176
|
if (e.persisted) {
|
|
259
|
-
|
|
177
|
+
this.sync();
|
|
260
178
|
}
|
|
261
179
|
});
|
|
262
180
|
}
|
|
263
181
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
enumerable: false,
|
|
269
|
-
configurable: true
|
|
270
|
-
});
|
|
182
|
+
get info() {
|
|
183
|
+
return this._info;
|
|
184
|
+
}
|
|
271
185
|
/**
|
|
272
186
|
* Only one sync can be performed at the same time.
|
|
273
187
|
* Any new sync request or instance update cancels all previously scheduled sync requests.
|
|
274
188
|
*/
|
|
275
|
-
|
|
276
|
-
var _this = this;
|
|
189
|
+
sync() {
|
|
277
190
|
this.cancelSync();
|
|
278
191
|
this.syncTokenSource = new vscode_jsonrpc_1.CancellationTokenSource();
|
|
279
|
-
|
|
280
|
-
this.syncQueue = this.syncQueue.then(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
_a.label = 1;
|
|
289
|
-
case 1:
|
|
290
|
-
_a.trys.push([1, 3, , 4]);
|
|
291
|
-
return [4 /*yield*/, this.service.server.getWorkspace(this._info.workspace.id)];
|
|
292
|
-
case 2:
|
|
293
|
-
info = _a.sent();
|
|
294
|
-
if (token.isCancellationRequested) {
|
|
295
|
-
return [2 /*return*/];
|
|
296
|
-
}
|
|
297
|
-
this._info = info;
|
|
298
|
-
this.source = 'sync';
|
|
299
|
-
this.onDidChangeEmitter.fire(undefined);
|
|
300
|
-
return [3 /*break*/, 4];
|
|
301
|
-
case 3:
|
|
302
|
-
e_6 = _a.sent();
|
|
303
|
-
console.error('failed to sync workspace instance:', e_6);
|
|
304
|
-
return [3 /*break*/, 4];
|
|
305
|
-
case 4: return [2 /*return*/];
|
|
192
|
+
const token = this.syncTokenSource.token;
|
|
193
|
+
this.syncQueue = this.syncQueue.then(() => __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
if (token.isCancellationRequested) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
const info = yield this.service.server.getWorkspace(this._info.workspace.id);
|
|
199
|
+
if (token.isCancellationRequested) {
|
|
200
|
+
return;
|
|
306
201
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
202
|
+
this._info = info;
|
|
203
|
+
this.source = 'sync';
|
|
204
|
+
this.onDidChangeEmitter.fire(undefined);
|
|
205
|
+
}
|
|
206
|
+
catch (e) {
|
|
207
|
+
console.error('failed to sync workspace instance:', e);
|
|
208
|
+
}
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
cancelSync() {
|
|
311
212
|
if (this.syncTokenSource) {
|
|
312
213
|
this.syncTokenSource.cancel();
|
|
313
214
|
this.syncTokenSource = undefined;
|
|
314
215
|
}
|
|
315
|
-
}
|
|
216
|
+
}
|
|
316
217
|
/**
|
|
317
218
|
* If sync seen more recent update then ignore all updates with previous phases.
|
|
318
219
|
* Within the same phase still the race can occur but which should be eventually consistent.
|
|
319
220
|
*/
|
|
320
|
-
|
|
221
|
+
isOutOfOrder(instance) {
|
|
321
222
|
var _a;
|
|
322
223
|
if (instance.workspaceId !== this._info.workspace.id) {
|
|
323
224
|
return true;
|
|
@@ -329,50 +230,63 @@ var WorkspaceInstanceUpdateListener = /** @class */ (function () {
|
|
|
329
230
|
return false;
|
|
330
231
|
}
|
|
331
232
|
return phasesOrder[instance.status.phase] < phasesOrder[this.info.latestInstance.status.phase];
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
}());
|
|
233
|
+
}
|
|
234
|
+
}
|
|
335
235
|
exports.WorkspaceInstanceUpdateListener = WorkspaceInstanceUpdateListener;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
var _this = this;
|
|
236
|
+
class GitpodServiceImpl {
|
|
237
|
+
constructor(server, options) {
|
|
339
238
|
this.server = server;
|
|
239
|
+
this.options = options;
|
|
340
240
|
this.compositeClient = new GitpodCompositeClient();
|
|
341
241
|
this.instanceListeners = new Map();
|
|
342
242
|
server.setClient(this.compositeClient);
|
|
343
|
-
server.onDidOpenConnection(
|
|
344
|
-
server.onDidCloseConnection(
|
|
243
|
+
server.onDidOpenConnection(() => this.compositeClient.notifyDidOpenConnection());
|
|
244
|
+
server.onDidCloseConnection(() => this.compositeClient.notifyDidCloseConnection());
|
|
345
245
|
}
|
|
346
|
-
|
|
246
|
+
registerClient(client) {
|
|
347
247
|
return this.compositeClient.registerClient(client);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
switch (_a.label) {
|
|
356
|
-
case 0: return [4 /*yield*/, this.server.getWorkspace(workspaceId)];
|
|
357
|
-
case 1:
|
|
358
|
-
info = _a.sent();
|
|
359
|
-
return [2 /*return*/, new WorkspaceInstanceUpdateListener(this, info)];
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
}); })();
|
|
248
|
+
}
|
|
249
|
+
listenToInstance(workspaceId) {
|
|
250
|
+
const listener = this.instanceListeners.get(workspaceId) ||
|
|
251
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
252
|
+
const info = yield this.server.getWorkspace(workspaceId);
|
|
253
|
+
return new WorkspaceInstanceUpdateListener(this, info);
|
|
254
|
+
}))();
|
|
363
255
|
this.instanceListeners.set(workspaceId, listener);
|
|
364
256
|
return listener;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
257
|
+
}
|
|
258
|
+
reconnect() {
|
|
259
|
+
var _a;
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.onReconnect) {
|
|
262
|
+
yield this.options.onReconnect();
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
368
267
|
exports.GitpodServiceImpl = GitpodServiceImpl;
|
|
369
268
|
function createGitpodService(serverUrl) {
|
|
370
|
-
|
|
371
|
-
.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
269
|
+
const toWsUrl = (serverUrl) => {
|
|
270
|
+
return new gitpod_host_url_1.GitpodHostUrl(serverUrl)
|
|
271
|
+
.asWebsocket()
|
|
272
|
+
.withApi({ pathname: exports.GitpodServerPath })
|
|
273
|
+
.toString();
|
|
274
|
+
};
|
|
275
|
+
let url;
|
|
276
|
+
if (typeof serverUrl === "string") {
|
|
277
|
+
url = toWsUrl(serverUrl);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
url = serverUrl.then(url => toWsUrl(url));
|
|
281
|
+
}
|
|
282
|
+
const connectionProvider = new connection_1.WebSocketConnectionProvider();
|
|
283
|
+
let onReconnect = () => { };
|
|
284
|
+
const gitpodServer = connectionProvider.createProxy(url, undefined, {
|
|
285
|
+
onListening: socket => {
|
|
286
|
+
onReconnect = () => socket.reconnect();
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
return new GitpodServiceImpl(gitpodServer, { onReconnect });
|
|
376
290
|
}
|
|
377
291
|
exports.createGitpodService = createGitpodService;
|
|
378
292
|
//# sourceMappingURL=gitpod-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-service.js","sourceRoot":"","sources":["../src/gitpod-service.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"gitpod-service.js","sourceRoot":"","sources":["../src/gitpod-service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAcH,mDAAqE;AAIrE,4DAAuD;AACvD,+DAA6E;AAG7E,wCAAuC;AAsB1B,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAmQtC,QAAA,sBAAsB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AAE/D,MAAM,iBAAiB,GAAG,UAA0D,OAAiC;IACxH,OAAO,IAAI,iBAAiB,CAAO,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B;AAEM,MAAM,gBAAgB,GAAG,UAA0D,OAAiC;IACvH,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACjD,OAAO,IAAI,KAAK,CAAkB,OAAiC,EAAE;QACjE,aAAa;QACb,GAAG,EAAE,CAAC,MAAS,EAAE,QAAiB,EAAE,EAAE;YAClC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAChC,IAAI,CAAC,MAAM,EAAE;gBACT,MAAM,I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E,MAAM,CAAC,EAAE;YAClB,WAAW,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAC3C,CAAC;KACJ,CAAC,CAAC;IACH,OAAO,IAAI,iBAAiB,CAAO,YAAY,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;AACtE,CAAC;AAtBD,kDAsBC"}
|
|
@@ -15,20 +15,17 @@ export declare namespace HeadlessWorkspaceEventType {
|
|
|
15
15
|
function isRunning(t: HeadlessWorkspaceEventType): boolean;
|
|
16
16
|
function didFinish(t: HeadlessWorkspaceEventType): boolean;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface HeadlessWorkspaceEvent {
|
|
19
19
|
workspaceID: string;
|
|
20
20
|
text: string;
|
|
21
21
|
type: HeadlessWorkspaceEventType;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
export interface TheiaHeadlessLogMessage {
|
|
29
|
-
type: TheiaHeadlessLogType;
|
|
30
|
-
data?: string;
|
|
31
|
-
error?: string;
|
|
32
|
-
snapshotURL?: string;
|
|
23
|
+
export interface HeadlessLogUrls {
|
|
24
|
+
streams: {
|
|
25
|
+
[streamID: string]: string;
|
|
26
|
+
};
|
|
33
27
|
}
|
|
28
|
+
/** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
|
|
29
|
+
export declare const HEADLESS_LOG_STREAM_STATUS_CODE = "X-LogStream-StatusCode";
|
|
30
|
+
export declare const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX: RegExp;
|
|
34
31
|
//# sourceMappingURL=headless-workspace-log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless-workspace-log.d.ts","sourceRoot":"","sources":["../src/headless-workspace-log.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,oBAAY,0BAA0B;IAClC,SAAS,eAAe;IACxB,oBAAoB,mBAAmB;IACvC,iBAAiB,gBAAgB;IACjC,eAAe,oBAAoB;IACnC,OAAO,YAAY;IACnB,OAAO,YAAY;CACtB;AACD,yBAAiB,0BAA0B,CAAC;IACxC,SAAgB,SAAS,CAAC,CAAC,EAAE,0BAA0B,WAEtD;IACD,SAAgB,SAAS,CAAC,CAAC,EAAE,0BAA0B,WAEtD;CACJ;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"headless-workspace-log.d.ts","sourceRoot":"","sources":["../src/headless-workspace-log.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,oBAAY,0BAA0B;IAClC,SAAS,eAAe;IACxB,oBAAoB,mBAAmB;IACvC,iBAAiB,gBAAgB;IACjC,eAAe,oBAAoB;IACnC,OAAO,YAAY;IACnB,OAAO,YAAY;CACtB;AACD,yBAAiB,0BAA0B,CAAC;IACxC,SAAgB,SAAS,CAAC,CAAC,EAAE,0BAA0B,WAEtD;IACD,SAAgB,SAAS,CAAC,CAAC,EAAE,0BAA0B,WAEtD;CACJ;AAED,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,0BAA0B,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAE5B,OAAO,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED,wDAAwD;AACxD,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,qCAAqC,QAAuC,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* See License-AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = exports.HEADLESS_LOG_STREAM_STATUS_CODE = exports.HeadlessWorkspaceEventType = void 0;
|
|
9
9
|
var HeadlessWorkspaceEventType;
|
|
10
10
|
(function (HeadlessWorkspaceEventType) {
|
|
11
11
|
HeadlessWorkspaceEventType["LogOutput"] = "log-output";
|
|
@@ -25,10 +25,7 @@ var HeadlessWorkspaceEventType;
|
|
|
25
25
|
}
|
|
26
26
|
HeadlessWorkspaceEventType.didFinish = didFinish;
|
|
27
27
|
})(HeadlessWorkspaceEventType = exports.HeadlessWorkspaceEventType || (exports.HeadlessWorkspaceEventType = {}));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
TheiaHeadlessLogType["TaskFailedLabel"] = "workspaceTaskFailed";
|
|
32
|
-
TheiaHeadlessLogType["TaskSuccessfulLabel"] = "workspaceTaskDone";
|
|
33
|
-
})(TheiaHeadlessLogType = exports.TheiaHeadlessLogType || (exports.TheiaHeadlessLogType = {}));
|
|
28
|
+
/** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
|
|
29
|
+
exports.HEADLESS_LOG_STREAM_STATUS_CODE = "X-LogStream-StatusCode";
|
|
30
|
+
exports.HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
|
|
34
31
|
//# sourceMappingURL=headless-workspace-log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless-workspace-log.js","sourceRoot":"","sources":["../src/headless-workspace-log.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,IAAY,0BAOX;AAPD,WAAY,0BAA0B;IAClC,sDAAwB,CAAA;IACxB,qEAAuC,CAAA;IACvC,+DAAiC,CAAA;IACjC,iEAAmC,CAAA;IACnC,iDAAmB,CAAA;IACnB,iDAAmB,CAAA;AACvB,CAAC,EAPW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAOrC;AACD,WAAiB,0BAA0B;IACvC,SAAgB,SAAS,CAAC,CAA6B;QACnD,OAAO,CAAC,KAAK,0BAA0B,CAAC,SAAS,CAAC;IACtD,CAAC;IAF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