@theia/core 1.44.0 → 1.45.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.
Files changed (260) hide show
  1. package/README.md +6 -6
  2. package/i18n/nls.cs.json +10 -3
  3. package/i18n/nls.de.json +10 -3
  4. package/i18n/nls.es.json +10 -3
  5. package/i18n/nls.fr.json +10 -3
  6. package/i18n/nls.hu.json +10 -3
  7. package/i18n/nls.it.json +10 -3
  8. package/i18n/nls.ja.json +10 -3
  9. package/i18n/nls.json +10 -3
  10. package/i18n/nls.pl.json +10 -3
  11. package/i18n/nls.pt-br.json +10 -3
  12. package/i18n/nls.pt-pt.json +10 -3
  13. package/i18n/nls.ru.json +10 -3
  14. package/i18n/nls.zh-cn.json +10 -3
  15. package/lib/browser/common-frontend-contribution.d.ts +6 -0
  16. package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
  17. package/lib/browser/common-frontend-contribution.js +52 -9
  18. package/lib/browser/common-frontend-contribution.js.map +1 -1
  19. package/lib/browser/connection-status-service.d.ts +2 -2
  20. package/lib/browser/connection-status-service.d.ts.map +1 -1
  21. package/lib/browser/connection-status-service.js +3 -3
  22. package/lib/browser/connection-status-service.js.map +1 -1
  23. package/lib/browser/connection-status-service.spec.js +6 -6
  24. package/lib/browser/connection-status-service.spec.js.map +1 -1
  25. package/lib/browser/core-preferences.d.ts.map +1 -1
  26. package/lib/browser/core-preferences.js +16 -0
  27. package/lib/browser/core-preferences.js.map +1 -1
  28. package/lib/browser/dialogs.d.ts +0 -1
  29. package/lib/browser/dialogs.d.ts.map +1 -1
  30. package/lib/browser/dialogs.js +1 -34
  31. package/lib/browser/dialogs.js.map +1 -1
  32. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  33. package/lib/browser/frontend-application-module.js +1 -0
  34. package/lib/browser/frontend-application-module.js.map +1 -1
  35. package/lib/browser/messaging/connection-source.d.ts +9 -0
  36. package/lib/browser/messaging/connection-source.d.ts.map +1 -0
  37. package/lib/browser/messaging/connection-source.js +20 -0
  38. package/lib/browser/messaging/connection-source.js.map +1 -0
  39. package/lib/browser/messaging/frontend-id-provider.d.ts +13 -0
  40. package/lib/browser/messaging/frontend-id-provider.d.ts.map +1 -0
  41. package/lib/browser/messaging/frontend-id-provider.js +40 -0
  42. package/lib/browser/messaging/frontend-id-provider.js.map +1 -0
  43. package/lib/browser/messaging/messaging-frontend-module.d.ts.map +1 -1
  44. package/lib/browser/messaging/messaging-frontend-module.js +18 -1
  45. package/lib/browser/messaging/messaging-frontend-module.js.map +1 -1
  46. package/lib/browser/messaging/service-connection-provider.d.ts +48 -0
  47. package/lib/browser/messaging/service-connection-provider.d.ts.map +1 -0
  48. package/lib/browser/messaging/service-connection-provider.js +115 -0
  49. package/lib/browser/messaging/service-connection-provider.js.map +1 -0
  50. package/lib/browser/messaging/ws-connection-provider.d.ts +7 -38
  51. package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
  52. package/lib/browser/messaging/ws-connection-provider.js +17 -121
  53. package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
  54. package/lib/browser/messaging/ws-connection-source.d.ts +41 -0
  55. package/lib/browser/messaging/ws-connection-source.d.ts.map +1 -0
  56. package/lib/browser/messaging/ws-connection-source.js +210 -0
  57. package/lib/browser/messaging/ws-connection-source.js.map +1 -0
  58. package/lib/browser/preload/i18n-preload-contribution.js +1 -1
  59. package/lib/browser/preload/i18n-preload-contribution.js.map +1 -1
  60. package/lib/browser/shell/application-shell.js +1 -1
  61. package/lib/browser/shell/application-shell.js.map +1 -1
  62. package/lib/browser/tree/tree-compression/compressed-tree-widget.d.ts +1 -0
  63. package/lib/browser/tree/tree-compression/compressed-tree-widget.d.ts.map +1 -1
  64. package/lib/browser/tree/tree-compression/compressed-tree-widget.js +5 -0
  65. package/lib/browser/tree/tree-compression/compressed-tree-widget.js.map +1 -1
  66. package/lib/browser/tree/tree-widget.d.ts +6 -0
  67. package/lib/browser/tree/tree-widget.d.ts.map +1 -1
  68. package/lib/browser/tree/tree-widget.js +21 -11
  69. package/lib/browser/tree/tree-widget.js.map +1 -1
  70. package/lib/browser/user-working-directory-provider.d.ts +8 -1
  71. package/lib/browser/user-working-directory-provider.d.ts.map +1 -1
  72. package/lib/browser/user-working-directory-provider.js +22 -1
  73. package/lib/browser/user-working-directory-provider.js.map +1 -1
  74. package/lib/browser/window/default-secondary-window-service.d.ts +3 -0
  75. package/lib/browser/window/default-secondary-window-service.d.ts.map +1 -1
  76. package/lib/browser/window/default-secondary-window-service.js +55 -1
  77. package/lib/browser/window/default-secondary-window-service.js.map +1 -1
  78. package/lib/common/message-rpc/channel.d.ts.map +1 -1
  79. package/lib/common/message-rpc/channel.js +7 -1
  80. package/lib/common/message-rpc/channel.js.map +1 -1
  81. package/lib/common/message-rpc/message-buffer.d.ts +2 -0
  82. package/lib/common/message-rpc/message-buffer.d.ts.map +1 -1
  83. package/lib/common/message-rpc/message-buffer.js +4 -0
  84. package/lib/common/message-rpc/message-buffer.js.map +1 -1
  85. package/lib/common/message-rpc/uint8-array-message-buffer.d.ts +1 -0
  86. package/lib/common/message-rpc/uint8-array-message-buffer.d.ts.map +1 -1
  87. package/lib/common/message-rpc/uint8-array-message-buffer.js +6 -0
  88. package/lib/common/message-rpc/uint8-array-message-buffer.js.map +1 -1
  89. package/lib/common/messaging/connection-management.d.ts +25 -0
  90. package/lib/common/messaging/connection-management.d.ts.map +1 -0
  91. package/lib/common/messaging/connection-management.js +38 -0
  92. package/lib/common/messaging/connection-management.js.map +1 -0
  93. package/lib/common/messaging/handler.d.ts +1 -0
  94. package/lib/common/messaging/handler.d.ts.map +1 -1
  95. package/lib/common/messaging/handler.js +2 -1
  96. package/lib/common/messaging/handler.js.map +1 -1
  97. package/lib/common/messaging/socket-write-buffer.d.ts +11 -0
  98. package/lib/common/messaging/socket-write-buffer.d.ts.map +1 -0
  99. package/lib/common/messaging/socket-write-buffer.js +50 -0
  100. package/lib/common/messaging/socket-write-buffer.js.map +1 -0
  101. package/lib/common/messaging/web-socket-channel.d.ts +7 -35
  102. package/lib/common/messaging/web-socket-channel.d.ts.map +1 -1
  103. package/lib/common/messaging/web-socket-channel.js +20 -9
  104. package/lib/common/messaging/web-socket-channel.js.map +1 -1
  105. package/lib/electron-browser/messaging/electron-frontend-id-provider.d.ts +5 -0
  106. package/lib/electron-browser/messaging/electron-frontend-id-provider.d.ts.map +1 -0
  107. package/lib/{electron-node/token/electron-token-messaging-contribution.js → electron-browser/messaging/electron-frontend-id-provider.js} +9 -28
  108. package/lib/electron-browser/messaging/electron-frontend-id-provider.js.map +1 -0
  109. package/lib/electron-browser/messaging/electron-ipc-connection-source.d.ts +24 -0
  110. package/lib/electron-browser/messaging/electron-ipc-connection-source.d.ts.map +1 -0
  111. package/lib/electron-browser/messaging/{electron-ipc-connection-provider.js → electron-ipc-connection-source.js} +19 -19
  112. package/lib/electron-browser/messaging/electron-ipc-connection-source.js.map +1 -0
  113. package/lib/electron-browser/messaging/electron-local-ws-connection-source.d.ts +7 -0
  114. package/lib/electron-browser/messaging/electron-local-ws-connection-source.d.ts.map +1 -0
  115. package/lib/electron-browser/messaging/{electron-local-ws-connection-provider.js → electron-local-ws-connection-source.js} +7 -7
  116. package/lib/electron-browser/messaging/electron-local-ws-connection-source.js.map +1 -0
  117. package/lib/electron-browser/messaging/electron-messaging-frontend-module.d.ts.map +1 -1
  118. package/lib/electron-browser/messaging/electron-messaging-frontend-module.js +45 -13
  119. package/lib/electron-browser/messaging/electron-messaging-frontend-module.js.map +1 -1
  120. package/lib/electron-browser/messaging/electron-ws-connection-source.d.ts +12 -0
  121. package/lib/electron-browser/messaging/electron-ws-connection-source.d.ts.map +1 -0
  122. package/lib/electron-browser/messaging/{electron-ws-connection-provider.js → electron-ws-connection-source.js} +14 -21
  123. package/lib/electron-browser/messaging/electron-ws-connection-source.js.map +1 -0
  124. package/lib/electron-browser/preload.d.ts.map +1 -1
  125. package/lib/electron-browser/preload.js +10 -0
  126. package/lib/electron-browser/preload.js.map +1 -1
  127. package/lib/electron-browser/window/electron-window-module.js +2 -2
  128. package/lib/electron-browser/window/electron-window-module.js.map +1 -1
  129. package/lib/electron-browser/window/electron-window-service.d.ts +4 -0
  130. package/lib/electron-browser/window/electron-window-service.d.ts.map +1 -1
  131. package/lib/electron-browser/window/electron-window-service.js +13 -0
  132. package/lib/electron-browser/window/electron-window-service.js.map +1 -1
  133. package/lib/electron-common/electron-api.d.ts +6 -0
  134. package/lib/electron-common/electron-api.d.ts.map +1 -1
  135. package/lib/electron-common/electron-api.js +3 -1
  136. package/lib/electron-common/electron-api.js.map +1 -1
  137. package/lib/electron-main/electron-api-main.d.ts +1 -0
  138. package/lib/electron-main/electron-api-main.d.ts.map +1 -1
  139. package/lib/electron-main/electron-api-main.js +15 -0
  140. package/lib/electron-main/electron-api-main.js.map +1 -1
  141. package/lib/electron-main/electron-main-application-module.js +5 -5
  142. package/lib/electron-main/electron-main-application-module.js.map +1 -1
  143. package/lib/electron-main/electron-main-application.d.ts +7 -13
  144. package/lib/electron-main/electron-main-application.d.ts.map +1 -1
  145. package/lib/electron-main/electron-main-application.js +36 -26
  146. package/lib/electron-main/electron-main-application.js.map +1 -1
  147. package/lib/electron-main/messaging/electron-connection-handler.d.ts.map +1 -0
  148. package/lib/electron-main/messaging/electron-connection-handler.js.map +1 -0
  149. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +13 -22
  150. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
  151. package/lib/electron-main/messaging/electron-messaging-contribution.js +39 -39
  152. package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
  153. package/lib/electron-main/messaging/electron-messaging-service.d.ts.map +1 -1
  154. package/lib/electron-main/messaging/electron-messaging-service.js.map +1 -1
  155. package/lib/electron-main/theia-electron-window.d.ts +2 -2
  156. package/lib/electron-main/theia-electron-window.d.ts.map +1 -1
  157. package/lib/electron-main/theia-electron-window.js +3 -2
  158. package/lib/electron-main/theia-electron-window.js.map +1 -1
  159. package/lib/node/messaging/default-messaging-service.d.ts +29 -0
  160. package/lib/node/messaging/default-messaging-service.d.ts.map +1 -0
  161. package/lib/node/messaging/default-messaging-service.js +140 -0
  162. package/lib/node/messaging/default-messaging-service.js.map +1 -0
  163. package/lib/node/messaging/frontend-connection-service.d.ts +7 -0
  164. package/lib/node/messaging/frontend-connection-service.d.ts.map +1 -0
  165. package/lib/node/messaging/frontend-connection-service.js +19 -0
  166. package/lib/node/messaging/frontend-connection-service.js.map +1 -0
  167. package/lib/node/messaging/messaging-backend-module.d.ts.map +1 -1
  168. package/lib/node/messaging/messaging-backend-module.js +23 -9
  169. package/lib/node/messaging/messaging-backend-module.js.map +1 -1
  170. package/lib/node/messaging/messaging-service.d.ts +2 -3
  171. package/lib/node/messaging/messaging-service.d.ts.map +1 -1
  172. package/lib/node/messaging/test/test-web-socket-channel.d.ts +3 -3
  173. package/lib/node/messaging/test/test-web-socket-channel.d.ts.map +1 -1
  174. package/lib/node/messaging/test/test-web-socket-channel.js +38 -24
  175. package/lib/node/messaging/test/test-web-socket-channel.js.map +1 -1
  176. package/lib/node/messaging/websocket-endpoint.d.ts +21 -0
  177. package/lib/node/messaging/websocket-endpoint.d.ts.map +1 -0
  178. package/lib/node/messaging/websocket-endpoint.js +89 -0
  179. package/lib/node/messaging/websocket-endpoint.js.map +1 -0
  180. package/lib/node/messaging/websocket-frontend-connection-service.d.ts +30 -0
  181. package/lib/node/messaging/websocket-frontend-connection-service.d.ts.map +1 -0
  182. package/lib/node/messaging/websocket-frontend-connection-service.js +173 -0
  183. package/lib/node/messaging/websocket-frontend-connection-service.js.map +1 -0
  184. package/package.json +6 -6
  185. package/src/browser/common-frontend-contribution.ts +55 -9
  186. package/src/browser/connection-status-service.spec.ts +6 -6
  187. package/src/browser/connection-status-service.ts +2 -2
  188. package/src/browser/core-preferences.ts +16 -0
  189. package/src/browser/dialogs.ts +0 -34
  190. package/src/browser/frontend-application-module.ts +1 -0
  191. package/src/browser/messaging/connection-source.ts +26 -0
  192. package/src/browser/messaging/frontend-id-provider.ts +37 -0
  193. package/src/browser/messaging/messaging-frontend-module.ts +20 -2
  194. package/src/browser/messaging/service-connection-provider.ts +126 -0
  195. package/src/browser/messaging/ws-connection-provider.ts +16 -141
  196. package/src/browser/messaging/ws-connection-source.ts +210 -0
  197. package/src/browser/preload/i18n-preload-contribution.ts +1 -1
  198. package/src/browser/shell/application-shell.ts +1 -1
  199. package/src/browser/tree/tree-compression/compressed-tree-widget.tsx +27 -7
  200. package/src/browser/tree/tree-widget.tsx +21 -10
  201. package/src/browser/user-working-directory-provider.ts +32 -3
  202. package/src/browser/window/default-secondary-window-service.ts +54 -1
  203. package/src/common/i18n/nls.metadata.json +7208 -6923
  204. package/src/common/message-rpc/channel.ts +5 -1
  205. package/src/common/message-rpc/message-buffer.ts +6 -0
  206. package/src/common/message-rpc/uint8-array-message-buffer.ts +7 -0
  207. package/src/common/messaging/connection-management.ts +43 -0
  208. package/src/common/messaging/handler.ts +2 -0
  209. package/src/common/messaging/socket-write-buffer.ts +52 -0
  210. package/src/common/messaging/web-socket-channel.ts +28 -45
  211. package/src/electron-browser/messaging/electron-frontend-id-provider.ts +25 -0
  212. package/src/electron-browser/messaging/{electron-ipc-connection-provider.ts → electron-ipc-connection-source.ts} +17 -13
  213. package/src/electron-browser/messaging/{electron-local-ws-connection-provider.ts → electron-local-ws-connection-source.ts} +2 -2
  214. package/src/electron-browser/messaging/electron-messaging-frontend-module.ts +49 -12
  215. package/src/electron-browser/messaging/{electron-ws-connection-provider.ts → electron-ws-connection-source.ts} +6 -17
  216. package/src/electron-browser/preload.ts +15 -1
  217. package/src/electron-browser/window/electron-window-module.ts +1 -1
  218. package/src/electron-browser/window/electron-window-service.ts +11 -0
  219. package/src/electron-common/electron-api.ts +7 -0
  220. package/src/electron-main/electron-api-main.ts +20 -1
  221. package/src/electron-main/electron-main-application-module.ts +5 -5
  222. package/src/electron-main/electron-main-application.ts +46 -41
  223. package/src/electron-main/messaging/electron-messaging-contribution.ts +45 -43
  224. package/src/electron-main/messaging/electron-messaging-service.ts +1 -0
  225. package/src/electron-main/theia-electron-window.ts +4 -3
  226. package/src/node/messaging/default-messaging-service.ts +129 -0
  227. package/src/node/messaging/frontend-connection-service.ts +24 -0
  228. package/src/node/messaging/messaging-backend-module.ts +25 -10
  229. package/src/node/messaging/messaging-service.ts +3 -3
  230. package/src/node/messaging/test/test-web-socket-channel.ts +32 -27
  231. package/src/node/messaging/websocket-endpoint.ts +79 -0
  232. package/src/node/messaging/websocket-frontend-connection-service.ts +171 -0
  233. package/lib/common/messaging/abstract-connection-provider.d.ts +0 -45
  234. package/lib/common/messaging/abstract-connection-provider.d.ts.map +0 -1
  235. package/lib/common/messaging/abstract-connection-provider.js +0 -93
  236. package/lib/common/messaging/abstract-connection-provider.js.map +0 -1
  237. package/lib/electron-browser/messaging/electron-ipc-connection-provider.d.ts +0 -19
  238. package/lib/electron-browser/messaging/electron-ipc-connection-provider.d.ts.map +0 -1
  239. package/lib/electron-browser/messaging/electron-ipc-connection-provider.js.map +0 -1
  240. package/lib/electron-browser/messaging/electron-local-ws-connection-provider.d.ts +0 -7
  241. package/lib/electron-browser/messaging/electron-local-ws-connection-provider.d.ts.map +0 -1
  242. package/lib/electron-browser/messaging/electron-local-ws-connection-provider.js.map +0 -1
  243. package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts +0 -17
  244. package/lib/electron-browser/messaging/electron-ws-connection-provider.d.ts.map +0 -1
  245. package/lib/electron-browser/messaging/electron-ws-connection-provider.js.map +0 -1
  246. package/lib/electron-common/messaging/electron-connection-handler.d.ts.map +0 -1
  247. package/lib/electron-common/messaging/electron-connection-handler.js.map +0 -1
  248. package/lib/electron-node/token/electron-token-messaging-contribution.d.ts +0 -16
  249. package/lib/electron-node/token/electron-token-messaging-contribution.d.ts.map +0 -1
  250. package/lib/electron-node/token/electron-token-messaging-contribution.js.map +0 -1
  251. package/lib/node/messaging/messaging-contribution.d.ts +0 -44
  252. package/lib/node/messaging/messaging-contribution.d.ts.map +0 -1
  253. package/lib/node/messaging/messaging-contribution.js +0 -210
  254. package/lib/node/messaging/messaging-contribution.js.map +0 -1
  255. package/src/common/messaging/abstract-connection-provider.ts +0 -115
  256. package/src/electron-node/token/electron-token-messaging-contribution.ts +0 -41
  257. package/src/node/messaging/messaging-contribution.ts +0 -197
  258. /package/lib/{electron-common → electron-main}/messaging/electron-connection-handler.d.ts +0 -0
  259. /package/lib/{electron-common → electron-main}/messaging/electron-connection-handler.js +0 -0
  260. /package/src/{electron-common → electron-main}/messaging/electron-connection-handler.ts +0 -0
@@ -0,0 +1,25 @@
1
+ export declare const ConnectionCloseService: unique symbol;
2
+ export declare const connectionCloseServicePath = "/services/ChannelCloseService";
3
+ /**
4
+ * These messages are used to negotiate service reconnection between a front ends and back end.
5
+ * Whenever a front end first connects to a back end, it sends the ${@link ConnectionManagementMessages#INITIAL_CONNECT} message
6
+ * together with its front end id.
7
+ * The back end then starts a new front end connection context for that front end. If the back end already had another connection context
8
+ * for the given front end id, it gets discarded.
9
+ * If the front end reconnects after a websocket disconnect, it sends the ${@link ConnectionManagementMessages#RECONNECT} message
10
+ * together with its front end id..
11
+ * If the back end still has a connection context for the front end id, the context is reconnected and the back end replies with the value true.
12
+ * If there is no context anymore, the back end replies with value false. The front end can then either do an initial connect or reload
13
+ * the whole UI.
14
+ */
15
+ export declare namespace ConnectionManagementMessages {
16
+ const INITIAL_CONNECT = "initialConnection";
17
+ const RECONNECT = "reconnect";
18
+ }
19
+ /**
20
+ * A service to mark a front end as unused. As soon as it disconnects from the back end, the connection context will be discarded.
21
+ */
22
+ export interface ConnectionCloseService {
23
+ markForClose(frontEndId: string): Promise<void>;
24
+ }
25
+ //# sourceMappingURL=connection-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-management.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/connection-management.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AACvE,eAAO,MAAM,0BAA0B,kCAAkC,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,yBAAiB,4BAA4B,CAAC;IACnC,MAAM,eAAe,sBAAsB,CAAC;IAC5C,MAAM,SAAS,cAAc,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ConnectionManagementMessages = exports.connectionCloseServicePath = exports.ConnectionCloseService = void 0;
19
+ exports.ConnectionCloseService = Symbol('ConnectionCloseService');
20
+ exports.connectionCloseServicePath = '/services/ChannelCloseService';
21
+ /**
22
+ * These messages are used to negotiate service reconnection between a front ends and back end.
23
+ * Whenever a front end first connects to a back end, it sends the ${@link ConnectionManagementMessages#INITIAL_CONNECT} message
24
+ * together with its front end id.
25
+ * The back end then starts a new front end connection context for that front end. If the back end already had another connection context
26
+ * for the given front end id, it gets discarded.
27
+ * If the front end reconnects after a websocket disconnect, it sends the ${@link ConnectionManagementMessages#RECONNECT} message
28
+ * together with its front end id..
29
+ * If the back end still has a connection context for the front end id, the context is reconnected and the back end replies with the value true.
30
+ * If there is no context anymore, the back end replies with value false. The front end can then either do an initial connect or reload
31
+ * the whole UI.
32
+ */
33
+ var ConnectionManagementMessages;
34
+ (function (ConnectionManagementMessages) {
35
+ ConnectionManagementMessages.INITIAL_CONNECT = 'initialConnection';
36
+ ConnectionManagementMessages.RECONNECT = 'reconnect';
37
+ })(ConnectionManagementMessages = exports.ConnectionManagementMessages || (exports.ConnectionManagementMessages = {}));
38
+ //# sourceMappingURL=connection-management.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-management.js","sourceRoot":"","sources":["../../../src/common/messaging/connection-management.ts"],"names":[],"mappings":";AACA,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,gFAAgF;AAChF,gFAAgF;;;AAEnE,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAC1D,QAAA,0BAA0B,GAAG,+BAA+B,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,IAAiB,4BAA4B,CAG5C;AAHD,WAAiB,4BAA4B;IAC5B,4CAAe,GAAG,mBAAmB,CAAC;IACtC,sCAAS,GAAG,WAAW,CAAC;AACzC,CAAC,EAHgB,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAG5C"}
@@ -1,4 +1,5 @@
1
1
  import { Channel } from '../message-rpc/channel';
2
+ export declare const servicesPath = "/services";
2
3
  export declare const ConnectionHandler: unique symbol;
3
4
  export interface ConnectionHandler {
4
5
  readonly path: string;
@@ -1 +1 @@
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
+ {"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,YAAY,cAAc,CAAC;AAExC,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"}
@@ -15,6 +15,7 @@
15
15
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
16
  // *****************************************************************************
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ConnectionHandler = void 0;
18
+ exports.ConnectionHandler = exports.servicesPath = void 0;
19
+ exports.servicesPath = '/services';
19
20
  exports.ConnectionHandler = Symbol('ConnectionHandler');
20
21
  //# sourceMappingURL=handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/common/messaging/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,gFAAgF;AAChF,gFAAgF;;;AAInE,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/common/messaging/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,gFAAgF;AAChF,gFAAgF;;;AAInE,QAAA,YAAY,GAAG,WAAW,CAAC;AAE3B,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { WebSocket } from './web-socket-channel';
2
+ export declare class SocketWriteBuffer {
3
+ private static DISCONNECTED_BUFFER_SIZE;
4
+ private disconnectedBuffer;
5
+ private bufferWritePosition;
6
+ buffer(data: Uint8Array): void;
7
+ protected ensureWriteBuffer(byteLength: number): void;
8
+ flush(socket: WebSocket): void;
9
+ drain(): void;
10
+ }
11
+ //# sourceMappingURL=socket-write-buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket-write-buffer.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/socket-write-buffer.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAc;IAErD,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,mBAAmB,CAAK;IAEhC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAM9B,SAAS,CAAC,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAWrD,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAO9B,KAAK,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.SocketWriteBuffer = void 0;
19
+ class SocketWriteBuffer {
20
+ constructor() {
21
+ this.bufferWritePosition = 0;
22
+ }
23
+ buffer(data) {
24
+ var _a;
25
+ this.ensureWriteBuffer(data.byteLength);
26
+ (_a = this.disconnectedBuffer) === null || _a === void 0 ? void 0 : _a.set(data, this.bufferWritePosition);
27
+ this.bufferWritePosition += data.byteLength;
28
+ }
29
+ ensureWriteBuffer(byteLength) {
30
+ if (!this.disconnectedBuffer) {
31
+ this.disconnectedBuffer = new Uint8Array(SocketWriteBuffer.DISCONNECTED_BUFFER_SIZE);
32
+ this.bufferWritePosition = 0;
33
+ }
34
+ if (this.bufferWritePosition + byteLength > this.disconnectedBuffer.byteLength) {
35
+ throw new Error(`Max disconnected buffer size exceeded by adding ${byteLength} bytes`);
36
+ }
37
+ }
38
+ flush(socket) {
39
+ if (this.disconnectedBuffer) {
40
+ socket.send(this.disconnectedBuffer.slice(0, this.bufferWritePosition));
41
+ this.disconnectedBuffer = undefined;
42
+ }
43
+ }
44
+ drain() {
45
+ this.disconnectedBuffer = undefined;
46
+ }
47
+ }
48
+ exports.SocketWriteBuffer = SocketWriteBuffer;
49
+ SocketWriteBuffer.DISCONNECTED_BUFFER_SIZE = 100 * 1024;
50
+ //# sourceMappingURL=socket-write-buffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket-write-buffer.js","sourceRoot":"","sources":["../../../src/common/messaging/socket-write-buffer.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,gFAAgF;AAChF,gFAAgF;;;AAIhF,MAAa,iBAAiB;IAA9B;QAIY,wBAAmB,GAAG,CAAC,CAAC;IA6BpC,CAAC;IA3BG,MAAM,CAAC,IAAgB;;QACnB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxC,MAAA,IAAI,CAAC,kBAAkB,0CAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC7D,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,UAAU,CAAC;IAChD,CAAC;IAES,iBAAiB,CAAC,UAAkB;QAC1C,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC1B,IAAI,CAAC,kBAAkB,GAAG,IAAI,UAAU,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,CAAC;YACrF,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;SAChC;QAED,IAAI,IAAI,CAAC,mBAAmB,GAAG,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE;YAC5E,MAAM,IAAI,KAAK,CAAC,mDAAmD,UAAU,QAAQ,CAAC,CAAC;SAC1F;IACL,CAAC;IAED,KAAK,CAAC,MAAiB;QACnB,IAAI,IAAI,CAAC,kBAAkB,EAAE;YACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACxE,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;SACvC;IACL,CAAC;IAED,KAAK;QACD,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACxC,CAAC;;AAhCL,8CAiCC;AAhCkB,0CAAwB,GAAG,GAAG,GAAG,IAAI,CAAC"}
@@ -1,48 +1,20 @@
1
1
  import { WriteBuffer } from '../message-rpc';
2
2
  import { AbstractChannel } from '../message-rpc/channel';
3
+ import { Socket as ClientSocket } from 'socket.io-client';
4
+ import { Socket as ServerSocket } from 'socket.io';
5
+ export declare type WebSocket = ClientSocket | ServerSocket;
3
6
  /**
4
7
  * A channel that manages the main websocket connection between frontend and backend. All service channels
5
8
  * are reusing this main channel. (multiplexing). An {@link IWebSocket} abstraction is used to keep the implementation
6
9
  * independent of the actual websocket implementation and its execution context (backend vs. frontend).
7
10
  */
8
11
  export declare class WebSocketChannel extends AbstractChannel {
9
- protected readonly socket: IWebSocket;
12
+ protected readonly socket: WebSocket;
10
13
  static wsPath: string;
11
- constructor(socket: IWebSocket);
14
+ private onDidConnectEmitter;
15
+ onDidConnect: import("vscode-languageserver-protocol").Event<void>;
16
+ constructor(socket: WebSocket);
12
17
  getWriteBuffer(): WriteBuffer;
13
- }
14
- /**
15
- * An abstraction that enables reuse of the `{@link WebSocketChannel} class in the frontend and backend
16
- * independent of the actual underlying socket implementation.
17
- */
18
- export interface IWebSocket {
19
- /**
20
- * Sends the given message over the web socket in binary format.
21
- * @param message The binary message.
22
- */
23
- send(message: Uint8Array): void;
24
- /**
25
- * Closes the websocket from the local side.
26
- */
27
18
  close(): void;
28
- /**
29
- * The connection state of the web socket.
30
- */
31
- isConnected(): boolean;
32
- /**
33
- * Listener callback to handle incoming messages.
34
- * @param cb The callback.
35
- */
36
- onMessage(cb: (message: Uint8Array) => void): void;
37
- /**
38
- * Listener callback to handle socket errors.
39
- * @param cb The callback.
40
- */
41
- onError(cb: (reason: any) => void): void;
42
- /**
43
- * Listener callback to handle close events (Remote side).
44
- * @param cb The callback.
45
- */
46
- onClose(cb: (reason: string, code?: number) => void): void;
47
19
  }
48
20
  //# 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,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;IAGrC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;IAFjD,MAAM,CAAC,MAAM,SAAe;gBAEG,MAAM,EAAE,UAAU;IAcjD,cAAc,IAAI,WAAW;CAWhC;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"}
1
+ {"version":3,"file":"web-socket-channel.d.ts","sourceRoot":"","sources":["../../../src/common/messaging/web-socket-channel.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AAGnD,oBAAY,SAAS,GAAG,YAAY,GAAG,YAAY,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;IAMrC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS;IALhD,MAAM,CAAC,MAAM,SAAe;IAE5B,OAAO,CAAC,mBAAmB,CAAuB;IAClD,YAAY,uDAAkC;gBAEf,MAAM,EAAE,SAAS;IAqBhD,cAAc,IAAI,WAAW;IAYpB,KAAK,IAAI,IAAI;CAIzB"}
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.WebSocketChannel = void 0;
19
19
  const uint8_array_message_buffer_1 = require("../message-rpc/uint8-array-message-buffer");
20
20
  const channel_1 = require("../message-rpc/channel");
21
- const disposable_1 = require("../disposable");
21
+ const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
22
22
  /**
23
23
  * A channel that manages the main websocket connection between frontend and backend. All service channels
24
24
  * are reusing this main channel. (multiplexing). An {@link IWebSocket} abstraction is used to keep the implementation
@@ -28,26 +28,37 @@ class WebSocketChannel extends channel_1.AbstractChannel {
28
28
  constructor(socket) {
29
29
  super();
30
30
  this.socket = socket;
31
- this.toDispose.push(disposable_1.Disposable.create(() => socket.close()));
32
- socket.onClose((reason, code) => this.onCloseEmitter.fire({ reason, code }));
33
- socket.onClose(() => this.close());
34
- socket.onError(error => this.onErrorEmitter.fire(error));
35
- socket.onMessage(data => this.onMessageEmitter.fire(() => {
31
+ this.onDidConnectEmitter = new vscode_languageserver_protocol_1.Emitter();
32
+ this.onDidConnect = this.onDidConnectEmitter.event;
33
+ socket.on('connect', () => {
34
+ this.onDidConnectEmitter.fire();
35
+ });
36
+ socket.on('disconnect', reason => {
37
+ this.onCloseEmitter.fire({
38
+ reason: reason
39
+ });
40
+ });
41
+ socket.on('error', reason => this.onErrorEmitter.fire(reason));
42
+ socket.on('message', data => {
36
43
  // In the browser context socketIO receives binary messages as ArrayBuffers.
37
44
  // So we have to convert them to a Uint8Array before delegating the message to the read buffer.
38
45
  const buffer = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
39
- return new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(buffer);
40
- }));
46
+ this.onMessageEmitter.fire(() => new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(buffer));
47
+ });
41
48
  }
42
49
  getWriteBuffer() {
43
50
  const result = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer();
44
51
  result.onCommit(buffer => {
45
- if (this.socket.isConnected()) {
52
+ if (this.socket.connected) {
46
53
  this.socket.send(buffer);
47
54
  }
48
55
  });
49
56
  return result;
50
57
  }
58
+ close() {
59
+ this.socket.disconnect();
60
+ super.close();
61
+ }
51
62
  }
52
63
  exports.WebSocketChannel = WebSocketChannel;
53
64
  WebSocketChannel.wsPath = '/services';
@@ -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,gFAAgF;AAChF,gFAAgF;;;AAKhF,0FAAwG;AACxG,oDAAyD;AACzD,8CAA2C;AAE3C;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,yBAAe;IAGjD,YAA+B,MAAkB;QAC7C,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAY;QAE7C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,uBAAU,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7E,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE;YACrD,4EAA4E;YAC5E,+FAA+F;YAC/F,MAAM,MAAM,GAAG,IAAI,YAAY,WAAW,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACzE,OAAO,IAAI,iDAAoB,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IAED,cAAc;QACV,MAAM,MAAM,GAAG,IAAI,kDAAqB,EAAE,CAAC;QAE3C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YACrB,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE;gBAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC5B;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAClB,CAAC;;AA3BL,4CA4BC;AA3BU,uBAAM,GAAG,WAAW,CAAC"}
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,gFAAgF;AAChF,gFAAgF;;;AAKhF,0FAAwG;AACxG,oDAAyD;AAGzD,mFAAyD;AAIzD;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,yBAAe;IAMjD,YAA+B,MAAiB;QAC5C,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAW;QAHxC,wBAAmB,GAAG,IAAI,wCAAO,EAAQ,CAAC;QAClD,iBAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC;QAI1C,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;YACtB,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE;YAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;gBACrB,MAAM,EAAE,MAAM;aACjB,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;YACxB,4EAA4E;YAC5E,+FAA+F;YAC/F,MAAM,MAAM,GAAG,IAAI,YAAY,WAAW,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACzE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,iDAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACP,CAAC;IAED,cAAc;QACV,MAAM,MAAM,GAAG,IAAI,kDAAqB,EAAE,CAAC;QAE3C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YACrB,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC5B;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAClB,CAAC;IAEQ,KAAK;QACV,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACzB,KAAK,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;;AA1CL,4CA2CC;AA1CU,uBAAM,GAAG,WAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { FrontendIdProvider } from '../../browser/messaging/frontend-id-provider';
2
+ export declare class ElectronFrontendIdProvider implements FrontendIdProvider {
3
+ getId(): string;
4
+ }
5
+ //# sourceMappingURL=electron-frontend-id-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electron-frontend-id-provider.d.ts","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-frontend-id-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,qBACa,0BAA2B,YAAW,kBAAkB;IACjE,KAAK,IAAI,MAAM;CAGlB"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  // *****************************************************************************
3
- // Copyright (C) 2020 Ericsson and others.
3
+ // Copyright (C) 2023 STMicroelectronics and others.
4
4
  //
5
5
  // This program and the accompanying materials are made available under the
6
6
  // terms of the Eclipse Public License v. 2.0 which is available at
@@ -20,35 +20,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
20
20
  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;
21
21
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22
22
  };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
23
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.ElectronMessagingContribution = void 0;
24
+ exports.ElectronFrontendIdProvider = void 0;
28
25
  const inversify_1 = require("inversify");
29
- const messaging_contribution_1 = require("../../node/messaging/messaging-contribution");
30
- const electron_token_validator_1 = require("./electron-token-validator");
31
- /**
32
- * Override the browser MessagingContribution class to refuse connections that do not include a specific token.
33
- * @deprecated since 1.8.0
34
- */
35
- let ElectronMessagingContribution = class ElectronMessagingContribution extends messaging_contribution_1.MessagingContribution {
36
- /**
37
- * Only allow token-bearers.
38
- */
39
- async allowConnect(request) {
40
- if (this.tokenValidator.allowRequest(request)) {
41
- return super.allowConnect(request);
42
- }
43
- return false;
26
+ let ElectronFrontendIdProvider = class ElectronFrontendIdProvider {
27
+ getId() {
28
+ return window.electronTheiaCore.WindowMetadata.webcontentId;
44
29
  }
45
30
  };
46
- __decorate([
47
- (0, inversify_1.inject)(electron_token_validator_1.ElectronTokenValidator),
48
- __metadata("design:type", electron_token_validator_1.ElectronTokenValidator)
49
- ], ElectronMessagingContribution.prototype, "tokenValidator", void 0);
50
- ElectronMessagingContribution = __decorate([
31
+ ElectronFrontendIdProvider = __decorate([
51
32
  (0, inversify_1.injectable)()
52
- ], ElectronMessagingContribution);
53
- exports.ElectronMessagingContribution = ElectronMessagingContribution;
54
- //# sourceMappingURL=electron-token-messaging-contribution.js.map
33
+ ], ElectronFrontendIdProvider);
34
+ exports.ElectronFrontendIdProvider = ElectronFrontendIdProvider;
35
+ //# sourceMappingURL=electron-frontend-id-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electron-frontend-id-provider.js","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-frontend-id-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;;;;;AAEhF,yCAAuC;AAIvC,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;IACnC,KAAK;QACD,OAAO,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,YAAY,CAAC;IAChE,CAAC;CACJ,CAAA;AAJY,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CAItC;AAJY,gEAA0B"}
@@ -0,0 +1,24 @@
1
+ import { interfaces } from 'inversify';
2
+ import { RpcProxy } from '../../common/messaging';
3
+ import { AbstractChannel, Channel, Emitter, Event, MaybePromise, WriteBuffer } from '../../common';
4
+ import { ConnectionSource } from '../../browser/messaging/connection-source';
5
+ import { FrontendApplicationContribution } from '../../browser';
6
+ export interface ElectronIpcOptions {
7
+ }
8
+ export declare const ElectronMainConnectionProvider: unique symbol;
9
+ /**
10
+ * Connection provider between the Theia frontend and the electron-main process via IPC.
11
+ */
12
+ export declare namespace ElectronIpcConnectionProvider {
13
+ function createProxy<T extends object>(container: interfaces.Container, path: string, arg?: object): RpcProxy<T>;
14
+ }
15
+ export declare class ElectronIpcConnectionSource implements ConnectionSource, FrontendApplicationContribution {
16
+ protected readonly onConnectionDidOpenEmitter: Emitter<Channel>;
17
+ onConnectionDidOpen: Event<Channel>;
18
+ onStart(): MaybePromise<void>;
19
+ }
20
+ export declare class ElectronIpcRendererChannel extends AbstractChannel {
21
+ constructor();
22
+ getWriteBuffer(): WriteBuffer;
23
+ }
24
+ //# sourceMappingURL=electron-ipc-connection-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electron-ipc-connection-source.d.ts","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-ipc-connection-source.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAc,UAAU,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAEhE,MAAM,WAAW,kBAAkB;CAClC;AAED,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AAEvF;;GAEG;AACH,yBAAiB,6BAA6B,CAAC;IAE3C,SAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAEtH;CACJ;AAED,qBACa,2BAA4B,YAAW,gBAAgB,EAAE,+BAA+B;IACjG,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAiB;IAChF,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAyC;IAE5E,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC;CAIhC;AAED,qBAAa,0BAA2B,SAAQ,eAAe;;IAQ3D,cAAc,IAAI,WAAW;CAMhC"}
@@ -20,36 +20,36 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
20
20
  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;
21
21
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22
22
  };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- var ElectronIpcConnectionProvider_1;
27
23
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.ElectronIpcRendererChannel = exports.ElectronIpcConnectionProvider = void 0;
24
+ exports.ElectronIpcRendererChannel = exports.ElectronIpcConnectionSource = exports.ElectronIpcConnectionProvider = exports.ElectronMainConnectionProvider = void 0;
29
25
  const inversify_1 = require("inversify");
30
- const abstract_connection_provider_1 = require("../../common/messaging/abstract-connection-provider");
31
26
  const common_1 = require("../../common");
32
27
  const uint8_array_message_buffer_1 = require("../../common/message-rpc/uint8-array-message-buffer");
28
+ exports.ElectronMainConnectionProvider = Symbol('ElectronMainConnectionProvider');
33
29
  /**
34
30
  * Connection provider between the Theia frontend and the electron-main process via IPC.
35
31
  */
36
- let ElectronIpcConnectionProvider = ElectronIpcConnectionProvider_1 = class ElectronIpcConnectionProvider extends abstract_connection_provider_1.AbstractConnectionProvider {
37
- static createProxy(container, path, arg) {
38
- return container.get(ElectronIpcConnectionProvider_1).createProxy(path, arg);
32
+ var ElectronIpcConnectionProvider;
33
+ (function (ElectronIpcConnectionProvider) {
34
+ function createProxy(container, path, arg) {
35
+ return container.get(exports.ElectronMainConnectionProvider).createProxy(path, arg);
39
36
  }
37
+ ElectronIpcConnectionProvider.createProxy = createProxy;
38
+ })(ElectronIpcConnectionProvider = exports.ElectronIpcConnectionProvider || (exports.ElectronIpcConnectionProvider = {}));
39
+ let ElectronIpcConnectionSource = class ElectronIpcConnectionSource {
40
40
  constructor() {
41
- super();
42
- this.initializeMultiplexer();
41
+ this.onConnectionDidOpenEmitter = new common_1.Emitter();
42
+ this.onConnectionDidOpen = this.onConnectionDidOpenEmitter.event;
43
43
  }
44
- createMainChannel() {
45
- return new ElectronIpcRendererChannel();
44
+ onStart() {
45
+ const channel = new ElectronIpcRendererChannel();
46
+ this.onConnectionDidOpenEmitter.fire(channel);
46
47
  }
47
48
  };
48
- ElectronIpcConnectionProvider = ElectronIpcConnectionProvider_1 = __decorate([
49
- (0, inversify_1.injectable)(),
50
- __metadata("design:paramtypes", [])
51
- ], ElectronIpcConnectionProvider);
52
- exports.ElectronIpcConnectionProvider = ElectronIpcConnectionProvider;
49
+ ElectronIpcConnectionSource = __decorate([
50
+ (0, inversify_1.injectable)()
51
+ ], ElectronIpcConnectionSource);
52
+ exports.ElectronIpcConnectionSource = ElectronIpcConnectionSource;
53
53
  class ElectronIpcRendererChannel extends common_1.AbstractChannel {
54
54
  constructor() {
55
55
  super();
@@ -62,4 +62,4 @@ class ElectronIpcRendererChannel extends common_1.AbstractChannel {
62
62
  }
63
63
  }
64
64
  exports.ElectronIpcRendererChannel = ElectronIpcRendererChannel;
65
- //# sourceMappingURL=electron-ipc-connection-provider.js.map
65
+ //# sourceMappingURL=electron-ipc-connection-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electron-ipc-connection-source.js","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-ipc-connection-source.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,gFAAgF;AAChF,gFAAgF;;;;;;;;;AAEhF,yCAAmD;AAEnD,yCAAmG;AACnG,oGAAkH;AAQrG,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAEvF;;GAEG;AACH,IAAiB,6BAA6B,CAK7C;AALD,WAAiB,6BAA6B;IAE1C,SAAgB,WAAW,CAAmB,SAA+B,EAAE,IAAY,EAAE,GAAY;QACrG,OAAO,SAAS,CAAC,GAAG,CAA4B,sCAA8B,CAAC,CAAC,WAAW,CAAI,IAAI,EAAE,GAAG,CAAC,CAAC;IAC9G,CAAC;IAFe,yCAAW,cAE1B,CAAA;AACL,CAAC,EALgB,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAK7C;AAGD,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IAAxC;QACuB,+BAA0B,GAAqB,IAAI,gBAAO,EAAE,CAAC;QAChF,wBAAmB,GAAmB,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC;IAMhF,CAAC;IAJG,OAAO;QACH,MAAM,OAAO,GAAG,IAAI,0BAA0B,EAAE,CAAC;QACjD,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;CACJ,CAAA;AARY,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAQvC;AARY,kEAA2B;AAUxC,MAAa,0BAA2B,SAAQ,wBAAe;IAE3D;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,iDAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnI,CAAC;IAED,cAAc;QACV,MAAM,MAAM,GAAG,IAAI,kDAAqB,EAAE,CAAC;QAC3C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ;AAdD,gEAcC"}
@@ -0,0 +1,7 @@
1
+ import { Endpoint } from '../../browser/endpoint';
2
+ import { WebSocketConnectionSource } from '../../browser/messaging/ws-connection-source';
3
+ export declare function getLocalPort(): string | undefined;
4
+ export declare class ElectronLocalWebSocketConnectionSource extends WebSocketConnectionSource {
5
+ protected createEndpoint(path: string): Endpoint;
6
+ }
7
+ //# sourceMappingURL=electron-local-ws-connection-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electron-local-ws-connection-source.d.ts","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-local-ws-connection-source.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAEzF,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAGjD;AAED,qBACa,sCAAuC,SAAQ,yBAAyB;cAE9D,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;CAgB5D"}
@@ -21,17 +21,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
21
21
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.ElectronLocalWebSocketConnectionProvider = exports.getLocalPort = void 0;
24
+ exports.ElectronLocalWebSocketConnectionSource = exports.getLocalPort = void 0;
25
25
  const inversify_1 = require("inversify");
26
- const ws_connection_provider_1 = require("../../browser/messaging/ws-connection-provider");
27
26
  const endpoint_1 = require("../../browser/endpoint");
27
+ const ws_connection_source_1 = require("../../browser/messaging/ws-connection-source");
28
28
  function getLocalPort() {
29
29
  var _a;
30
30
  const params = new URLSearchParams(location.search);
31
31
  return (_a = params.get('localPort')) !== null && _a !== void 0 ? _a : undefined;
32
32
  }
33
33
  exports.getLocalPort = getLocalPort;
34
- let ElectronLocalWebSocketConnectionProvider = class ElectronLocalWebSocketConnectionProvider extends ws_connection_provider_1.WebSocketConnectionProvider {
34
+ let ElectronLocalWebSocketConnectionSource = class ElectronLocalWebSocketConnectionSource extends ws_connection_source_1.WebSocketConnectionSource {
35
35
  createEndpoint(path) {
36
36
  const localPort = getLocalPort();
37
37
  if (!localPort) {
@@ -48,8 +48,8 @@ let ElectronLocalWebSocketConnectionProvider = class ElectronLocalWebSocketConne
48
48
  return endpoint;
49
49
  }
50
50
  };
51
- ElectronLocalWebSocketConnectionProvider = __decorate([
51
+ ElectronLocalWebSocketConnectionSource = __decorate([
52
52
  (0, inversify_1.injectable)()
53
- ], ElectronLocalWebSocketConnectionProvider);
54
- exports.ElectronLocalWebSocketConnectionProvider = ElectronLocalWebSocketConnectionProvider;
55
- //# sourceMappingURL=electron-local-ws-connection-provider.js.map
53
+ ], ElectronLocalWebSocketConnectionSource);
54
+ exports.ElectronLocalWebSocketConnectionSource = ElectronLocalWebSocketConnectionSource;
55
+ //# sourceMappingURL=electron-local-ws-connection-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electron-local-ws-connection-source.js","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-local-ws-connection-source.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,gFAAgF;AAChF,gFAAgF;;;;;;;;;AAEhF,yCAAuC;AACvC,qDAAkD;AAClD,uFAAyF;AAEzF,SAAgB,YAAY;;IACxB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpD,OAAO,MAAA,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,mCAAI,SAAS,CAAC;AAChD,CAAC;AAHD,oCAGC;AAGD,IAAa,sCAAsC,GAAnD,MAAa,sCAAuC,SAAQ,gDAAyB;IAE9D,cAAc,CAAC,IAAY;QAC1C,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;SAC1F;QACD,MAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAC;YAC1B,IAAI;SACP,EAAE;YACC,IAAI,EAAE,aAAa,SAAS,EAAE;YAC9B,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,EAAE;SACb,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACpB,CAAC;CAEJ,CAAA;AAlBY,sCAAsC;IADlD,IAAA,sBAAU,GAAE;GACA,sCAAsC,CAkBlD;AAlBY,wFAAsC"}
@@ -1 +1 @@
1
- {"version":3,"file":"electron-messaging-frontend-module.d.ts","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-messaging-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAO5C,eAAO,MAAM,uBAAuB,iBAiBlC,CAAC"}
1
+ {"version":3,"file":"electron-messaging-frontend-module.d.ts","sourceRoot":"","sources":["../../../src/electron-browser/messaging/electron-messaging-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAgB5C,eAAO,MAAM,uBAAuB,iBA6ClC,CAAC"}
@@ -18,27 +18,59 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.messagingFrontendModule = void 0;
19
19
  const inversify_1 = require("inversify");
20
20
  const frontend_application_contribution_1 = require("../../browser/frontend-application-contribution");
21
- const ws_connection_provider_1 = require("../../browser/messaging/ws-connection-provider");
22
- const electron_ws_connection_provider_1 = require("./electron-ws-connection-provider");
23
- const electron_ipc_connection_provider_1 = require("./electron-ipc-connection-provider");
24
- const electron_local_ws_connection_provider_1 = require("./electron-local-ws-connection-provider");
21
+ const electron_ws_connection_source_1 = require("./electron-ws-connection-source");
22
+ const electron_ipc_connection_source_1 = require("./electron-ipc-connection-source");
23
+ const electron_local_ws_connection_source_1 = require("./electron-local-ws-connection-source");
24
+ const electron_frontend_id_provider_1 = require("./electron-frontend-id-provider");
25
+ const frontend_id_provider_1 = require("../../browser/messaging/frontend-id-provider");
26
+ const connection_source_1 = require("../../browser/messaging/connection-source");
27
+ const service_connection_provider_1 = require("../../browser/messaging/service-connection-provider");
28
+ const browser_1 = require("../../browser");
29
+ const connection_management_1 = require("../../common/messaging/connection-management");
30
+ const ws_connection_source_1 = require("../../browser/messaging/ws-connection-source");
31
+ const backendServiceProvider = Symbol('backendServiceProvider2');
32
+ const localServiceProvider = Symbol('localServiceProvider');
25
33
  exports.messagingFrontendModule = new inversify_1.ContainerModule(bind => {
26
- bind(electron_ws_connection_provider_1.ElectronWebSocketConnectionProvider).toSelf().inSingletonScope();
27
- bind(frontend_application_contribution_1.FrontendApplicationContribution).toService(electron_ws_connection_provider_1.ElectronWebSocketConnectionProvider);
28
- bind(ws_connection_provider_1.WebSocketConnectionProvider).toService(electron_ws_connection_provider_1.ElectronWebSocketConnectionProvider);
29
- bind(electron_local_ws_connection_provider_1.ElectronLocalWebSocketConnectionProvider).toSelf().inSingletonScope();
30
- bind(ws_connection_provider_1.LocalWebSocketConnectionProvider).toDynamicValue(ctx => {
31
- const localPort = (0, electron_local_ws_connection_provider_1.getLocalPort)();
34
+ bind(connection_management_1.ConnectionCloseService).toDynamicValue(ctx => browser_1.WebSocketConnectionProvider.createProxy(ctx.container, connection_management_1.connectionCloseServicePath)).inSingletonScope();
35
+ bind(electron_ws_connection_source_1.ElectronWebSocketConnectionSource).toSelf().inSingletonScope();
36
+ bind(ws_connection_source_1.WebSocketConnectionSource).toService(electron_ws_connection_source_1.ElectronWebSocketConnectionSource);
37
+ bind(electron_ipc_connection_source_1.ElectronIpcConnectionSource).toSelf().inSingletonScope();
38
+ bind(frontend_application_contribution_1.FrontendApplicationContribution).toService(electron_ipc_connection_source_1.ElectronIpcConnectionSource);
39
+ bind(electron_local_ws_connection_source_1.ElectronLocalWebSocketConnectionSource).toSelf().inSingletonScope();
40
+ bind(backendServiceProvider).toDynamicValue(ctx => {
41
+ const container = ctx.container.createChild();
42
+ container.bind(service_connection_provider_1.ServiceConnectionProvider).toSelf().inSingletonScope();
43
+ container.bind(connection_source_1.ConnectionSource).toService(electron_ws_connection_source_1.ElectronWebSocketConnectionSource);
44
+ return container.get(service_connection_provider_1.ServiceConnectionProvider);
45
+ }).inSingletonScope();
46
+ bind(localServiceProvider).toDynamicValue(ctx => {
47
+ const container = ctx.container.createChild();
48
+ container.bind(service_connection_provider_1.ServiceConnectionProvider).toSelf().inSingletonScope();
49
+ container.bind(connection_source_1.ConnectionSource).toService(electron_local_ws_connection_source_1.ElectronLocalWebSocketConnectionSource);
50
+ return container.get(service_connection_provider_1.ServiceConnectionProvider);
51
+ }).inSingletonScope();
52
+ bind(electron_ipc_connection_source_1.ElectronMainConnectionProvider).toDynamicValue(ctx => {
53
+ const container = ctx.container.createChild();
54
+ container.bind(service_connection_provider_1.ServiceConnectionProvider).toSelf().inSingletonScope();
55
+ container.bind(connection_source_1.ConnectionSource).toService(electron_ipc_connection_source_1.ElectronIpcConnectionSource);
56
+ return container.get(service_connection_provider_1.ServiceConnectionProvider);
57
+ }).inSingletonScope();
58
+ bind(service_connection_provider_1.LocalConnectionProvider).toDynamicValue(ctx => {
59
+ const localPort = (0, electron_local_ws_connection_source_1.getLocalPort)();
32
60
  if (localPort) {
33
61
  // Return new web socket provider that connects to local app
34
- return ctx.container.get(electron_local_ws_connection_provider_1.ElectronLocalWebSocketConnectionProvider);
62
+ return ctx.container.get(localServiceProvider);
35
63
  }
36
64
  else {
37
65
  // Return the usual web socket provider that already established its connection
38
66
  // That way we don't create a second socket connection
39
- return ctx.container.get(ws_connection_provider_1.WebSocketConnectionProvider);
67
+ return ctx.container.get(backendServiceProvider);
40
68
  }
41
69
  }).inSingletonScope();
42
- bind(electron_ipc_connection_provider_1.ElectronIpcConnectionProvider).toSelf().inSingletonScope();
70
+ bind(service_connection_provider_1.RemoteConnectionProvider).toService(backendServiceProvider);
71
+ bind(frontend_application_contribution_1.FrontendApplicationContribution).toService(electron_ws_connection_source_1.ElectronWebSocketConnectionSource);
72
+ bind(electron_frontend_id_provider_1.ElectronFrontendIdProvider).toSelf().inSingletonScope();
73
+ bind(frontend_id_provider_1.FrontendIdProvider).toService(electron_frontend_id_provider_1.ElectronFrontendIdProvider);
74
+ bind(browser_1.WebSocketConnectionProvider).toSelf().inSingletonScope();
43
75
  });
44
76
  //# sourceMappingURL=electron-messaging-frontend-module.js.map