@gitpod/gitpod-protocol 0.1.5-wth-argo.0 → 0.1.5-wth-test.41
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 +8 -22
- 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 +20 -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/{util/without.js → analytics.js} +4 -2
- 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} +3 -1
- 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 +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 +132 -18
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +168 -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/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.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 +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/connection-error-handler.js +11 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +3 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +6 -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/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 +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 +94 -16
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +104 -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 +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 +7 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +103 -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/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 +32 -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 +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.js +43 -47
- package/lib/util/tracing.js.map +1 -1
- 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 +74 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +16 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +7 -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 +229 -0
- package/src/admin-protocol.ts +39 -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 +198 -33
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +4 -0
- package/src/index.ts +5 -1
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +8 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +2 -2
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +2 -1
- package/src/plans.ts +632 -0
- package/src/protocol.ts +153 -43
- 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 +132 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/deferred.ts +1 -1
- 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 +25 -1
- 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/queue.spec.ts +1 -1
- package/src/util/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/workspace-cluster.ts +96 -0
- package/src/workspace-instance.ts +31 -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
|
@@ -5,42 +5,30 @@
|
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
6
6
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
7
|
*/
|
|
8
|
-
var __assign = (this && this.__assign) || function () {
|
|
9
|
-
__assign = Object.assign || function(t) {
|
|
10
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11
|
-
s = arguments[i];
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
}
|
|
15
|
-
return t;
|
|
16
|
-
};
|
|
17
|
-
return __assign.apply(this, arguments);
|
|
18
|
-
};
|
|
19
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
9
|
exports.ConnectionErrorHandler = void 0;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
const logging_1 = require("../util/logging");
|
|
11
|
+
class ConnectionErrorHandler {
|
|
12
|
+
constructor(options) {
|
|
24
13
|
this.restarts = [];
|
|
25
|
-
this.options =
|
|
14
|
+
this.options = Object.assign({ maxErrors: 3, maxRestarts: 5, restartInterval: 3 }, options);
|
|
26
15
|
}
|
|
27
|
-
|
|
16
|
+
shouldStop(error, message, count) {
|
|
28
17
|
return !count || count > this.options.maxErrors;
|
|
29
|
-
}
|
|
30
|
-
|
|
18
|
+
}
|
|
19
|
+
shouldRestart() {
|
|
31
20
|
this.restarts.push(Date.now());
|
|
32
21
|
if (this.restarts.length <= this.options.maxRestarts) {
|
|
33
22
|
return true;
|
|
34
23
|
}
|
|
35
|
-
|
|
24
|
+
const diff = this.restarts[this.restarts.length - 1] - this.restarts[0];
|
|
36
25
|
if (diff <= this.options.restartInterval * 60 * 1000) {
|
|
37
|
-
logging_1.log.error(
|
|
26
|
+
logging_1.log.error(`Server ${this.options.serverName} crashed ${this.options.maxRestarts} times in the last ${this.options.restartInterval} minutes. Will not restart`);
|
|
38
27
|
return false;
|
|
39
28
|
}
|
|
40
29
|
this.restarts.shift();
|
|
41
30
|
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
}());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
45
33
|
exports.ConnectionErrorHandler = ConnectionErrorHandler;
|
|
46
34
|
//# sourceMappingURL=connection-error-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-error-handler.js","sourceRoot":"","sources":["../../src/messaging/connection-error-handler.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"connection-error-handler.js","sourceRoot":"","sources":["../../src/messaging/connection-error-handler.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,6CAAsC;AAsBtC,MAAa,sBAAsB;IAG/B,YAAY,OAAsC;QAa/B,aAAQ,GAAa,EAAE,CAAC;QAZvC,IAAI,CAAC,OAAO,mBACR,SAAS,EAAE,CAAC,EACZ,WAAW,EAAE,CAAC,EACd,eAAe,EAAE,CAAC,IACf,OAAO,CACb,CAAC;IACN,CAAC;IAED,UAAU,CAAC,KAAY,EAAE,OAAiB,EAAE,KAAc;QACtD,OAAO,CAAC,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACpD,CAAC;IAGD,aAAa;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC/B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;YAClD,OAAO,IAAI,CAAC;SACf;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxE,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,EAAE,GAAG,IAAI,EAAE;YAClD,aAAG,CAAC,KAAK,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,UAAU,YAAY,IAAI,CAAC,OAAO,CAAC,WAAW,sBAAsB,IAAI,CAAC,OAAO,CAAC,eAAe,4BAA4B,CAAC,CAAC;YAC/J,OAAO,KAAK,CAAC;SAChB;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ;AA/BD,wDA+BC"}
|
package/lib/messaging/error.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare namespace ErrorCodes {
|
|
|
13
13
|
const TOO_MANY_REQUESTS = 429;
|
|
14
14
|
const REPOSITORY_NOT_WHITELISTED = 430;
|
|
15
15
|
const CONTEXT_PARSE_ERROR = 460;
|
|
16
|
+
const INVALID_GITPOD_YML = 461;
|
|
16
17
|
const PAYMENT_ERROR = 450;
|
|
17
18
|
const USER_BLOCKED = 470;
|
|
18
19
|
const USER_DELETED = 471;
|
|
@@ -23,8 +24,9 @@ export declare namespace ErrorCodes {
|
|
|
23
24
|
const TOO_MANY_RUNNING_WORKSPACES = 490;
|
|
24
25
|
const EE_FEATURE = 501;
|
|
25
26
|
const EE_LICENSE_REQUIRED = 555;
|
|
27
|
+
const SAAS_FEATURE = 601;
|
|
26
28
|
const TEAM_SUBSCRIPTION_INVALID_QUANTITY = 610;
|
|
27
29
|
const TEAM_SUBSCRIPTION_ASSIGNMENT_FAILED = 620;
|
|
28
|
-
const
|
|
30
|
+
const SNAPSHOT_ERROR = 630;
|
|
29
31
|
}
|
|
30
32
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/messaging/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,yBAAiB,UAAU,CAAC;IAEjB,MAAM,iBAAiB,MAAM,CAAC;IAG9B,MAAM,iBAAiB,MAAM,CAAC;IAG9B,MAAM,iBAAiB,MAAM,CAAC;IAG9B,MAAM,SAAS,MAAM,CAAC;IAGtB,MAAM,QAAQ,MAAM,CAAC;IAGrB,MAAM,cAAc,MAAM,CAAC;IAG3B,MAAM,iBAAiB,MAAM,CAAC;IAG9B,MAAM,0BAA0B,MAAM,CAAC;IAGvC,MAAM,mBAAmB,MAAM,CAAC;IAGhC,MAAM,aAAa,MAAM,CAAC;IAG1B,MAAM,YAAY,MAAM,CAAC;IAGzB,MAAM,YAAY,MAAM,CAAC;IAGzB,MAAM,8BAA8B,MAAM,CAA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-26,6 +26,8 @@ var ErrorCodes;
|
|
|
26
26
|
ErrorCodes.REPOSITORY_NOT_WHITELISTED = 430;
|
|
27
27
|
// 460 Context Parse Error (custom status code)
|
|
28
28
|
ErrorCodes.CONTEXT_PARSE_ERROR = 460;
|
|
29
|
+
// 461 Invalid gitpod yml
|
|
30
|
+
ErrorCodes.INVALID_GITPOD_YML = 461;
|
|
29
31
|
// 450 Payment error
|
|
30
32
|
ErrorCodes.PAYMENT_ERROR = 450;
|
|
31
33
|
// 470 User Blocked (custom status code)
|
|
@@ -46,11 +48,13 @@ var ErrorCodes;
|
|
|
46
48
|
ErrorCodes.EE_FEATURE = 501;
|
|
47
49
|
// 555 EE License Required
|
|
48
50
|
ErrorCodes.EE_LICENSE_REQUIRED = 555;
|
|
51
|
+
// 601 SaaS Feature
|
|
52
|
+
ErrorCodes.SAAS_FEATURE = 601;
|
|
49
53
|
// 610 Invalid Team Subscription Quantity
|
|
50
54
|
ErrorCodes.TEAM_SUBSCRIPTION_INVALID_QUANTITY = 610;
|
|
51
55
|
// 620 Team Subscription Assignment Failed
|
|
52
56
|
ErrorCodes.TEAM_SUBSCRIPTION_ASSIGNMENT_FAILED = 620;
|
|
53
|
-
//
|
|
54
|
-
ErrorCodes.
|
|
57
|
+
// 630 Snapshot Error
|
|
58
|
+
ErrorCodes.SNAPSHOT_ERROR = 630;
|
|
55
59
|
})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
|
|
56
60
|
//# sourceMappingURL=error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/messaging/error.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH,IAAiB,UAAU,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/messaging/error.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH,IAAiB,UAAU,CAwE1B;AAxED,WAAiB,UAAU;IACvB,mBAAmB;IACN,4BAAiB,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|
5
5
|
onConnection(connection: MessageConnection, session?: object): void;
|
|
6
6
|
}
|
|
7
|
+
export interface ConnectionEventHandler {
|
|
8
|
+
/**
|
|
9
|
+
* Called when the transport underpinning the connection got closed
|
|
10
|
+
*/
|
|
11
|
+
onTransportDidClose(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Called when the transport underpinning the connection is (re-)opened
|
|
14
|
+
*/
|
|
15
|
+
onTransportDidOpen(): void;
|
|
16
|
+
}
|
|
7
17
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/messaging/handler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvE"}
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/messaging/handler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvE;AAED,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACF,mBAAmB,IAAI,IAAI,CAAC;IAE5B;;OAEG;IACH,kBAAkB,IAAI,IAAI,CAAC;CAC/B"}
|
|
@@ -7,40 +7,40 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.toIWebSocket = exports.openSocket = exports.openJsonRpcSocket = exports.createServerWebSocketConnection = void 0;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const ws = require("ws");
|
|
11
|
+
const url = require("url");
|
|
12
|
+
const vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
|
|
13
|
+
const logging_1 = require("../../util/logging");
|
|
14
14
|
function createServerWebSocketConnection(options, onConnect) {
|
|
15
|
-
openJsonRpcSocket(options,
|
|
16
|
-
onConnect(vscode_ws_jsonrpc_1.createWebSocketConnection(socket, console));
|
|
15
|
+
openJsonRpcSocket(options, socket => {
|
|
16
|
+
onConnect((0, vscode_ws_jsonrpc_1.createWebSocketConnection)(socket, console));
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
exports.createServerWebSocketConnection = createServerWebSocketConnection;
|
|
20
20
|
function openJsonRpcSocket(options, onOpen) {
|
|
21
|
-
openSocket(options,
|
|
22
|
-
|
|
21
|
+
openSocket(options, socket => {
|
|
22
|
+
const webSocket = toIWebSocket(socket);
|
|
23
23
|
onOpen(webSocket);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
exports.openJsonRpcSocket = openJsonRpcSocket;
|
|
27
27
|
function openSocket(options, onOpen) {
|
|
28
|
-
|
|
28
|
+
const wss = new ws.Server({
|
|
29
29
|
noServer: true,
|
|
30
30
|
perMessageDeflate: {
|
|
31
31
|
// don't compress if a message is less than 256kb
|
|
32
32
|
threshold: 256 * 1024
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
options.server.on('upgrade',
|
|
36
|
-
|
|
35
|
+
options.server.on('upgrade', (request, socket, head) => {
|
|
36
|
+
const pathname = request.url ? url.parse(request.url).pathname : undefined;
|
|
37
37
|
if (options.path && pathname === options.path || options.matches && options.matches(request)) {
|
|
38
|
-
wss.handleUpgrade(request, socket, head,
|
|
38
|
+
wss.handleUpgrade(request, socket, head, webSocket => {
|
|
39
39
|
if (webSocket.readyState === webSocket.OPEN) {
|
|
40
40
|
onOpen(webSocket, request, socket, head);
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
webSocket.on('open',
|
|
43
|
+
webSocket.on('open', () => onOpen(webSocket, request, socket, head));
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -48,25 +48,25 @@ function openSocket(options, onOpen) {
|
|
|
48
48
|
}
|
|
49
49
|
exports.openSocket = openSocket;
|
|
50
50
|
function toIWebSocket(webSocket) {
|
|
51
|
-
|
|
51
|
+
let sendsAfterOpen = 0;
|
|
52
52
|
return {
|
|
53
|
-
send:
|
|
53
|
+
send: content => {
|
|
54
54
|
if (webSocket.readyState !== ws.OPEN) {
|
|
55
55
|
if (sendsAfterOpen++ > 3) {
|
|
56
|
-
|
|
56
|
+
//log.debug(`Repeated try to send on closed web socket (readyState was ${webSocket.readyState})`, { ws });
|
|
57
57
|
}
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
webSocket.send(content,
|
|
60
|
+
webSocket.send(content, err => {
|
|
61
61
|
if (err) {
|
|
62
|
-
logging_1.log.error('
|
|
62
|
+
logging_1.log.error('error in ws.send()', err, { ws });
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
},
|
|
66
|
-
onMessage:
|
|
67
|
-
onError:
|
|
68
|
-
onClose:
|
|
69
|
-
dispose:
|
|
66
|
+
onMessage: cb => webSocket.on('message', cb),
|
|
67
|
+
onError: cb => webSocket.on('error', cb),
|
|
68
|
+
onClose: cb => webSocket.on('close', cb),
|
|
69
|
+
dispose: () => {
|
|
70
70
|
if (webSocket.readyState < ws.CLOSING) {
|
|
71
71
|
webSocket.close();
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/node/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"connection.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EAAE,CAAC,OAAO,EAAE;gBACnC,SAAS,CAAC,KAAK,EAAE,CAAC;aACrB;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AAzBD,oCAyBC"}
|
|
@@ -77,6 +77,8 @@ export declare class JsonRpcProxyFactory<T extends object> implements ProxyHandl
|
|
|
77
77
|
*/
|
|
78
78
|
constructor(target?: any);
|
|
79
79
|
protected waitForConnection(): void;
|
|
80
|
+
fireConnectionClosed(): void;
|
|
81
|
+
fireConnectionOpened(): void;
|
|
80
82
|
/**
|
|
81
83
|
* Connect a MessageConnection to the factory.
|
|
82
84
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.d.ts","sourceRoot":"","sources":["../../src/messaging/proxy-factory.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,oBAAY,aAAa,CAAC,MAAM,IAAI,UAAU,GAAG;IAC7C;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CAC/C,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1C,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CAC9C;AACD,oBAAY,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,6BAA6B,CAAC;AAEhE,qBAAa,wBAAwB,CAAC,CAAC,SAAS,MAAM,CAAE,YAAW,iBAAiB;IAE5E,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY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OAWG;cACa,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAavE;;;;;OAKG;IACH,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM9D;;;;;;OAMG;IACH,WAAW,IAAI,YAAY,CAAC,CAAC,CAAC;IAK9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG;IAiClD;;;;;;;;OAQG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;CAGpD"}
|
|
@@ -14,71 +14,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
14
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
19
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
-
function step(op) {
|
|
22
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
-
while (_) try {
|
|
24
|
-
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;
|
|
25
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
-
switch (op[0]) {
|
|
27
|
-
case 0: case 1: t = op; break;
|
|
28
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
-
default:
|
|
32
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
-
if (t[2]) _.ops.pop();
|
|
37
|
-
_.trys.pop(); continue;
|
|
38
|
-
}
|
|
39
|
-
op = body.call(thisArg, _);
|
|
40
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
45
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
46
|
-
if (!m) return o;
|
|
47
|
-
var i = m.call(o), r, ar = [], e;
|
|
48
|
-
try {
|
|
49
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
50
|
-
}
|
|
51
|
-
catch (error) { e = { error: error }; }
|
|
52
|
-
finally {
|
|
53
|
-
try {
|
|
54
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
55
|
-
}
|
|
56
|
-
finally { if (e) throw e.error; }
|
|
57
|
-
}
|
|
58
|
-
return ar;
|
|
59
|
-
};
|
|
60
|
-
var __spread = (this && this.__spread) || function () {
|
|
61
|
-
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
62
|
-
return ar;
|
|
63
|
-
};
|
|
64
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
18
|
exports.JsonRpcProxyFactory = exports.JsonRpcConnectionHandler = void 0;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
19
|
+
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
|
|
20
|
+
const event_1 = require("../util/event");
|
|
21
|
+
const logging_1 = require("../util/logging");
|
|
22
|
+
class JsonRpcConnectionHandler {
|
|
23
|
+
constructor(path, targetFactory) {
|
|
71
24
|
this.path = path;
|
|
72
25
|
this.targetFactory = targetFactory;
|
|
73
26
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
27
|
+
onConnection(connection, request) {
|
|
28
|
+
const factory = new JsonRpcProxyFactory();
|
|
29
|
+
const proxy = factory.createProxy();
|
|
77
30
|
factory.target = this.targetFactory(proxy, request);
|
|
78
31
|
factory.listen(connection);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
}());
|
|
32
|
+
}
|
|
33
|
+
}
|
|
82
34
|
exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
|
|
83
35
|
/**
|
|
84
36
|
* Factory for JSON-RPC proxy objects.
|
|
@@ -122,57 +74,45 @@ exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
|
|
|
122
74
|
*
|
|
123
75
|
* @param <T> - The type of the object to expose to JSON-RPC.
|
|
124
76
|
*/
|
|
125
|
-
|
|
77
|
+
class JsonRpcProxyFactory {
|
|
126
78
|
/**
|
|
127
79
|
* Build a new JsonRpcProxyFactory.
|
|
128
80
|
*
|
|
129
81
|
* @param target - The object to expose to JSON-RPC methods calls. If this
|
|
130
82
|
* is omitted, the proxy won't be able to handle requests, only send them.
|
|
131
83
|
*/
|
|
132
|
-
|
|
84
|
+
constructor(target) {
|
|
133
85
|
this.target = target;
|
|
134
86
|
this.onDidOpenConnectionEmitter = new event_1.Emitter();
|
|
135
87
|
this.onDidCloseConnectionEmitter = new event_1.Emitter();
|
|
136
88
|
this.waitForConnection();
|
|
137
89
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.connectionPromise
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.connectionPromise.then(function (connection) {
|
|
144
|
-
connection.onClose(function () {
|
|
145
|
-
return _this.onDidCloseConnectionEmitter.fire(undefined);
|
|
146
|
-
});
|
|
147
|
-
_this.onDidOpenConnectionEmitter.fire(undefined);
|
|
90
|
+
waitForConnection() {
|
|
91
|
+
this.connectionPromise = new Promise(resolve => this.connectionPromiseResolve = resolve);
|
|
92
|
+
this.connectionPromise.then(connection => {
|
|
93
|
+
connection.onClose(() => this.fireConnectionClosed());
|
|
94
|
+
this.fireConnectionOpened();
|
|
148
95
|
});
|
|
149
|
-
}
|
|
96
|
+
}
|
|
97
|
+
fireConnectionClosed() {
|
|
98
|
+
this.onDidCloseConnectionEmitter.fire(undefined);
|
|
99
|
+
}
|
|
100
|
+
fireConnectionOpened() {
|
|
101
|
+
this.onDidOpenConnectionEmitter.fire(undefined);
|
|
102
|
+
}
|
|
150
103
|
/**
|
|
151
104
|
* Connect a MessageConnection to the factory.
|
|
152
105
|
*
|
|
153
106
|
* This connection will be used to send/receive JSON-RPC requests and
|
|
154
107
|
* response.
|
|
155
108
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
connection.
|
|
159
|
-
|
|
160
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
161
|
-
params[_i - 1] = arguments[_i];
|
|
162
|
-
}
|
|
163
|
-
return _this.onRequest.apply(_this, __spread([method], params));
|
|
164
|
-
});
|
|
165
|
-
connection.onNotification(function (method) {
|
|
166
|
-
var params = [];
|
|
167
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
168
|
-
params[_i - 1] = arguments[_i];
|
|
169
|
-
}
|
|
170
|
-
return _this.onNotification.apply(_this, __spread([method], params));
|
|
171
|
-
});
|
|
172
|
-
connection.onDispose(function () { return _this.waitForConnection(); });
|
|
109
|
+
listen(connection) {
|
|
110
|
+
connection.onRequest((method, ...params) => this.onRequest(method, ...params));
|
|
111
|
+
connection.onNotification((method, ...params) => this.onNotification(method, ...params));
|
|
112
|
+
connection.onDispose(() => this.waitForConnection());
|
|
173
113
|
connection.listen();
|
|
174
114
|
this.connectionPromiseResolve(connection);
|
|
175
|
-
}
|
|
115
|
+
}
|
|
176
116
|
/**
|
|
177
117
|
* Process an incoming JSON-RPC method call.
|
|
178
118
|
*
|
|
@@ -185,48 +125,33 @@ var JsonRpcProxyFactory = /** @class */ (function () {
|
|
|
185
125
|
*
|
|
186
126
|
* @returns A promise of the method call completion.
|
|
187
127
|
*/
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
_b.trys.push([0, 2, , 3]);
|
|
200
|
-
return [4 /*yield*/, (_a = this.target)[method].apply(_a, __spread(args))];
|
|
201
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
202
|
-
case 2:
|
|
203
|
-
e_1 = _b.sent();
|
|
204
|
-
if (e_1 instanceof vscode_jsonrpc_1.ResponseError) {
|
|
205
|
-
logging_1.log.info("Request " + method + " unsuccessful: " + e_1.code + "/\"" + e_1.message + "\"", { method: method, args: args });
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
logging_1.log.error("Request " + method + " failed with internal server error", e_1, { method: method, args: args });
|
|
209
|
-
}
|
|
210
|
-
throw e_1;
|
|
211
|
-
case 3: return [2 /*return*/];
|
|
128
|
+
onRequest(method, ...args) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
try {
|
|
131
|
+
return yield this.target[method](...args);
|
|
132
|
+
}
|
|
133
|
+
catch (e) {
|
|
134
|
+
if (e instanceof vscode_jsonrpc_1.ResponseError) {
|
|
135
|
+
logging_1.log.info(`Request ${method} unsuccessful: ${e.code}/"${e.message}"`, { method, args });
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
logging_1.log.error(`Request ${method} failed with internal server error`, e, { method, args });
|
|
212
139
|
}
|
|
213
|
-
|
|
140
|
+
throw e;
|
|
141
|
+
}
|
|
214
142
|
});
|
|
215
|
-
}
|
|
143
|
+
}
|
|
216
144
|
/**
|
|
217
145
|
* Process an incoming JSON-RPC notification.
|
|
218
146
|
*
|
|
219
147
|
* Same as [[onRequest]], but called on incoming notifications rather than
|
|
220
148
|
* methods calls.
|
|
221
149
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
226
|
-
args[_i - 1] = arguments[_i];
|
|
150
|
+
onNotification(method, ...args) {
|
|
151
|
+
if (this.target[method]) {
|
|
152
|
+
this.target[method](...args);
|
|
227
153
|
}
|
|
228
|
-
|
|
229
|
-
};
|
|
154
|
+
}
|
|
230
155
|
/**
|
|
231
156
|
* Create a Proxy exposing the interface of an object of type T. This Proxy
|
|
232
157
|
* can be used to do JSON-RPC method calls on the remote target object as
|
|
@@ -234,10 +159,10 @@ var JsonRpcProxyFactory = /** @class */ (function () {
|
|
|
234
159
|
*
|
|
235
160
|
* If `T` implements `JsonRpcServer` then a client is used as a target object for a remote target object.
|
|
236
161
|
*/
|
|
237
|
-
|
|
238
|
-
|
|
162
|
+
createProxy() {
|
|
163
|
+
const result = new Proxy(this, this);
|
|
239
164
|
return result;
|
|
240
|
-
}
|
|
165
|
+
}
|
|
241
166
|
/**
|
|
242
167
|
* Get a callable object that executes a JSON-RPC method call.
|
|
243
168
|
*
|
|
@@ -260,11 +185,10 @@ var JsonRpcProxyFactory = /** @class */ (function () {
|
|
|
260
185
|
* @param receiver - unused.
|
|
261
186
|
* @returns A callable that executes the JSON-RPC call.
|
|
262
187
|
*/
|
|
263
|
-
|
|
264
|
-
var _this = this;
|
|
188
|
+
get(target, p, receiver) {
|
|
265
189
|
if (p === 'setClient') {
|
|
266
|
-
return
|
|
267
|
-
|
|
190
|
+
return (client) => {
|
|
191
|
+
this.target = client;
|
|
268
192
|
};
|
|
269
193
|
}
|
|
270
194
|
if (p === 'onDidOpenConnection') {
|
|
@@ -273,33 +197,25 @@ var JsonRpcProxyFactory = /** @class */ (function () {
|
|
|
273
197
|
if (p === 'onDidCloseConnection') {
|
|
274
198
|
return this.onDidCloseConnectionEmitter.event;
|
|
275
199
|
}
|
|
276
|
-
|
|
277
|
-
return
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
200
|
+
const isNotify = this.isNotification(p);
|
|
201
|
+
return (...args) => this.connectionPromise.then(connection => new Promise((resolve, reject) => {
|
|
202
|
+
try {
|
|
203
|
+
if (isNotify) {
|
|
204
|
+
connection.sendNotification(p.toString(), ...args);
|
|
205
|
+
resolve(undefined);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
const resultPromise = connection.sendRequest(p.toString(), ...args);
|
|
209
|
+
resultPromise
|
|
210
|
+
.catch((err) => reject(err))
|
|
211
|
+
.then((result) => resolve(result));
|
|
212
|
+
}
|
|
281
213
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
resolve();
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
var resultPromise = connection.sendRequest.apply(connection, __spread([p.toString()], args));
|
|
291
|
-
resultPromise
|
|
292
|
-
.catch(function (err) { return reject(err); })
|
|
293
|
-
.then(function (result) { return resolve(result); });
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
catch (err) {
|
|
297
|
-
reject(err);
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
|
-
};
|
|
214
|
+
catch (err) {
|
|
215
|
+
reject(err);
|
|
216
|
+
}
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
303
219
|
/**
|
|
304
220
|
* Return whether the given property represents a notification.
|
|
305
221
|
*
|
|
@@ -309,10 +225,9 @@ var JsonRpcProxyFactory = /** @class */ (function () {
|
|
|
309
225
|
* @param p - The property being called on the proxy.
|
|
310
226
|
* @return Whether `p` represents a notification.
|
|
311
227
|
*/
|
|
312
|
-
|
|
228
|
+
isNotification(p) {
|
|
313
229
|
return p.toString().startsWith("notify") || p.toString().startsWith("on");
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
}());
|
|
230
|
+
}
|
|
231
|
+
}
|
|
317
232
|
exports.JsonRpcProxyFactory = JsonRpcProxyFactory;
|
|
318
233
|
//# sourceMappingURL=proxy-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../src/messaging/proxy-factory.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../src/messaging/proxy-factory.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;AAEH,mDAAkE;AAClE,yCAA+C;AAG/C,6CAAsC;AAiBtC,MAAa,wBAAwB;IACjC,YACa,IAAY,EACZ,aAAgE;QADhE,SAAI,GAAJ,IAAI,CAAQ;QACZ,kBAAa,GAAb,aAAa,CAAmD;IACzE,CAAC;IAEL,YAAY,CAAC,UAA6B,EAAE,OAAgB;QACxD,MAAM,OAAO,GAAG,IAAI,mBAAmB,EAAK,CAAC;QAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC;CACJ;AAZD,4DAYC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,mBAAmB;IAQ5B;;;;;OAKG;IACH,YAAmB,MAAY;QAAZ,WAAM,GAAN,MAAM,CAAM;QAZZ,+BAA0B,GAAG,I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