@gitpod/gitpod-protocol 0.1.5-wth-argo.0 → 0.1.5-yh-vmoptions-fork.1
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 +206 -28
- package/lib/accounting-protocol.d.ts +162 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +107 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +32 -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 +180 -33
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +194 -273
- 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 +5 -1
- 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/{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 +7 -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 +6 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +12 -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 +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 +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 +196 -83
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +264 -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 +91 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +74 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +118 -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 +1 -0
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +35 -17
- 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 +45 -5
- 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 +32 -18
- package/pkg-yarn.lock +18 -10
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +241 -0
- package/src/admin-protocol.ts +70 -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 +348 -110
- package/src/headless-workspace-log.ts +12 -14
- package/src/ide-frontend-service.ts +6 -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 +12 -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 +18 -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 +20 -0
- package/src/permission.ts +42 -33
- package/src/plans.ts +679 -0
- package/src/protocol.ts +493 -275
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +147 -0
- package/src/teams-projects-protocol.ts +153 -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 +25 -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 +98 -31
- 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/util/event.js
CHANGED
|
@@ -7,18 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.Emitter = exports.Event = void 0;
|
|
10
|
-
|
|
10
|
+
const logging_1 = require("./logging");
|
|
11
11
|
var Event;
|
|
12
12
|
(function (Event) {
|
|
13
|
-
|
|
14
|
-
Event.None = function () {
|
|
13
|
+
const _disposable = { dispose() { } };
|
|
14
|
+
Event.None = function () {
|
|
15
|
+
return _disposable;
|
|
16
|
+
};
|
|
15
17
|
})(Event = exports.Event || (exports.Event = {}));
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
CallbackList.prototype.add = function (callback, context, bucket) {
|
|
20
|
-
var _this = this;
|
|
21
|
-
if (context === void 0) { context = null; }
|
|
18
|
+
class CallbackList {
|
|
19
|
+
add(callback, context = null, bucket) {
|
|
22
20
|
if (!this._callbacks) {
|
|
23
21
|
this._callbacks = [];
|
|
24
22
|
this._contexts = [];
|
|
@@ -26,16 +24,15 @@ var CallbackList = /** @class */ (function () {
|
|
|
26
24
|
this._callbacks.push(callback);
|
|
27
25
|
this._contexts.push(context);
|
|
28
26
|
if (Array.isArray(bucket)) {
|
|
29
|
-
bucket.push({ dispose:
|
|
27
|
+
bucket.push({ dispose: () => this.remove(callback, context) });
|
|
30
28
|
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (context === void 0) { context = null; }
|
|
29
|
+
}
|
|
30
|
+
remove(callback, context = null) {
|
|
34
31
|
if (!this._callbacks) {
|
|
35
32
|
return;
|
|
36
33
|
}
|
|
37
|
-
|
|
38
|
-
for (
|
|
34
|
+
let foundCallbackWithDifferentContext = false;
|
|
35
|
+
for (let i = 0, len = this._callbacks.length; i < len; i++) {
|
|
39
36
|
if (this._callbacks[i] === callback) {
|
|
40
37
|
if (this._contexts[i] === context) {
|
|
41
38
|
// callback & context match => remove it
|
|
@@ -49,21 +46,17 @@ var CallbackList = /** @class */ (function () {
|
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
if (foundCallbackWithDifferentContext) {
|
|
52
|
-
throw new Error(
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
CallbackList.prototype.invoke = function () {
|
|
56
|
-
var args = [];
|
|
57
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
58
|
-
args[_i] = arguments[_i];
|
|
49
|
+
throw new Error("When adding a listener with a context, you should remove it with the same context");
|
|
59
50
|
}
|
|
51
|
+
}
|
|
52
|
+
invoke(...args) {
|
|
60
53
|
if (!this._callbacks) {
|
|
61
54
|
return [];
|
|
62
55
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
for (
|
|
56
|
+
const ret = [];
|
|
57
|
+
const callbacks = this._callbacks.slice(0);
|
|
58
|
+
const contexts = this._contexts.slice(0);
|
|
59
|
+
for (let i = 0, len = callbacks.length; i < len; i++) {
|
|
67
60
|
try {
|
|
68
61
|
ret.push(callbacks[i].apply(contexts[i], args));
|
|
69
62
|
}
|
|
@@ -72,74 +65,67 @@ var CallbackList = /** @class */ (function () {
|
|
|
72
65
|
}
|
|
73
66
|
}
|
|
74
67
|
return ret;
|
|
75
|
-
}
|
|
76
|
-
|
|
68
|
+
}
|
|
69
|
+
isEmpty() {
|
|
77
70
|
return !this._callbacks || this._callbacks.length === 0;
|
|
78
|
-
}
|
|
79
|
-
|
|
71
|
+
}
|
|
72
|
+
dispose() {
|
|
80
73
|
this._callbacks = undefined;
|
|
81
74
|
this._contexts = undefined;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
function Emitter(_options) {
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
class Emitter {
|
|
78
|
+
constructor(_options) {
|
|
87
79
|
this._options = _options;
|
|
88
80
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
dispose
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (_this._options && _this._options.onLastListenerRemove && _this._callbacks.isEmpty()) {
|
|
111
|
-
_this._options.onLastListenerRemove(_this);
|
|
112
|
-
}
|
|
81
|
+
/**
|
|
82
|
+
* For the public to allow to subscribe
|
|
83
|
+
* to events from this Emitter
|
|
84
|
+
*/
|
|
85
|
+
get event() {
|
|
86
|
+
if (!this._event) {
|
|
87
|
+
this._event = (listener, thisArgs, disposables) => {
|
|
88
|
+
if (!this._callbacks) {
|
|
89
|
+
this._callbacks = new CallbackList();
|
|
90
|
+
}
|
|
91
|
+
if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
|
|
92
|
+
this._options.onFirstListenerAdd(this);
|
|
93
|
+
}
|
|
94
|
+
this._callbacks.add(listener, thisArgs);
|
|
95
|
+
let result;
|
|
96
|
+
result = {
|
|
97
|
+
dispose: () => {
|
|
98
|
+
this._callbacks.remove(listener, thisArgs);
|
|
99
|
+
result.dispose = Emitter._noop;
|
|
100
|
+
if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
|
|
101
|
+
this._options.onLastListenerRemove(this);
|
|
113
102
|
}
|
|
114
|
-
}
|
|
115
|
-
if (Array.isArray(disposables)) {
|
|
116
|
-
disposables.push(result);
|
|
117
|
-
}
|
|
118
|
-
return result;
|
|
103
|
+
},
|
|
119
104
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
105
|
+
if (Array.isArray(disposables)) {
|
|
106
|
+
disposables.push(result);
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return this._event;
|
|
112
|
+
}
|
|
126
113
|
/**
|
|
127
114
|
* To be kept private to fire an event to
|
|
128
115
|
* subscribers
|
|
129
116
|
*/
|
|
130
|
-
|
|
117
|
+
fire(event) {
|
|
131
118
|
if (this._callbacks) {
|
|
132
119
|
this._callbacks.invoke.call(this._callbacks, event);
|
|
133
120
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
121
|
+
}
|
|
122
|
+
dispose() {
|
|
136
123
|
if (this._callbacks) {
|
|
137
124
|
this._callbacks.dispose();
|
|
138
125
|
this._callbacks = undefined;
|
|
139
126
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return Emitter;
|
|
143
|
-
}());
|
|
127
|
+
}
|
|
128
|
+
}
|
|
144
129
|
exports.Emitter = Emitter;
|
|
130
|
+
Emitter._noop = function () { };
|
|
145
131
|
//# sourceMappingURL=event.js.map
|
package/lib/util/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/util/event.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/util/event.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,uCAAgC;AAgBhC,IAAiB,KAAK,CAKrB;AALD,WAAiB,KAAK;IAClB,MAAM,WAAW,GAAG,EAAE,OAAO,KAAI,CAAC,EAAE,CAAC;IACxB,UAAI,GAAe;QAC5B,OAAO,WAAW,CAAC;IACvB,CAAC,CAAC;AACN,CAAC,EALgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAKrB;AAED,MAAM,YAAY;IAIP,GAAG,CAAC,QAAkB,EAAE,UAAe,IAAI,EAAE,MAAqB;QACrE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;SACvB;QACD,IAAI,CAAC,UAAU,CAA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ds: number);
|
|
16
16
|
set(key: string, value: T): void;
|
|
17
17
|
get(key: string): T | undefined;
|
|
18
|
+
delete(key: string): void;
|
|
18
19
|
protected regularlyCollectGarbage(): void;
|
|
19
20
|
protected collectGarbage(): void;
|
|
20
21
|
protected calcExpiryDate(maxAgeSeconds?: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"garbage-collected-cache.d.ts","sourceRoot":"","sources":["../../src/util/garbage-collected-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"garbage-collected-cache.d.ts","sourceRoot":"","sources":["../../src/util/garbage-collected-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,UAAU,UAAU,CAAC,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,CAAC,CAAC;IACT,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,qBAAqB,CAAC,CAAC;IAGpB,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,MAAM;IAAE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAFzG,SAAS,CAAC,QAAQ,CAAC,KAAK,6BAAoC;gBAE7B,oBAAoB,EAAE,MAAM,EAAqB,iBAAiB,EAAE,MAAM;IAIlG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAazB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAQ/B,MAAM,CAAC,GAAG,EAAE,MAAM;IAIzB,SAAS,CAAC,uBAAuB;IAIjC,SAAS,CAAC,cAAc;IASxB,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM;CAG3D"}
|
|
@@ -4,72 +4,52 @@
|
|
|
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 __values = (this && this.__values) || function(o) {
|
|
8
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
9
|
-
if (m) return m.call(o);
|
|
10
|
-
if (o && typeof o.length === "number") return {
|
|
11
|
-
next: function () {
|
|
12
|
-
if (o && i >= o.length) o = void 0;
|
|
13
|
-
return { value: o && o[i++], done: !o };
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
17
|
-
};
|
|
18
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
8
|
exports.GarbageCollectedCache = void 0;
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
const repeat_1 = require("./repeat");
|
|
10
|
+
class GarbageCollectedCache {
|
|
11
|
+
constructor(defaultMaxAgeSeconds, gcIntervalSeconds) {
|
|
22
12
|
this.defaultMaxAgeSeconds = defaultMaxAgeSeconds;
|
|
23
13
|
this.gcIntervalSeconds = gcIntervalSeconds;
|
|
24
14
|
this.store = new Map();
|
|
25
15
|
this.regularlyCollectGarbage();
|
|
26
16
|
}
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
set(key, value) {
|
|
18
|
+
const oldValue = this.store.get(key);
|
|
29
19
|
if (oldValue) {
|
|
30
20
|
// We don't want values to be cached indefinitely just because their queried often
|
|
31
21
|
return;
|
|
32
22
|
}
|
|
33
23
|
this.store.set(key, {
|
|
34
|
-
key
|
|
35
|
-
value
|
|
24
|
+
key,
|
|
25
|
+
value,
|
|
36
26
|
expiryDate: this.calcExpiryDate(),
|
|
37
27
|
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
}
|
|
29
|
+
get(key) {
|
|
30
|
+
const entry = this.store.get(key);
|
|
41
31
|
if (!entry) {
|
|
42
32
|
return undefined;
|
|
43
33
|
}
|
|
44
34
|
return entry.value;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.store.delete(entry.key);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
62
|
-
finally {
|
|
63
|
-
try {
|
|
64
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
35
|
+
}
|
|
36
|
+
delete(key) {
|
|
37
|
+
this.store.delete(key);
|
|
38
|
+
}
|
|
39
|
+
regularlyCollectGarbage() {
|
|
40
|
+
(0, repeat_1.repeat)(() => this.collectGarbage(), this.gcIntervalSeconds * 1000);
|
|
41
|
+
}
|
|
42
|
+
collectGarbage() {
|
|
43
|
+
const now = Date.now();
|
|
44
|
+
for (const entry of this.store.values()) {
|
|
45
|
+
if (entry.expiryDate < now) {
|
|
46
|
+
this.store.delete(entry.key);
|
|
65
47
|
}
|
|
66
|
-
finally { if (e_1) throw e_1.error; }
|
|
67
48
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return Date.now() + (
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
}());
|
|
49
|
+
}
|
|
50
|
+
calcExpiryDate(maxAgeSeconds) {
|
|
51
|
+
return Date.now() + (maxAgeSeconds || this.defaultMaxAgeSeconds) * 1000;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
74
54
|
exports.GarbageCollectedCache = GarbageCollectedCache;
|
|
75
55
|
//# sourceMappingURL=garbage-collected-cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"garbage-collected-cache.js","sourceRoot":"","sources":["../../src/util/garbage-collected-cache.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"garbage-collected-cache.js","sourceRoot":"","sources":["../../src/util/garbage-collected-cache.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qCAAkC;AAQlC,MAAa,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,CAAC,CAAC;aAChC;SACJ;IACL,CAAC;IAES,cAAc,CAAC,aAAsB;QAC3C,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IAC5E,CAAC;CACJ;AAhDD,sDAgDC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateWorkspaceID(firstSegment?: string, secondSegment?: string): Promise<string>;
|
|
2
7
|
export declare const colors: string[];
|
|
3
8
|
export declare const animals: string[];
|
|
4
9
|
//# sourceMappingURL=generate-workspace-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-workspace-id.d.ts","sourceRoot":"","sources":["../../src/util/generate-workspace-id.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-workspace-id.d.ts","sourceRoot":"","sources":["../../src/util/generate-workspace-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAsB,mBAAmB,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxG;AA8BD,eAAO,MAAM,MAAM,UAsDlB,CAAC;AAEF,eAAO,MAAM,OAAO,UA2XnB,CAAC"}
|