@gitpod/gitpod-protocol 0.1.5-test.9 → 0.1.5-tweak-workspaceconfig-origin-docs-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/builtin-theia-plugins.json +28 -18
- package/data/gitpod-schema.json +17 -17
- 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 +22 -5
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +16 -1
- 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 +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/context-url.spec.d.ts +12 -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 +2 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +6 -5
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.js +7 -5
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +1 -1
- package/lib/encryption/encryption-engine.js +21 -21
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +2 -2
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +31 -37
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +1 -1
- package/lib/encryption/encryption-service.js +31 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +2 -2
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +27 -31
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +2 -3
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +21 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.js +27 -42
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +117 -117
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +186 -34
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +239 -116
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +9 -12
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +5 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +26 -0
- package/lib/ide-frontend-service.d.ts.map +1 -0
- package/lib/ide-frontend-service.js +8 -0
- package/lib/ide-frontend-service.js.map +1 -0
- 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 +5 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +25 -12
- package/lib/index.js.map +1 -1
- package/lib/license-protocol.d.ts +1 -1
- package/lib/license-protocol.js +2 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +6 -4
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +188 -48
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +26 -0
- package/lib/messaging/browser/window-connection.d.ts.map +1 -0
- package/lib/messaging/browser/window-connection.js +68 -0
- package/lib/messaging/browser/window-connection.js.map +1 -0
- 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 +12 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +6 -2
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +13 -4
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/handler.js +1 -0
- package/lib/messaging/handler.js.map +1 -1
- package/lib/messaging/node/connection.js +23 -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 +75 -169
- 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 +14 -12
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +21 -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 +123 -30
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +121 -117
- 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} +3 -4
- 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/theia-plugins.d.ts +1 -1
- package/lib/theia-plugins.js +1 -1
- package/lib/typings/globals.d.ts +12 -0
- package/lib/typings/globals.d.ts.map +1 -0
- package/lib/typings/globals.js +7 -0
- package/lib/typings/globals.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.d.ts +1 -1
- package/lib/util/async-iterator.js +57 -134
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +19 -60
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +10 -9
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deep-partial.d.ts +1 -1
- package/lib/util/deep-partial.js +1 -1
- package/lib/util/deferred.d.ts +1 -1
- package/lib/util/deferred.js +12 -13
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts +2 -2
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +27 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +59 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -1
- package/lib/util/garbage-collected-cache.js +24 -47
- 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 +470 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/generate-workspace-id.spec.d.ts +7 -0
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +63 -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 +8 -3
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +106 -76
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +16 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
- package/lib/util/gitpod-host-url.spec.js +124 -0
- package/lib/util/gitpod-host-url.spec.js.map +1 -0
- 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 +57 -34
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +119 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.d.ts +1 -1
- package/lib/util/make-link.js +4 -3
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +14 -4
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +39 -8
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +9 -1
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +129 -48
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +1 -1
- package/lib/util/queue.js +18 -56
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.d.ts +1 -1
- package/lib/util/queue.spec.js +145 -287
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeater.d.ts +1 -1
- package/lib/util/repeater.js +37 -89
- package/lib/util/repeater.js.map +1 -1
- package/lib/util/safe-promise.d.ts +1 -1
- package/lib/util/safe-promise.js +11 -13
- package/lib/util/safe-promise.js.map +1 -1
- package/lib/util/semaphore.d.ts +1 -1
- package/lib/util/semaphore.js +17 -47
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.js +8 -7
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +1 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +30 -17
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +1 -1
- package/lib/util/timeutil.spec.js +23 -25
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +15 -2
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +86 -51
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/workspace-port-authentication.d.ts +1 -1
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +5 -3
- 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 +10 -4
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +3 -2
- package/lib/wsready.js.map +1 -1
- package/package.json +32 -16
- package/pkg-yarn.lock +18 -9
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +41 -6
- package/src/analytics.ts +54 -0
- package/src/auth.ts +27 -0
- package/src/context-url.spec.ts +39 -0
- package/src/context-url.ts +51 -0
- package/src/email-protocol.ts +3 -4
- package/src/encryption/container-module.ts +1 -1
- package/src/encryption/encryption-engine.spec.ts +1 -1
- package/src/encryption/encryption-engine.ts +1 -1
- package/src/encryption/encryption-service.ts +1 -1
- package/src/encryption/key-provider.ts +1 -1
- package/src/env.ts +11 -11
- package/src/gitpod-file-parser.spec.ts +1 -1
- package/src/gitpod-file-parser.ts +1 -1
- package/src/gitpod-service.ts +386 -52
- package/src/headless-workspace-log.ts +8 -12
- package/src/ide-frontend-service.ts +28 -0
- package/src/ide-protocol.ts +92 -0
- package/src/index.ts +6 -2
- package/src/license-protocol.ts +1 -1
- package/src/messaging/browser/connection.ts +201 -23
- package/src/messaging/browser/window-connection.ts +72 -0
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +16 -4
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +2 -2
- package/src/messaging/proxy-factory.ts +16 -14
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +9 -8
- package/src/plans.ts +632 -0
- package/src/protocol.ts +204 -61
- 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/theia-plugins.ts +1 -1
- package/src/typings/globals.ts +12 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/async-iterator.ts +1 -1
- package/src/util/cancelable.ts +1 -1
- package/src/util/date-time.ts +1 -1
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +2 -2
- package/src/util/garbage-collected-cache.ts +3 -3
- package/src/util/generate-workspace-id.spec.ts +31 -0
- package/src/util/generate-workspace-id.ts +457 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +49 -0
- package/src/util/gitpod-host-url.ts +58 -14
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client.d.ts +1 -1
- package/src/util/logging.ts +111 -39
- package/src/util/make-link.ts +1 -1
- package/src/util/parse-workspace-id.spec.ts +46 -5
- package/src/util/parse-workspace-id.ts +39 -8
- package/src/util/queue.spec.ts +2 -2
- package/src/util/queue.ts +1 -1
- package/src/util/repeater.ts +1 -1
- package/src/util/safe-promise.ts +1 -1
- package/src/util/semaphore.ts +3 -3
- package/src/util/skip-if.ts +2 -2
- package/src/util/timeutil.spec.ts +1 -1
- package/src/util/timeutil.ts +5 -5
- package/src/util/tracing.ts +66 -4
- package/src/util/workspace-port-authentication.ts +1 -1
- package/src/workspace-cluster.ts +96 -0
- package/src/workspace-instance.ts +38 -16
- package/src/wsready.ts +2 -2
- 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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import * as prometheusClient from 'prom-client';
|
|
7
|
+
declare type GrpcMethodType = 'unary' | 'client_stream' | 'server_stream' | 'bidi_stream';
|
|
8
|
+
export interface IGrpcCallMetricsLabels {
|
|
9
|
+
service: string;
|
|
10
|
+
method: string;
|
|
11
|
+
type: GrpcMethodType;
|
|
12
|
+
}
|
|
13
|
+
export interface IGrpcCallMetricsLabelsWithCode extends IGrpcCallMetricsLabels {
|
|
14
|
+
code: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const IClientCallMetrics: unique symbol;
|
|
17
|
+
export interface IClientCallMetrics {
|
|
18
|
+
started(labels: IGrpcCallMetricsLabels): void;
|
|
19
|
+
sent(labels: IGrpcCallMetricsLabels): void;
|
|
20
|
+
received(labels: IGrpcCallMetricsLabels): void;
|
|
21
|
+
handled(labels: IGrpcCallMetricsLabelsWithCode): void;
|
|
22
|
+
}
|
|
23
|
+
export declare class PrometheusClientCallMetrics implements IClientCallMetrics {
|
|
24
|
+
readonly startedCounter: prometheusClient.Counter<string>;
|
|
25
|
+
readonly sentCounter: prometheusClient.Counter<string>;
|
|
26
|
+
readonly receivedCounter: prometheusClient.Counter<string>;
|
|
27
|
+
readonly handledCounter: prometheusClient.Counter<string>;
|
|
28
|
+
constructor();
|
|
29
|
+
started(labels: IGrpcCallMetricsLabels): void;
|
|
30
|
+
sent(labels: IGrpcCallMetricsLabels): void;
|
|
31
|
+
received(labels: IGrpcCallMetricsLabels): void;
|
|
32
|
+
handled(labels: IGrpcCallMetricsLabelsWithCode): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=client-call-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-call-metrics.d.ts","sourceRoot":"","sources":["../../src/messaging/client-call-metrics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,gBAAgB,MAAM,aAAa,CAAC;AAEhD,aAAK,cAAc,GAAG,OAAO,GAAG,eAAe,GAAG,eAAe,GAAG,aAAa,CAAC;AAClF,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC7E,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IAClC,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAI,IAAI,CAAC;IAC5C,IAAI,CAAC,MAAM,EAAE,sBAAsB,GAAI,IAAI,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAI,IAAI,CAAC;IAChD,OAAO,CAAC,MAAM,EAAE,8BAA8B,GAAI,IAAI,CAAC;CAC1D;AAED,qBACa,2BAA4B,YAAW,kBAAkB;IAErE,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,QAAQ,CAAC,eAAe,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;;IA6B1D,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAQ7C,IAAI,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAQ1C,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAQ9C,OAAO,CAAC,MAAM,EAAE,8BAA8B,GAAG,IAAI;CAQrD"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
4
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
+
* See License-AGPL.txt in the project root for license information.
|
|
6
|
+
*/
|
|
7
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
|
+
};
|
|
13
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PrometheusClientCallMetrics = exports.IClientCallMetrics = void 0;
|
|
18
|
+
const inversify_1 = require("inversify");
|
|
19
|
+
const prometheusClient = require("prom-client");
|
|
20
|
+
exports.IClientCallMetrics = Symbol("IClientCallMetrics");
|
|
21
|
+
let PrometheusClientCallMetrics = class PrometheusClientCallMetrics {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.startedCounter = new prometheusClient.Counter({
|
|
24
|
+
name: 'grpc_client_started_total',
|
|
25
|
+
help: 'Total number of RPCs started on the client.',
|
|
26
|
+
labelNames: ['grpc_service', 'grpc_method', 'grpc_type'],
|
|
27
|
+
registers: [prometheusClient.register]
|
|
28
|
+
});
|
|
29
|
+
this.sentCounter = new prometheusClient.Counter({
|
|
30
|
+
name: 'grpc_client_msg_sent_total',
|
|
31
|
+
help: ' Total number of gRPC stream messages sent by the client.',
|
|
32
|
+
labelNames: ['grpc_service', 'grpc_method', 'grpc_type'],
|
|
33
|
+
registers: [prometheusClient.register]
|
|
34
|
+
});
|
|
35
|
+
this.receivedCounter = new prometheusClient.Counter({
|
|
36
|
+
name: 'grpc_client_msg_received_total',
|
|
37
|
+
help: 'Total number of RPC stream messages received by the client.',
|
|
38
|
+
labelNames: ['grpc_service', 'grpc_method', 'grpc_type'],
|
|
39
|
+
registers: [prometheusClient.register]
|
|
40
|
+
});
|
|
41
|
+
this.handledCounter = new prometheusClient.Counter({
|
|
42
|
+
name: 'grpc_client_handled_total',
|
|
43
|
+
help: 'Total number of RPCs completed by the client, regardless of success or failure.',
|
|
44
|
+
labelNames: ['grpc_service', 'grpc_method', 'grpc_type', 'grpc_code'],
|
|
45
|
+
registers: [prometheusClient.register]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
started(labels) {
|
|
49
|
+
this.startedCounter.inc({
|
|
50
|
+
grpc_service: labels.service,
|
|
51
|
+
grpc_method: labels.method,
|
|
52
|
+
grpc_type: labels.type
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
sent(labels) {
|
|
56
|
+
this.sentCounter.inc({
|
|
57
|
+
grpc_service: labels.service,
|
|
58
|
+
grpc_method: labels.method,
|
|
59
|
+
grpc_type: labels.type
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
received(labels) {
|
|
63
|
+
this.receivedCounter.inc({
|
|
64
|
+
grpc_service: labels.service,
|
|
65
|
+
grpc_method: labels.method,
|
|
66
|
+
grpc_type: labels.type
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
handled(labels) {
|
|
70
|
+
this.handledCounter.inc({
|
|
71
|
+
grpc_service: labels.service,
|
|
72
|
+
grpc_method: labels.method,
|
|
73
|
+
grpc_type: labels.type,
|
|
74
|
+
grpc_code: labels.code
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
PrometheusClientCallMetrics = __decorate([
|
|
79
|
+
(0, inversify_1.injectable)(),
|
|
80
|
+
__metadata("design:paramtypes", [])
|
|
81
|
+
], PrometheusClientCallMetrics);
|
|
82
|
+
exports.PrometheusClientCallMetrics = PrometheusClientCallMetrics;
|
|
83
|
+
//# sourceMappingURL=client-call-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-call-metrics.js","sourceRoot":"","sources":["../../src/messaging/client-call-metrics.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,yCAAuC;AACvC,gDAAgD;AAanC,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAU/D,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IAOvC;QACC,IAAI,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC;YAClD,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,6CAA6C;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M;YAC1B,SAAS,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,MAA8B;QACtC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC;YACxB,YAAY,EAAE,MAAM,CAAC,OAAO;YAC5B,WAAW,EAAE,MAAM,CAAC,MAAM;YAC1B,SAAS,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,MAAsC;QAC7C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;YACvB,YAAY,EAAE,MAAM,CAAC,OAAO;YAC5B,WAAW,EAAE,MAAM,CAAC,MAAM;YAC1B,SAAS,EAAE,MAAM,CAAC,IAAI;YACtB,SAAS,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AAlEY,2BAA2B;IADvC,IAAA,sBAAU,GAAE;;GACA,2BAA2B,CAkEvC;AAlEY,kEAA2B"}
|
|
@@ -5,41 +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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
exports.ConnectionErrorHandler = void 0;
|
|
10
|
+
const logging_1 = require("../util/logging");
|
|
11
|
+
class ConnectionErrorHandler {
|
|
12
|
+
constructor(options) {
|
|
23
13
|
this.restarts = [];
|
|
24
|
-
this.options =
|
|
14
|
+
this.options = Object.assign({ maxErrors: 3, maxRestarts: 5, restartInterval: 3 }, options);
|
|
25
15
|
}
|
|
26
|
-
|
|
16
|
+
shouldStop(error, message, count) {
|
|
27
17
|
return !count || count > this.options.maxErrors;
|
|
28
|
-
}
|
|
29
|
-
|
|
18
|
+
}
|
|
19
|
+
shouldRestart() {
|
|
30
20
|
this.restarts.push(Date.now());
|
|
31
21
|
if (this.restarts.length <= this.options.maxRestarts) {
|
|
32
22
|
return true;
|
|
33
23
|
}
|
|
34
|
-
|
|
24
|
+
const diff = this.restarts[this.restarts.length - 1] - this.restarts[0];
|
|
35
25
|
if (diff <= this.options.restartInterval * 60 * 1000) {
|
|
36
|
-
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`);
|
|
37
27
|
return false;
|
|
38
28
|
}
|
|
39
29
|
this.restarts.shift();
|
|
40
30
|
return true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
}());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
44
33
|
exports.ConnectionErrorHandler = ConnectionErrorHandler;
|
|
45
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
@@ -10,19 +10,23 @@ export declare namespace ErrorCodes {
|
|
|
10
10
|
const NOT_FOUND = 404;
|
|
11
11
|
const CONFLICT = 409;
|
|
12
12
|
const SETUP_REQUIRED = 410;
|
|
13
|
+
const TOO_MANY_REQUESTS = 429;
|
|
13
14
|
const REPOSITORY_NOT_WHITELISTED = 430;
|
|
14
15
|
const CONTEXT_PARSE_ERROR = 460;
|
|
16
|
+
const INVALID_GITPOD_YML = 461;
|
|
15
17
|
const PAYMENT_ERROR = 450;
|
|
16
18
|
const USER_BLOCKED = 470;
|
|
17
19
|
const USER_DELETED = 471;
|
|
20
|
+
const USER_TERMS_ACCEPTANCE_REQUIRED = 472;
|
|
18
21
|
const PLAN_DOES_NOT_ALLOW_PRIVATE_REPOS = 480;
|
|
19
22
|
const PLAN_PROFESSIONAL_REQUIRED = 481;
|
|
20
23
|
const PLAN_ONLY_ALLOWED_FOR_STUDENTS = 485;
|
|
21
24
|
const TOO_MANY_RUNNING_WORKSPACES = 490;
|
|
22
25
|
const EE_FEATURE = 501;
|
|
23
26
|
const EE_LICENSE_REQUIRED = 555;
|
|
27
|
+
const SAAS_FEATURE = 601;
|
|
24
28
|
const TEAM_SUBSCRIPTION_INVALID_QUANTITY = 610;
|
|
25
29
|
const TEAM_SUBSCRIPTION_ASSIGNMENT_FAILED = 620;
|
|
26
|
-
const
|
|
30
|
+
const SNAPSHOT_ERROR = 630;
|
|
27
31
|
}
|
|
28
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,0BAA0B,MAA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B,MAAM,kCAAkC,MAAM,CAAC;IAG/C,MAAM,mCAAmC,MAAM,CAAC;IAGhD,MAAM,cAAc,MAAM,CAAC;CACrC"}
|
package/lib/messaging/error.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020
|
|
3
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
5
|
* See License-AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ErrorCodes = void 0;
|
|
8
9
|
var ErrorCodes;
|
|
9
10
|
(function (ErrorCodes) {
|
|
10
11
|
// 401 Unauthorized
|
|
@@ -19,16 +20,22 @@ var ErrorCodes;
|
|
|
19
20
|
ErrorCodes.CONFLICT = 409;
|
|
20
21
|
// 410 No User
|
|
21
22
|
ErrorCodes.SETUP_REQUIRED = 410;
|
|
23
|
+
// 429 Too Many Requests
|
|
24
|
+
ErrorCodes.TOO_MANY_REQUESTS = 429;
|
|
22
25
|
// 430 Repository not whitelisted (custom status code)
|
|
23
26
|
ErrorCodes.REPOSITORY_NOT_WHITELISTED = 430;
|
|
24
27
|
// 460 Context Parse Error (custom status code)
|
|
25
28
|
ErrorCodes.CONTEXT_PARSE_ERROR = 460;
|
|
29
|
+
// 461 Invalid gitpod yml
|
|
30
|
+
ErrorCodes.INVALID_GITPOD_YML = 461;
|
|
26
31
|
// 450 Payment error
|
|
27
32
|
ErrorCodes.PAYMENT_ERROR = 450;
|
|
28
33
|
// 470 User Blocked (custom status code)
|
|
29
34
|
ErrorCodes.USER_BLOCKED = 470;
|
|
30
|
-
// 471 User
|
|
35
|
+
// 471 User Deleted (custom status code)
|
|
31
36
|
ErrorCodes.USER_DELETED = 471;
|
|
37
|
+
// 472 Terms Acceptance Required (custom status code)
|
|
38
|
+
ErrorCodes.USER_TERMS_ACCEPTANCE_REQUIRED = 472;
|
|
32
39
|
// 480 Plan does not allow private repos
|
|
33
40
|
ErrorCodes.PLAN_DOES_NOT_ALLOW_PRIVATE_REPOS = 480;
|
|
34
41
|
// 481 Professional plan is required for this operation
|
|
@@ -41,11 +48,13 @@ var ErrorCodes;
|
|
|
41
48
|
ErrorCodes.EE_FEATURE = 501;
|
|
42
49
|
// 555 EE License Required
|
|
43
50
|
ErrorCodes.EE_LICENSE_REQUIRED = 555;
|
|
51
|
+
// 601 SaaS Feature
|
|
52
|
+
ErrorCodes.SAAS_FEATURE = 601;
|
|
44
53
|
// 610 Invalid Team Subscription Quantity
|
|
45
54
|
ErrorCodes.TEAM_SUBSCRIPTION_INVALID_QUANTITY = 610;
|
|
46
55
|
// 620 Team Subscription Assignment Failed
|
|
47
56
|
ErrorCodes.TEAM_SUBSCRIPTION_ASSIGNMENT_FAILED = 620;
|
|
48
|
-
//
|
|
49
|
-
ErrorCodes.
|
|
57
|
+
// 630 Snapshot Error
|
|
58
|
+
ErrorCodes.SNAPSHOT_ERROR = 630;
|
|
50
59
|
})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
|
|
51
60
|
//# sourceMappingURL=error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/messaging/error.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
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,GAAG,GAAG,CAAC;IAErC,uBAAuB;IACV,4BAAiB,GAAG,GAAG,CAAC;IAErC,gBAAgB;IACH,4BAAiB,GAAG,GAAG,CAAC;IAErC,gBAAgB;IACH,oBAAS,GAAG,GAAG,CAAC;IAE7B,uCAAuC;IAC1B,mBAAQ,GAAG,GAAG,CAAC;IAE5B,cAAc;IACD,yBAAc,GAAG,GAAG,CAAC;IAElC,wBAAwB;IACX,4BAAiB,GAAG,GAAG,CAAC;IAErC,sDAAsD;IACzC,qCAA0B,GAAG,GAAG,CAAC;IAE9C,+CAA+C;IAClC,8BAAmB,GAAG,GAAG,CAAC;IAEvC,yBAAyB;IACZ,6BAAkB,GAAG,GAAG,CAAC;IAEtC,oBAAoB;IACP,wBAAa,GAAG,GAAG,CAAC;IAEjC,wCAAwC;IAC3B,uBAAY,GAAG,GAAG,CAAC;IAEhC,wCAAwC;IAC3B,uBAAY,GAAG,GAAG,CAAC;IAEhC,qDAAqD;IACxC,yCAA8B,GAAG,GAAG,CAAC;IAElD,wCAAwC;IAC3B,4CAAiC,GAAG,GAAG,CAAC;IAErD,uDAAuD;IAC1C,qCAA0B,GAAG,GAAG,CAAC;IAE9C,wCAAwC;IAC3B,yCAA8B,GAAG,GAAG,CAAC;IAElD,iCAAiC;IACpB,sCAA2B,GAAG,GAAG,CAAC;IAE/C,iBAAiB;IACJ,qBAAU,GAAG,GAAG,CAAC;IAE9B,0BAA0B;IACb,8BAAmB,GAAG,GAAG,CAAC;IAEvC,mBAAmB;IACN,uBAAY,GAAG,GAAG,CAAC;IAEhC,yCAAyC;IAC5B,6CAAkC,GAAG,GAAG,CAAC;IAEtD,0CAA0C;IAC7B,8CAAmC,GAAG,GAAG,CAAC;IAEvD,qBAAqB;IACR,yBAAc,GAAG,GAAG,CAAC;AACtC,CAAC,EAxEgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAwE1B"}
|
|
@@ -4,4 +4,14 @@ export interface ConnectionHandler {
|
|
|
4
4
|
readonly path: string;
|
|
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"}
|
package/lib/messaging/handler.js
CHANGED
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ConnectionHandler = void 0;
|
|
9
10
|
exports.ConnectionHandler = Symbol('ConnectionHandler');
|
|
10
11
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/messaging/handler.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/messaging/handler.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIU,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -6,40 +6,41 @@
|
|
|
6
6
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
exports.toIWebSocket = exports.openSocket = exports.openJsonRpcSocket = exports.createServerWebSocketConnection = void 0;
|
|
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");
|
|
13
14
|
function createServerWebSocketConnection(options, onConnect) {
|
|
14
|
-
openJsonRpcSocket(options,
|
|
15
|
-
onConnect(vscode_ws_jsonrpc_1.createWebSocketConnection(socket, console));
|
|
15
|
+
openJsonRpcSocket(options, socket => {
|
|
16
|
+
onConnect((0, vscode_ws_jsonrpc_1.createWebSocketConnection)(socket, console));
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
exports.createServerWebSocketConnection = createServerWebSocketConnection;
|
|
19
20
|
function openJsonRpcSocket(options, onOpen) {
|
|
20
|
-
openSocket(options,
|
|
21
|
-
|
|
21
|
+
openSocket(options, socket => {
|
|
22
|
+
const webSocket = toIWebSocket(socket);
|
|
22
23
|
onOpen(webSocket);
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
exports.openJsonRpcSocket = openJsonRpcSocket;
|
|
26
27
|
function openSocket(options, onOpen) {
|
|
27
|
-
|
|
28
|
+
const wss = new ws.Server({
|
|
28
29
|
noServer: true,
|
|
29
30
|
perMessageDeflate: {
|
|
30
31
|
// don't compress if a message is less than 256kb
|
|
31
32
|
threshold: 256 * 1024
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
|
-
options.server.on('upgrade',
|
|
35
|
-
|
|
35
|
+
options.server.on('upgrade', (request, socket, head) => {
|
|
36
|
+
const pathname = request.url ? url.parse(request.url).pathname : undefined;
|
|
36
37
|
if (options.path && pathname === options.path || options.matches && options.matches(request)) {
|
|
37
|
-
wss.handleUpgrade(request, socket, head,
|
|
38
|
+
wss.handleUpgrade(request, socket, head, webSocket => {
|
|
38
39
|
if (webSocket.readyState === webSocket.OPEN) {
|
|
39
40
|
onOpen(webSocket, request, socket, head);
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
42
|
-
webSocket.on('open',
|
|
43
|
+
webSocket.on('open', () => onOpen(webSocket, request, socket, head));
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
}
|
|
@@ -47,25 +48,25 @@ function openSocket(options, onOpen) {
|
|
|
47
48
|
}
|
|
48
49
|
exports.openSocket = openSocket;
|
|
49
50
|
function toIWebSocket(webSocket) {
|
|
50
|
-
|
|
51
|
+
let sendsAfterOpen = 0;
|
|
51
52
|
return {
|
|
52
|
-
send:
|
|
53
|
+
send: content => {
|
|
53
54
|
if (webSocket.readyState !== ws.OPEN) {
|
|
54
55
|
if (sendsAfterOpen++ > 3) {
|
|
55
|
-
|
|
56
|
+
//log.debug(`Repeated try to send on closed web socket (readyState was ${webSocket.readyState})`, { ws });
|
|
56
57
|
}
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
webSocket.send(content,
|
|
60
|
+
webSocket.send(content, err => {
|
|
60
61
|
if (err) {
|
|
61
|
-
logging_1.log.error('
|
|
62
|
+
logging_1.log.error('error in ws.send()', err, { ws });
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
65
|
},
|
|
65
|
-
onMessage:
|
|
66
|
-
onError:
|
|
67
|
-
onClose:
|
|
68
|
-
dispose:
|
|
66
|
+
onMessage: cb => webSocket.on('message', cb),
|
|
67
|
+
onError: cb => webSocket.on('error', cb),
|
|
68
|
+
onClose: cb => webSocket.on('close', cb),
|
|
69
|
+
dispose: () => {
|
|
69
70
|
if (webSocket.readyState < ws.CLOSING) {
|
|
70
71
|
webSocket.close();
|
|
71
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/node/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/node/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AAGzB,2BAA2B;AAG3B,yDAA0E;AAC1E,gDAAyC;AAQzC,SAAgB,+BAA+B,CAAC,OAAuB,EAAE,SAAkD;IACvH,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;QAChC,SAAS,CAAC,IAAA,6CAAyB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC;AAJD,0EAIC;AAED,SAAgB,iBAAiB,CAAC,OAAuB,EAAE,MAAoC;IAC3F,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;QACzB,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACP,CAAC;AALD,8CAKC;AAMD,SAAgB,UAAU,CAAC,OAAuB,EAAE,MAAc;IAC9D,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC;QACtB,QAAQ,EAAE,IAAI;QACV,iBAAiB,EAAE;YACf,iDAAiD;YACjD,SAAS,EAAE,GAAG,GAAG,IAAI;SACxB;KACR,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,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,EAAE,CAAC,CAAC;iBAChD;YACL,CAAC,CAAC,CAAA;QACN,CAAC;QACD,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;QAC5C,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACxC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACxC,OAAO,EAAE,GAAG,EAAE;YACV,IAAI,SAAS,CAAC,UAAU,GAAG,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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