@gitpod/gitpod-protocol 0.1.5-pluggable-workspace-cluster.21 → 0.1.5-port-description-3059-fork.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/gitpod-schema.json +12 -22
- package/lib/accounting-protocol.d.ts +3 -6
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +10 -16
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +15 -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/context-url.d.ts +18 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +49 -0
- package/lib/context-url.js.map +1 -0
- package/lib/{util/context-url.spec.d.ts → context-url.spec.d.ts} +2 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +73 -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 +4 -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 +94 -19
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +155 -278
- 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-protocol.d.ts +81 -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 +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +4 -6
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +175 -44
- 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/connection-error-handler.js +11 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +2 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +4 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +22 -22
- 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/permission.d.ts +2 -1
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +14 -13
- 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 +66 -13
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +68 -115
- 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 +4 -4
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +15 -12
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +103 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +23 -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.js +22 -46
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +13 -67
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +34 -79
- 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 +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +98 -98
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +6 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +102 -30
- 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/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 +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 +144 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeater.js +35 -88
- package/lib/util/repeater.js.map +1 -1
- package/lib/util/safe-promise.js +9 -12
- package/lib/util/safe-promise.js.map +1 -1
- 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 +16 -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 +14 -1
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +84 -50
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/workspace-port-authentication.js +2 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +22 -3
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +3 -3
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +5 -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 +28 -16
- package/pkg-yarn.lock +17 -9
- package/src/accounting-protocol.ts +4 -10
- package/src/admin-protocol.ts +33 -5
- package/src/analytics.ts +54 -0
- package/src/context-url.spec.ts +39 -0
- package/src/context-url.ts +51 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +129 -35
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-protocol.ts +92 -0
- package/src/index.ts +5 -1
- package/src/messaging/browser/connection.ts +184 -23
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +5 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +2 -2
- package/src/messaging/proxy-factory.ts +13 -5
- package/src/permission.ts +2 -1
- package/src/plans.ts +632 -0
- package/src/protocol.ts +89 -18
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +7 -5
- package/src/teams-projects-protocol.ts +132 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/garbage-collected-cache.ts +2 -2
- package/src/util/generate-workspace-id.spec.ts +3 -3
- package/src/util/generate-workspace-id.ts +2 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +24 -0
- package/src/util/gitpod-host-url.ts +23 -10
- package/src/util/grpc.ts +15 -0
- package/src/util/logging.ts +102 -38
- package/src/util/parse-workspace-id.spec.ts +21 -1
- package/src/util/parse-workspace-id.ts +32 -6
- 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.ts +65 -3
- package/src/workspace-cluster.ts +24 -8
- package/src/workspace-instance.ts +25 -13
- package/src/wsready.ts +2 -2
- 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.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/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
package/lib/util/safe-promise.js
CHANGED
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.SafePromise = void 0;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
SafePromise.catchAndLog = function (p, logCtx) {
|
|
14
|
-
return SafePromise.catch(p, function (err) {
|
|
9
|
+
const logging_1 = require("./logging");
|
|
10
|
+
class SafePromise {
|
|
11
|
+
static catchAndLog(p, logCtx) {
|
|
12
|
+
return SafePromise.catch(p, (err) => {
|
|
15
13
|
if (logCtx) {
|
|
16
14
|
logging_1.log.error(logCtx, err);
|
|
17
15
|
}
|
|
@@ -19,16 +17,15 @@ var SafePromise = /** @class */ (function () {
|
|
|
19
17
|
logging_1.log.error(err);
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
|
-
}
|
|
20
|
+
}
|
|
23
21
|
;
|
|
24
|
-
|
|
25
|
-
return p.catch(
|
|
22
|
+
static catch(p, handler) {
|
|
23
|
+
return p.catch((err) => {
|
|
26
24
|
handler(err);
|
|
27
25
|
return {}; // Nobody will ever see this value as the Promise already failed. It's just there to please the compiler
|
|
28
26
|
});
|
|
29
|
-
}
|
|
27
|
+
}
|
|
30
28
|
;
|
|
31
|
-
|
|
32
|
-
}());
|
|
29
|
+
}
|
|
33
30
|
exports.SafePromise = SafePromise;
|
|
34
31
|
//# sourceMappingURL=safe-promise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-promise.js","sourceRoot":"","sources":["../../src/util/safe-promise.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,
|
|
1
|
+
{"version":3,"file":"safe-promise.js","sourceRoot":"","sources":["../../src/util/safe-promise.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,uCAA4C;AAE5C,MAAa,WAAW;IACb,MAAM,CAAC,WAAW,CAAI,CAAa,EAAE,MAAmB;QAC3D,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;YAChC,IAAI,MAAM,EAAE;gBACR,aAAG,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;aAC1B;iBAAM;gBACH,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAClB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAAA,CAAC;IACK,MAAM,CAAC,KAAK,CAAI,CAAa,EAAE,OAA2B;QAC7D,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,EAAO,CAAC,CAAC,wGAAwG;QAC5H,CAAC,CAAC,CAAC;IACP,CAAC;IAAA,CAAC;CACL;AAhBD,kCAgBC"}
|
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,37 +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
34
|
exports.yearsLater = yearsLater;
|
|
35
35
|
// tslint:disable-next-line:no-shadowed-variable
|
|
36
|
-
|
|
36
|
+
const addMillis = (d1, millis) => (0, exports.liftDate1)(d1, (d1) => new Date(d1.getTime() + millis).toISOString());
|
|
37
37
|
exports.addMillis = addMillis;
|
|
38
|
-
|
|
38
|
+
const durationInHours = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => millisecondsToHours(d1.getTime() - d2.getTime()));
|
|
39
39
|
exports.durationInHours = durationInHours;
|
|
40
|
-
|
|
40
|
+
const durationInMillis = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => d1.getTime() - d2.getTime());
|
|
41
41
|
exports.durationInMillis = durationInMillis;
|
|
42
42
|
// tslint:disable-next-line:no-shadowed-variable
|
|
43
|
-
|
|
43
|
+
const isDateGreaterOrEqual = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => d1.getTime() >= d2.getTime());
|
|
44
44
|
exports.isDateGreaterOrEqual = isDateGreaterOrEqual;
|
|
45
|
-
|
|
45
|
+
const isDateSmallerOrEqual = (d1, d2) => !d2 || d1 <= d2;
|
|
46
46
|
exports.isDateSmallerOrEqual = isDateSmallerOrEqual;
|
|
47
|
-
|
|
47
|
+
const isDateSmaller = (d1, d2) => !d2 || d1 < d2;
|
|
48
48
|
exports.isDateSmaller = isDateSmaller;
|
|
49
|
-
|
|
49
|
+
const oldest = (d1, d2) => d1 > d2 ? d1 : d2;
|
|
50
50
|
exports.oldest = oldest;
|
|
51
|
-
|
|
51
|
+
const earliest = (d1, d2) => d1 < d2 ? d1 : d2;
|
|
52
52
|
exports.earliest = earliest;
|
|
53
|
-
|
|
53
|
+
const orderAsc = (d1, d2) => (0, exports.liftDate)(d1, d2, (d1, d2) => d1.getTime() - d2.getTime());
|
|
54
54
|
exports.orderAsc = orderAsc;
|
|
55
|
-
|
|
55
|
+
const liftDate1 = (d1, f) => f(new Date(d1));
|
|
56
56
|
exports.liftDate1 = liftDate1;
|
|
57
|
-
|
|
57
|
+
const liftDate = (d1, d2, f) => f(new Date(d1), new Date(d2));
|
|
58
58
|
exports.liftDate = liftDate;
|
|
59
59
|
function hoursLater(date, hours) {
|
|
60
|
-
|
|
60
|
+
const result = new Date(date);
|
|
61
61
|
result.setHours(result.getHours() + hours);
|
|
62
62
|
return result.toISOString();
|
|
63
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,aAAa,CAAC,QAAgB,EAAE,GAAY;IACxD,
|
|
1
|
+
{"version":3,"file":"timeutil.js","sourceRoot":"","sources":["../../src/util/timeutil.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAAC,QAAgB,EAAE,GAAY;IACxD,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,GAAG,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACnC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,QAAQ,EAAE,GAAG,SAAS,GAAG,CAAC,EAAE;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;KACpB;IACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC/B,CAAC;AAVD,sCAUC;AACM,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,KAAa,EAAU,EAAE,CAAC,IAAA,iBAAS,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;IAC7F,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,EAAE,GAAG,KAAK,CAAC,CAAC;IAC7C,OAAO,CAAC,CAAC,W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CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAA;IAC1C,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAChC,CAAC;AAJD,gCAIC;AAED,SAAgB,aAAa,CAAC,IAAY,EAAE,OAAe;IACvD,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7E,CAAC;AAFD,sCAEC;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;AAC3B,uDAA+C;AAC/C,yCAA2C;AAG3C,IAAa,YAAY,GAAzB,MAAa,YAAY;IAGrB,YAAY;QACR,4CAA4C;QAC5C,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAEnE,+CAA+C;QAC/C,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;QAEtE,+CAA+C;QAC/C,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;QAEtE,+CAA+C;QAC/C,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;QAEtE,YAAY;QACZ,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QACpE,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QAEvE,MAAM;QACN,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;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
|
@@ -5,13 +5,20 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as opentracing from 'opentracing';
|
|
7
7
|
import { Sampler, SamplingDecision } from 'jaeger-client';
|
|
8
|
+
import { ResponseError } from 'vscode-jsonrpc';
|
|
8
9
|
export interface TraceContext {
|
|
9
10
|
span?: opentracing.Span;
|
|
10
11
|
}
|
|
12
|
+
export declare type TraceContextWithSpan = TraceContext & {
|
|
13
|
+
span: opentracing.Span;
|
|
14
|
+
};
|
|
11
15
|
export declare namespace TraceContext {
|
|
12
|
-
function startSpan(operation: string,
|
|
16
|
+
function startSpan(operation: string, parentCtx: TraceContext): opentracing.Span;
|
|
17
|
+
function childContextWithSpan(operation: string, parentCtx: TraceContext): TraceContextWithSpan;
|
|
13
18
|
function startAsyncSpan(operation: string, ctx: TraceContext): opentracing.Span;
|
|
14
19
|
function logError(ctx: TraceContext, err: Error): void;
|
|
20
|
+
function logJsonRPCError(ctx: TraceContext, method: string, err: ResponseError<any>): void;
|
|
21
|
+
function addJsonRPCParameters(ctx: TraceContext, method: string, args: any[]): void;
|
|
15
22
|
}
|
|
16
23
|
export declare class TracingManager {
|
|
17
24
|
setup(serviceName: string, opts?: CustomTracerOpts): void;
|
|
@@ -36,4 +43,10 @@ export declare class PerOperationSampler implements Sampler {
|
|
|
36
43
|
equal(other: Sampler): boolean;
|
|
37
44
|
close(callback: () => void): void;
|
|
38
45
|
}
|
|
46
|
+
declare type IsValidArg<T> = T extends object ? keyof T extends never ? false : true : true;
|
|
47
|
+
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;
|
|
48
|
+
export declare type InterfaceWithTraceContext<T> = {
|
|
49
|
+
[P in keyof T]: AddTraceContext<T[P]>;
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
39
52
|
//# 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;AAC3C,OAAO,EAAoC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/util/tracing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAoC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI,CAAA;CAC1B;AACD,oBAAY,oBAAoB,GAAG,YAAY,GAAG;IAC9C,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;CACzB,CAAA;AAGD,yBAAiB,YAAY,CAAC;IAC1B,SAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,WAAW,CAAC,IAAI,CAKtF;IAED,SAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,oBAAoB,CAGrG;IAED,SAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,WAAW,CAAC,IAAI,CAMrF;IAED,SAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,QAUrD;IAED,SAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,MA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,CAAC,KAAK,CAAC,GACzE,UAAU,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,GACnE,CAAC,GAAG,EAAE,oBAAoB,KAAK,OAAO,CAAC,CAAC,CAAC,CAC5C,GAAG,KAAK,CAAC;AAEd,oBAAY,yBAAyB,CAAC,CAAC,IAAI;KACtC,CAAC,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC"}
|
package/lib/util/tracing.js
CHANGED
|
@@ -12,21 +12,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.PerOperationSampler = exports.TracingManager = exports.TraceContext = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const opentracing = require("opentracing");
|
|
16
|
+
const jaeger_client_1 = require("jaeger-client");
|
|
17
|
+
const opentracing_1 = require("opentracing");
|
|
18
|
+
const inversify_1 = require("inversify");
|
|
19
19
|
var TraceContext;
|
|
20
20
|
(function (TraceContext) {
|
|
21
|
-
function startSpan(operation,
|
|
22
|
-
|
|
23
|
-
childOf:
|
|
21
|
+
function startSpan(operation, parentCtx) {
|
|
22
|
+
const options = {
|
|
23
|
+
childOf: parentCtx.span
|
|
24
24
|
};
|
|
25
25
|
return opentracing.globalTracer().startSpan(operation, options);
|
|
26
26
|
}
|
|
27
27
|
TraceContext.startSpan = startSpan;
|
|
28
|
+
function childContextWithSpan(operation, parentCtx) {
|
|
29
|
+
const span = startSpan(operation, parentCtx);
|
|
30
|
+
return { span };
|
|
31
|
+
}
|
|
32
|
+
TraceContext.childContextWithSpan = childContextWithSpan;
|
|
28
33
|
function startAsyncSpan(operation, ctx) {
|
|
29
|
-
|
|
34
|
+
const options = {};
|
|
30
35
|
if (!!ctx.span) {
|
|
31
36
|
options.references = [opentracing.followsFrom(ctx.span.context())];
|
|
32
37
|
}
|
|
@@ -44,22 +49,53 @@ var TraceContext;
|
|
|
44
49
|
ctx.span.setTag("error", true);
|
|
45
50
|
}
|
|
46
51
|
TraceContext.logError = logError;
|
|
52
|
+
function logJsonRPCError(ctx, method, err) {
|
|
53
|
+
if (!ctx.span) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
logError(ctx, err);
|
|
57
|
+
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md#json-rpc
|
|
58
|
+
ctx.span.addTags({
|
|
59
|
+
rpc: {
|
|
60
|
+
system: "jsonrpc",
|
|
61
|
+
method,
|
|
62
|
+
jsonrpc: {
|
|
63
|
+
error_code: err.code,
|
|
64
|
+
error_message: err.message,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
TraceContext.logJsonRPCError = logJsonRPCError;
|
|
70
|
+
function addJsonRPCParameters(ctx, method, args) {
|
|
71
|
+
if (!ctx.span) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
ctx.span.addTags({
|
|
75
|
+
rpc: {
|
|
76
|
+
system: "jsonrpc",
|
|
77
|
+
method,
|
|
78
|
+
jsonrpc: {
|
|
79
|
+
parameters: args.slice(),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
TraceContext.addJsonRPCParameters = addJsonRPCParameters;
|
|
47
85
|
})(TraceContext = exports.TraceContext || (exports.TraceContext = {}));
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
TracingManager.prototype.getTracerForService = function (serviceName, opts) {
|
|
55
|
-
var config = {
|
|
86
|
+
let TracingManager = class TracingManager {
|
|
87
|
+
setup(serviceName, opts) {
|
|
88
|
+
(0, opentracing_1.initGlobalTracer)(this.getTracerForService(serviceName, opts));
|
|
89
|
+
}
|
|
90
|
+
getTracerForService(serviceName, opts) {
|
|
91
|
+
const config = {
|
|
56
92
|
disable: false,
|
|
57
93
|
reporter: {
|
|
58
94
|
logSpans: false
|
|
59
95
|
},
|
|
60
|
-
serviceName
|
|
96
|
+
serviceName
|
|
61
97
|
};
|
|
62
|
-
|
|
98
|
+
const t = (0, jaeger_client_1.initTracerFromEnv)(config, {
|
|
63
99
|
logger: console
|
|
64
100
|
});
|
|
65
101
|
if (opts) {
|
|
@@ -68,26 +104,25 @@ var TracingManager = /** @class */ (function () {
|
|
|
68
104
|
}
|
|
69
105
|
}
|
|
70
106
|
return t;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}());
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
TracingManager = __decorate([
|
|
110
|
+
(0, inversify_1.injectable)()
|
|
111
|
+
], TracingManager);
|
|
77
112
|
exports.TracingManager = TracingManager;
|
|
78
|
-
|
|
79
|
-
|
|
113
|
+
class PerOperationSampler {
|
|
114
|
+
constructor(fallback, strategies) {
|
|
80
115
|
this.fallback = fallback;
|
|
81
116
|
this.strategies = strategies;
|
|
82
117
|
}
|
|
83
|
-
|
|
118
|
+
name() {
|
|
84
119
|
return 'PerOperationSampler';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
120
|
+
}
|
|
121
|
+
toString() {
|
|
122
|
+
return `${this.name()}`;
|
|
123
|
+
}
|
|
124
|
+
isSampled(operation, tags) {
|
|
125
|
+
let shouldSample = this.strategies[operation];
|
|
91
126
|
if (shouldSample === undefined) {
|
|
92
127
|
if (!this.fallback.isSampled) {
|
|
93
128
|
return false;
|
|
@@ -95,31 +130,30 @@ var PerOperationSampler = /** @class */ (function () {
|
|
|
95
130
|
return this.fallback.isSampled(operation, tags);
|
|
96
131
|
}
|
|
97
132
|
return shouldSample;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
133
|
+
}
|
|
134
|
+
onCreateSpan(span) {
|
|
135
|
+
const outTags = {};
|
|
136
|
+
const isSampled = this.isSampled(span.operationName, outTags);
|
|
102
137
|
// NB: return retryable=true here since we can change decision after setOperationName().
|
|
103
138
|
return { sample: isSampled, retryable: true, tags: outTags };
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
139
|
+
}
|
|
140
|
+
onSetOperationName(span, operationName) {
|
|
141
|
+
const outTags = {};
|
|
142
|
+
const isSampled = this.isSampled(span.operationName, outTags);
|
|
108
143
|
return { sample: isSampled, retryable: false, tags: outTags };
|
|
109
|
-
}
|
|
110
|
-
|
|
144
|
+
}
|
|
145
|
+
onSetTag(span, key, value) {
|
|
111
146
|
return { sample: false, retryable: true, tags: null };
|
|
112
|
-
}
|
|
113
|
-
|
|
147
|
+
}
|
|
148
|
+
equal(other) {
|
|
114
149
|
return false; // TODO equal should be removed
|
|
115
|
-
}
|
|
116
|
-
|
|
150
|
+
}
|
|
151
|
+
close(callback) {
|
|
117
152
|
// all nested samplers are of simple types, so we do not need to Close them
|
|
118
153
|
if (callback) {
|
|
119
154
|
callback();
|
|
120
155
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
}());
|
|
156
|
+
}
|
|
157
|
+
}
|
|
124
158
|
exports.PerOperationSampler = PerOperationSampler;
|
|
125
159
|
//# sourceMappingURL=tracing.js.map
|
package/lib/util/tracing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/util/tracing.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAGH,
|
|
1
|
+
{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/util/tracing.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAGH,2CAA2C;AAC3C,iDAA4F;AA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AC;IAED,kBAAkB,CAAC,IAAsB,EAAE,aAAqB;QAC5D,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAE,IAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACvE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAClE,CAAC;IAED,QAAQ,CAAC,IAAsB,EAAE,GAAW,EAAE,KAAU;QACpD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,KAAc;QAChB,OAAO,KAAK,CAAC,CAAC,+BAA+B;IACjD,CAAC;IAED,KAAK,CAAC,QAAkB;QACpB,2EAA2E;QAC3E,IAAI,QAAQ,EAAE;YACV,QAAQ,EAAE,CAAC;SACd;IACL,CAAC;CACJ;AAlDD,kDAkDC"}
|
|
@@ -14,11 +14,11 @@ exports.worspacePortAuthCookieName = void 0;
|
|
|
14
14
|
* - server:
|
|
15
15
|
* - to authenticate access to port locations
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
const worspacePortAuthCookieName = function (host, workspaceId) {
|
|
18
18
|
return host
|
|
19
19
|
.replace(/https?/, '')
|
|
20
20
|
.replace(/[\W_]+/g, "_")
|
|
21
|
-
+
|
|
21
|
+
+ `_ws_${workspaceId}_port_auth_`;
|
|
22
22
|
};
|
|
23
23
|
exports.worspacePortAuthCookieName = worspacePortAuthCookieName;
|
|
24
24
|
//# sourceMappingURL=workspace-port-authentication.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-port-authentication.js","sourceRoot":"","sources":["../../src/util/workspace-port-authentication.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;;;EAOE;AACK,
|
|
1
|
+
{"version":3,"file":"workspace-port-authentication.js","sourceRoot":"","sources":["../../src/util/workspace-port-authentication.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;;;EAOE;AACK,MAAM,0BAA0B,GAAG,UAAS,IAAY,EAAE,WAAmB;IAChF,OAAO,IAAI;SACN,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;UACtB,OAAO,WAAW,aAAa,CAAC;AAC1C,CAAC,CAAC;AALW,QAAA,0BAA0B,8BAKrC"}
|