@gitpod/gitpod-protocol 0.1.5-test.9 → 0.1.5-tweak-workspaceconfig-origin-docs-fork.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/data/builtin-theia-plugins.json +28 -18
  2. package/data/gitpod-schema.json +17 -17
  3. package/lib/accounting-protocol.d.ts +155 -0
  4. package/lib/accounting-protocol.d.ts.map +1 -0
  5. package/lib/accounting-protocol.js +109 -0
  6. package/lib/accounting-protocol.js.map +1 -0
  7. package/lib/admin-protocol.d.ts +22 -5
  8. package/lib/admin-protocol.d.ts.map +1 -1
  9. package/lib/admin-protocol.js +16 -1
  10. package/lib/admin-protocol.js.map +1 -1
  11. package/lib/analytics.d.ts +45 -0
  12. package/lib/analytics.d.ts.map +1 -0
  13. package/lib/analytics.js +10 -0
  14. package/lib/analytics.js.map +1 -0
  15. package/lib/auth.d.ts +25 -0
  16. package/lib/auth.d.ts.map +1 -0
  17. package/lib/auth.js +16 -0
  18. package/lib/auth.js.map +1 -0
  19. package/lib/context-url.d.ts +18 -0
  20. package/lib/context-url.d.ts.map +1 -0
  21. package/lib/context-url.js +49 -0
  22. package/lib/context-url.js.map +1 -0
  23. package/lib/context-url.spec.d.ts +12 -0
  24. package/lib/context-url.spec.d.ts.map +1 -0
  25. package/lib/context-url.spec.js +73 -0
  26. package/lib/context-url.spec.js.map +1 -0
  27. package/lib/email-protocol.d.ts +2 -2
  28. package/lib/email-protocol.d.ts.map +1 -1
  29. package/lib/email-protocol.js +6 -5
  30. package/lib/email-protocol.js.map +1 -1
  31. package/lib/encryption/container-module.d.ts +1 -1
  32. package/lib/encryption/container-module.js +7 -5
  33. package/lib/encryption/container-module.js.map +1 -1
  34. package/lib/encryption/encryption-engine.d.ts +1 -1
  35. package/lib/encryption/encryption-engine.js +21 -21
  36. package/lib/encryption/encryption-engine.js.map +1 -1
  37. package/lib/encryption/encryption-engine.spec.d.ts +2 -2
  38. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  39. package/lib/encryption/encryption-engine.spec.js +31 -37
  40. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  41. package/lib/encryption/encryption-service.d.ts +1 -1
  42. package/lib/encryption/encryption-service.js +31 -44
  43. package/lib/encryption/encryption-service.js.map +1 -1
  44. package/lib/encryption/key-provider.d.ts +2 -2
  45. package/lib/encryption/key-provider.d.ts.map +1 -1
  46. package/lib/encryption/key-provider.js +27 -31
  47. package/lib/encryption/key-provider.js.map +1 -1
  48. package/lib/env.d.ts +2 -3
  49. package/lib/env.d.ts.map +1 -1
  50. package/lib/env.js +21 -21
  51. package/lib/env.js.map +1 -1
  52. package/lib/gitpod-file-parser.d.ts +1 -1
  53. package/lib/gitpod-file-parser.js +27 -42
  54. package/lib/gitpod-file-parser.js.map +1 -1
  55. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  56. package/lib/gitpod-file-parser.spec.js +117 -117
  57. package/lib/gitpod-file-parser.spec.js.map +1 -1
  58. package/lib/gitpod-service.d.ts +186 -34
  59. package/lib/gitpod-service.d.ts.map +1 -1
  60. package/lib/gitpod-service.js +239 -116
  61. package/lib/gitpod-service.js.map +1 -1
  62. package/lib/headless-workspace-log.d.ts +9 -12
  63. package/lib/headless-workspace-log.d.ts.map +1 -1
  64. package/lib/headless-workspace-log.js +5 -7
  65. package/lib/headless-workspace-log.js.map +1 -1
  66. package/lib/ide-frontend-service.d.ts +26 -0
  67. package/lib/ide-frontend-service.d.ts.map +1 -0
  68. package/lib/ide-frontend-service.js +8 -0
  69. package/lib/ide-frontend-service.js.map +1 -0
  70. package/lib/ide-protocol.d.ts +81 -0
  71. package/lib/ide-protocol.d.ts.map +1 -0
  72. package/lib/{util/without.js → ide-protocol.js} +2 -2
  73. package/lib/ide-protocol.js.map +1 -0
  74. package/lib/index.d.ts +5 -1
  75. package/lib/index.d.ts.map +1 -1
  76. package/lib/index.js +25 -12
  77. package/lib/index.js.map +1 -1
  78. package/lib/license-protocol.d.ts +1 -1
  79. package/lib/license-protocol.js +2 -1
  80. package/lib/license-protocol.js.map +1 -1
  81. package/lib/messaging/browser/connection.d.ts +6 -4
  82. package/lib/messaging/browser/connection.d.ts.map +1 -1
  83. package/lib/messaging/browser/connection.js +188 -48
  84. package/lib/messaging/browser/connection.js.map +1 -1
  85. package/lib/messaging/browser/window-connection.d.ts +26 -0
  86. package/lib/messaging/browser/window-connection.d.ts.map +1 -0
  87. package/lib/messaging/browser/window-connection.js +68 -0
  88. package/lib/messaging/browser/window-connection.js.map +1 -0
  89. package/lib/messaging/client-call-metrics.d.ts +35 -0
  90. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  91. package/lib/messaging/client-call-metrics.js +83 -0
  92. package/lib/messaging/client-call-metrics.js.map +1 -0
  93. package/lib/messaging/connection-error-handler.js +12 -23
  94. package/lib/messaging/connection-error-handler.js.map +1 -1
  95. package/lib/messaging/error.d.ts +6 -2
  96. package/lib/messaging/error.d.ts.map +1 -1
  97. package/lib/messaging/error.js +13 -4
  98. package/lib/messaging/error.js.map +1 -1
  99. package/lib/messaging/handler.d.ts +10 -0
  100. package/lib/messaging/handler.d.ts.map +1 -1
  101. package/lib/messaging/handler.js +1 -0
  102. package/lib/messaging/handler.js.map +1 -1
  103. package/lib/messaging/node/connection.js +23 -22
  104. package/lib/messaging/node/connection.js.map +1 -1
  105. package/lib/messaging/proxy-factory.d.ts +2 -0
  106. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  107. package/lib/messaging/proxy-factory.js +75 -169
  108. package/lib/messaging/proxy-factory.js.map +1 -1
  109. package/lib/payment-protocol.d.ts +18 -0
  110. package/lib/payment-protocol.d.ts.map +1 -0
  111. package/lib/payment-protocol.js +13 -0
  112. package/lib/payment-protocol.js.map +1 -0
  113. package/lib/permission.d.ts +14 -12
  114. package/lib/permission.d.ts.map +1 -1
  115. package/lib/permission.js +21 -19
  116. package/lib/permission.js.map +1 -1
  117. package/lib/plans.d.ts +210 -0
  118. package/lib/plans.d.ts.map +1 -0
  119. package/lib/plans.js +570 -0
  120. package/lib/plans.js.map +1 -0
  121. package/lib/protocol.d.ts +123 -30
  122. package/lib/protocol.d.ts.map +1 -1
  123. package/lib/protocol.js +121 -117
  124. package/lib/protocol.js.map +1 -1
  125. package/lib/snapshot-url.d.ts +14 -0
  126. package/lib/snapshot-url.d.ts.map +1 -0
  127. package/lib/snapshot-url.js +26 -0
  128. package/lib/snapshot-url.js.map +1 -0
  129. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +3 -4
  130. package/lib/snapshot-url.spec.d.ts.map +1 -0
  131. package/lib/snapshot-url.spec.js +41 -0
  132. package/lib/snapshot-url.spec.js.map +1 -0
  133. package/lib/team-subscription-protocol.d.ts +73 -0
  134. package/lib/team-subscription-protocol.d.ts.map +1 -0
  135. package/lib/team-subscription-protocol.js +63 -0
  136. package/lib/team-subscription-protocol.js.map +1 -0
  137. package/lib/teams-projects-protocol.d.ts +103 -0
  138. package/lib/teams-projects-protocol.d.ts.map +1 -0
  139. package/lib/teams-projects-protocol.js +23 -0
  140. package/lib/teams-projects-protocol.js.map +1 -0
  141. package/lib/theia-plugins.d.ts +1 -1
  142. package/lib/theia-plugins.js +1 -1
  143. package/lib/typings/globals.d.ts +12 -0
  144. package/lib/typings/globals.d.ts.map +1 -0
  145. package/lib/typings/globals.js +7 -0
  146. package/lib/typings/globals.js.map +1 -0
  147. package/lib/util/analytics.d.ts +8 -0
  148. package/lib/util/analytics.d.ts.map +1 -0
  149. package/lib/util/analytics.js +79 -0
  150. package/lib/util/analytics.js.map +1 -0
  151. package/lib/util/async-iterator.d.ts +1 -1
  152. package/lib/util/async-iterator.js +57 -134
  153. package/lib/util/async-iterator.js.map +1 -1
  154. package/lib/util/cancelable.d.ts +1 -1
  155. package/lib/util/cancelable.js +19 -60
  156. package/lib/util/cancelable.js.map +1 -1
  157. package/lib/util/date-time.d.ts +1 -1
  158. package/lib/util/date-time.js +10 -9
  159. package/lib/util/date-time.js.map +1 -1
  160. package/lib/util/deep-partial.d.ts +1 -1
  161. package/lib/util/deep-partial.js +1 -1
  162. package/lib/util/deferred.d.ts +1 -1
  163. package/lib/util/deferred.js +12 -13
  164. package/lib/util/deferred.js.map +1 -1
  165. package/lib/util/disposable.d.ts +2 -2
  166. package/lib/util/disposable.d.ts.map +1 -1
  167. package/lib/util/disposable.js +27 -39
  168. package/lib/util/disposable.js.map +1 -1
  169. package/lib/util/event.d.ts +1 -1
  170. package/lib/util/event.d.ts.map +1 -1
  171. package/lib/util/event.js +59 -74
  172. package/lib/util/event.js.map +1 -1
  173. package/lib/util/garbage-collected-cache.d.ts +1 -1
  174. package/lib/util/garbage-collected-cache.js +24 -47
  175. package/lib/util/garbage-collected-cache.js.map +1 -1
  176. package/lib/util/generate-workspace-id.d.ts +4 -0
  177. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  178. package/lib/util/generate-workspace-id.js +470 -0
  179. package/lib/util/generate-workspace-id.js.map +1 -0
  180. package/lib/util/generate-workspace-id.spec.d.ts +7 -0
  181. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  182. package/lib/util/generate-workspace-id.spec.js +63 -0
  183. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  184. package/lib/util/gitpod-cookie.d.ts +20 -0
  185. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  186. package/lib/util/gitpod-cookie.js +44 -0
  187. package/lib/util/gitpod-cookie.js.map +1 -0
  188. package/lib/util/gitpod-host-url.d.ts +8 -3
  189. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  190. package/lib/util/gitpod-host-url.js +106 -76
  191. package/lib/util/gitpod-host-url.js.map +1 -1
  192. package/lib/util/gitpod-host-url.spec.d.ts +16 -0
  193. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
  194. package/lib/util/gitpod-host-url.spec.js +124 -0
  195. package/lib/util/gitpod-host-url.spec.js.map +1 -0
  196. package/lib/util/grpc.d.ts +15 -0
  197. package/lib/util/grpc.d.ts.map +1 -0
  198. package/lib/util/grpc.js +18 -0
  199. package/lib/util/grpc.js.map +1 -0
  200. package/lib/util/logging.d.ts +57 -34
  201. package/lib/util/logging.d.ts.map +1 -1
  202. package/lib/util/logging.js +119 -110
  203. package/lib/util/logging.js.map +1 -1
  204. package/lib/util/make-link.d.ts +1 -1
  205. package/lib/util/make-link.js +4 -3
  206. package/lib/util/make-link.js.map +1 -1
  207. package/lib/util/parse-workspace-id.d.ts +14 -4
  208. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  209. package/lib/util/parse-workspace-id.js +39 -8
  210. package/lib/util/parse-workspace-id.js.map +1 -1
  211. package/lib/util/parse-workspace-id.spec.d.ts +9 -1
  212. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  213. package/lib/util/parse-workspace-id.spec.js +129 -48
  214. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  215. package/lib/util/queue.d.ts +1 -1
  216. package/lib/util/queue.js +18 -56
  217. package/lib/util/queue.js.map +1 -1
  218. package/lib/util/queue.spec.d.ts +1 -1
  219. package/lib/util/queue.spec.js +145 -287
  220. package/lib/util/queue.spec.js.map +1 -1
  221. package/lib/util/repeater.d.ts +1 -1
  222. package/lib/util/repeater.js +37 -89
  223. package/lib/util/repeater.js.map +1 -1
  224. package/lib/util/safe-promise.d.ts +1 -1
  225. package/lib/util/safe-promise.js +11 -13
  226. package/lib/util/safe-promise.js.map +1 -1
  227. package/lib/util/semaphore.d.ts +1 -1
  228. package/lib/util/semaphore.js +17 -47
  229. package/lib/util/semaphore.js.map +1 -1
  230. package/lib/util/skip-if.d.ts +1 -1
  231. package/lib/util/skip-if.js +8 -7
  232. package/lib/util/skip-if.js.map +1 -1
  233. package/lib/util/timeutil.d.ts +1 -1
  234. package/lib/util/timeutil.d.ts.map +1 -1
  235. package/lib/util/timeutil.js +30 -17
  236. package/lib/util/timeutil.js.map +1 -1
  237. package/lib/util/timeutil.spec.d.ts +1 -1
  238. package/lib/util/timeutil.spec.js +23 -25
  239. package/lib/util/timeutil.spec.js.map +1 -1
  240. package/lib/util/tracing.d.ts +15 -2
  241. package/lib/util/tracing.d.ts.map +1 -1
  242. package/lib/util/tracing.js +86 -51
  243. package/lib/util/tracing.js.map +1 -1
  244. package/lib/util/workspace-port-authentication.d.ts +1 -1
  245. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  246. package/lib/util/workspace-port-authentication.js +5 -3
  247. package/lib/util/workspace-port-authentication.js.map +1 -1
  248. package/lib/workspace-cluster.d.ts +74 -0
  249. package/lib/workspace-cluster.d.ts.map +1 -0
  250. package/lib/workspace-cluster.js +16 -0
  251. package/lib/workspace-cluster.js.map +1 -0
  252. package/lib/workspace-instance.d.ts +10 -4
  253. package/lib/workspace-instance.d.ts.map +1 -1
  254. package/lib/workspace-instance.js +1 -1
  255. package/lib/wsready.d.ts +1 -1
  256. package/lib/wsready.js +3 -2
  257. package/lib/wsready.js.map +1 -1
  258. package/package.json +32 -16
  259. package/pkg-yarn.lock +18 -9
  260. package/src/accounting-protocol.ts +229 -0
  261. package/src/admin-protocol.ts +41 -6
  262. package/src/analytics.ts +54 -0
  263. package/src/auth.ts +27 -0
  264. package/src/context-url.spec.ts +39 -0
  265. package/src/context-url.ts +51 -0
  266. package/src/email-protocol.ts +3 -4
  267. package/src/encryption/container-module.ts +1 -1
  268. package/src/encryption/encryption-engine.spec.ts +1 -1
  269. package/src/encryption/encryption-engine.ts +1 -1
  270. package/src/encryption/encryption-service.ts +1 -1
  271. package/src/encryption/key-provider.ts +1 -1
  272. package/src/env.ts +11 -11
  273. package/src/gitpod-file-parser.spec.ts +1 -1
  274. package/src/gitpod-file-parser.ts +1 -1
  275. package/src/gitpod-service.ts +386 -52
  276. package/src/headless-workspace-log.ts +8 -12
  277. package/src/ide-frontend-service.ts +28 -0
  278. package/src/ide-protocol.ts +92 -0
  279. package/src/index.ts +6 -2
  280. package/src/license-protocol.ts +1 -1
  281. package/src/messaging/browser/connection.ts +201 -23
  282. package/src/messaging/browser/window-connection.ts +72 -0
  283. package/src/messaging/client-call-metrics.ts +97 -0
  284. package/src/messaging/error.ts +16 -4
  285. package/src/messaging/handler.ts +12 -0
  286. package/src/messaging/node/connection.ts +2 -2
  287. package/src/messaging/proxy-factory.ts +16 -14
  288. package/src/payment-protocol.ts +20 -0
  289. package/src/permission.ts +9 -8
  290. package/src/plans.ts +632 -0
  291. package/src/protocol.ts +204 -61
  292. package/src/snapshot-url.spec.ts +25 -0
  293. package/src/snapshot-url.ts +27 -0
  294. package/src/team-subscription-protocol.ts +113 -0
  295. package/src/teams-projects-protocol.ts +132 -0
  296. package/src/theia-plugins.ts +1 -1
  297. package/src/typings/globals.ts +12 -0
  298. package/src/util/analytics.ts +87 -0
  299. package/src/util/async-iterator.ts +1 -1
  300. package/src/util/cancelable.ts +1 -1
  301. package/src/util/date-time.ts +1 -1
  302. package/src/util/deep-partial.ts +1 -1
  303. package/src/util/deferred.ts +2 -2
  304. package/src/util/garbage-collected-cache.ts +3 -3
  305. package/src/util/generate-workspace-id.spec.ts +31 -0
  306. package/src/util/generate-workspace-id.ts +457 -0
  307. package/src/util/gitpod-cookie.ts +39 -0
  308. package/src/util/gitpod-host-url.spec.ts +49 -0
  309. package/src/util/gitpod-host-url.ts +58 -14
  310. package/src/util/grpc.ts +15 -0
  311. package/src/util/jaeger-client.d.ts +1 -1
  312. package/src/util/logging.ts +111 -39
  313. package/src/util/make-link.ts +1 -1
  314. package/src/util/parse-workspace-id.spec.ts +46 -5
  315. package/src/util/parse-workspace-id.ts +39 -8
  316. package/src/util/queue.spec.ts +2 -2
  317. package/src/util/queue.ts +1 -1
  318. package/src/util/repeater.ts +1 -1
  319. package/src/util/safe-promise.ts +1 -1
  320. package/src/util/semaphore.ts +3 -3
  321. package/src/util/skip-if.ts +2 -2
  322. package/src/util/timeutil.spec.ts +1 -1
  323. package/src/util/timeutil.ts +5 -5
  324. package/src/util/tracing.ts +66 -4
  325. package/src/util/workspace-port-authentication.ts +1 -1
  326. package/src/workspace-cluster.ts +96 -0
  327. package/src/workspace-instance.ts +38 -16
  328. package/src/wsready.ts +2 -2
  329. package/lib/util/without.d.ts +0 -7
  330. package/lib/util/without.d.ts.map +0 -1
  331. package/lib/util/without.js.map +0 -1
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ /**
7
+ * `IDEServer` provides a list of available IDEs.
8
+ */
9
+ export interface IDEServer {
10
+ /**
11
+ * Returns the IDE preferences.
12
+ */
13
+ getIDEOptions(): Promise<IDEOptions>;
14
+ }
15
+ export interface IDEOptions {
16
+ /**
17
+ * A list of available IDEs.
18
+ */
19
+ options: {
20
+ [key: string]: IDEOption;
21
+ };
22
+ /**
23
+ * The default (browser) IDE when the user has not specified one.
24
+ */
25
+ defaultIde: string;
26
+ /**
27
+ * The default desktop IDE when the user has not specified one.
28
+ */
29
+ defaultDesktopIde: string;
30
+ }
31
+ export interface IDEOption {
32
+ /**
33
+ * To ensure a stable order one can set an `orderKey`.
34
+ */
35
+ orderKey?: string;
36
+ /**
37
+ * Human readable title text of the IDE (plain text only).
38
+ */
39
+ title: string;
40
+ /**
41
+ * The type of the IDE, currently 'browser' or 'desktop'.
42
+ */
43
+ type: 'browser' | 'desktop';
44
+ /**
45
+ * The logo for the IDE. That could be a key in (see
46
+ * components/dashboard/src/images/ideLogos.ts) or a URL.
47
+ */
48
+ logo: string;
49
+ /**
50
+ * Text of an optional tooltip (plain text only).
51
+ */
52
+ tooltip?: string;
53
+ /**
54
+ * Text of an optional label next to the IDE option like “Insiders” (plain
55
+ * text only).
56
+ */
57
+ label?: string;
58
+ /**
59
+ * Notes to the IDE option that are renderd in the preferences when a user
60
+ * chooses this IDE.
61
+ */
62
+ notes?: string[];
63
+ /**
64
+ * If `true` this IDE option is not visible in the IDE preferences.
65
+ */
66
+ hidden?: boolean;
67
+ /**
68
+ * The image ref to the IDE image.
69
+ */
70
+ image: string;
71
+ /**
72
+ * When this is `true`, the tag of this image is resolved to the latest
73
+ * image digest regularly.
74
+ *
75
+ * This is useful if this image points to a tag like `nightly` that will be
76
+ * updated regularly. When `resolveImageDigest` is `true`, we make sure that
77
+ * we resolve the tag regularly to the most recent image version.
78
+ */
79
+ resolveImageDigest?: boolean;
80
+ }
81
+ //# sourceMappingURL=ide-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ide-protocol.d.ts","sourceRoot":"","sources":["../src/ide-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAEtC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAE5B;;;MAGE;IACF,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;MAEE;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- //# sourceMappingURL=without.js.map
8
+ //# sourceMappingURL=ide-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ide-protocol.js","sourceRoot":"","sources":["../src/ide-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
@@ -13,4 +13,8 @@ export * from './workspace-instance';
13
13
  export * from './permission';
14
14
  export * from './admin-protocol';
15
15
  export * from './email-protocol';
16
+ export * from './headless-workspace-log';
17
+ export * from './context-url';
18
+ export * from './teams-projects-protocol';
19
+ export * from './snapshot-url';
16
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC"}
package/lib/index.js CHANGED
@@ -1,19 +1,32 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
7
- function __export(m) {
8
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
9
- }
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
10
17
  Object.defineProperty(exports, "__esModule", { value: true });
11
- __export(require("./protocol"));
12
- __export(require("./gitpod-service"));
13
- __export(require("./util/disposable"));
14
- __export(require("./util/event"));
15
- __export(require("./util/queue"));
16
- __export(require("./license-protocol"));
17
- __export(require("./permission"));
18
- __export(require("./email-protocol"));
18
+ __exportStar(require("./protocol"), exports);
19
+ __exportStar(require("./gitpod-service"), exports);
20
+ __exportStar(require("./util/disposable"), exports);
21
+ __exportStar(require("./util/event"), exports);
22
+ __exportStar(require("./util/queue"), exports);
23
+ __exportStar(require("./license-protocol"), exports);
24
+ __exportStar(require("./workspace-instance"), exports);
25
+ __exportStar(require("./permission"), exports);
26
+ __exportStar(require("./admin-protocol"), exports);
27
+ __exportStar(require("./email-protocol"), exports);
28
+ __exportStar(require("./headless-workspace-log"), exports);
29
+ __exportStar(require("./context-url"), exports);
30
+ __exportStar(require("./teams-projects-protocol"), exports);
31
+ __exportStar(require("./snapshot-url"), exports);
19
32
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAEH,gCAA2B;AAC3B,sCAAiC;AACjC,uCAAkC;AAClC,kCAA6B;AAC7B,kCAA6B;AAC7B,wCAAmC;AAEnC,kCAA6B;AAE7B,sCAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,qDAAmC;AACnC,uDAAqC;AACrC,+CAA6B;AAC7B,mDAAiC;AACjC,mDAAiC;AACjC,2DAAyC;AACzC,gDAA8B;AAC9B,4DAA0C;AAC1C,iDAA+B"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.LicenseFeature = void 0;
8
9
  var LicenseFeature;
9
10
  (function (LicenseFeature) {
10
11
  LicenseFeature["CreateSnapshot"] = "create-snapshot";
@@ -1 +1 @@
1
- {"version":3,"file":"license-protocol.js","sourceRoot":"","sources":["../src/license-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAwBH,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,oDAAkC,CAAA;IAClC,gBAAgB;AACpB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB"}
1
+ {"version":3,"file":"license-protocol.js","sourceRoot":"","sources":["../src/license-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAwBH,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,oDAAkC,CAAA;IAClC,gBAAgB;AACpB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB"}
@@ -1,8 +1,10 @@
1
1
  import { Logger } from "vscode-ws-jsonrpc";
2
2
  import { JsonRpcProxy } from "../proxy-factory";
3
- import { ConnectionHandler } from "../handler";
3
+ import { ConnectionEventHandler, ConnectionHandler } from "../handler";
4
+ import ReconnectingWebSocket, { Event } from 'reconnecting-websocket';
4
5
  export interface WebSocketOptions {
5
6
  onerror?: (event: Event) => void;
7
+ onListening?: (socket: ReconnectingWebSocket) => void;
6
8
  }
7
9
  export declare class WebSocketConnectionProvider {
8
10
  /**
@@ -12,15 +14,15 @@ export declare class WebSocketConnectionProvider {
12
14
  * An optional target can be provided to handle
13
15
  * notifications and requests from a remote side.
14
16
  */
15
- createProxy<T extends object>(path: string, target?: object, options?: WebSocketOptions): JsonRpcProxy<T>;
17
+ createProxy<T extends object>(path: string | Promise<string>, target?: object, options?: WebSocketOptions): JsonRpcProxy<T>;
16
18
  /**
17
19
  * Install a connection handler for the given path.
18
20
  */
19
- listen(handler: ConnectionHandler, options?: WebSocketOptions): void;
21
+ listen(handler: ConnectionHandler, eventHandler: ConnectionEventHandler, options?: WebSocketOptions): WebSocket;
20
22
  protected createLogger(): Logger;
21
23
  /**
22
24
  * Creates a web socket for the given url
23
25
  */
24
- createWebSocket(url: string, options?: WebSocketOptions): WebSocket;
26
+ createWebSocket(url: string): WebSocket;
25
27
  }
26
28
  //# sourceMappingURL=connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":"AAQA,OAAO,EAAsB,MAAM,EAAiB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAuB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACpC;AAED,qBACa,2BAA2B;IAEpC;;;;;;OAMG;IACH,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC;IASzG;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI;IAsBpE,SAAS,CAAC,YAAY,IAAI,MAAM;IAIhC;;OAEG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS;CAYtE"}
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAuC,MAAM,mBAAmB,CAAC;AAIhF,OAAO,EAAuB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,qBAAqB,EAAE,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACzD;AAED,qBAAa,2BAA2B;IAEpC;;;;;;OAMG;IACH,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC;IAyB3H;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS;IAwB/G,SAAS,CAAC,YAAY,IAAI,MAAM;IAIhC;;OAEG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;CAW1C"}
@@ -5,20 +5,15 @@
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
6
6
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7
7
  */
8
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
9
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11
- 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;
12
- return c > 3 && r && Object.defineProperty(target, key, r), r;
13
- };
14
8
  Object.defineProperty(exports, "__esModule", { value: true });
15
- var inversify_1 = require("inversify");
16
- var vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
17
- var proxy_factory_1 = require("../proxy-factory");
18
- var reconnecting_websocket_1 = require("reconnecting-websocket");
19
- var WebSocketConnectionProvider = /** @class */ (function () {
20
- function WebSocketConnectionProvider() {
21
- }
9
+ exports.WebSocketConnectionProvider = void 0;
10
+ const vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
11
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
12
+ const messageWriter_1 = require("vscode-jsonrpc/lib/messageWriter");
13
+ const messageReader_1 = require("vscode-jsonrpc/lib/messageReader");
14
+ const proxy_factory_1 = require("../proxy-factory");
15
+ const reconnecting_websocket_1 = require("reconnecting-websocket");
16
+ class WebSocketConnectionProvider {
22
17
  /**
23
18
  * Create a proxy object to remote interface of T type
24
19
  * over a web socket connection for the given path.
@@ -26,59 +21,204 @@ var WebSocketConnectionProvider = /** @class */ (function () {
26
21
  * An optional target can be provided to handle
27
22
  * notifications and requests from a remote side.
28
23
  */
29
- WebSocketConnectionProvider.prototype.createProxy = function (path, target, options) {
30
- var factory = new proxy_factory_1.JsonRpcProxyFactory(target);
31
- this.listen({
32
- path: path,
33
- onConnection: function (c) { return factory.listen(c); }
34
- }, options);
24
+ createProxy(path, target, options) {
25
+ const factory = new proxy_factory_1.JsonRpcProxyFactory(target);
26
+ const startListening = (path) => {
27
+ const socket = this.listen({
28
+ path,
29
+ onConnection: c => factory.listen(c),
30
+ }, {
31
+ onTransportDidClose: () => factory.fireConnectionClosed(),
32
+ onTransportDidOpen: () => factory.fireConnectionOpened(),
33
+ }, options);
34
+ if (options === null || options === void 0 ? void 0 : options.onListening) {
35
+ options.onListening(socket);
36
+ }
37
+ };
38
+ if (typeof path === "string") {
39
+ startListening(path);
40
+ }
41
+ else {
42
+ path.then(path => startListening(path));
43
+ }
35
44
  return factory.createProxy();
36
- };
45
+ }
37
46
  /**
38
47
  * Install a connection handler for the given path.
39
48
  */
40
- WebSocketConnectionProvider.prototype.listen = function (handler, options) {
41
- var url = handler.path;
42
- var webSocket = this.createWebSocket(url, options);
43
- var logger = this.createLogger();
49
+ listen(handler, eventHandler, options) {
50
+ const url = handler.path;
51
+ const webSocket = this.createWebSocket(url);
52
+ const logger = this.createLogger();
44
53
  if (options && options.onerror) {
45
- var onerror_1 = options.onerror;
46
- webSocket.addEventListener('error', function (event) {
47
- onerror_1(event);
54
+ const onerror = options.onerror;
55
+ webSocket.addEventListener('error', (event) => {
56
+ onerror(event);
48
57
  });
49
58
  }
50
59
  else {
51
- webSocket.addEventListener('error', function (error) {
60
+ webSocket.addEventListener('error', (error) => {
52
61
  logger.error(JSON.stringify(error));
53
62
  });
54
63
  }
55
- vscode_ws_jsonrpc_1.listen({
56
- webSocket: webSocket,
57
- onConnection: function (connection) { return handler.onConnection(connection); },
58
- logger: logger
59
- });
60
- };
61
- WebSocketConnectionProvider.prototype.createLogger = function () {
64
+ doListen(webSocket, handler, eventHandler, logger);
65
+ return webSocket;
66
+ }
67
+ createLogger() {
62
68
  return new vscode_ws_jsonrpc_1.ConsoleLogger();
63
- };
69
+ }
64
70
  /**
65
71
  * Creates a web socket for the given url
66
72
  */
67
- WebSocketConnectionProvider.prototype.createWebSocket = function (url, options) {
68
- var socketOptions = {
73
+ createWebSocket(url) {
74
+ return new reconnecting_websocket_1.default(url, undefined, {
69
75
  maxReconnectionDelay: 10000,
70
76
  minReconnectionDelay: 1000,
71
77
  reconnectionDelayGrowFactor: 1.3,
72
78
  maxRetries: Infinity,
73
- debug: false
74
- };
75
- var result = new reconnecting_websocket_1.default(url, undefined, socketOptions);
76
- return result; //HACK ReconnectingWebScoket does not fully implement the WebScoket type.
77
- };
78
- WebSocketConnectionProvider = __decorate([
79
- inversify_1.injectable()
80
- ], WebSocketConnectionProvider);
81
- return WebSocketConnectionProvider;
82
- }());
79
+ debug: false,
80
+ WebSocket: WebSocket
81
+ });
82
+ }
83
+ }
83
84
  exports.WebSocketConnectionProvider = WebSocketConnectionProvider;
85
+ // The following was extracted from vscode-ws-jsonrpc to make these changes:
86
+ // - switch from WebSocket to ReconnectingWebSocket
87
+ // - webSocket.onopen: making sure it's only ever called once so we're re-using MessageConnection
88
+ // - WebSocketMessageWriter: buffer and re-try messages instead of throwing an error immidiately
89
+ // - WebSocketMessageReader: don't close MessageConnection on 'socket.onclose'
90
+ function doListen(resocket, handler, eventHandler, logger) {
91
+ resocket.addEventListener("close", () => eventHandler.onTransportDidClose());
92
+ let alreadyOpened = false;
93
+ resocket.onopen = () => {
94
+ // trigerr "open" every time we re-open the underlying websocket
95
+ eventHandler.onTransportDidOpen();
96
+ // make sure we're only ever creating one MessageConnection, irregardless of how many times we have to re-open the underlying (reconnecting) websocket
97
+ if (alreadyOpened) {
98
+ return;
99
+ }
100
+ alreadyOpened = true;
101
+ const connection = createWebSocketConnection(resocket, logger);
102
+ handler.onConnection(connection);
103
+ };
104
+ }
105
+ function createWebSocketConnection(resocket, logger) {
106
+ const socket = (0, vscode_ws_jsonrpc_1.toSocket)(resocket);
107
+ const messageReader = new NonClosingWebSocketMessageReader(socket);
108
+ const messageWriter = new BufferingWebSocketMessageWriter(resocket, logger);
109
+ const connection = (0, vscode_jsonrpc_1.createMessageConnection)(messageReader, messageWriter, logger);
110
+ connection.onClose(() => connection.dispose());
111
+ return connection;
112
+ }
113
+ /**
114
+ * This takes vscode-ws-jsonrpc/lib/socket/writer/WebSocketMessageWriter and adds a buffer
115
+ */
116
+ class BufferingWebSocketMessageWriter extends messageWriter_1.AbstractMessageWriter {
117
+ constructor(socket, logger) {
118
+ super();
119
+ this.errorCount = 0;
120
+ this.buffer = [];
121
+ this.socket = socket;
122
+ this.logger = logger;
123
+ socket.addEventListener("open", (event) => this.flushBuffer());
124
+ }
125
+ write(msg) {
126
+ if (this.socket.readyState !== reconnecting_websocket_1.default.OPEN) {
127
+ this.bufferMsg(msg);
128
+ return;
129
+ }
130
+ try {
131
+ const content = JSON.stringify(msg);
132
+ this.socket.send(content);
133
+ }
134
+ catch (e) {
135
+ this.errorCount++;
136
+ this.fireError(e, msg, this.errorCount);
137
+ this.bufferMsg(msg);
138
+ }
139
+ }
140
+ flushBuffer() {
141
+ if (this.buffer.length === 0) {
142
+ return;
143
+ }
144
+ const buffer = [...this.buffer];
145
+ this.buffer = [];
146
+ for (const msg of buffer) {
147
+ this.write(msg);
148
+ }
149
+ //this.logger.info(`flushed buffer (${this.buffer.length})`)
150
+ }
151
+ bufferMsg(msg) {
152
+ this.buffer.push(msg);
153
+ //this.logger.info(`buffered message (${this.buffer.length})`);
154
+ }
155
+ }
156
+ /**
157
+ * This takes vscode-ws-jsonrpc/lib/socket/reader/WebSocketMessageReader and removes the "onClose -> fireClose" connection
158
+ */
159
+ class NonClosingWebSocketMessageReader extends messageReader_1.AbstractMessageReader {
160
+ constructor(socket) {
161
+ super();
162
+ this.events = [];
163
+ this.state = 'initial';
164
+ this.callback = () => { };
165
+ this.socket = socket;
166
+ this.socket.onMessage(message => this.readMessage(message));
167
+ this.socket.onError(error => this.fireError(error));
168
+ this.socket.onClose((code, reason) => {
169
+ if (code !== 1000) {
170
+ const error = {
171
+ name: '' + code,
172
+ message: `Error during socket reconnect: code = ${code}, reason = ${reason}`
173
+ };
174
+ this.fireError(error);
175
+ }
176
+ // this.fireClose(); // <-- reason for this class to be copied over
177
+ });
178
+ }
179
+ listen(callback) {
180
+ if (this.state === 'initial') {
181
+ this.state = 'listening';
182
+ this.callback = callback;
183
+ while (this.events.length !== 0) {
184
+ const event = this.events.pop();
185
+ if (event.message) {
186
+ this.readMessage(event.message);
187
+ }
188
+ else if (event.error) {
189
+ this.fireError(event.error);
190
+ }
191
+ else {
192
+ this.fireClose();
193
+ }
194
+ }
195
+ }
196
+ }
197
+ readMessage(message) {
198
+ if (this.state === 'initial') {
199
+ this.events.splice(0, 0, { message });
200
+ }
201
+ else if (this.state === 'listening') {
202
+ const data = JSON.parse(message);
203
+ this.callback(data);
204
+ }
205
+ }
206
+ fireError(error) {
207
+ if (this.state === 'initial') {
208
+ this.events.splice(0, 0, { error });
209
+ }
210
+ else if (this.state === 'listening') {
211
+ super.fireError(error);
212
+ }
213
+ }
214
+ fireClose() {
215
+ if (this.state === 'initial') {
216
+ this.events.splice(0, 0, {});
217
+ }
218
+ else if (this.state === 'listening') {
219
+ super.fireClose();
220
+ }
221
+ this.state = 'closed';
222
+ }
223
+ }
84
224
  //# sourceMappingURL=connection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;AAEH,uCAAuC;AACvC,uDAA8E;AAC9E,kDAAqE;AAErE,iEAA2D;AAO3D;IAAA;IA8DA,CAAC;IA5DG;;;;;;OAMG;IACH,iDAAW,GAAX,UAA8B,IAAY,EAAE,MAAe,EAAE,OAA0B;QACnF,IAAM,OAAO,GAAG,IAAI,mCAAmB,CAAI,MAAM,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC;YACR,IAAI,MAAA;YACJ,YAAY,EAAE,UAAA,CAAC,IAAI,OAAA,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAjB,CAAiB;SACvC,EAAE,OAAO,CAAC,CAAC;QACZ,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,4CAAM,GAAN,UAAO,OAA0B,EAAE,OAA0B;QACzD,IAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAErD,IAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACnC,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE;YAC5B,IAAM,SAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAChC,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,KAAK;gBACtC,SAAO,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC,CAAC,CAAC;SACN;aAAM;YACH,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,KAAY;gBAC7C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;SACN;QACD,0BAAQ,CAAC;YACL,SAAS,WAAA;YACT,YAAY,EAAE,UAAA,UAAU,IAAI,OAAA,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,EAAhC,CAAgC;YAC5D,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;IAES,kDAAY,GAAtB;QACI,OAAO,IAAI,iCAAa,EAAE,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,qDAAe,GAAf,UAAgB,GAAW,EAAE,OAA0B;QACnD,IAAM,aAAa,GAAG;YAClB,oBAAoB,EAAE,KAAK;YAC3B,oBAAoB,EAAE,IAAI;YAC1B,2BAA2B,EAAE,GAAG;YAChC,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,KAAK;SACf,CAAC;QACF,IAAM,MAAM,GAAG,IAAI,gCAAqB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QACxE,OAAO,MAAa,CAAC,CAAC,yEAAyE;IACnG,CAAC;IA5DQ,2BAA2B;QADvC,sBAAU,EAAE;OACA,2BAA2B,CA8DvC;IAAD,kCAAC;CAAA,AA9DD,IA8DC;AA9DY,kEAA2B"}
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yDAAgF;AAChF,mDAAyD;AACzD,oEAAyE;AACzE,oEAAyE;AACzE,oDAAqE;AAErE,mEAAsE;AAOtE,MAAa,2BAA2B;IAEpC;;;;;;OAMG;IACH,WAAW,CAAmB,IAA8B,EAAE,MAAe,EAAE,OAA0B;QACrG,MAAM,OAAO,GAAG,IAAI,mCAAmB,CAAI,MAAM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AE,CAAC,CAAC;SACvC;aACI,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;YACjC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SAC1B;IACL,CAAC;IACD,SAAS;QACL,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;SAChC;aACI,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;YACjC,KAAK,CAAC,SAAS,EAAE,CAAC;SACrB;QACD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACJ"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ import { Message } from 'vscode-jsonrpc/lib/messages';
7
+ import { AbstractMessageWriter, MessageWriter } from 'vscode-jsonrpc/lib/messageWriter';
8
+ import { AbstractMessageReader, MessageReader, DataCallback } from 'vscode-jsonrpc/lib/messageReader';
9
+ import { MessageConnection } from 'vscode-jsonrpc/lib/main';
10
+ export declare class WindowMessageWriter extends AbstractMessageWriter implements MessageWriter {
11
+ readonly serviceId: string;
12
+ readonly window: Window;
13
+ readonly targetOrigin: string;
14
+ constructor(serviceId: string, window: Window, targetOrigin: string);
15
+ write(msg: Message): void;
16
+ }
17
+ export declare class WindowMessageReader extends AbstractMessageReader implements MessageReader {
18
+ readonly serviceId: string;
19
+ readonly sourceOrigin: string;
20
+ protected callback?: DataCallback;
21
+ protected readonly buffer: Message[];
22
+ constructor(serviceId: string, sourceOrigin: string);
23
+ listen(callback: DataCallback): void;
24
+ }
25
+ export declare function createWindowMessageConnection(serviceId: string, window: Window, sourceOrigin: string, targetOrigin?: string): MessageConnection;
26
+ //# sourceMappingURL=window-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/browser/window-connection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAYrF,qBAAa,mBAAoB,SAAQ,qBAAsB,YAAW,aAAa;IAEvE,QAAQ,CAAC,SAAS,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM;gBAAzE,SAAS,EAAE,MAAM,EAAW,MAAM,EAAE,MAAM,EAAW,YAAY,EAAE,MAAM;IAI9F,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;CAK5B;AAED,qBAAa,mBAAoB,SAAQ,qBAAsB,YAAW,aAAa;IAKvE,QAAQ,CAAC,SAAS,EAAE,MAAM;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM;IAHrE,SAAS,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IAClC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,CAAM;gBAErB,SAAS,EAAE,MAAM,EAAW,YAAY,EAAE,MAAM;IAiBrE,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;CASvC;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,SAAe,GAAG,iBAAiB,CAIrJ"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License-AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createWindowMessageConnection = exports.WindowMessageReader = exports.WindowMessageWriter = void 0;
9
+ const messageWriter_1 = require("vscode-jsonrpc/lib/messageWriter");
10
+ const messageReader_1 = require("vscode-jsonrpc/lib/messageReader");
11
+ const main_1 = require("vscode-jsonrpc/lib/main");
12
+ const vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
13
+ function isWindowMessage(value) {
14
+ return !!value && typeof value === 'object' &&
15
+ ('jsonrpc' in value && typeof value['jsonrpc'] === 'string') &&
16
+ ('serviceId' in value && typeof value['serviceId'] === 'string');
17
+ }
18
+ class WindowMessageWriter extends messageWriter_1.AbstractMessageWriter {
19
+ constructor(serviceId, window, targetOrigin) {
20
+ super();
21
+ this.serviceId = serviceId;
22
+ this.window = window;
23
+ this.targetOrigin = targetOrigin;
24
+ }
25
+ write(msg) {
26
+ const { serviceId } = this;
27
+ this.window.postMessage(Object.assign(msg, { serviceId }), this.targetOrigin);
28
+ }
29
+ }
30
+ exports.WindowMessageWriter = WindowMessageWriter;
31
+ class WindowMessageReader extends messageReader_1.AbstractMessageReader {
32
+ constructor(serviceId, sourceOrigin) {
33
+ super();
34
+ this.serviceId = serviceId;
35
+ this.sourceOrigin = sourceOrigin;
36
+ this.buffer = [];
37
+ window.addEventListener('message', event => {
38
+ if (this.sourceOrigin !== '*' && event.origin !== this.sourceOrigin) {
39
+ return;
40
+ }
41
+ if (!isWindowMessage(event.data) || event.data.serviceId !== this.serviceId) {
42
+ return;
43
+ }
44
+ if (this.callback) {
45
+ this.callback(event.data);
46
+ }
47
+ else {
48
+ this.buffer.push(event.data);
49
+ }
50
+ }, false);
51
+ }
52
+ listen(callback) {
53
+ let message;
54
+ while (message = this.buffer.pop()) {
55
+ callback(message);
56
+ }
57
+ Object.freeze(this.buffer);
58
+ this.callback = callback;
59
+ }
60
+ }
61
+ exports.WindowMessageReader = WindowMessageReader;
62
+ function createWindowMessageConnection(serviceId, window, sourceOrigin, targetOrigin = sourceOrigin) {
63
+ const reader = new WindowMessageReader(serviceId, sourceOrigin);
64
+ const writer = new WindowMessageWriter(serviceId, window, targetOrigin);
65
+ return (0, main_1.createMessageConnection)(reader, writer, new vscode_ws_jsonrpc_1.ConsoleLogger());
66
+ }
67
+ exports.createWindowMessageConnection = createWindowMessageConnection;
68
+ //# sourceMappingURL=window-connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/window-connection.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,oEAAwF;AACxF,oEAAsG;AACtG,kDAAqF;AACrF,yDAAkD;AAKlD,SAAS,eAAe,CAAC,KAAU;IAC/B,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QACvC,CAAC,SAAS,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC;QAC5D,CAAC,WAAW,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC,CAAC;AACzE,CAAC;AAED,MAAa,mBAAoB,SAAQ,qCAAqB;IAE1D,YAAqB,SAAiB,EAAW,MAAc,EAAW,YAAoB;QAC1F,KAAK,EAAE,CAAC;QADS,cAAS,GAAT,SAAS,CAAQ;QAAW,WAAM,GAAN,MAAM,CAAQ;QAAW,iBAAY,GAAZ,YAAY,CAAQ;IAE9F,CAAC;IAED,KAAK,CAAC,GAAY;QACd,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAClF,CAAC;CAEJ;AAXD,kDAWC;AAED,MAAa,mBAAoB,SAAQ,qCAAq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