@theia/core 1.26.0 → 1.27.0-next.10
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/README.md +6 -7
- package/lib/browser/messaging/ws-connection-provider.d.ts +5 -4
- package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.js +30 -23
- package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
- package/lib/browser/progress-status-bar-item.d.ts +1 -1
- package/lib/browser/progress-status-bar-item.d.ts.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-widget.js +2 -2
- package/lib/browser/tree/tree-compression/compressed-tree-widget.js.map +1 -1
- package/lib/browser/widgets/select-component.d.ts +4 -1
- package/lib/browser/widgets/select-component.d.ts.map +1 -1
- package/lib/browser/widgets/select-component.js +30 -16
- package/lib/browser/widgets/select-component.js.map +1 -1
- package/lib/common/cancellation.d.ts +1 -0
- package/lib/common/cancellation.d.ts.map +1 -1
- package/lib/common/cancellation.js +8 -0
- package/lib/common/cancellation.js.map +1 -1
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +2 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/message-rpc/channel.d.ts +106 -0
- package/lib/common/message-rpc/channel.d.ts.map +1 -0
- package/lib/common/message-rpc/channel.js +195 -0
- package/lib/common/message-rpc/channel.js.map +1 -0
- package/lib/common/message-rpc/channel.spec.d.ts +9 -0
- package/lib/common/message-rpc/channel.spec.d.ts.map +1 -0
- package/lib/common/message-rpc/channel.spec.js +80 -0
- package/lib/common/message-rpc/channel.spec.js.map +1 -0
- package/lib/common/message-rpc/index.d.ts +4 -0
- package/lib/common/message-rpc/index.d.ts.map +1 -0
- package/lib/{node/messaging/logger.js → common/message-rpc/index.js} +6 -19
- package/lib/common/message-rpc/index.js.map +1 -0
- package/lib/common/message-rpc/message-buffer.d.ts +50 -0
- package/lib/common/message-rpc/message-buffer.d.ts.map +1 -0
- package/lib/common/message-rpc/message-buffer.js +56 -0
- package/lib/common/message-rpc/message-buffer.js.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.d.ts +159 -0
- package/lib/common/message-rpc/rpc-message-encoder.d.ts.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.js +362 -0
- package/lib/common/message-rpc/rpc-message-encoder.js.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.d.ts +2 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.d.ts.map +1 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.js +37 -0
- package/lib/common/message-rpc/rpc-message-encoder.spec.js.map +1 -0
- package/lib/common/message-rpc/rpc-protocol.d.ts +61 -0
- package/lib/common/message-rpc/rpc-protocol.d.ts.map +1 -0
- package/lib/common/message-rpc/rpc-protocol.js +183 -0
- package/lib/common/message-rpc/rpc-protocol.js.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.d.ts +52 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.d.ts.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.js +169 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.js.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.d.ts +2 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.d.ts.map +1 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.js +39 -0
- package/lib/common/message-rpc/uint8-array-message-buffer.spec.js.map +1 -0
- package/lib/common/messaging/abstract-connection-provider.d.ts +9 -8
- package/lib/common/messaging/abstract-connection-provider.d.ts.map +1 -1
- package/lib/common/messaging/abstract-connection-provider.js +20 -35
- package/lib/common/messaging/abstract-connection-provider.js.map +1 -1
- package/lib/common/messaging/connection-error-handler.d.ts +1 -2
- package/lib/common/messaging/connection-error-handler.d.ts.map +1 -1
- package/lib/common/messaging/connection-error-handler.js +1 -1
- package/lib/common/messaging/connection-error-handler.js.map +1 -1
- package/lib/common/messaging/handler.d.ts +2 -2
- package/lib/common/messaging/handler.d.ts.map +1 -1
- package/lib/common/messaging/proxy-factory.d.ts +13 -7
- package/lib/common/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/common/messaging/proxy-factory.js +18 -13
- package/lib/common/messaging/proxy-factory.js.map +1 -1
- package/lib/common/messaging/proxy-factory.spec.js +4 -15
- package/lib/common/messaging/proxy-factory.spec.js.map +1 -1
- package/lib/common/messaging/web-socket-channel.d.ts +54 -48
- package/lib/common/messaging/web-socket-channel.d.ts.map +1 -1
- package/lib/common/messaging/web-socket-channel.js +41 -105
- package/lib/common/messaging/web-socket-channel.js.map +1 -1
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.d.ts +2 -2
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.d.ts.map +1 -1
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.js +18 -7
- package/lib/electron-browser/messaging/electron-ipc-connection-provider.js.map +1 -1
- package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts +2 -2
- package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts.map +1 -1
- package/lib/electron-browser/messaging/electron-ws-connection-provider.js +5 -7
- package/lib/electron-browser/messaging/electron-ws-connection-provider.js.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +37 -9
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.js +83 -68
- package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-service.d.ts +2 -8
- package/lib/electron-main/messaging/electron-messaging-service.d.ts.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-service.js.map +1 -1
- package/lib/electron-main/theia-electron-window.d.ts.map +1 -1
- package/lib/electron-main/theia-electron-window.js +11 -8
- package/lib/electron-main/theia-electron-window.js.map +1 -1
- package/lib/node/messaging/binary-message-pipe.d.ts +45 -0
- package/lib/node/messaging/binary-message-pipe.d.ts.map +1 -0
- package/lib/node/messaging/binary-message-pipe.js +152 -0
- package/lib/node/messaging/binary-message-pipe.js.map +1 -0
- package/lib/node/messaging/ipc-bootstrap.js +2 -11
- package/lib/node/messaging/ipc-bootstrap.js.map +1 -1
- package/lib/node/messaging/ipc-channel.d.ts +26 -0
- package/lib/node/messaging/ipc-channel.d.ts.map +1 -0
- package/lib/node/messaging/ipc-channel.js +86 -0
- package/lib/node/messaging/ipc-channel.js.map +1 -0
- package/lib/node/messaging/ipc-connection-provider.d.ts +3 -5
- package/lib/node/messaging/ipc-connection-provider.d.ts.map +1 -1
- package/lib/node/messaging/ipc-connection-provider.js +14 -31
- package/lib/node/messaging/ipc-connection-provider.js.map +1 -1
- package/lib/node/messaging/ipc-protocol.d.ts +2 -2
- package/lib/node/messaging/ipc-protocol.d.ts.map +1 -1
- package/lib/node/messaging/messaging-contribution.d.ts +6 -9
- package/lib/node/messaging/messaging-contribution.d.ts.map +1 -1
- package/lib/node/messaging/messaging-contribution.js +23 -68
- package/lib/node/messaging/messaging-contribution.js.map +1 -1
- package/lib/node/messaging/messaging-service.d.ts +4 -23
- package/lib/node/messaging/messaging-service.d.ts.map +1 -1
- package/lib/node/messaging/messaging-service.js +1 -15
- package/lib/node/messaging/messaging-service.js.map +1 -1
- package/lib/node/messaging/test/test-web-socket-channel.d.ts +4 -2
- package/lib/node/messaging/test/test-web-socket-channel.d.ts.map +1 -1
- package/lib/node/messaging/test/test-web-socket-channel.js +25 -12
- package/lib/node/messaging/test/test-web-socket-channel.js.map +1 -1
- package/package.json +5 -8
- package/src/browser/messaging/ws-connection-provider.ts +34 -25
- package/src/browser/progress-status-bar-item.ts +1 -1
- package/src/browser/style/menus.css +1 -0
- package/src/browser/tree/tree-compression/compressed-tree-widget.tsx +2 -2
- package/src/browser/widgets/select-component.tsx +37 -17
- package/src/common/cancellation.ts +8 -0
- package/src/common/index.ts +2 -0
- package/src/common/message-rpc/channel.spec.ts +88 -0
- package/src/common/message-rpc/channel.ts +260 -0
- package/src/{node/messaging/logger.ts → common/message-rpc/index.ts} +4 -23
- package/src/common/message-rpc/message-buffer.ts +99 -0
- package/src/common/message-rpc/rpc-message-encoder.spec.ts +42 -0
- package/src/common/message-rpc/rpc-message-encoder.ts +497 -0
- package/src/common/message-rpc/rpc-protocol.ts +217 -0
- package/src/common/message-rpc/uint8-array-message-buffer.spec.ts +41 -0
- package/src/common/message-rpc/uint8-array-message-buffer.ts +206 -0
- package/src/common/messaging/abstract-connection-provider.ts +28 -37
- package/src/common/messaging/connection-error-handler.ts +1 -2
- package/src/common/messaging/handler.ts +2 -2
- package/src/common/messaging/proxy-factory.spec.ts +4 -17
- package/src/common/messaging/proxy-factory.ts +27 -16
- package/src/common/messaging/web-socket-channel.ts +79 -135
- package/src/electron-browser/messaging/electron-ipc-connection-provider.ts +21 -7
- package/src/electron-browser/messaging/electron-ws-connection-provider.ts +5 -8
- package/src/electron-main/messaging/electron-messaging-contribution.ts +87 -65
- package/src/electron-main/messaging/electron-messaging-service.ts +2 -8
- package/src/electron-main/theia-electron-window.ts +12 -9
- package/src/node/messaging/binary-message-pipe.ts +168 -0
- package/src/node/messaging/ipc-bootstrap.ts +3 -11
- package/src/node/messaging/ipc-channel.ts +97 -0
- package/src/node/messaging/ipc-connection-provider.ts +18 -35
- package/src/node/messaging/ipc-protocol.ts +2 -2
- package/src/node/messaging/messaging-contribution.ts +29 -74
- package/src/node/messaging/messaging-service.ts +4 -31
- package/src/node/messaging/test/test-web-socket-channel.ts +26 -17
- package/lib/node/messaging/logger.d.ts +0 -8
- package/lib/node/messaging/logger.d.ts.map +0 -1
- package/lib/node/messaging/logger.js.map +0 -1
- package/shared/vscode-ws-jsonrpc/index.d.ts +0 -1
- package/shared/vscode-ws-jsonrpc/index.js +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Message } from 'vscode-ws-jsonrpc';
|
|
2
1
|
import { ILogger } from '../../common';
|
|
3
2
|
export interface ResolvedConnectionErrorHandlerOptions {
|
|
4
3
|
readonly serverName: string;
|
|
@@ -23,7 +22,7 @@ export declare type ConnectionErrorHandlerOptions = Partial<ResolvedConnectionEr
|
|
|
23
22
|
export declare class ConnectionErrorHandler {
|
|
24
23
|
protected readonly options: ResolvedConnectionErrorHandlerOptions;
|
|
25
24
|
constructor(options: ConnectionErrorHandlerOptions);
|
|
26
|
-
shouldStop(error: Error,
|
|
25
|
+
shouldStop(error: Error, count?: number): boolean;
|
|
27
26
|
protected readonly restarts: number[];
|
|
28
27
|
shouldRestart(): boolean;
|
|
29
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-error-handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"connection-error-handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,qCAAqC;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CACnC;AAED,oBAAY,6BAA6B,GAAG,OAAO,CAAC,qCAAqC,CAAC,GAAG;IACzF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAC3B,CAAC;AAEF,qBAAa,sBAAsB;IAE/B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,qCAAqC,CAAC;gBACtD,OAAO,EAAE,6BAA6B;IASlD,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;IAIjD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAM;IAC3C,aAAa,IAAI,OAAO;CAe3B"}
|
|
@@ -21,7 +21,7 @@ class ConnectionErrorHandler {
|
|
|
21
21
|
this.restarts = [];
|
|
22
22
|
this.options = Object.assign({ maxErrors: 3, maxRestarts: 5, restartInterval: 3 }, options);
|
|
23
23
|
}
|
|
24
|
-
shouldStop(error,
|
|
24
|
+
shouldStop(error, count) {
|
|
25
25
|
return !count || count > this.options.maxErrors;
|
|
26
26
|
}
|
|
27
27
|
shouldRestart() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-error-handler.js","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;
|
|
1
|
+
{"version":3,"file":"connection-error-handler.js","sourceRoot":"","sources":["../../../src/common/messaging/connection-error-handler.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AA0BhF,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,KAAc;QACnC,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,mCAAmC;YACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,mBAAmB,IAAI,CAAC,OAAO,CAAC,WAAW,sBAAsB,IAAI,CAAC,OAAO,CAAC,eAAe,6CAA6C,CAAC,CAAC;YACpM,OAAO,KAAK,CAAC;SAChB;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;CAEJ;AAhCD,wDAgCC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Channel } from '../message-rpc/channel';
|
|
2
2
|
export declare const ConnectionHandler: unique symbol;
|
|
3
3
|
export interface ConnectionHandler {
|
|
4
4
|
readonly path: string;
|
|
5
|
-
onConnection(connection:
|
|
5
|
+
onConnection(connection: Channel): void;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MessageConnection } from 'vscode-ws-jsonrpc';
|
|
2
|
-
import { Event, Emitter } from '../event';
|
|
3
1
|
import { Disposable } from '../disposable';
|
|
2
|
+
import { Emitter, Event } from '../event';
|
|
3
|
+
import { Channel } from '../message-rpc/channel';
|
|
4
|
+
import { RequestHandler, RpcProtocol } from '../message-rpc/rpc-protocol';
|
|
4
5
|
import { ConnectionHandler } from './handler';
|
|
5
6
|
export declare type JsonRpcServer<Client> = Disposable & {
|
|
6
7
|
/**
|
|
@@ -21,8 +22,12 @@ export declare class JsonRpcConnectionHandler<T extends object> implements Conne
|
|
|
21
22
|
readonly targetFactory: (proxy: JsonRpcProxy<T>) => any;
|
|
22
23
|
readonly factoryConstructor: new () => JsonRpcProxyFactory<T>;
|
|
23
24
|
constructor(path: string, targetFactory: (proxy: JsonRpcProxy<T>) => any, factoryConstructor?: new () => JsonRpcProxyFactory<T>);
|
|
24
|
-
onConnection(connection:
|
|
25
|
+
onConnection(connection: Channel): void;
|
|
25
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Factory for creating a new {@link RpcConnection} for a given chanel and {@link RequestHandler}.
|
|
29
|
+
*/
|
|
30
|
+
export declare type RpcConnectionFactory = (channel: Channel, requestHandler: RequestHandler) => RpcProtocol;
|
|
26
31
|
/**
|
|
27
32
|
* Factory for JSON-RPC proxy objects.
|
|
28
33
|
*
|
|
@@ -67,17 +72,18 @@ export declare class JsonRpcConnectionHandler<T extends object> implements Conne
|
|
|
67
72
|
*/
|
|
68
73
|
export declare class JsonRpcProxyFactory<T extends object> implements ProxyHandler<T> {
|
|
69
74
|
target?: any;
|
|
75
|
+
protected rpcConnectionFactory: RpcConnectionFactory;
|
|
70
76
|
protected readonly onDidOpenConnectionEmitter: Emitter<void>;
|
|
71
77
|
protected readonly onDidCloseConnectionEmitter: Emitter<void>;
|
|
72
|
-
protected connectionPromiseResolve: (connection:
|
|
73
|
-
protected connectionPromise: Promise<
|
|
78
|
+
protected connectionPromiseResolve: (connection: RpcProtocol) => void;
|
|
79
|
+
protected connectionPromise: Promise<RpcProtocol>;
|
|
74
80
|
/**
|
|
75
81
|
* Build a new JsonRpcProxyFactory.
|
|
76
82
|
*
|
|
77
83
|
* @param target - The object to expose to JSON-RPC methods calls. If this
|
|
78
84
|
* is omitted, the proxy won't be able to handle requests, only send them.
|
|
79
85
|
*/
|
|
80
|
-
constructor(target?: any);
|
|
86
|
+
constructor(target?: any, rpcConnectionFactory?: RpcConnectionFactory);
|
|
81
87
|
protected waitForConnection(): void;
|
|
82
88
|
/**
|
|
83
89
|
* Connect a MessageConnection to the factory.
|
|
@@ -85,7 +91,7 @@ export declare class JsonRpcProxyFactory<T extends object> implements ProxyHandl
|
|
|
85
91
|
* This connection will be used to send/receive JSON-RPC requests and
|
|
86
92
|
* response.
|
|
87
93
|
*/
|
|
88
|
-
listen(
|
|
94
|
+
listen(channel: Channel): void;
|
|
89
95
|
/**
|
|
90
96
|
* Process an incoming JSON-RPC method call.
|
|
91
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy-factory.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/pro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;IAQrC,SAAS,CAAC,gBAAgB,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG;CAgBhE"}
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.JsonRpcProxyFactory = exports.JsonRpcConnectionHandler = void 0;
|
|
19
19
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
20
|
-
const
|
|
20
|
+
const rpc_message_encoder_1 = require("../message-rpc/rpc-message-encoder");
|
|
21
21
|
const application_error_1 = require("../application-error");
|
|
22
22
|
const event_1 = require("../event");
|
|
23
|
+
const rpc_protocol_1 = require("../message-rpc/rpc-protocol");
|
|
23
24
|
class JsonRpcConnectionHandler {
|
|
24
25
|
constructor(path, targetFactory, factoryConstructor = JsonRpcProxyFactory) {
|
|
25
26
|
this.path = path;
|
|
@@ -34,6 +35,7 @@ class JsonRpcConnectionHandler {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
|
|
38
|
+
const defaultRPCConnectionFactory = (channel, requestHandler) => new rpc_protocol_1.RpcProtocol(channel, requestHandler);
|
|
37
39
|
/**
|
|
38
40
|
* Factory for JSON-RPC proxy objects.
|
|
39
41
|
*
|
|
@@ -83,8 +85,9 @@ class JsonRpcProxyFactory {
|
|
|
83
85
|
* @param target - The object to expose to JSON-RPC methods calls. If this
|
|
84
86
|
* is omitted, the proxy won't be able to handle requests, only send them.
|
|
85
87
|
*/
|
|
86
|
-
constructor(target) {
|
|
88
|
+
constructor(target, rpcConnectionFactory = defaultRPCConnectionFactory) {
|
|
87
89
|
this.target = target;
|
|
90
|
+
this.rpcConnectionFactory = rpcConnectionFactory;
|
|
88
91
|
this.onDidOpenConnectionEmitter = new event_1.Emitter();
|
|
89
92
|
this.onDidCloseConnectionEmitter = new event_1.Emitter();
|
|
90
93
|
this.waitForConnection();
|
|
@@ -92,7 +95,11 @@ class JsonRpcProxyFactory {
|
|
|
92
95
|
waitForConnection() {
|
|
93
96
|
this.connectionPromise = new Promise(resolve => this.connectionPromiseResolve = resolve);
|
|
94
97
|
this.connectionPromise.then(connection => {
|
|
95
|
-
connection.onClose(() =>
|
|
98
|
+
connection.channel.onClose(() => {
|
|
99
|
+
this.onDidCloseConnectionEmitter.fire(undefined);
|
|
100
|
+
// Wait for connection in case the backend reconnects
|
|
101
|
+
this.waitForConnection();
|
|
102
|
+
});
|
|
96
103
|
this.onDidOpenConnectionEmitter.fire(undefined);
|
|
97
104
|
});
|
|
98
105
|
}
|
|
@@ -102,11 +109,9 @@ class JsonRpcProxyFactory {
|
|
|
102
109
|
* This connection will be used to send/receive JSON-RPC requests and
|
|
103
110
|
* response.
|
|
104
111
|
*/
|
|
105
|
-
listen(
|
|
106
|
-
connection.
|
|
107
|
-
connection.onNotification(
|
|
108
|
-
connection.onDispose(() => this.waitForConnection());
|
|
109
|
-
connection.listen();
|
|
112
|
+
listen(channel) {
|
|
113
|
+
const connection = this.rpcConnectionFactory(channel, (meth, args) => this.onRequest(meth, ...args));
|
|
114
|
+
connection.onNotification(event => this.onNotification(event.method, ...event.args));
|
|
110
115
|
this.connectionPromiseResolve(connection);
|
|
111
116
|
}
|
|
112
117
|
/**
|
|
@@ -132,7 +137,7 @@ class JsonRpcProxyFactory {
|
|
|
132
137
|
}
|
|
133
138
|
catch (error) {
|
|
134
139
|
const e = this.serializeError(error);
|
|
135
|
-
if (e instanceof
|
|
140
|
+
if (e instanceof rpc_message_encoder_1.ResponseError) {
|
|
136
141
|
throw e;
|
|
137
142
|
}
|
|
138
143
|
const reason = e.message || '';
|
|
@@ -207,11 +212,11 @@ class JsonRpcProxyFactory {
|
|
|
207
212
|
return this.connectionPromise.then(connection => new Promise((resolve, reject) => {
|
|
208
213
|
try {
|
|
209
214
|
if (isNotify) {
|
|
210
|
-
connection.sendNotification(method,
|
|
215
|
+
connection.sendNotification(method, args);
|
|
211
216
|
resolve(undefined);
|
|
212
217
|
}
|
|
213
218
|
else {
|
|
214
|
-
const resultPromise = connection.sendRequest(method,
|
|
219
|
+
const resultPromise = connection.sendRequest(method, args);
|
|
215
220
|
resultPromise
|
|
216
221
|
.catch((err) => reject(this.deserializeError(capturedError, err)))
|
|
217
222
|
.then((result) => resolve(result));
|
|
@@ -237,12 +242,12 @@ class JsonRpcProxyFactory {
|
|
|
237
242
|
}
|
|
238
243
|
serializeError(e) {
|
|
239
244
|
if (application_error_1.ApplicationError.is(e)) {
|
|
240
|
-
return new
|
|
245
|
+
return new rpc_message_encoder_1.ResponseError(e.code, '', Object.assign({ kind: 'application' }, e.toJson()));
|
|
241
246
|
}
|
|
242
247
|
return e;
|
|
243
248
|
}
|
|
244
249
|
deserializeError(capturedError, e) {
|
|
245
|
-
if (e instanceof
|
|
250
|
+
if (e instanceof rpc_message_encoder_1.ResponseError) {
|
|
246
251
|
const capturedStack = capturedError.stack || '';
|
|
247
252
|
if (e.data && e.data.kind === 'application') {
|
|
248
253
|
const { stack, data, message } = e.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,uDAAuD;AAEvD,
|
|
1
|
+
{"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7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MAAM,EAAE,CAAC,CACrD,CAAC;SACL;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IACS,gBAAgB,CAAC,aAAoB,EAAE,CAAM;QACnD,IAAI,CAAC,YAAY,mCAAa,EAAE;YAC5B,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC;YAChD,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;gBACzC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC;gBACxC,OAAO,oCAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE;oBACrC,OAAO,EAAE,OAAO,IAAI,aAAa,CAAC,OAAO;oBACzC,IAAI;oBACJ,KAAK,EAAE,GAAG,aAAa,gBAAgB,KAAK,EAAE;iBACjD,CAAC,CAAC;aACN;YACD,CAAC,CAAC,KAAK,GAAG,aAAa,CAAC;SAC3B;QACD,OAAO,CAAC,CAAC;IACb,CAAC;CAEJ;AAtMD,kDAsMC"}
|
|
@@ -16,17 +16,9 @@
|
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const chai = require("chai");
|
|
19
|
-
const logger_1 = require("../../node/messaging/logger");
|
|
20
19
|
const proxy_factory_1 = require("./proxy-factory");
|
|
21
|
-
const
|
|
22
|
-
const stream = require("stream");
|
|
20
|
+
const channel_spec_1 = require("../message-rpc/channel.spec");
|
|
23
21
|
const expect = chai.expect;
|
|
24
|
-
class NoTransform extends stream.Transform {
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
-
_transform(chunk, encoding, callback) {
|
|
27
|
-
callback(undefined, chunk);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
22
|
class TestServer {
|
|
31
23
|
constructor() {
|
|
32
24
|
this.requests = [];
|
|
@@ -92,14 +84,11 @@ function getSetup() {
|
|
|
92
84
|
const client = new TestClient();
|
|
93
85
|
const server = new TestServer();
|
|
94
86
|
const serverProxyFactory = new proxy_factory_1.JsonRpcProxyFactory(client);
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const serverConnection = (0, main_1.createMessageConnection)(server2client, client2server, new logger_1.ConsoleLogger());
|
|
98
|
-
serverProxyFactory.listen(serverConnection);
|
|
87
|
+
const pipe = new channel_spec_1.ChannelPipe();
|
|
88
|
+
serverProxyFactory.listen(pipe.right);
|
|
99
89
|
const serverProxy = serverProxyFactory.createProxy();
|
|
100
90
|
const clientProxyFactory = new proxy_factory_1.JsonRpcProxyFactory(server);
|
|
101
|
-
|
|
102
|
-
clientProxyFactory.listen(clientConnection);
|
|
91
|
+
clientProxyFactory.listen(pipe.left);
|
|
103
92
|
const clientProxy = clientProxyFactory.createProxy();
|
|
104
93
|
return {
|
|
105
94
|
client,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-factory.spec.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;AAEhF,6BAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"proxy-factory.spec.js","sourceRoot":"","sources":["../../../src/common/messaging/proxy-factory.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF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IAAI,EAAE,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,SAAS,QAAQ;IAMb,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAEhC,MAAM,kBAAkB,GAAG,IAAI,mCAAmB,CAAa,MAAM,CAAC,CAAC;IACvE,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;IAC/B,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;IAErD,MAAM,kBAAkB,GAAG,IAAI,mCAAmB,CAAa,MAAM,CAAC,CAAC;IACvE,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;IACrD,OAAO;QACH,MAAM;QACN,WAAW;QACX,MAAM;QACN,WAAW;KACd,CAAC;AACN,CAAC"}
|
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Emitter, Event } from '../event';
|
|
2
|
+
import { WriteBuffer } from '../message-rpc';
|
|
3
|
+
import { Channel, MessageProvider, ChannelCloseEvent } from '../message-rpc/channel';
|
|
4
|
+
import { DisposableCollection } from '../disposable';
|
|
5
|
+
/**
|
|
6
|
+
* A channel that manages the main websocket connection between frontend and backend. All service channels
|
|
7
|
+
* are reusing this main channel. (multiplexing). An {@link IWebSocket} abstraction is used to keep the implementation
|
|
8
|
+
* independent of the actual websocket implementation and its execution context (backend vs. frontend).
|
|
9
|
+
*/
|
|
10
|
+
export declare class WebSocketChannel implements Channel {
|
|
11
|
+
protected readonly socket: IWebSocket;
|
|
7
12
|
static wsPath: string;
|
|
8
|
-
protected readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
protected
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
close(
|
|
18
|
-
tryClose(code?: number, reason?: string): void;
|
|
19
|
-
protected fireOpen: () => void;
|
|
20
|
-
onOpen(cb: () => void): void;
|
|
21
|
-
protected fireMessage: (data: any) => void;
|
|
22
|
-
onMessage(cb: (data: any) => void): void;
|
|
23
|
-
fireError: (reason: any) => void;
|
|
24
|
-
onError(cb: (reason: any) => void): void;
|
|
25
|
-
protected closing: boolean;
|
|
26
|
-
protected fireClose(code: number, reason: string): void;
|
|
27
|
-
onClose(cb: (code: number, reason: string) => void): Disposable;
|
|
13
|
+
protected readonly onCloseEmitter: Emitter<ChannelCloseEvent>;
|
|
14
|
+
get onClose(): Event<ChannelCloseEvent>;
|
|
15
|
+
protected readonly onMessageEmitter: Emitter<MessageProvider>;
|
|
16
|
+
get onMessage(): Event<MessageProvider>;
|
|
17
|
+
protected readonly onErrorEmitter: Emitter<unknown>;
|
|
18
|
+
get onError(): Event<unknown>;
|
|
19
|
+
protected toDispose: DisposableCollection;
|
|
20
|
+
constructor(socket: IWebSocket);
|
|
21
|
+
getWriteBuffer(): WriteBuffer;
|
|
22
|
+
close(): void;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
/**
|
|
25
|
+
* An abstraction that enables reuse of the `{@link WebSocketChannel} class in the frontend and backend
|
|
26
|
+
* independent of the actual underlying socket implementation.
|
|
27
|
+
*/
|
|
28
|
+
export interface IWebSocket {
|
|
29
|
+
/**
|
|
30
|
+
* Sends the given message over the web socket in binary format.
|
|
31
|
+
* @param message The binary message.
|
|
32
|
+
*/
|
|
33
|
+
send(message: Uint8Array): void;
|
|
34
|
+
/**
|
|
35
|
+
* Closes the websocket from the local side.
|
|
36
|
+
*/
|
|
37
|
+
close(): void;
|
|
38
|
+
/**
|
|
39
|
+
* The connection state of the web socket.
|
|
40
|
+
*/
|
|
41
|
+
isConnected(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Listener callback to handle incoming messages.
|
|
44
|
+
* @param cb The callback.
|
|
45
|
+
*/
|
|
46
|
+
onMessage(cb: (message: Uint8Array) => void): void;
|
|
47
|
+
/**
|
|
48
|
+
* Listener callback to handle socket errors.
|
|
49
|
+
* @param cb The callback.
|
|
50
|
+
*/
|
|
51
|
+
onError(cb: (reason: any) => void): void;
|
|
52
|
+
/**
|
|
53
|
+
* Listener callback to handle close events (Remote side).
|
|
54
|
+
* @param cb The callback.
|
|
55
|
+
*/
|
|
56
|
+
onClose(cb: (reason: string, code?: number) => void): void;
|
|
51
57
|
}
|
|
52
58
|
//# sourceMappingURL=web-socket-channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-socket-channel.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/web-socket-channel.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"web-socket-channel.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/web-socket-channel.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,OAAO;IAoBhC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;IAnBjD,MAAM,CAAC,MAAM,SAAe;IAE5B,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAiB;IAC9E,IAAI,OAAO,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAEtC;IAED,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAiB;IAC9E,IAAI,SAAS,IAAI,KAAK,CAAC,eAAe,CAAC,CAEtC;IAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,CAAiB;IACpE,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAE5B;IAED,SAAS,CAAC,SAAS,uBAA8B;gBAElB,MAAM,EAAE,UAAU;IAcjD,cAAc,IAAI,WAAW;IAY7B,KAAK,IAAI,IAAI;CAIhB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACvB;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IACd;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI,CAAC;IACnD;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;IACzC;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CAC9D"}
|
|
@@ -16,119 +16,55 @@
|
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.WebSocketChannel = void 0;
|
|
19
|
-
|
|
19
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
20
20
|
const event_1 = require("../event");
|
|
21
|
+
const uint8_array_message_buffer_1 = require("../message-rpc/uint8-array-message-buffer");
|
|
22
|
+
const disposable_1 = require("../disposable");
|
|
23
|
+
/**
|
|
24
|
+
* A channel that manages the main websocket connection between frontend and backend. All service channels
|
|
25
|
+
* are reusing this main channel. (multiplexing). An {@link IWebSocket} abstraction is used to keep the implementation
|
|
26
|
+
* independent of the actual websocket implementation and its execution context (backend vs. frontend).
|
|
27
|
+
*/
|
|
21
28
|
class WebSocketChannel {
|
|
22
|
-
constructor(
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
handleMessage(message) {
|
|
41
|
-
if (message.kind === 'ready') {
|
|
42
|
-
this.fireOpen();
|
|
43
|
-
}
|
|
44
|
-
else if (message.kind === 'data') {
|
|
45
|
-
this.fireMessage(message.content);
|
|
46
|
-
}
|
|
47
|
-
else if (message.kind === 'close') {
|
|
48
|
-
this.fireClose(message.code, message.reason);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
open(path) {
|
|
52
|
-
this.checkNotDisposed();
|
|
53
|
-
this.doSend(JSON.stringify({
|
|
54
|
-
kind: 'open',
|
|
55
|
-
id: this.id,
|
|
56
|
-
path
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
ready() {
|
|
60
|
-
this.checkNotDisposed();
|
|
61
|
-
this.doSend(JSON.stringify({
|
|
62
|
-
kind: 'ready',
|
|
63
|
-
id: this.id
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
send(content) {
|
|
67
|
-
this.checkNotDisposed();
|
|
68
|
-
this.doSend(JSON.stringify({
|
|
69
|
-
kind: 'data',
|
|
70
|
-
id: this.id,
|
|
71
|
-
content
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
close(code = 1000, reason = '') {
|
|
75
|
-
if (this.closing) {
|
|
76
|
-
// Do not try to close the channel if it is already closing.
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
this.checkNotDisposed();
|
|
80
|
-
this.doSend(JSON.stringify({
|
|
81
|
-
kind: 'close',
|
|
82
|
-
id: this.id,
|
|
83
|
-
code,
|
|
84
|
-
reason
|
|
85
|
-
}));
|
|
86
|
-
this.fireClose(code, reason);
|
|
87
|
-
}
|
|
88
|
-
tryClose(code = 1000, reason = '') {
|
|
89
|
-
if (this.closing || this.toDispose.disposed) {
|
|
90
|
-
// Do not try to close the channel if it is already closing or disposed.
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
this.doSend(JSON.stringify({
|
|
94
|
-
kind: 'close',
|
|
95
|
-
id: this.id,
|
|
96
|
-
code,
|
|
97
|
-
reason
|
|
29
|
+
constructor(socket) {
|
|
30
|
+
this.socket = socket;
|
|
31
|
+
this.onCloseEmitter = new event_1.Emitter();
|
|
32
|
+
this.onMessageEmitter = new event_1.Emitter();
|
|
33
|
+
this.onErrorEmitter = new event_1.Emitter();
|
|
34
|
+
this.toDispose = new disposable_1.DisposableCollection();
|
|
35
|
+
this.toDispose.pushAll([this.onCloseEmitter, this.onMessageEmitter, this.onErrorEmitter]);
|
|
36
|
+
socket.onClose((reason, code) => this.onCloseEmitter.fire({ reason, code }));
|
|
37
|
+
socket.onClose(() => this.close());
|
|
38
|
+
socket.onError(error => this.onErrorEmitter.fire(error));
|
|
39
|
+
// eslint-disable-next-line arrow-body-style
|
|
40
|
+
socket.onMessage(data => this.onMessageEmitter.fire(() => {
|
|
41
|
+
// In the browser context socketIO receives binary messages as ArrayBuffers.
|
|
42
|
+
// So we have to convert them to a Uint8Array before delegating the message to the read buffer.
|
|
43
|
+
const buffer = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
|
|
44
|
+
return new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(buffer);
|
|
98
45
|
}));
|
|
99
|
-
this.fireClose(code, reason);
|
|
100
46
|
}
|
|
101
|
-
|
|
102
|
-
this.
|
|
103
|
-
this.fireOpen = cb;
|
|
104
|
-
this.toDispose.push(disposable_1.Disposable.create(() => this.fireOpen = () => { }));
|
|
47
|
+
get onClose() {
|
|
48
|
+
return this.onCloseEmitter.event;
|
|
105
49
|
}
|
|
106
|
-
onMessage(
|
|
107
|
-
this.
|
|
108
|
-
this.fireMessage = cb;
|
|
109
|
-
this.toDispose.push(disposable_1.Disposable.create(() => this.fireMessage = () => { }));
|
|
50
|
+
get onMessage() {
|
|
51
|
+
return this.onMessageEmitter.event;
|
|
110
52
|
}
|
|
111
|
-
onError(
|
|
112
|
-
this.
|
|
113
|
-
this.fireError = cb;
|
|
114
|
-
this.toDispose.push(disposable_1.Disposable.create(() => this.fireError = () => { }));
|
|
53
|
+
get onError() {
|
|
54
|
+
return this.onErrorEmitter.event;
|
|
115
55
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
finally {
|
|
125
|
-
this.closing = false;
|
|
126
|
-
}
|
|
127
|
-
this.dispose();
|
|
56
|
+
getWriteBuffer() {
|
|
57
|
+
const result = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer();
|
|
58
|
+
result.onCommit(buffer => {
|
|
59
|
+
if (this.socket.isConnected()) {
|
|
60
|
+
this.socket.send(buffer);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return result;
|
|
128
64
|
}
|
|
129
|
-
|
|
130
|
-
this.
|
|
131
|
-
|
|
65
|
+
close() {
|
|
66
|
+
this.toDispose.dispose();
|
|
67
|
+
this.socket.close();
|
|
132
68
|
}
|
|
133
69
|
}
|
|
134
70
|
exports.WebSocketChannel = WebSocketChannel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-socket-channel.js","sourceRoot":"","sources":["../../../src/common/messaging/web-socket-channel.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;
|
|
1
|
+
{"version":3,"file":"web-socket-channel.js","sourceRoot":"","sources":["../../../src/common/messaging/web-socket-channel.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,uDAAuD;AAEvD,oCAA0C;AAE1C,0FAAwG;AAExG,8CAAqD;AAErD;;;;GAIG;AACH,MAAa,gBAAgB;IAoBzB,YAA+B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAjB9B,mBAAc,GAA+B,IAAI,eAAO,EAAE,CAAC;QAK3D,qBAAgB,GAA6B,IAAI,eAAO,EAAE,CAAC;QAK3D,mBAAc,GAAqB,IAAI,eAAO,EAAE,CAAC;QAK1D,cAAS,GAAG,IAAI,iCAAoB,EAAE,CAAC;QAG7C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAC1F,MAAM,CAAC,OAAO,CA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