@gitpod/gitpod-protocol 0.1.5-v0.6.0-beta2 → 0.1.5-vn-integrate-gitpod-yml-tasks-into-jetbrainsa.5
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 +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/messaging/browser/connection.d.ts +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 +8 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +36 -19
- 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 +118 -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 +2 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +96 -95
- 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 +76 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +33 -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 +42 -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 +24 -9
- package/src/plans.ts +632 -0
- package/src/protocol.ts +192 -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 +27 -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 +104 -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/util/semaphore.js
CHANGED
|
@@ -13,67 +13,36 @@ 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
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
17
|
exports.Semaphore = void 0;
|
|
45
|
-
|
|
46
|
-
|
|
18
|
+
class Semaphore {
|
|
19
|
+
constructor(capacity) {
|
|
47
20
|
this.capacity = capacity;
|
|
48
21
|
this.queue = [];
|
|
49
22
|
if (capacity < 1) {
|
|
50
23
|
throw new Error("Capacity cannot be less than 1");
|
|
51
24
|
}
|
|
52
25
|
}
|
|
53
|
-
|
|
26
|
+
release() {
|
|
54
27
|
if (this.used == 0)
|
|
55
28
|
return;
|
|
56
|
-
|
|
29
|
+
const queued = this.queue.shift();
|
|
57
30
|
if (queued) {
|
|
58
31
|
queued();
|
|
59
32
|
}
|
|
60
33
|
this.used--;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return [2 /*return*/, new Promise(function (rs, rj) {
|
|
71
|
-
_this.queue.push(rs);
|
|
72
|
-
})];
|
|
34
|
+
}
|
|
35
|
+
acquire() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
this.used++;
|
|
38
|
+
if (this.used <= this.capacity) {
|
|
39
|
+
return Promise.resolve();
|
|
40
|
+
}
|
|
41
|
+
return new Promise((rs, rj) => {
|
|
42
|
+
this.queue.push(rs);
|
|
73
43
|
});
|
|
74
44
|
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
78
47
|
exports.Semaphore = Semaphore;
|
|
79
48
|
//# sourceMappingURL=semaphore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semaphore.js","sourceRoot":"","sources":["../../src/util/semaphore.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"semaphore.js","sourceRoot":"","sources":["../../src/util/semaphore.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAGH,MAAa,SAAS;IAIlB,YAA+B,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;QAHrC,UAAK,GAAmB,EAAE,CAAC;QAIjC,IAAG,QAAQ,GAAG,CAAC,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACrD;IACL,CAAC;IAEM,OAAO;QACV,IAAG,IAAI,CAAC,IAAI,IAAI,CAAC;YAAE,OAAO;QAE1B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,MAAM,EAAE;YACR,MAAM,EAAE,CAAC;SACZ;QAED,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAEY,OAAO;;YAChB,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,IAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAC3B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;aAC5B;YAED,OAAO,IAAI,OAAO,CAAO,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;gBAChC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;QACP,CAAC;KAAA;CAEJ;AAhCD,8BAgCC"}
|
package/lib/util/skip-if.js
CHANGED
|
@@ -11,9 +11,9 @@ exports.skipIfEnvVarNotSet = exports.skipIf = void 0;
|
|
|
11
11
|
* @param doSkip A function which takes a TestSuite and decides if it should be skipped
|
|
12
12
|
*/
|
|
13
13
|
function skipIf(doSkip) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const trait = function (ctx, ctor) {
|
|
15
|
+
const suite = ctx; // No idea why those fields are not exported in the types
|
|
16
|
+
const skip = doSkip(suite);
|
|
17
17
|
suite.beforeEach(function () {
|
|
18
18
|
if (skip) {
|
|
19
19
|
this.skip();
|
|
@@ -30,10 +30,10 @@ exports.skipIf = skipIf;
|
|
|
30
30
|
* @param name The name of the env var the TestSuite depends on being present
|
|
31
31
|
*/
|
|
32
32
|
function skipIfEnvVarNotSet(name) {
|
|
33
|
-
return skipIf(
|
|
34
|
-
|
|
33
|
+
return skipIf((suite) => {
|
|
34
|
+
const skip = process.env[name] === undefined;
|
|
35
35
|
if (skip) {
|
|
36
|
-
console.log(
|
|
36
|
+
console.log(`Skipping suite ${suite.title} because env var '${name}' is not set`);
|
|
37
37
|
}
|
|
38
38
|
return skip;
|
|
39
39
|
});
|
package/lib/util/skip-if.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-if.js","sourceRoot":"","sources":["../../src/util/skip-if.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAWH;;;GAGG;AACH,SAAgB,MAAM,CAAC,MAA4C;IAC/D,
|
|
1
|
+
{"version":3,"file":"skip-if.js","sourceRoot":"","sources":["../../src/util/skip-if.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAWH;;;GAGG;AACH,SAAgB,MAAM,CAAC,MAA4C;IAC/D,MAAM,KAAK,GAA+B,UAA4C,GAAgC,EAAE,IAAc;QAClI,MAAM,KAAK,GAAG,GAA8B,CAAC,CAAE,yDAAyD;QACxG,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,KAAK,CAAC,UAAU,CAAC;YACb,IAAI,IAAI,EAAE;gBACN,IAAI,CAAC,IAAI,EAAE,CAAC;aACf;QACL,CAAC,CAAC,CAAA;IACN,CAAC,CAAC;IAEF,2IAA2I;IAC1I,KAAa,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;IACvC,OAAO,KAAK,CAAC;AACjB,CAAC;AAdD,wBAcC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,IAAY;IAC3C,OAAO,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACpB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;QAC7C,IAAI,IAAI,EAAE;YACN,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,CAAC,KAAK,qBAAqB,IAAI,cAAc,CAAC,CAAC;SACrF;QACD,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;AACP,CAAC;AARD,gDAQC"}
|
package/lib/util/timeutil.js
CHANGED
|
@@ -16,9 +16,9 @@ exports.hoursToMilliseconds = exports.millisecondsToHours = exports.rightBefore
|
|
|
16
16
|
* @param day
|
|
17
17
|
*/
|
|
18
18
|
function oneMonthLater(fromDate, day) {
|
|
19
|
-
|
|
19
|
+
const later = new Date(fromDate);
|
|
20
20
|
day = day || later.getDate();
|
|
21
|
-
|
|
21
|
+
const fromMonth = later.getMonth();
|
|
22
22
|
later.setDate(day);
|
|
23
23
|
later.setMonth(later.getMonth() + 1);
|
|
24
24
|
if (later.getMonth() - fromMonth > 1) {
|
|
@@ -27,25 +27,37 @@ function oneMonthLater(fromDate, day) {
|
|
|
27
27
|
return later.toISOString();
|
|
28
28
|
}
|
|
29
29
|
exports.oneMonthLater = oneMonthLater;
|
|
30
|
-
|
|
30
|
+
const yearsLater = (fromDate, years) => (0, exports.liftDate1)(fromDate, (d) => {
|
|
31
31
|
d.setUTCFullYear(d.getUTCFullYear() + years);
|
|
32
32
|
return d.toISOString();
|
|
33
|
-
});
|
|
33
|
+
});
|
|
34
|
+
exports.yearsLater = yearsLater;
|
|
34
35
|
// tslint:disable-next-line:no-shadowed-variable
|
|
35
|
-
|
|
36
|
-
exports.
|
|
37
|
-
|
|
36
|
+
const addMillis = (d1, millis) => (0, exports.liftDate1)(d1, (d1) => new Date(d1.getTime() + millis).toISOString());
|
|
37
|
+
exports.addMillis = addMillis;
|
|
38
|
+
const durationInHours = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => millisecondsToHours(d1.getTime() - d2.getTime()));
|
|
39
|
+
exports.durationInHours = durationInHours;
|
|
40
|
+
const durationInMillis = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => d1.getTime() - d2.getTime());
|
|
41
|
+
exports.durationInMillis = durationInMillis;
|
|
38
42
|
// tslint:disable-next-line:no-shadowed-variable
|
|
39
|
-
|
|
40
|
-
exports.
|
|
41
|
-
|
|
42
|
-
exports.
|
|
43
|
-
|
|
44
|
-
exports.
|
|
45
|
-
|
|
46
|
-
exports.
|
|
43
|
+
const isDateGreaterOrEqual = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => d1.getTime() >= d2.getTime());
|
|
44
|
+
exports.isDateGreaterOrEqual = isDateGreaterOrEqual;
|
|
45
|
+
const isDateSmallerOrEqual = (d1, d2) => !d2 || d1 <= d2;
|
|
46
|
+
exports.isDateSmallerOrEqual = isDateSmallerOrEqual;
|
|
47
|
+
const isDateSmaller = (d1, d2) => !d2 || d1 < d2;
|
|
48
|
+
exports.isDateSmaller = isDateSmaller;
|
|
49
|
+
const oldest = (d1, d2) => d1 > d2 ? d1 : d2;
|
|
50
|
+
exports.oldest = oldest;
|
|
51
|
+
const earliest = (d1, d2) => d1 < d2 ? d1 : d2;
|
|
52
|
+
exports.earliest = earliest;
|
|
53
|
+
const orderAsc = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => d1.getTime() - d2.getTime());
|
|
54
|
+
exports.orderAsc = orderAsc;
|
|
55
|
+
const liftDate1 = (d1, f) => f(new Date(d1));
|
|
56
|
+
exports.liftDate1 = liftDate1;
|
|
57
|
+
const liftDate = (d1, d2, f) => f(new Date(d1), new Date(d2));
|
|
58
|
+
exports.liftDate = liftDate;
|
|
47
59
|
function hoursLater(date, hours) {
|
|
48
|
-
|
|
60
|
+
const result = new Date(date);
|
|
49
61
|
result.setHours(result.getHours() + hours);
|
|
50
62
|
return result.toISOString();
|
|
51
63
|
}
|
package/lib/util/timeutil.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeutil.js","sourceRoot":"","sources":["../../src/util/timeutil.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;;;;GAQG;AACH,SAAgB,a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EC;AAED,SAAgB,UAAU,CAAC,IAAY;IACnC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAChE,CAAC;AAFD,gCAEC;AAED,SAAgB,WAAW,CAAC,IAAY;IACpC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAChE,CAAC;AAFD,kCAEC;AAED,SAAgB,mBAAmB,CAAC,YAAoB;IACpD,OAAO,YAAY,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;AACzC,CAAC;AAFD,kDAEC;AAED,SAAgB,mBAAmB,CAAC,KAAa;IAC7C,OAAO,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAClC,CAAC;AAFD,kDAEC"}
|
|
@@ -15,14 +15,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.TimeutilSpec = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
TimeutilSpec.prototype.testTimeutil = function () {
|
|
18
|
+
const chai = require("chai");
|
|
19
|
+
const expect = chai.expect;
|
|
20
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
21
|
+
const timeutil_1 = require("./timeutil");
|
|
22
|
+
let TimeutilSpec = class TimeutilSpec {
|
|
23
|
+
testTimeutil() {
|
|
26
24
|
// targeting a 1st, 1th of Jan => 1st of Feb
|
|
27
25
|
this.isOneMonthLater(new Date(2000, 0, 1), 1, new Date(2000, 1, 1));
|
|
28
26
|
// targeting a 31th, 30th of Apr => 31st of May
|
|
@@ -38,21 +36,20 @@ var TimeutilSpec = /** @class */ (function () {
|
|
|
38
36
|
this.isOneMonthLater(new Date(2001, 0, 31), 31, new Date(2001, 1, 28));
|
|
39
37
|
// Feb leap year
|
|
40
38
|
this.isOneMonthLater(new Date(2000, 0, 31), 31, new Date(2000, 1, 29));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
expect(later,
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}());
|
|
39
|
+
}
|
|
40
|
+
isOneMonthLater(from, day, expectation) {
|
|
41
|
+
const later = (0, timeutil_1.oneMonthLater)(from.toISOString(), day);
|
|
42
|
+
expect(later, `expected ${later} to be equal ${expectation}`).to.be.equal(expectation.toISOString());
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
__decorate([
|
|
46
|
+
mocha_typescript_1.test,
|
|
47
|
+
__metadata("design:type", Function),
|
|
48
|
+
__metadata("design:paramtypes", []),
|
|
49
|
+
__metadata("design:returntype", void 0)
|
|
50
|
+
], TimeutilSpec.prototype, "testTimeutil", null);
|
|
51
|
+
TimeutilSpec = __decorate([
|
|
52
|
+
(0, mocha_typescript_1.suite)()
|
|
53
|
+
], TimeutilSpec);
|
|
57
54
|
exports.TimeutilSpec = TimeutilSpec;
|
|
58
55
|
//# sourceMappingURL=timeutil.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeutil.spec.js","sourceRoot":"","sources":["../../src/util/timeutil.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"timeutil.spec.js","sourceRoot":"","sources":["../../src/util/timeutil.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,6BAA6B;AAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3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,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QACtE,gBAAgB;QAChB,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,eAAe,CAAC,IAAU,EAAE,GAAW,EAAE,WAAiB;QACtD,MAAM,KAAK,GAAG,IAAA,wBAAa,EAAC,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,CAAA;QACpD,MAAM,CAAC,KAAK,EAAE,YAAY,KAAK,gBAAgB,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAA;IACxG,CAAC;CACJ,CAAA;AA3BG;IADC,uBAAI;;;;gDAsBJ;AAxBQ,YAAY;IADxB,IAAA,wBAAK,GAAE;GACK,YAAY,CA8BxB;AA9BY,oCAAY"}
|
package/lib/util/tracing.d.ts
CHANGED
|
@@ -4,18 +4,58 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
import * as opentracing from 'opentracing';
|
|
7
|
-
import { Sampler, SamplingDecision } from 'jaeger-client';
|
|
7
|
+
import { Sampler, SamplingDecision } from './jaeger-client-types';
|
|
8
|
+
import { ResponseError } from 'vscode-jsonrpc';
|
|
9
|
+
import { LogContext } from './logging';
|
|
8
10
|
export interface TraceContext {
|
|
9
11
|
span?: opentracing.Span;
|
|
10
12
|
}
|
|
13
|
+
export declare type TraceContextWithSpan = TraceContext & {
|
|
14
|
+
span: opentracing.Span;
|
|
15
|
+
};
|
|
11
16
|
export declare namespace TraceContext {
|
|
12
|
-
function startSpan(operation: string,
|
|
13
|
-
function
|
|
14
|
-
function
|
|
17
|
+
function startSpan(operation: string, parentCtx?: TraceContext): opentracing.Span;
|
|
18
|
+
function childContext(operation: string, parentCtx: TraceContext): TraceContextWithSpan;
|
|
19
|
+
function withSpan(operation: string, callback: (ctx: TraceContext) => void, ctx?: TraceContext): void;
|
|
20
|
+
function setError(ctx: TraceContext, err: Error): void;
|
|
21
|
+
function setJsonRPCMetadata(ctx: TraceContext, method?: string): void;
|
|
22
|
+
function setJsonRPCError(ctx: TraceContext, method: string, err: ResponseError<any>, withStatusCode?: boolean): void;
|
|
23
|
+
function addJsonRPCParameters(ctx: TraceContext, params: {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}): void;
|
|
26
|
+
/**
|
|
27
|
+
* Does what one would expect from `span.addTags`: Calls `span.addTag` for all keys in map, recursively for objects.
|
|
28
|
+
* Example:
|
|
29
|
+
* ```
|
|
30
|
+
* TraceContext.addNestedTags(ctx, {
|
|
31
|
+
* rpc: {
|
|
32
|
+
* system: "jsonrpc",
|
|
33
|
+
* jsonrpc: {
|
|
34
|
+
* version: "1.0",
|
|
35
|
+
* method: "test",
|
|
36
|
+
* parameters: ["abc", "def"],
|
|
37
|
+
* },
|
|
38
|
+
* },
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
* gives
|
|
42
|
+
* rpc.system = "jsonrpc"
|
|
43
|
+
* rpc.jsonrpc.version = "1.0"
|
|
44
|
+
* rpc.jsonrpc.method = "test"
|
|
45
|
+
* rpc.jsonrpc.parameters.0 = "abc"
|
|
46
|
+
* rpc.jsonrpc.parameters.1 = "def"
|
|
47
|
+
* @param ctx
|
|
48
|
+
* @param keyValueMap
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
function addNestedTags(ctx: TraceContext, keyValueMap: {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}, _namespace?: string): void;
|
|
54
|
+
function setOWI(ctx: TraceContext, owi: LogContext): void;
|
|
15
55
|
}
|
|
16
56
|
export declare class TracingManager {
|
|
17
57
|
setup(serviceName: string, opts?: CustomTracerOpts): void;
|
|
18
|
-
getTracerForService(serviceName: string, opts?: CustomTracerOpts):
|
|
58
|
+
getTracerForService(serviceName: string, opts?: CustomTracerOpts): import("jaeger-client").JaegerTracer;
|
|
19
59
|
}
|
|
20
60
|
export interface CustomTracerOpts {
|
|
21
61
|
perOpSampling?: PerOperationSampling;
|
|
@@ -36,4 +76,10 @@ export declare class PerOperationSampler implements Sampler {
|
|
|
36
76
|
equal(other: Sampler): boolean;
|
|
37
77
|
close(callback: () => void): void;
|
|
38
78
|
}
|
|
79
|
+
declare type IsValidArg<T> = T extends object ? keyof T extends never ? false : true : true;
|
|
80
|
+
declare type AddTraceContext<T> = T extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E, f: infer F) => infer R ? (IsValidArg<F> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E, f: F) => R : IsValidArg<E> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E) => R : IsValidArg<D> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D) => R : IsValidArg<C> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C) => R : IsValidArg<B> extends true ? (ctx: TraceContextWithSpan, a: A, b: B) => R : IsValidArg<A> extends true ? (ctx: TraceContextWithSpan, a: A) => R : (ctx: TraceContextWithSpan) => Promise<R>) : never;
|
|
81
|
+
export declare type InterfaceWithTraceContext<T> = {
|
|
82
|
+
[P in keyof T]: AddTraceContext<T[P]>;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
39
85
|
//# sourceMappingURL=tracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/util/tracing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot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