@gitpod/gitpod-protocol 0.1.5-v0.6.0-beta2 → 0.1.5-vn-integrate-gitpod-yml-tasks-into-jetbrainsa.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/builtin-theia-plugins.json +9 -9
- package/data/gitpod-schema.json +25 -24
- package/lib/accounting-protocol.d.ts +155 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +109 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +31 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +15 -0
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +45 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/auth.d.ts +25 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +16 -0
- package/lib/auth.js.map +1 -0
- package/lib/context-url.d.ts +31 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +102 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +14 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +94 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +1 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +4 -4
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.js +5 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.js +19 -20
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -36
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.js +29 -43
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.js +25 -30
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -2
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +20 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.js +25 -41
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +116 -116
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +162 -20
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +170 -256
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +8 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +4 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +4 -0
- package/lib/ide-frontend-service.d.ts.map +1 -1
- package/lib/ide-protocol.d.ts +105 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +8 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/messaging/browser/connection.d.ts +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +183 -33
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.js +35 -55
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +5 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +10 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +23 -59
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +2 -0
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -159
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +8 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +36 -19
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +570 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +118 -58
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +116 -130
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +73 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +63 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +113 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +30 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +79 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.js +55 -133
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js +17 -59
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +8 -8
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.js +26 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.js +58 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -0
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +26 -46
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +4 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +487 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/{without.d.ts → generate-workspace-id.spec.d.ts} +2 -2
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +87 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -0
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +2 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +96 -95
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +8 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +104 -22
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/{without.js → jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +49 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +107 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +2 -2
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +13 -3
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +38 -8
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +8 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +127 -47
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.js +16 -55
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.js +144 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.js +28 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.js +21 -24
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +51 -5
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +197 -62
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.js +3 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +76 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +33 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +26 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +33 -17
- package/pkg-yarn.lock +18 -9
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +53 -5
- package/src/analytics.ts +54 -0
- package/src/auth.ts +27 -0
- package/src/context-url.spec.ts +53 -0
- package/src/context-url.ts +107 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +237 -38
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +5 -1
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +7 -1
- package/src/installation-admin-protocol.ts +42 -0
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +14 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +24 -9
- package/src/plans.ts +632 -0
- package/src/protocol.ts +192 -87
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +113 -0
- package/src/teams-projects-protocol.ts +147 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +9 -3
- package/src/util/generate-workspace-id.spec.ts +48 -0
- package/src/util/generate-workspace-id.ts +475 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +30 -1
- package/src/util/gitpod-host-url.ts +27 -13
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +102 -38
- package/src/util/parse-workspace-id.spec.ts +45 -4
- package/src/util/parse-workspace-id.ts +38 -7
- package/src/util/queue.spec.ts +1 -1
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +183 -17
- package/src/workspace-cluster.ts +104 -0
- package/src/workspace-instance.ts +51 -13
- package/src/wsready.ts +2 -2
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -46
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -118
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -34
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
|
@@ -8,6 +8,10 @@ import { Disposable } from "./util/disposable";
|
|
|
8
8
|
export declare type IDEFrontendState = 'init' | 'ready' | 'terminated';
|
|
9
9
|
export interface IDEFrontendService {
|
|
10
10
|
readonly state: IDEFrontendState;
|
|
11
|
+
/**
|
|
12
|
+
* A cause of the ide frontend application failure when state is terminated.
|
|
13
|
+
*/
|
|
14
|
+
readonly failureCause?: Error;
|
|
11
15
|
readonly onDidChange: Event<void>;
|
|
12
16
|
/**
|
|
13
17
|
* Starts the ide frontend application.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ide-frontend-service.d.ts","sourceRoot":"","sources":["../src/ide-frontend-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,oBAAY,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC;;;;;;;OAOG;IACH,KAAK,IAAI,UAAU,CAAC;CACvB"}
|
|
1
|
+
{"version":3,"file":"ide-frontend-service.d.ts","sourceRoot":"","sources":["../src/ide-frontend-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,oBAAY,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC;;;;;;;OAOG;IACH,KAAK,IAAI,UAAU,CAAC;CACvB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* `IDEServer` provides a list of available IDEs.
|
|
8
|
+
*/
|
|
9
|
+
export interface IDEServer {
|
|
10
|
+
/**
|
|
11
|
+
* Returns the IDE preferences.
|
|
12
|
+
*/
|
|
13
|
+
getIDEOptions(): Promise<IDEOptions>;
|
|
14
|
+
}
|
|
15
|
+
export interface IDEOptions {
|
|
16
|
+
/**
|
|
17
|
+
* A list of available IDEs.
|
|
18
|
+
*/
|
|
19
|
+
options: {
|
|
20
|
+
[key: string]: IDEOption;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The default (browser) IDE when the user has not specified one.
|
|
24
|
+
*/
|
|
25
|
+
defaultIde: string;
|
|
26
|
+
/**
|
|
27
|
+
* The default desktop IDE when the user has not specified one.
|
|
28
|
+
*/
|
|
29
|
+
defaultDesktopIde: string;
|
|
30
|
+
/**
|
|
31
|
+
* Client specific IDE options.
|
|
32
|
+
*/
|
|
33
|
+
clients?: {
|
|
34
|
+
[id: string]: IDEClient;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface IDEClient {
|
|
38
|
+
/**
|
|
39
|
+
* The default desktop IDE when the user has not specified one.
|
|
40
|
+
*/
|
|
41
|
+
defaultDesktopIDE?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Desktop IDEs supported by the client.
|
|
44
|
+
*/
|
|
45
|
+
desktopIDEs?: string[];
|
|
46
|
+
/**
|
|
47
|
+
* Steps to install the client on user machine.
|
|
48
|
+
*/
|
|
49
|
+
installationSteps?: string[];
|
|
50
|
+
}
|
|
51
|
+
export interface IDEOption {
|
|
52
|
+
/**
|
|
53
|
+
* To ensure a stable order one can set an `orderKey`.
|
|
54
|
+
*/
|
|
55
|
+
orderKey?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Human readable title text of the IDE (plain text only).
|
|
58
|
+
*/
|
|
59
|
+
title: string;
|
|
60
|
+
/**
|
|
61
|
+
* The type of the IDE, currently 'browser' or 'desktop'.
|
|
62
|
+
*/
|
|
63
|
+
type: 'browser' | 'desktop';
|
|
64
|
+
/**
|
|
65
|
+
* The logo for the IDE. That could be a key in (see
|
|
66
|
+
* components/dashboard/src/images/ideLogos.ts) or a URL.
|
|
67
|
+
*/
|
|
68
|
+
logo: string;
|
|
69
|
+
/**
|
|
70
|
+
* Text of an optional tooltip (plain text only).
|
|
71
|
+
*/
|
|
72
|
+
tooltip?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Text of an optional label next to the IDE option like “Insiders” (plain
|
|
75
|
+
* text only).
|
|
76
|
+
*/
|
|
77
|
+
label?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Notes to the IDE option that are renderd in the preferences when a user
|
|
80
|
+
* chooses this IDE.
|
|
81
|
+
*/
|
|
82
|
+
notes?: string[];
|
|
83
|
+
/**
|
|
84
|
+
* If `true` this IDE option is not visible in the IDE preferences.
|
|
85
|
+
*/
|
|
86
|
+
hidden?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The image ref to the IDE image.
|
|
89
|
+
*/
|
|
90
|
+
image: string;
|
|
91
|
+
/**
|
|
92
|
+
* The latest image ref to the IDE image, this image ref always resolve to digest.
|
|
93
|
+
*/
|
|
94
|
+
latestImage?: string;
|
|
95
|
+
/**
|
|
96
|
+
* When this is `true`, the tag of this image is resolved to the latest
|
|
97
|
+
* image digest regularly.
|
|
98
|
+
*
|
|
99
|
+
* This is useful if this image points to a tag like `nightly` that will be
|
|
100
|
+
* updated regularly. When `resolveImageDigest` is `true`, we make sure that
|
|
101
|
+
* we resolve the tag regularly to the most recent image version.
|
|
102
|
+
*/
|
|
103
|
+
resolveImageDigest?: boolean;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=ide-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ide-protocol.d.ts","sourceRoot":"","sources":["../src/ide-protocol.ts"],"names":[],"mappings":"AAAA;;;;G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|
+
/**
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
//# sourceMappingURL=ide-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ide-protocol.js","sourceRoot":"","sources":["../src/ide-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
package/lib/index.d.ts
CHANGED
|
@@ -13,4 +13,10 @@ export * from './workspace-instance';
|
|
|
13
13
|
export * from './permission';
|
|
14
14
|
export * from './admin-protocol';
|
|
15
15
|
export * from './email-protocol';
|
|
16
|
+
export * from './headless-workspace-log';
|
|
17
|
+
export * from './context-url';
|
|
18
|
+
export * from './teams-projects-protocol';
|
|
19
|
+
export * from './snapshot-url';
|
|
20
|
+
export * from './oss-allowlist';
|
|
21
|
+
export * from './installation-admin-protocol';
|
|
16
22
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
12
12
|
o[k2] = m[k];
|
|
13
13
|
}));
|
|
14
14
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
__exportStar(require("./protocol"), exports);
|
|
@@ -25,4 +25,10 @@ __exportStar(require("./workspace-instance"), exports);
|
|
|
25
25
|
__exportStar(require("./permission"), exports);
|
|
26
26
|
__exportStar(require("./admin-protocol"), exports);
|
|
27
27
|
__exportStar(require("./email-protocol"), exports);
|
|
28
|
+
__exportStar(require("./headless-workspace-log"), exports);
|
|
29
|
+
__exportStar(require("./context-url"), exports);
|
|
30
|
+
__exportStar(require("./teams-projects-protocol"), exports);
|
|
31
|
+
__exportStar(require("./snapshot-url"), exports);
|
|
32
|
+
__exportStar(require("./oss-allowlist"), exports);
|
|
33
|
+
__exportStar(require("./installation-admin-protocol"), exports);
|
|
28
34
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,qDAAmC;AACnC,uDAAqC;AACrC,+CAA6B;AAC7B,mDAAiC;AACjC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,qDAAmC;AACnC,uDAAqC;AACrC,+CAA6B;AAC7B,mDAAiC;AACjC,mDAAiC;AACjC,2DAAyC;AACzC,gDAA8B;AAC9B,4DAA0C;AAC1C,iDAA+B;AAC/B,kDAAgC;AAChC,gEAA8C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 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
|
+
declare const InstallationAdminSettingsPrototype: {
|
|
7
|
+
sendTelemetry: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare type InstallationAdminSettings = typeof InstallationAdminSettingsPrototype;
|
|
10
|
+
export declare namespace InstallationAdminSettings {
|
|
11
|
+
function fields(): (keyof InstallationAdminSettings)[];
|
|
12
|
+
}
|
|
13
|
+
export interface InstallationAdmin {
|
|
14
|
+
id: string;
|
|
15
|
+
settings: InstallationAdminSettings;
|
|
16
|
+
}
|
|
17
|
+
export interface Data {
|
|
18
|
+
installationAdmin: InstallationAdmin;
|
|
19
|
+
totalUsers: number;
|
|
20
|
+
totalWorkspaces: number;
|
|
21
|
+
totalInstances: number;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace InstallationAdmin {
|
|
24
|
+
function createDefault(): InstallationAdmin;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=installation-admin-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation-admin-protocol.d.ts","sourceRoot":"","sources":["../src/installation-admin-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,QAAA,MAAM,kCAAkC;;CAEvC,CAAA;AAED,oBAAY,yBAAyB,GAAG,OAAO,kCAAkC,CAAC;AAElF,yBAAiB,yBAAyB,CAAC;IACvC,SAAgB,MAAM,IAAI,CAAC,MAAM,yBAAyB,CAAC,EAAE,CAE5D;CACJ;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,yBAAyB,CAAC;CACvC;AAED,MAAM,WAAW,IAAI;IACjB,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;CACzB;AAED,yBAAiB,iBAAiB,CAAC;IAC/B,SAAgB,aAAa,IAAI,iBAAiB,CAOjD;CACJ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.InstallationAdmin = exports.InstallationAdminSettings = void 0;
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
const InstallationAdminSettingsPrototype = {
|
|
11
|
+
sendTelemetry: true
|
|
12
|
+
};
|
|
13
|
+
var InstallationAdminSettings;
|
|
14
|
+
(function (InstallationAdminSettings) {
|
|
15
|
+
function fields() {
|
|
16
|
+
return Object.keys(InstallationAdminSettingsPrototype);
|
|
17
|
+
}
|
|
18
|
+
InstallationAdminSettings.fields = fields;
|
|
19
|
+
})(InstallationAdminSettings = exports.InstallationAdminSettings || (exports.InstallationAdminSettings = {}));
|
|
20
|
+
var InstallationAdmin;
|
|
21
|
+
(function (InstallationAdmin) {
|
|
22
|
+
function createDefault() {
|
|
23
|
+
return {
|
|
24
|
+
id: (0, uuid_1.v4)(),
|
|
25
|
+
settings: Object.assign({}, InstallationAdminSettingsPrototype)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
InstallationAdmin.createDefault = createDefault;
|
|
29
|
+
})(InstallationAdmin = exports.InstallationAdmin || (exports.InstallationAdmin = {}));
|
|
30
|
+
//# sourceMappingURL=installation-admin-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation-admin-protocol.js","sourceRoot":"","sources":["../src/installation-admin-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+BAAoC;AAEpC,MAAM,kCAAkC,GAAG;IACvC,aAAa,EAAE,IAAI;CACtB,CAAA;AAID,IAAiB,yBAAyB,CAIzC;AAJD,WAAiB,yBAAyB;IACtC,SAAgB,MAAM;QAClB,OAAO,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAwC,CAAC;IAClG,CAAC;IAFe,gCAAM,SAErB,CAAA;AACL,CAAC,EAJgB,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAIzC;AAcD,IAAiB,iBAAiB,CASjC;AATD,WAAiB,iBAAiB;IAC9B,SAAgB,aAAa;QACzB,OAAO;YACH,EAAE,EAAE,IAAA,SAAM,GAAE;YACZ,QAAQ,oBACD,kCAAkC,CACxC;SACJ,CAAC;IACN,CAAC;IAPe,+BAAa,gBAO5B,CAAA;AACL,CAAC,EATgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QASjC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Logger } from "vscode-ws-jsonrpc";
|
|
2
2
|
import { JsonRpcProxy } from "../proxy-factory";
|
|
3
|
-
import { ConnectionHandler } from "../handler";
|
|
3
|
+
import { ConnectionEventHandler, ConnectionHandler } from "../handler";
|
|
4
|
+
import ReconnectingWebSocket, { Event } from 'reconnecting-websocket';
|
|
4
5
|
export interface WebSocketOptions {
|
|
5
6
|
onerror?: (event: Event) => void;
|
|
7
|
+
onListening?: (socket: ReconnectingWebSocket) => void;
|
|
6
8
|
}
|
|
7
9
|
export declare class WebSocketConnectionProvider {
|
|
8
10
|
/**
|
|
@@ -12,11 +14,11 @@ export declare class WebSocketConnectionProvider {
|
|
|
12
14
|
* An optional target can be provided to handle
|
|
13
15
|
* notifications and requests from a remote side.
|
|
14
16
|
*/
|
|
15
|
-
createProxy<T extends object>(path: string
|
|
17
|
+
createProxy<T extends object>(path: string | Promise<string>, target?: object, options?: WebSocketOptions): JsonRpcProxy<T>;
|
|
16
18
|
/**
|
|
17
19
|
* Install a connection handler for the given path.
|
|
18
20
|
*/
|
|
19
|
-
listen(handler: ConnectionHandler, options?: WebSocketOptions):
|
|
21
|
+
listen(handler: ConnectionHandler, eventHandler: ConnectionEventHandler, options?: WebSocketOptions): WebSocket;
|
|
20
22
|
protected createLogger(): Logger;
|
|
21
23
|
/**
|
|
22
24
|
* Creates a web socket for the given url
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAuC,MAAM,mBAAmB,CAAC;AAIhF,OAAO,EAAuB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,qBAAqB,EAAE,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACzD;AAED,qBAAa,2BAA2B;IAEpC;;;;;;OAMG;IACH,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC;IAyB3H;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS;IAwB/G,SAAS,CAAC,YAAY,IAAI,MAAM;IAIhC;;OAEG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;CAW1C"}
|
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.WebSocketConnectionProvider = void 0;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
|
|
11
|
+
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
|
|
12
|
+
const messageWriter_1 = require("vscode-jsonrpc/lib/messageWriter");
|
|
13
|
+
const messageReader_1 = require("vscode-jsonrpc/lib/messageReader");
|
|
14
|
+
const proxy_factory_1 = require("../proxy-factory");
|
|
15
|
+
const reconnecting_websocket_1 = require("reconnecting-websocket");
|
|
16
|
+
class WebSocketConnectionProvider {
|
|
16
17
|
/**
|
|
17
18
|
* Create a proxy object to remote interface of T type
|
|
18
19
|
* over a web socket connection for the given path.
|
|
@@ -20,45 +21,56 @@ var WebSocketConnectionProvider = /** @class */ (function () {
|
|
|
20
21
|
* An optional target can be provided to handle
|
|
21
22
|
* notifications and requests from a remote side.
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
createProxy(path, target, options) {
|
|
25
|
+
const factory = new proxy_factory_1.JsonRpcProxyFactory(target);
|
|
26
|
+
const startListening = (path) => {
|
|
27
|
+
const socket = this.listen({
|
|
28
|
+
path,
|
|
29
|
+
onConnection: c => factory.listen(c),
|
|
30
|
+
}, {
|
|
31
|
+
onTransportDidClose: () => factory.fireConnectionClosed(),
|
|
32
|
+
onTransportDidOpen: () => factory.fireConnectionOpened(),
|
|
33
|
+
}, options);
|
|
34
|
+
if (options === null || options === void 0 ? void 0 : options.onListening) {
|
|
35
|
+
options.onListening(socket);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
if (typeof path === "string") {
|
|
39
|
+
startListening(path);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
path.then(path => startListening(path));
|
|
43
|
+
}
|
|
29
44
|
return factory.createProxy();
|
|
30
|
-
}
|
|
45
|
+
}
|
|
31
46
|
/**
|
|
32
47
|
* Install a connection handler for the given path.
|
|
33
48
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
listen(handler, eventHandler, options) {
|
|
50
|
+
const url = handler.path;
|
|
51
|
+
const webSocket = this.createWebSocket(url);
|
|
52
|
+
const logger = this.createLogger();
|
|
38
53
|
if (options && options.onerror) {
|
|
39
|
-
|
|
40
|
-
webSocket.addEventListener('error',
|
|
41
|
-
|
|
54
|
+
const onerror = options.onerror;
|
|
55
|
+
webSocket.addEventListener('error', (event) => {
|
|
56
|
+
onerror(event);
|
|
42
57
|
});
|
|
43
58
|
}
|
|
44
59
|
else {
|
|
45
|
-
webSocket.addEventListener('error',
|
|
60
|
+
webSocket.addEventListener('error', (error) => {
|
|
46
61
|
logger.error(JSON.stringify(error));
|
|
47
62
|
});
|
|
48
63
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
WebSocketConnectionProvider.prototype.createLogger = function () {
|
|
64
|
+
doListen(webSocket, handler, eventHandler, logger);
|
|
65
|
+
return webSocket;
|
|
66
|
+
}
|
|
67
|
+
createLogger() {
|
|
56
68
|
return new vscode_ws_jsonrpc_1.ConsoleLogger();
|
|
57
|
-
}
|
|
69
|
+
}
|
|
58
70
|
/**
|
|
59
71
|
* Creates a web socket for the given url
|
|
60
72
|
*/
|
|
61
|
-
|
|
73
|
+
createWebSocket(url) {
|
|
62
74
|
return new reconnecting_websocket_1.default(url, undefined, {
|
|
63
75
|
maxReconnectionDelay: 10000,
|
|
64
76
|
minReconnectionDelay: 1000,
|
|
@@ -67,8 +79,146 @@ var WebSocketConnectionProvider = /** @class */ (function () {
|
|
|
67
79
|
debug: false,
|
|
68
80
|
WebSocket: WebSocket
|
|
69
81
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}());
|
|
82
|
+
}
|
|
83
|
+
}
|
|
73
84
|
exports.WebSocketConnectionProvider = WebSocketConnectionProvider;
|
|
85
|
+
// The following was extracted from vscode-ws-jsonrpc to make these changes:
|
|
86
|
+
// - switch from WebSocket to ReconnectingWebSocket
|
|
87
|
+
// - webSocket.onopen: making sure it's only ever called once so we're re-using MessageConnection
|
|
88
|
+
// - WebSocketMessageWriter: buffer and re-try messages instead of throwing an error immidiately
|
|
89
|
+
// - WebSocketMessageReader: don't close MessageConnection on 'socket.onclose'
|
|
90
|
+
function doListen(resocket, handler, eventHandler, logger) {
|
|
91
|
+
resocket.addEventListener("close", () => eventHandler.onTransportDidClose());
|
|
92
|
+
let alreadyOpened = false;
|
|
93
|
+
resocket.onopen = () => {
|
|
94
|
+
// trigerr "open" every time we re-open the underlying websocket
|
|
95
|
+
eventHandler.onTransportDidOpen();
|
|
96
|
+
// make sure we're only ever creating one MessageConnection, irregardless of how many times we have to re-open the underlying (reconnecting) websocket
|
|
97
|
+
if (alreadyOpened) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
alreadyOpened = true;
|
|
101
|
+
const connection = createWebSocketConnection(resocket, logger);
|
|
102
|
+
handler.onConnection(connection);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function createWebSocketConnection(resocket, logger) {
|
|
106
|
+
const socket = (0, vscode_ws_jsonrpc_1.toSocket)(resocket);
|
|
107
|
+
const messageReader = new NonClosingWebSocketMessageReader(socket);
|
|
108
|
+
const messageWriter = new BufferingWebSocketMessageWriter(resocket, logger);
|
|
109
|
+
const connection = (0, vscode_jsonrpc_1.createMessageConnection)(messageReader, messageWriter, logger);
|
|
110
|
+
connection.onClose(() => connection.dispose());
|
|
111
|
+
return connection;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* This takes vscode-ws-jsonrpc/lib/socket/writer/WebSocketMessageWriter and adds a buffer
|
|
115
|
+
*/
|
|
116
|
+
class BufferingWebSocketMessageWriter extends messageWriter_1.AbstractMessageWriter {
|
|
117
|
+
constructor(socket, logger) {
|
|
118
|
+
super();
|
|
119
|
+
this.errorCount = 0;
|
|
120
|
+
this.buffer = [];
|
|
121
|
+
this.socket = socket;
|
|
122
|
+
this.logger = logger;
|
|
123
|
+
socket.addEventListener("open", (event) => this.flushBuffer());
|
|
124
|
+
}
|
|
125
|
+
write(msg) {
|
|
126
|
+
if (this.socket.readyState !== reconnecting_websocket_1.default.OPEN) {
|
|
127
|
+
this.bufferMsg(msg);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
const content = JSON.stringify(msg);
|
|
132
|
+
this.socket.send(content);
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
this.errorCount++;
|
|
136
|
+
this.fireError(e, msg, this.errorCount);
|
|
137
|
+
this.bufferMsg(msg);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
flushBuffer() {
|
|
141
|
+
if (this.buffer.length === 0) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const buffer = [...this.buffer];
|
|
145
|
+
this.buffer = [];
|
|
146
|
+
for (const msg of buffer) {
|
|
147
|
+
this.write(msg);
|
|
148
|
+
}
|
|
149
|
+
//this.logger.info(`flushed buffer (${this.buffer.length})`)
|
|
150
|
+
}
|
|
151
|
+
bufferMsg(msg) {
|
|
152
|
+
this.buffer.push(msg);
|
|
153
|
+
//this.logger.info(`buffered message (${this.buffer.length})`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* This takes vscode-ws-jsonrpc/lib/socket/reader/WebSocketMessageReader and removes the "onClose -> fireClose" connection
|
|
158
|
+
*/
|
|
159
|
+
class NonClosingWebSocketMessageReader extends messageReader_1.AbstractMessageReader {
|
|
160
|
+
constructor(socket) {
|
|
161
|
+
super();
|
|
162
|
+
this.events = [];
|
|
163
|
+
this.state = 'initial';
|
|
164
|
+
this.callback = () => { };
|
|
165
|
+
this.socket = socket;
|
|
166
|
+
this.socket.onMessage(message => this.readMessage(message));
|
|
167
|
+
this.socket.onError(error => this.fireError(error));
|
|
168
|
+
this.socket.onClose((code, reason) => {
|
|
169
|
+
if (code !== 1000) {
|
|
170
|
+
const error = {
|
|
171
|
+
name: '' + code,
|
|
172
|
+
message: `Error during socket reconnect: code = ${code}, reason = ${reason}`
|
|
173
|
+
};
|
|
174
|
+
this.fireError(error);
|
|
175
|
+
}
|
|
176
|
+
// this.fireClose(); // <-- reason for this class to be copied over
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
listen(callback) {
|
|
180
|
+
if (this.state === 'initial') {
|
|
181
|
+
this.state = 'listening';
|
|
182
|
+
this.callback = callback;
|
|
183
|
+
while (this.events.length !== 0) {
|
|
184
|
+
const event = this.events.pop();
|
|
185
|
+
if (event.message) {
|
|
186
|
+
this.readMessage(event.message);
|
|
187
|
+
}
|
|
188
|
+
else if (event.error) {
|
|
189
|
+
this.fireError(event.error);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
this.fireClose();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
readMessage(message) {
|
|
198
|
+
if (this.state === 'initial') {
|
|
199
|
+
this.events.splice(0, 0, { message });
|
|
200
|
+
}
|
|
201
|
+
else if (this.state === 'listening') {
|
|
202
|
+
const data = JSON.parse(message);
|
|
203
|
+
this.callback(data);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
fireError(error) {
|
|
207
|
+
if (this.state === 'initial') {
|
|
208
|
+
this.events.splice(0, 0, { error });
|
|
209
|
+
}
|
|
210
|
+
else if (this.state === 'listening') {
|
|
211
|
+
super.fireError(error);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
fireClose() {
|
|
215
|
+
if (this.state === 'initial') {
|
|
216
|
+
this.events.splice(0, 0, {});
|
|
217
|
+
}
|
|
218
|
+
else if (this.state === 'listening') {
|
|
219
|
+
super.fireClose();
|
|
220
|
+
}
|
|
221
|
+
this.state = 'closed';
|
|
222
|
+
}
|
|
223
|
+
}
|
|
74
224
|
//# sourceMappingURL=connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yDAAgF;AAChF,mDAAyD;AACzD,oEAAyE;AACzE,oEAAyE;AACzE,oDAAqE;AAErE,mEAAsE;AAOtE,MAAa,2BAA2B;IAEpC;;;;;;OAMG;IACH,WAAW,CAAmB,IAA8B,EAA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