@gitpod/gitpod-protocol 0.1.5-wth-argo.0 → 0.1.5-yh-vmoptions-fork.1

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 (352) hide show
  1. package/data/gitpod-schema.json +206 -28
  2. package/lib/accounting-protocol.d.ts +162 -0
  3. package/lib/accounting-protocol.d.ts.map +1 -0
  4. package/lib/accounting-protocol.js +107 -0
  5. package/lib/accounting-protocol.js.map +1 -0
  6. package/lib/admin-protocol.d.ts +32 -4
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +15 -0
  9. package/lib/admin-protocol.js.map +1 -1
  10. package/lib/analytics.d.ts +44 -0
  11. package/lib/analytics.d.ts.map +1 -0
  12. package/lib/analytics.js +10 -0
  13. package/lib/analytics.js.map +1 -0
  14. package/lib/auth.d.ts.map +1 -1
  15. package/lib/context-url.d.ts +31 -0
  16. package/lib/context-url.d.ts.map +1 -0
  17. package/lib/context-url.js +102 -0
  18. package/lib/context-url.js.map +1 -0
  19. package/lib/context-url.spec.d.ts +14 -0
  20. package/lib/context-url.spec.d.ts.map +1 -0
  21. package/lib/context-url.spec.js +109 -0
  22. package/lib/context-url.spec.js.map +1 -0
  23. package/lib/email-protocol.d.ts +1 -2
  24. package/lib/email-protocol.d.ts.map +1 -1
  25. package/lib/email-protocol.js +4 -4
  26. package/lib/email-protocol.js.map +1 -1
  27. package/lib/encryption/container-module.d.ts.map +1 -1
  28. package/lib/encryption/container-module.js +5 -4
  29. package/lib/encryption/container-module.js.map +1 -1
  30. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  31. package/lib/encryption/encryption-engine.js +25 -26
  32. package/lib/encryption/encryption-engine.js.map +1 -1
  33. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  34. package/lib/encryption/encryption-engine.spec.js +29 -37
  35. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  36. package/lib/encryption/encryption-service.d.ts.map +1 -1
  37. package/lib/encryption/encryption-service.js +30 -44
  38. package/lib/encryption/encryption-service.js.map +1 -1
  39. package/lib/encryption/key-provider.d.ts.map +1 -1
  40. package/lib/encryption/key-provider.js +31 -38
  41. package/lib/encryption/key-provider.js.map +1 -1
  42. package/lib/env.d.ts +0 -6
  43. package/lib/env.d.ts.map +1 -1
  44. package/lib/env.js +7 -27
  45. package/lib/env.js.map +1 -1
  46. package/lib/gitpod-file-parser.d.ts.map +1 -1
  47. package/lib/gitpod-file-parser.js +26 -42
  48. package/lib/gitpod-file-parser.js.map +1 -1
  49. package/lib/gitpod-file-parser.spec.js +145 -142
  50. package/lib/gitpod-file-parser.spec.js.map +1 -1
  51. package/lib/gitpod-service.d.ts +180 -33
  52. package/lib/gitpod-service.d.ts.map +1 -1
  53. package/lib/gitpod-service.js +194 -273
  54. package/lib/gitpod-service.js.map +1 -1
  55. package/lib/headless-workspace-log.d.ts +9 -11
  56. package/lib/headless-workspace-log.d.ts.map +1 -1
  57. package/lib/headless-workspace-log.js +6 -8
  58. package/lib/headless-workspace-log.js.map +1 -1
  59. package/lib/ide-frontend-service.d.ts +5 -1
  60. package/lib/ide-frontend-service.d.ts.map +1 -1
  61. package/lib/ide-protocol.d.ts +105 -0
  62. package/lib/ide-protocol.d.ts.map +1 -0
  63. package/lib/{util/without.js → ide-protocol.js} +2 -2
  64. package/lib/ide-protocol.js.map +1 -0
  65. package/lib/index.d.ts +16 -10
  66. package/lib/index.d.ts.map +1 -1
  67. package/lib/index.js +7 -1
  68. package/lib/index.js.map +1 -1
  69. package/lib/installation-admin-protocol.d.ts +27 -0
  70. package/lib/installation-admin-protocol.d.ts.map +1 -0
  71. package/lib/installation-admin-protocol.js +30 -0
  72. package/lib/installation-admin-protocol.js.map +1 -0
  73. package/lib/license-protocol.d.ts +7 -0
  74. package/lib/license-protocol.d.ts.map +1 -1
  75. package/lib/license-protocol.js.map +1 -1
  76. package/lib/messaging/browser/connection.d.ts +5 -3
  77. package/lib/messaging/browser/connection.d.ts.map +1 -1
  78. package/lib/messaging/browser/connection.js +184 -34
  79. package/lib/messaging/browser/connection.js.map +1 -1
  80. package/lib/messaging/browser/window-connection.d.ts +4 -4
  81. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  82. package/lib/messaging/browser/window-connection.js +42 -59
  83. package/lib/messaging/browser/window-connection.js.map +1 -1
  84. package/lib/messaging/client-call-metrics.d.ts +35 -0
  85. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  86. package/lib/messaging/client-call-metrics.js +83 -0
  87. package/lib/messaging/client-call-metrics.js.map +1 -0
  88. package/lib/messaging/error.d.ts +6 -1
  89. package/lib/messaging/error.d.ts.map +1 -1
  90. package/lib/messaging/error.js +12 -2
  91. package/lib/messaging/error.js.map +1 -1
  92. package/lib/messaging/handler.d.ts +10 -0
  93. package/lib/messaging/handler.d.ts.map +1 -1
  94. package/lib/messaging/handler.js +1 -1
  95. package/lib/messaging/node/connection.d.ts +1 -17
  96. package/lib/messaging/node/connection.d.ts.map +1 -1
  97. package/lib/messaging/node/connection.js +24 -60
  98. package/lib/messaging/node/connection.js.map +1 -1
  99. package/lib/messaging/proxy-factory.d.ts +3 -1
  100. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  101. package/lib/messaging/proxy-factory.js +75 -162
  102. package/lib/messaging/proxy-factory.js.map +1 -1
  103. package/lib/oss-allowlist.d.ts +14 -0
  104. package/lib/oss-allowlist.d.ts.map +1 -0
  105. package/lib/oss-allowlist.js +8 -0
  106. package/lib/oss-allowlist.js.map +1 -0
  107. package/lib/payment-protocol.d.ts +18 -0
  108. package/lib/payment-protocol.d.ts.map +1 -0
  109. package/lib/payment-protocol.js +13 -0
  110. package/lib/payment-protocol.js.map +1 -0
  111. package/lib/permission.d.ts +10 -3
  112. package/lib/permission.d.ts.map +1 -1
  113. package/lib/permission.js +41 -31
  114. package/lib/permission.js.map +1 -1
  115. package/lib/plans.d.ts +210 -0
  116. package/lib/plans.d.ts.map +1 -0
  117. package/lib/plans.js +605 -0
  118. package/lib/plans.js.map +1 -0
  119. package/lib/protocol.d.ts +196 -83
  120. package/lib/protocol.d.ts.map +1 -1
  121. package/lib/protocol.js +264 -200
  122. package/lib/protocol.js.map +1 -1
  123. package/lib/snapshot-url.d.ts +14 -0
  124. package/lib/snapshot-url.d.ts.map +1 -0
  125. package/lib/snapshot-url.js +26 -0
  126. package/lib/snapshot-url.js.map +1 -0
  127. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
  128. package/lib/snapshot-url.spec.d.ts.map +1 -0
  129. package/lib/snapshot-url.spec.js +41 -0
  130. package/lib/snapshot-url.spec.js.map +1 -0
  131. package/lib/team-subscription-protocol.d.ts +91 -0
  132. package/lib/team-subscription-protocol.d.ts.map +1 -0
  133. package/lib/team-subscription-protocol.js +74 -0
  134. package/lib/team-subscription-protocol.js.map +1 -0
  135. package/lib/teams-projects-protocol.d.ts +118 -0
  136. package/lib/teams-projects-protocol.d.ts.map +1 -0
  137. package/lib/teams-projects-protocol.js +30 -0
  138. package/lib/teams-projects-protocol.js.map +1 -0
  139. package/lib/typings/globals.d.ts +2 -2
  140. package/lib/typings/globals.d.ts.map +1 -1
  141. package/lib/util/analytics.d.ts +8 -0
  142. package/lib/util/analytics.d.ts.map +1 -0
  143. package/lib/util/analytics.js +88 -0
  144. package/lib/util/analytics.js.map +1 -0
  145. package/lib/util/async-iterator.d.ts.map +1 -1
  146. package/lib/util/async-iterator.js +57 -135
  147. package/lib/util/async-iterator.js.map +1 -1
  148. package/lib/util/cancelable.js +17 -59
  149. package/lib/util/cancelable.js.map +1 -1
  150. package/lib/util/date-time.js +11 -11
  151. package/lib/util/date-time.js.map +1 -1
  152. package/lib/util/deferred.js +10 -12
  153. package/lib/util/deferred.js.map +1 -1
  154. package/lib/util/disposable.d.ts.map +1 -1
  155. package/lib/util/disposable.js +27 -40
  156. package/lib/util/disposable.js.map +1 -1
  157. package/lib/util/event.d.ts.map +1 -1
  158. package/lib/util/event.js +63 -77
  159. package/lib/util/event.js.map +1 -1
  160. package/lib/util/garbage-collected-cache.d.ts +1 -0
  161. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  162. package/lib/util/garbage-collected-cache.js +27 -47
  163. package/lib/util/garbage-collected-cache.js.map +1 -1
  164. package/lib/util/generate-workspace-id.d.ts +6 -1
  165. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  166. package/lib/util/generate-workspace-id.js +469 -502
  167. package/lib/util/generate-workspace-id.js.map +1 -1
  168. package/lib/util/generate-workspace-id.spec.js +68 -78
  169. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  170. package/lib/util/gitpod-cookie.d.ts +20 -0
  171. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  172. package/lib/util/gitpod-cookie.js +41 -0
  173. package/lib/util/gitpod-cookie.js.map +1 -0
  174. package/lib/util/gitpod-host-url.d.ts +1 -2
  175. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  176. package/lib/util/gitpod-host-url.js +108 -109
  177. package/lib/util/gitpod-host-url.js.map +1 -1
  178. package/lib/util/gitpod-host-url.spec.d.ts +7 -1
  179. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  180. package/lib/util/gitpod-host-url.spec.js +113 -31
  181. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  182. package/lib/util/grpc.d.ts +15 -0
  183. package/lib/util/grpc.d.ts.map +1 -0
  184. package/lib/util/grpc.js +18 -0
  185. package/lib/util/grpc.js.map +1 -0
  186. package/lib/util/jaeger-client-types.d.ts +68 -0
  187. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  188. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
  189. package/lib/util/jaeger-client-types.js.map +1 -0
  190. package/lib/util/logging.d.ts +49 -33
  191. package/lib/util/logging.d.ts.map +1 -1
  192. package/lib/util/logging.js +125 -129
  193. package/lib/util/logging.js.map +1 -1
  194. package/lib/util/make-link.js +5 -5
  195. package/lib/util/make-link.js.map +1 -1
  196. package/lib/util/parse-workspace-id.d.ts +10 -0
  197. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  198. package/lib/util/parse-workspace-id.js +31 -7
  199. package/lib/util/parse-workspace-id.js.map +1 -1
  200. package/lib/util/parse-workspace-id.spec.d.ts +4 -0
  201. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  202. package/lib/util/parse-workspace-id.spec.js +123 -84
  203. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  204. package/lib/util/queue.js +16 -55
  205. package/lib/util/queue.js.map +1 -1
  206. package/lib/util/queue.spec.js +147 -288
  207. package/lib/util/queue.spec.js.map +1 -1
  208. package/lib/util/repeat.d.ts +15 -0
  209. package/lib/util/repeat.d.ts.map +1 -0
  210. package/lib/util/repeat.js +55 -0
  211. package/lib/util/repeat.js.map +1 -0
  212. package/lib/util/semaphore.d.ts.map +1 -1
  213. package/lib/util/semaphore.js +15 -46
  214. package/lib/util/semaphore.js.map +1 -1
  215. package/lib/util/skip-if.d.ts.map +1 -1
  216. package/lib/util/skip-if.js +6 -6
  217. package/lib/util/skip-if.js.map +1 -1
  218. package/lib/util/timeutil.d.ts +1 -0
  219. package/lib/util/timeutil.d.ts.map +1 -1
  220. package/lib/util/timeutil.js +35 -17
  221. package/lib/util/timeutil.js.map +1 -1
  222. package/lib/util/timeutil.spec.d.ts.map +1 -1
  223. package/lib/util/timeutil.spec.js +21 -24
  224. package/lib/util/timeutil.spec.js.map +1 -1
  225. package/lib/util/tracing.d.ts +52 -6
  226. package/lib/util/tracing.d.ts.map +1 -1
  227. package/lib/util/tracing.js +197 -64
  228. package/lib/util/tracing.js.map +1 -1
  229. package/lib/util/tracing.spec.d.ts +7 -0
  230. package/lib/util/tracing.spec.d.ts.map +1 -0
  231. package/lib/util/tracing.spec.js +121 -0
  232. package/lib/util/tracing.spec.js.map +1 -0
  233. package/lib/util/workspace-port-authentication.d.ts +7 -7
  234. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  235. package/lib/util/workspace-port-authentication.js +10 -12
  236. package/lib/util/workspace-port-authentication.js.map +1 -1
  237. package/lib/workspace-cluster.d.ts +76 -0
  238. package/lib/workspace-cluster.d.ts.map +1 -0
  239. package/lib/workspace-cluster.js +31 -0
  240. package/lib/workspace-cluster.js.map +1 -0
  241. package/lib/workspace-instance.d.ts +45 -5
  242. package/lib/workspace-instance.d.ts.map +1 -1
  243. package/lib/wsready.d.ts +1 -1
  244. package/lib/wsready.d.ts.map +1 -1
  245. package/lib/wsready.js +2 -2
  246. package/package.json +32 -18
  247. package/pkg-yarn.lock +18 -10
  248. package/provenance-bundle.jsonl +2 -0
  249. package/src/accounting-protocol.ts +241 -0
  250. package/src/admin-protocol.ts +70 -19
  251. package/src/analytics.ts +52 -0
  252. package/src/auth.ts +2 -2
  253. package/src/context-url.spec.ts +67 -0
  254. package/src/context-url.ts +109 -0
  255. package/src/email-protocol.ts +5 -7
  256. package/src/encryption/container-module.ts +2 -3
  257. package/src/encryption/encryption-engine.spec.ts +9 -8
  258. package/src/encryption/encryption-engine.ts +14 -14
  259. package/src/encryption/encryption-service.ts +4 -5
  260. package/src/encryption/key-provider.ts +16 -19
  261. package/src/env.ts +0 -22
  262. package/src/gitpod-file-parser.spec.ts +55 -61
  263. package/src/gitpod-file-parser.ts +16 -17
  264. package/src/gitpod-service.ts +348 -110
  265. package/src/headless-workspace-log.ts +12 -14
  266. package/src/ide-frontend-service.ts +6 -2
  267. package/src/ide-protocol.ts +119 -0
  268. package/src/index.ts +16 -10
  269. package/src/installation-admin-protocol.ts +42 -0
  270. package/src/license-protocol.ts +12 -6
  271. package/src/messaging/browser/connection.ts +197 -18
  272. package/src/messaging/browser/window-connection.ts +39 -29
  273. package/src/messaging/client-call-metrics.ts +96 -0
  274. package/src/messaging/error.ts +18 -5
  275. package/src/messaging/handler.ts +13 -1
  276. package/src/messaging/node/connection.ts +23 -70
  277. package/src/messaging/proxy-factory.ts +35 -34
  278. package/src/oss-allowlist.ts +15 -0
  279. package/src/payment-protocol.ts +20 -0
  280. package/src/permission.ts +42 -33
  281. package/src/plans.ts +679 -0
  282. package/src/protocol.ts +493 -275
  283. package/src/snapshot-url.spec.ts +27 -0
  284. package/src/snapshot-url.ts +27 -0
  285. package/src/team-subscription-protocol.ts +147 -0
  286. package/src/teams-projects-protocol.ts +153 -0
  287. package/src/typings/globals.ts +4 -4
  288. package/src/util/analytics.ts +109 -0
  289. package/src/util/async-iterator.ts +4 -5
  290. package/src/util/cancelable.ts +3 -3
  291. package/src/util/date-time.ts +8 -8
  292. package/src/util/deferred.ts +6 -6
  293. package/src/util/disposable.ts +3 -6
  294. package/src/util/event.ts +9 -11
  295. package/src/util/garbage-collected-cache.ts +11 -8
  296. package/src/util/generate-workspace-id.spec.ts +37 -10
  297. package/src/util/generate-workspace-id.ts +464 -438
  298. package/src/util/gitpod-cookie.ts +38 -0
  299. package/src/util/gitpod-host-url.spec.ts +59 -8
  300. package/src/util/gitpod-host-url.ts +52 -40
  301. package/src/util/grpc.ts +15 -0
  302. package/src/util/jaeger-client-types.ts +102 -0
  303. package/src/util/logging.ts +145 -72
  304. package/src/util/make-link.ts +6 -7
  305. package/src/util/parse-workspace-id.spec.ts +37 -8
  306. package/src/util/parse-workspace-id.ts +32 -7
  307. package/src/util/queue.spec.ts +28 -26
  308. package/src/util/repeat.ts +45 -0
  309. package/src/util/semaphore.ts +6 -8
  310. package/src/util/skip-if.ts +10 -7
  311. package/src/util/timeutil.spec.ts +14 -15
  312. package/src/util/timeutil.ts +25 -15
  313. package/src/util/tracing.spec.ts +88 -0
  314. package/src/util/tracing.ts +200 -31
  315. package/src/util/workspace-port-authentication.ts +10 -13
  316. package/src/workspace-cluster.ts +107 -0
  317. package/src/workspace-instance.ts +98 -31
  318. package/src/wsready.ts +3 -3
  319. package/data/builtin-theia-plugins.json +0 -372
  320. package/lib/messaging/connection-error-handler.d.ts +0 -27
  321. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  322. package/lib/messaging/connection-error-handler.js +0 -46
  323. package/lib/messaging/connection-error-handler.js.map +0 -1
  324. package/lib/theia-plugins.d.ts +0 -11
  325. package/lib/theia-plugins.d.ts.map +0 -1
  326. package/lib/theia-plugins.js.map +0 -1
  327. package/lib/util/context-url.d.ts +0 -13
  328. package/lib/util/context-url.d.ts.map +0 -1
  329. package/lib/util/context-url.js +0 -26
  330. package/lib/util/context-url.js.map +0 -1
  331. package/lib/util/context-url.spec.d.ts +0 -10
  332. package/lib/util/context-url.spec.d.ts.map +0 -1
  333. package/lib/util/context-url.spec.js +0 -52
  334. package/lib/util/context-url.spec.js.map +0 -1
  335. package/lib/util/repeater.d.ts +0 -22
  336. package/lib/util/repeater.d.ts.map +0 -1
  337. package/lib/util/repeater.js +0 -118
  338. package/lib/util/repeater.js.map +0 -1
  339. package/lib/util/safe-promise.d.ts +0 -11
  340. package/lib/util/safe-promise.d.ts.map +0 -1
  341. package/lib/util/safe-promise.js +0 -34
  342. package/lib/util/safe-promise.js.map +0 -1
  343. package/lib/util/without.d.ts +0 -7
  344. package/lib/util/without.d.ts.map +0 -1
  345. package/lib/util/without.js.map +0 -1
  346. package/src/messaging/connection-error-handler.ts +0 -62
  347. package/src/theia-plugins.ts +0 -11
  348. package/src/util/context-url.spec.ts +0 -25
  349. package/src/util/context-url.ts +0 -23
  350. package/src/util/jaeger-client.d.ts +0 -105
  351. package/src/util/repeater.ts +0 -49
  352. package/src/util/safe-promise.ts +0 -26
@@ -8,6 +8,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ErrorCodes = void 0;
9
9
  var ErrorCodes;
10
10
  (function (ErrorCodes) {
11
+ // 400 Unauthorized
12
+ ErrorCodes.BAD_REQUEST = 400;
11
13
  // 401 Unauthorized
12
14
  ErrorCodes.NOT_AUTHENTICATED = 401;
13
15
  // 402 Payment Required
@@ -26,6 +28,8 @@ var ErrorCodes;
26
28
  ErrorCodes.REPOSITORY_NOT_WHITELISTED = 430;
27
29
  // 460 Context Parse Error (custom status code)
28
30
  ErrorCodes.CONTEXT_PARSE_ERROR = 460;
31
+ // 461 Invalid gitpod yml
32
+ ErrorCodes.INVALID_GITPOD_YML = 461;
29
33
  // 450 Payment error
30
34
  ErrorCodes.PAYMENT_ERROR = 450;
31
35
  // 470 User Blocked (custom status code)
@@ -42,15 +46,21 @@ var ErrorCodes;
42
46
  ErrorCodes.PLAN_ONLY_ALLOWED_FOR_STUDENTS = 485;
43
47
  // 490 Too Many Running Workspace
44
48
  ErrorCodes.TOO_MANY_RUNNING_WORKSPACES = 490;
49
+ // 500 Internal Server Error
50
+ ErrorCodes.INTERNAL_SERVER_ERROR = 500;
45
51
  // 501 EE Feature
46
52
  ErrorCodes.EE_FEATURE = 501;
47
53
  // 555 EE License Required
48
54
  ErrorCodes.EE_LICENSE_REQUIRED = 555;
55
+ // 601 SaaS Feature
56
+ ErrorCodes.SAAS_FEATURE = 601;
49
57
  // 610 Invalid Team Subscription Quantity
50
58
  ErrorCodes.TEAM_SUBSCRIPTION_INVALID_QUANTITY = 610;
51
59
  // 620 Team Subscription Assignment Failed
52
60
  ErrorCodes.TEAM_SUBSCRIPTION_ASSIGNMENT_FAILED = 620;
53
- // 666 Not Implemented TODO IO-SPLIT remove
54
- ErrorCodes.NOT_IMPLEMENTED = 666;
61
+ // 630 Snapshot Error
62
+ ErrorCodes.SNAPSHOT_ERROR = 630;
63
+ // 640 Headless logs are not available (yet)
64
+ ErrorCodes.HEADLESS_LOG_NOT_YET_AVAILABLE = 640;
55
65
  })(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
56
66
  //# sourceMappingURL=error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/messaging/error.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH,IAAiB,UAAU,CAkE1B;AAlED,WAAiB,UAAU;IACvB,mBAAmB;IACN,4BAAiB,GAAG,GAAG,CAAC;IAErC,uBAAuB;IACV,4BAAiB,GAAG,GAAG,CAAC;IAErC,gBAAgB;IACH,4BAA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+4,14 @@ export interface ConnectionHandler {
4
4
  readonly path: string;
5
5
  onConnection(connection: MessageConnection, session?: object): void;
6
6
  }
7
+ export interface ConnectionEventHandler {
8
+ /**
9
+ * Called when the transport underpinning the connection got closed
10
+ */
11
+ onTransportDidClose(): void;
12
+ /**
13
+ * Called when the transport underpinning the connection is (re-)opened
14
+ */
15
+ onTransportDidOpen(): void;
16
+ }
7
17
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/messaging/handler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvE"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/messaging/handler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvE;AAED,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAC;IAE5B;;OAEG;IACH,kBAAkB,IAAI,IAAI,CAAC;CAC9B"}
@@ -7,5 +7,5 @@
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.ConnectionHandler = void 0;
10
- exports.ConnectionHandler = Symbol('ConnectionHandler');
10
+ exports.ConnectionHandler = Symbol("ConnectionHandler");
11
11
  //# sourceMappingURL=handler.js.map
@@ -1,20 +1,4 @@
1
- /// <reference types="node" />
2
1
  import * as ws from "ws";
3
- import * as http from "http";
4
- import * as https from "https";
5
- import * as net from "net";
6
- import { MessageConnection } from "vscode-jsonrpc";
7
2
  import { IWebSocket } from "vscode-ws-jsonrpc";
8
- export interface IServerOptions {
9
- readonly server: http.Server | https.Server;
10
- readonly path?: string;
11
- matches?(request: http.IncomingMessage): boolean;
12
- }
13
- export declare function createServerWebSocketConnection(options: IServerOptions, onConnect: (connection: MessageConnection) => void): void;
14
- export declare function openJsonRpcSocket(options: IServerOptions, onOpen: (socket: IWebSocket) => void): void;
15
- export interface OnOpen {
16
- (webSocket: ws, request: http.IncomingMessage, socket: net.Socket, head: Buffer): void;
17
- }
18
- export declare function openSocket(options: IServerOptions, onOpen: OnOpen): void;
19
- export declare function toIWebSocket(webSocket: ws): IWebSocket;
3
+ export declare function toIWebSocket(ws: ws): IWebSocket;
20
4
  //# sourceMappingURL=connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/node/connection.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAA6B,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG1E,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;CACpD;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI,CAIjI;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI,CAKrG;AAED,MAAM,WAAW,MAAM;IACnB,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1F;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAoBxE;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,EAAE,cAyBzC"}
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/node/connection.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,cA6BlC"}
@@ -6,71 +6,35 @@
6
6
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.toIWebSocket = exports.openSocket = exports.openJsonRpcSocket = exports.createServerWebSocketConnection = void 0;
10
- var ws = require("ws");
11
- var url = require("url");
12
- var vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
13
- var logging_1 = require("../../util/logging");
14
- function createServerWebSocketConnection(options, onConnect) {
15
- openJsonRpcSocket(options, function (socket) {
16
- onConnect(vscode_ws_jsonrpc_1.createWebSocketConnection(socket, console));
17
- });
18
- }
19
- exports.createServerWebSocketConnection = createServerWebSocketConnection;
20
- function openJsonRpcSocket(options, onOpen) {
21
- openSocket(options, function (socket) {
22
- var webSocket = toIWebSocket(socket);
23
- onOpen(webSocket);
24
- });
25
- }
26
- exports.openJsonRpcSocket = openJsonRpcSocket;
27
- function openSocket(options, onOpen) {
28
- var wss = new ws.Server({
29
- noServer: true,
30
- perMessageDeflate: {
31
- // don't compress if a message is less than 256kb
32
- threshold: 256 * 1024
33
- }
34
- });
35
- options.server.on('upgrade', function (request, socket, head) {
36
- var pathname = request.url ? url.parse(request.url).pathname : undefined;
37
- if (options.path && pathname === options.path || options.matches && options.matches(request)) {
38
- wss.handleUpgrade(request, socket, head, function (webSocket) {
39
- if (webSocket.readyState === webSocket.OPEN) {
40
- onOpen(webSocket, request, socket, head);
41
- }
42
- else {
43
- webSocket.on('open', function () { return onOpen(webSocket, request, socket, head); });
44
- }
45
- });
46
- }
47
- });
48
- }
49
- exports.openSocket = openSocket;
50
- function toIWebSocket(webSocket) {
51
- var sendsAfterOpen = 0;
9
+ exports.toIWebSocket = void 0;
10
+ function toIWebSocket(ws) {
52
11
  return {
53
- send: function (content) {
54
- if (webSocket.readyState !== ws.OPEN) {
55
- if (sendsAfterOpen++ > 3) {
56
- logging_1.log.error("Repeated try to send on closed web socket (readyState was " + webSocket.readyState + ")", { ws: ws });
57
- }
12
+ send: (content) => {
13
+ if (ws.readyState >= ws.CLOSING) {
14
+ // ws is already CLOSING/CLOSED, send() would just return an error.
58
15
  return;
59
16
  }
60
- webSocket.send(content, function (err) {
61
- if (err) {
62
- logging_1.log.error('Error in ws.send()', err, { ws: ws });
63
- }
64
- });
17
+ // in general send-errors should trigger an 'error' event already, we just make sure it actually happens.
18
+ try {
19
+ ws.send(content, (err) => {
20
+ if (!err) {
21
+ return;
22
+ }
23
+ ws.emit("error", err);
24
+ });
25
+ }
26
+ catch (err) {
27
+ ws.emit("error", err);
28
+ }
65
29
  },
66
- onMessage: function (cb) { return webSocket.on('message', cb); },
67
- onError: function (cb) { return webSocket.on('error', cb); },
68
- onClose: function (cb) { return webSocket.on('close', cb); },
69
- dispose: function () {
70
- if (webSocket.readyState < ws.CLOSING) {
71
- webSocket.close();
30
+ onMessage: (cb) => ws.on("message", cb),
31
+ onError: (cb) => ws.on("error", cb),
32
+ onClose: (cb) => ws.on("close", cb),
33
+ dispose: () => {
34
+ if (ws.readyState < ws.CLOSING) {
35
+ ws.close();
72
36
  }
73
- }
37
+ },
74
38
  };
75
39
  }
76
40
  exports.toIWebSocket = toIWebSocket;
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/node/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uBAAyB;AAGzB,yBAA2B;AAG3B,uDAA0E;AAC1E,8CAAyC;AAQzC,SAAgB,+BAA+B,CAAC,OAAuB,EAAE,SAAkD;IACvH,iBAAiB,CAAC,OAAO,EAAE,UAAA,MAAM;QAC7B,SAAS,CAAC,6CAAyB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC;AAJD,0EAIC;AAED,SAAgB,iBAAiB,CAAC,OAAuB,EAAE,MAAoC;IAC3F,UAAU,CAAC,OAAO,EAAE,UAAA,MAAM;QACtB,IAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACP,CAAC;AALD,8CAKC;AAMD,SAAgB,UAAU,CAAC,OAAuB,EAAE,MAAc;IAC9D,IAAM,GAAG,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC;QACtB,QAAQ,EAAE,IAAI;QACV,iBAAiB,EAAE;YACf,iDAAiD;YACjD,SAAS,EAAE,GAAG,GAAG,IAAI;SACxB;KACR,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,OAA6B,EAAE,MAAkB,EAAE,IAAY;QACzF,IAAM,QAAQ,GAAG,OAAO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BAChD;YACL,CAAC,CAAC,CAAA;QACN,CAAC;QACD,SAAS,EAAE,UAAA,EAAE,IAAI,OAAA,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,EAA3B,CAA2B;QAC5C,OAAO,EAAE,UAAA,EAAE,IAAI,OAAA,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,EAAzB,CAAyB;QACxC,OAAO,EAAE,UAAA,EAAE,IAAI,OAAA,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,EAAzB,CAAyB;QACxC,OAAO,EAAE;YACL,IAAI,SAAS,CAAC,UAAU,GAAG,EAAE,CAAC,OAAO,EAAE;gBACnC,SAAS,CAAC,KAAK,EAAE,CAAC;aACrB;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AAzBD,oCAyBC"}
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/node/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAKH,SAAgB,YAAY,CAAC,EAAM;IAC/B,OAAmB;QACf,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;YACd,IAAI,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC,OAAO,EAAE;gBAC7B,mEAAmE;gBACnE,OAAO;aACV;YAED,yGAAyG;YACzG,IAAI;gBACA,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;oBACrB,IAAI,CAAC,GAAG,EAAE;wBACN,OAAO;qBACV;oBACD,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC1B,CAAC,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;aACzB;QACL,CAAC;QACD,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACnC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACnC,OAAO,EAAE,GAAG,EAAE;YACV,IAAI,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,OAAO,EAAE;gBAC5B,EAAE,CAAC,KAAK,EAAE,CAAC;aACd;QACL,CAAC;KACJ,CAAC;AACN,CAAC;AA7BD,oCA6BC"}
@@ -1,7 +1,7 @@
1
1
  import { MessageConnection } from "vscode-jsonrpc";
2
2
  import { Event, Emitter } from "../util/event";
3
3
  import { Disposable } from "../util/disposable";
4
- import { ConnectionHandler } from './handler';
4
+ import { ConnectionHandler } from "./handler";
5
5
  export declare type JsonRpcServer<Client> = Disposable & {
6
6
  /**
7
7
  * If this server is a proxy to a remote server then
@@ -77,6 +77,8 @@ export declare class JsonRpcProxyFactory<T extends object> implements ProxyHandl
77
77
  */
78
78
  constructor(target?: any);
79
79
  protected waitForConnection(): void;
80
+ fireConnectionClosed(): void;
81
+ fireConnectionOpened(): void;
80
82
  /**
81
83
  * Connect a MessageConnection to the factory.
82
84
  *
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-factory.d.ts","sourceRoot":"","sources":["../../src/messaging/proxy-factory.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,oBAAY,aAAa,CAAC,MAAM,IAAI,UAAU,GAAG;IAC7C;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,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YAAY,CAAC,CAAC,CAAC;IAK9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG;IAgClD;;;;;;;;OAQG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;CAGpD"}
@@ -14,71 +14,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
15
  });
16
16
  };
17
- var __generator = (this && this.__generator) || function (thisArg, body) {
18
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
19
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
- function verb(n) { return function (v) { return step([n, v]); }; }
21
- function step(op) {
22
- if (f) throw new TypeError("Generator is already executing.");
23
- while (_) try {
24
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25
- if (y = 0, t) op = [op[0] & 2, t.value];
26
- switch (op[0]) {
27
- case 0: case 1: t = op; break;
28
- case 4: _.label++; return { value: op[1], done: false };
29
- case 5: _.label++; y = op[1]; op = [0]; continue;
30
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
- default:
32
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
- if (t[2]) _.ops.pop();
37
- _.trys.pop(); continue;
38
- }
39
- op = body.call(thisArg, _);
40
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
- }
43
- };
44
- var __read = (this && this.__read) || function (o, n) {
45
- var m = typeof Symbol === "function" && o[Symbol.iterator];
46
- if (!m) return o;
47
- var i = m.call(o), r, ar = [], e;
48
- try {
49
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
50
- }
51
- catch (error) { e = { error: error }; }
52
- finally {
53
- try {
54
- if (r && !r.done && (m = i["return"])) m.call(i);
55
- }
56
- finally { if (e) throw e.error; }
57
- }
58
- return ar;
59
- };
60
- var __spread = (this && this.__spread) || function () {
61
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
62
- return ar;
63
- };
64
17
  Object.defineProperty(exports, "__esModule", { value: true });
65
18
  exports.JsonRpcProxyFactory = exports.JsonRpcConnectionHandler = void 0;
66
- var vscode_jsonrpc_1 = require("vscode-jsonrpc");
67
- var event_1 = require("../util/event");
68
- var logging_1 = require("../util/logging");
69
- var JsonRpcConnectionHandler = /** @class */ (function () {
70
- function JsonRpcConnectionHandler(path, targetFactory) {
19
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
20
+ const event_1 = require("../util/event");
21
+ const logging_1 = require("../util/logging");
22
+ class JsonRpcConnectionHandler {
23
+ constructor(path, targetFactory) {
71
24
  this.path = path;
72
25
  this.targetFactory = targetFactory;
73
26
  }
74
- JsonRpcConnectionHandler.prototype.onConnection = function (connection, request) {
75
- var factory = new JsonRpcProxyFactory();
76
- var proxy = factory.createProxy();
27
+ onConnection(connection, request) {
28
+ const factory = new JsonRpcProxyFactory();
29
+ const proxy = factory.createProxy();
77
30
  factory.target = this.targetFactory(proxy, request);
78
31
  factory.listen(connection);
79
- };
80
- return JsonRpcConnectionHandler;
81
- }());
32
+ }
33
+ }
82
34
  exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
83
35
  /**
84
36
  * Factory for JSON-RPC proxy objects.
@@ -122,57 +74,45 @@ exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
122
74
  *
123
75
  * @param <T> - The type of the object to expose to JSON-RPC.
124
76
  */
125
- var JsonRpcProxyFactory = /** @class */ (function () {
77
+ class JsonRpcProxyFactory {
126
78
  /**
127
79
  * Build a new JsonRpcProxyFactory.
128
80
  *
129
81
  * @param target - The object to expose to JSON-RPC methods calls. If this
130
82
  * is omitted, the proxy won't be able to handle requests, only send them.
131
83
  */
132
- function JsonRpcProxyFactory(target) {
84
+ constructor(target) {
133
85
  this.target = target;
134
86
  this.onDidOpenConnectionEmitter = new event_1.Emitter();
135
87
  this.onDidCloseConnectionEmitter = new event_1.Emitter();
136
88
  this.waitForConnection();
137
89
  }
138
- JsonRpcProxyFactory.prototype.waitForConnection = function () {
139
- var _this = this;
140
- this.connectionPromise = new Promise(function (resolve) {
141
- return _this.connectionPromiseResolve = resolve;
142
- });
143
- this.connectionPromise.then(function (connection) {
144
- connection.onClose(function () {
145
- return _this.onDidCloseConnectionEmitter.fire(undefined);
146
- });
147
- _this.onDidOpenConnectionEmitter.fire(undefined);
90
+ waitForConnection() {
91
+ this.connectionPromise = new Promise((resolve) => (this.connectionPromiseResolve = resolve));
92
+ this.connectionPromise.then((connection) => {
93
+ connection.onClose(() => this.fireConnectionClosed());
94
+ this.fireConnectionOpened();
148
95
  });
149
- };
96
+ }
97
+ fireConnectionClosed() {
98
+ this.onDidCloseConnectionEmitter.fire(undefined);
99
+ }
100
+ fireConnectionOpened() {
101
+ this.onDidOpenConnectionEmitter.fire(undefined);
102
+ }
150
103
  /**
151
104
  * Connect a MessageConnection to the factory.
152
105
  *
153
106
  * This connection will be used to send/receive JSON-RPC requests and
154
107
  * response.
155
108
  */
156
- JsonRpcProxyFactory.prototype.listen = function (connection) {
157
- var _this = this;
158
- connection.onRequest(function (method) {
159
- var params = [];
160
- for (var _i = 1; _i < arguments.length; _i++) {
161
- params[_i - 1] = arguments[_i];
162
- }
163
- return _this.onRequest.apply(_this, __spread([method], params));
164
- });
165
- connection.onNotification(function (method) {
166
- var params = [];
167
- for (var _i = 1; _i < arguments.length; _i++) {
168
- params[_i - 1] = arguments[_i];
169
- }
170
- return _this.onNotification.apply(_this, __spread([method], params));
171
- });
172
- connection.onDispose(function () { return _this.waitForConnection(); });
109
+ listen(connection) {
110
+ connection.onRequest((method, ...params) => this.onRequest(method, ...params));
111
+ connection.onNotification((method, ...params) => this.onNotification(method, ...params));
112
+ connection.onDispose(() => this.waitForConnection());
173
113
  connection.listen();
174
114
  this.connectionPromiseResolve(connection);
175
- };
115
+ }
176
116
  /**
177
117
  * Process an incoming JSON-RPC method call.
178
118
  *
@@ -185,48 +125,33 @@ var JsonRpcProxyFactory = /** @class */ (function () {
185
125
  *
186
126
  * @returns A promise of the method call completion.
187
127
  */
188
- JsonRpcProxyFactory.prototype.onRequest = function (method) {
189
- var args = [];
190
- for (var _i = 1; _i < arguments.length; _i++) {
191
- args[_i - 1] = arguments[_i];
192
- }
193
- return __awaiter(this, void 0, void 0, function () {
194
- var e_1;
195
- var _a;
196
- return __generator(this, function (_b) {
197
- switch (_b.label) {
198
- case 0:
199
- _b.trys.push([0, 2, , 3]);
200
- return [4 /*yield*/, (_a = this.target)[method].apply(_a, __spread(args))];
201
- case 1: return [2 /*return*/, _b.sent()];
202
- case 2:
203
- e_1 = _b.sent();
204
- if (e_1 instanceof vscode_jsonrpc_1.ResponseError) {
205
- logging_1.log.info("Request " + method + " unsuccessful: " + e_1.code + "/\"" + e_1.message + "\"", { method: method, args: args });
206
- }
207
- else {
208
- logging_1.log.error("Request " + method + " failed with internal server error", e_1, { method: method, args: args });
209
- }
210
- throw e_1;
211
- case 3: return [2 /*return*/];
128
+ onRequest(method, ...args) {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ try {
131
+ return yield this.target[method](...args);
132
+ }
133
+ catch (e) {
134
+ if (e instanceof vscode_jsonrpc_1.ResponseError) {
135
+ logging_1.log.info(`Request ${method} unsuccessful: ${e.code}/"${e.message}"`, { method, args });
136
+ }
137
+ else {
138
+ logging_1.log.error(`Request ${method} failed with internal server error`, e, { method, args });
212
139
  }
213
- });
140
+ throw e;
141
+ }
214
142
  });
215
- };
143
+ }
216
144
  /**
217
145
  * Process an incoming JSON-RPC notification.
218
146
  *
219
147
  * Same as [[onRequest]], but called on incoming notifications rather than
220
148
  * methods calls.
221
149
  */
222
- JsonRpcProxyFactory.prototype.onNotification = function (method) {
223
- var _a;
224
- var args = [];
225
- for (var _i = 1; _i < arguments.length; _i++) {
226
- args[_i - 1] = arguments[_i];
150
+ onNotification(method, ...args) {
151
+ if (this.target[method]) {
152
+ this.target[method](...args);
227
153
  }
228
- (_a = this.target)[method].apply(_a, __spread(args));
229
- };
154
+ }
230
155
  /**
231
156
  * Create a Proxy exposing the interface of an object of type T. This Proxy
232
157
  * can be used to do JSON-RPC method calls on the remote target object as
@@ -234,10 +159,10 @@ var JsonRpcProxyFactory = /** @class */ (function () {
234
159
  *
235
160
  * If `T` implements `JsonRpcServer` then a client is used as a target object for a remote target object.
236
161
  */
237
- JsonRpcProxyFactory.prototype.createProxy = function () {
238
- var result = new Proxy(this, this);
162
+ createProxy() {
163
+ const result = new Proxy(this, this);
239
164
  return result;
240
- };
165
+ }
241
166
  /**
242
167
  * Get a callable object that executes a JSON-RPC method call.
243
168
  *
@@ -260,46 +185,35 @@ var JsonRpcProxyFactory = /** @class */ (function () {
260
185
  * @param receiver - unused.
261
186
  * @returns A callable that executes the JSON-RPC call.
262
187
  */
263
- JsonRpcProxyFactory.prototype.get = function (target, p, receiver) {
264
- var _this = this;
265
- if (p === 'setClient') {
266
- return function (client) {
267
- _this.target = client;
188
+ get(target, p, receiver) {
189
+ if (p === "setClient") {
190
+ return (client) => {
191
+ this.target = client;
268
192
  };
269
193
  }
270
- if (p === 'onDidOpenConnection') {
194
+ if (p === "onDidOpenConnection") {
271
195
  return this.onDidOpenConnectionEmitter.event;
272
196
  }
273
- if (p === 'onDidCloseConnection') {
197
+ if (p === "onDidCloseConnection") {
274
198
  return this.onDidCloseConnectionEmitter.event;
275
199
  }
276
- var isNotify = this.isNotification(p);
277
- return function () {
278
- var args = [];
279
- for (var _i = 0; _i < arguments.length; _i++) {
280
- args[_i] = arguments[_i];
200
+ const isNotify = this.isNotification(p);
201
+ return (...args) => this.connectionPromise.then((connection) => new Promise((resolve, reject) => {
202
+ try {
203
+ if (isNotify) {
204
+ connection.sendNotification(p.toString(), ...args);
205
+ resolve(undefined);
206
+ }
207
+ else {
208
+ const resultPromise = connection.sendRequest(p.toString(), ...args);
209
+ resultPromise.catch((err) => reject(err)).then((result) => resolve(result));
210
+ }
281
211
  }
282
- return _this.connectionPromise.then(function (connection) {
283
- return new Promise(function (resolve, reject) {
284
- try {
285
- if (isNotify) {
286
- connection.sendNotification.apply(connection, __spread([p.toString()], args));
287
- resolve();
288
- }
289
- else {
290
- var resultPromise = connection.sendRequest.apply(connection, __spread([p.toString()], args));
291
- resultPromise
292
- .catch(function (err) { return reject(err); })
293
- .then(function (result) { return resolve(result); });
294
- }
295
- }
296
- catch (err) {
297
- reject(err);
298
- }
299
- });
300
- });
301
- };
302
- };
212
+ catch (err) {
213
+ reject(err);
214
+ }
215
+ }));
216
+ }
303
217
  /**
304
218
  * Return whether the given property represents a notification.
305
219
  *
@@ -309,10 +223,9 @@ var JsonRpcProxyFactory = /** @class */ (function () {
309
223
  * @param p - The property being called on the proxy.
310
224
  * @return Whether `p` represents a notification.
311
225
  */
312
- JsonRpcProxyFactory.prototype.isNotification = function (p) {
226
+ isNotification(p) {
313
227
  return p.toString().startsWith("notify") || p.toString().startsWith("on");
314
- };
315
- return JsonRpcProxyFactory;
316
- }());
228
+ }
229
+ }
317
230
  exports.JsonRpcProxyFactory = JsonRpcProxyFactory;
318
231
  //# sourceMappingURL=proxy-factory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../src/messaging/proxy-fact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,CAAC;IAED;;;;;;;;OAQG;IACO,cAAc,CAAC,CAAc;QACnC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;CACJ;AAlKD,kDAkKC"}
@@ -0,0 +1,14 @@
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
+ export interface OssAllowList {
7
+ /**
8
+ * A string that identifies a GitHub/GitLab/Bitbucket identity of the form "<host>/<profilename>"
9
+ * E.g., "github.com/geropl"
10
+ */
11
+ identity: string;
12
+ deleted?: boolean;
13
+ }
14
+ //# sourceMappingURL=oss-allowlist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oss-allowlist.d.ts","sourceRoot":"","sources":["../src/oss-allowlist.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License-AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=oss-allowlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oss-allowlist.js","sourceRoot":"","sources":["../src/oss-allowlist.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}