@gitpod/gitpod-protocol 0.1.5-update-ovsx.0 → 0.1.5-update-yarnlock.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 (455) hide show
  1. package/data/gitpod-schema.json +159 -25
  2. package/lib/accounting-protocol.d.ts +165 -0
  3. package/lib/accounting-protocol.d.ts.map +1 -0
  4. package/lib/accounting-protocol.js +120 -0
  5. package/lib/accounting-protocol.js.map +1 -0
  6. package/lib/admin-protocol.d.ts +51 -6
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +17 -2
  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/attribution.d.ts +25 -0
  15. package/lib/attribution.d.ts.map +1 -0
  16. package/lib/attribution.js +58 -0
  17. package/lib/attribution.js.map +1 -0
  18. package/lib/auth.d.ts +25 -0
  19. package/lib/auth.d.ts.map +1 -0
  20. package/lib/auth.js +16 -0
  21. package/lib/auth.js.map +1 -0
  22. package/lib/billing-mode.d.ts +45 -0
  23. package/lib/billing-mode.d.ts.map +1 -0
  24. package/lib/billing-mode.js +44 -0
  25. package/lib/billing-mode.js.map +1 -0
  26. package/lib/blocked-repositories-protocol.d.ts +13 -0
  27. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  28. package/lib/blocked-repositories-protocol.js +8 -0
  29. package/lib/blocked-repositories-protocol.js.map +1 -0
  30. package/lib/context-url.d.ts +30 -0
  31. package/lib/context-url.d.ts.map +1 -0
  32. package/lib/context-url.js +100 -0
  33. package/lib/context-url.js.map +1 -0
  34. package/lib/context-url.spec.d.ts +12 -0
  35. package/lib/context-url.spec.d.ts.map +1 -0
  36. package/lib/context-url.spec.js +81 -0
  37. package/lib/context-url.spec.js.map +1 -0
  38. package/lib/encryption/container-module.d.ts +2 -2
  39. package/lib/encryption/container-module.d.ts.map +1 -1
  40. package/lib/encryption/container-module.js +8 -6
  41. package/lib/encryption/container-module.js.map +1 -1
  42. package/lib/encryption/encryption-engine.d.ts +2 -2
  43. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  44. package/lib/encryption/encryption-engine.js +28 -28
  45. package/lib/encryption/encryption-engine.js.map +1 -1
  46. package/lib/encryption/encryption-engine.spec.d.ts +3 -3
  47. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  48. package/lib/encryption/encryption-engine.spec.js +32 -39
  49. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  50. package/lib/encryption/encryption-service.d.ts +2 -2
  51. package/lib/encryption/encryption-service.d.ts.map +1 -1
  52. package/lib/encryption/encryption-service.js +33 -46
  53. package/lib/encryption/encryption-service.js.map +1 -1
  54. package/lib/encryption/key-provider.d.ts +3 -3
  55. package/lib/encryption/key-provider.d.ts.map +1 -1
  56. package/lib/encryption/key-provider.js +34 -40
  57. package/lib/encryption/key-provider.js.map +1 -1
  58. package/lib/env.d.ts +2 -8
  59. package/lib/env.d.ts.map +1 -1
  60. package/lib/env.js +10 -29
  61. package/lib/env.js.map +1 -1
  62. package/lib/experiments/always-default.d.ts +8 -0
  63. package/lib/experiments/always-default.d.ts.map +1 -0
  64. package/lib/experiments/always-default.js +20 -0
  65. package/lib/experiments/always-default.js.map +1 -0
  66. package/lib/experiments/configcat-server.d.ts +10 -0
  67. package/lib/experiments/configcat-server.d.ts.map +1 -0
  68. package/lib/experiments/configcat-server.js +37 -0
  69. package/lib/experiments/configcat-server.js.map +1 -0
  70. package/lib/experiments/configcat.d.ts +21 -0
  71. package/lib/experiments/configcat.d.ts.map +1 -0
  72. package/lib/experiments/configcat.js +51 -0
  73. package/lib/experiments/configcat.js.map +1 -0
  74. package/lib/experiments/types.d.ts +22 -0
  75. package/lib/experiments/types.d.ts.map +1 -0
  76. package/lib/experiments/types.js +10 -0
  77. package/lib/experiments/types.js.map +1 -0
  78. package/lib/frontend-dashboard-service.d.ts +99 -0
  79. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  80. package/lib/frontend-dashboard-service.js +55 -0
  81. package/lib/frontend-dashboard-service.js.map +1 -0
  82. package/lib/gitpod-file-parser.d.ts +2 -2
  83. package/lib/gitpod-file-parser.d.ts.map +1 -1
  84. package/lib/gitpod-file-parser.js +29 -44
  85. package/lib/gitpod-file-parser.js.map +1 -1
  86. package/lib/gitpod-file-parser.spec.d.ts +2 -2
  87. package/lib/gitpod-file-parser.spec.js +147 -144
  88. package/lib/gitpod-file-parser.spec.js.map +1 -1
  89. package/lib/gitpod-service.d.ts +290 -50
  90. package/lib/gitpod-service.d.ts.map +1 -1
  91. package/lib/gitpod-service.js +288 -123
  92. package/lib/gitpod-service.js.map +1 -1
  93. package/lib/headless-workspace-log.d.ts +11 -13
  94. package/lib/headless-workspace-log.d.ts.map +1 -1
  95. package/lib/headless-workspace-log.js +8 -9
  96. package/lib/headless-workspace-log.js.map +1 -1
  97. package/lib/ide-frontend-service.d.ts +26 -0
  98. package/lib/ide-frontend-service.d.ts.map +1 -0
  99. package/lib/ide-frontend-service.js +8 -0
  100. package/lib/ide-frontend-service.js.map +1 -0
  101. package/lib/ide-protocol.d.ts +126 -0
  102. package/lib/ide-protocol.d.ts.map +1 -0
  103. package/lib/ide-protocol.js +18 -0
  104. package/lib/ide-protocol.js.map +1 -0
  105. package/lib/index.d.ts +18 -12
  106. package/lib/index.d.ts.map +1 -1
  107. package/lib/index.js +28 -13
  108. package/lib/index.js.map +1 -1
  109. package/lib/installation-admin-protocol.d.ts +30 -0
  110. package/lib/installation-admin-protocol.d.ts.map +1 -0
  111. package/lib/installation-admin-protocol.js +31 -0
  112. package/lib/installation-admin-protocol.js.map +1 -0
  113. package/lib/license-protocol.d.ts +9 -2
  114. package/lib/license-protocol.d.ts.map +1 -1
  115. package/lib/license-protocol.js +3 -2
  116. package/lib/license-protocol.js.map +1 -1
  117. package/lib/messaging/browser/connection.d.ts +6 -4
  118. package/lib/messaging/browser/connection.d.ts.map +1 -1
  119. package/lib/messaging/browser/connection.js +188 -48
  120. package/lib/messaging/browser/connection.js.map +1 -1
  121. package/lib/messaging/browser/window-connection.d.ts +9 -4
  122. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  123. package/lib/messaging/browser/window-connection.js +48 -59
  124. package/lib/messaging/browser/window-connection.js.map +1 -1
  125. package/lib/messaging/client-call-metrics.d.ts +21 -0
  126. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  127. package/lib/messaging/client-call-metrics.js +95 -0
  128. package/lib/messaging/client-call-metrics.js.map +1 -0
  129. package/lib/messaging/error.d.ts +18 -4
  130. package/lib/messaging/error.d.ts.map +1 -1
  131. package/lib/messaging/error.js +38 -7
  132. package/lib/messaging/error.js.map +1 -1
  133. package/lib/messaging/handler.d.ts +10 -0
  134. package/lib/messaging/handler.d.ts.map +1 -1
  135. package/lib/messaging/handler.js +2 -1
  136. package/lib/messaging/handler.js.map +1 -1
  137. package/lib/messaging/node/connection.d.ts +1 -17
  138. package/lib/messaging/node/connection.d.ts.map +1 -1
  139. package/lib/messaging/node/connection.js +24 -59
  140. package/lib/messaging/node/connection.js.map +1 -1
  141. package/lib/messaging/proxy-factory.d.ts +3 -1
  142. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  143. package/lib/messaging/proxy-factory.js +76 -162
  144. package/lib/messaging/proxy-factory.js.map +1 -1
  145. package/lib/oss-allowlist.d.ts +14 -0
  146. package/lib/oss-allowlist.d.ts.map +1 -0
  147. package/lib/oss-allowlist.js +8 -0
  148. package/lib/oss-allowlist.js.map +1 -0
  149. package/lib/payment-protocol.d.ts +18 -0
  150. package/lib/payment-protocol.d.ts.map +1 -0
  151. package/lib/payment-protocol.js +13 -0
  152. package/lib/payment-protocol.js.map +1 -0
  153. package/lib/permission.d.ts +26 -15
  154. package/lib/permission.d.ts.map +1 -1
  155. package/lib/permission.js +50 -36
  156. package/lib/permission.js.map +1 -1
  157. package/lib/plans.d.ts +213 -0
  158. package/lib/plans.d.ts.map +1 -0
  159. package/lib/plans.js +625 -0
  160. package/lib/plans.js.map +1 -0
  161. package/lib/protocol.d.ts +338 -111
  162. package/lib/protocol.d.ts.map +1 -1
  163. package/lib/protocol.js +422 -201
  164. package/lib/protocol.js.map +1 -1
  165. package/lib/protocol.spec.d.ts +7 -0
  166. package/lib/protocol.spec.d.ts.map +1 -0
  167. package/lib/protocol.spec.js +127 -0
  168. package/lib/protocol.spec.js.map +1 -0
  169. package/lib/snapshot-url.d.ts +14 -0
  170. package/lib/snapshot-url.d.ts.map +1 -0
  171. package/lib/snapshot-url.js +26 -0
  172. package/lib/snapshot-url.js.map +1 -0
  173. package/lib/snapshot-url.spec.d.ts +7 -0
  174. package/lib/snapshot-url.spec.d.ts.map +1 -0
  175. package/lib/snapshot-url.spec.js +41 -0
  176. package/lib/snapshot-url.spec.js.map +1 -0
  177. package/lib/team-subscription-protocol.d.ts +93 -0
  178. package/lib/team-subscription-protocol.d.ts.map +1 -0
  179. package/lib/team-subscription-protocol.js +82 -0
  180. package/lib/team-subscription-protocol.js.map +1 -0
  181. package/lib/teams-projects-protocol.d.ts +136 -0
  182. package/lib/teams-projects-protocol.d.ts.map +1 -0
  183. package/lib/teams-projects-protocol.js +41 -0
  184. package/lib/teams-projects-protocol.js.map +1 -0
  185. package/lib/typings/globals.d.ts +8 -3
  186. package/lib/typings/globals.d.ts.map +1 -1
  187. package/lib/typings/globals.js +2 -2
  188. package/lib/usage.d.ts +73 -0
  189. package/lib/usage.d.ts.map +1 -0
  190. package/lib/usage.js +20 -0
  191. package/lib/usage.js.map +1 -0
  192. package/lib/util/analytics.d.ts +8 -0
  193. package/lib/util/analytics.d.ts.map +1 -0
  194. package/lib/util/analytics.js +88 -0
  195. package/lib/util/analytics.js.map +1 -0
  196. package/lib/util/async-iterator.d.ts +2 -2
  197. package/lib/util/async-iterator.d.ts.map +1 -1
  198. package/lib/util/async-iterator.js +60 -137
  199. package/lib/util/async-iterator.js.map +1 -1
  200. package/lib/util/cancelable.d.ts +2 -2
  201. package/lib/util/cancelable.js +20 -61
  202. package/lib/util/cancelable.js.map +1 -1
  203. package/lib/util/date-time.d.ts +2 -2
  204. package/lib/util/date-time.js +14 -13
  205. package/lib/util/date-time.js.map +1 -1
  206. package/lib/util/debug-app.d.ts +25 -0
  207. package/lib/util/debug-app.d.ts.map +1 -0
  208. package/lib/util/debug-app.js +100 -0
  209. package/lib/util/debug-app.js.map +1 -0
  210. package/lib/util/deep-partial.d.ts +2 -2
  211. package/lib/util/deep-partial.js +2 -2
  212. package/lib/util/deferred.d.ts +2 -2
  213. package/lib/util/deferred.js +13 -14
  214. package/lib/util/deferred.js.map +1 -1
  215. package/lib/util/disposable.d.ts +2 -2
  216. package/lib/util/disposable.d.ts.map +1 -1
  217. package/lib/util/disposable.js +28 -40
  218. package/lib/util/disposable.js.map +1 -1
  219. package/lib/util/event.d.ts +1 -1
  220. package/lib/util/event.d.ts.map +1 -1
  221. package/lib/util/event.js +64 -77
  222. package/lib/util/event.js.map +1 -1
  223. package/lib/util/garbage-collected-cache.d.ts +3 -2
  224. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  225. package/lib/util/garbage-collected-cache.js +35 -49
  226. package/lib/util/garbage-collected-cache.js.map +1 -1
  227. package/lib/util/generate-workspace-id.d.ts +9 -0
  228. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  229. package/lib/util/generate-workspace-id.js +491 -0
  230. package/lib/util/generate-workspace-id.js.map +1 -0
  231. package/lib/util/generate-workspace-id.spec.d.ts +7 -0
  232. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  233. package/lib/util/generate-workspace-id.spec.js +98 -0
  234. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  235. package/lib/util/gitpod-cookie.d.ts +20 -0
  236. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  237. package/lib/util/gitpod-cookie.js +41 -0
  238. package/lib/util/gitpod-cookie.js.map +1 -0
  239. package/lib/util/gitpod-host-url.d.ts +20 -8
  240. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  241. package/lib/util/gitpod-host-url.js +143 -85
  242. package/lib/util/gitpod-host-url.js.map +1 -1
  243. package/lib/util/gitpod-host-url.spec.d.ts +16 -0
  244. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
  245. package/lib/util/gitpod-host-url.spec.js +134 -0
  246. package/lib/util/gitpod-host-url.spec.js.map +1 -0
  247. package/lib/util/grpc.d.ts +35 -0
  248. package/lib/util/grpc.d.ts.map +1 -0
  249. package/lib/util/grpc.js +90 -0
  250. package/lib/util/grpc.js.map +1 -0
  251. package/lib/util/jaeger-client-types.d.ts +68 -0
  252. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  253. package/lib/util/jaeger-client-types.js +8 -0
  254. package/lib/util/jaeger-client-types.js.map +1 -0
  255. package/lib/util/logging.d.ts +58 -35
  256. package/lib/util/logging.d.ts.map +1 -1
  257. package/lib/util/logging.js +144 -129
  258. package/lib/util/logging.js.map +1 -1
  259. package/lib/util/logging.spec.d.ts +7 -0
  260. package/lib/util/logging.spec.d.ts.map +1 -0
  261. package/lib/util/logging.spec.js +52 -0
  262. package/lib/util/logging.spec.js.map +1 -0
  263. package/lib/util/make-link.d.ts +2 -2
  264. package/lib/util/make-link.js +8 -7
  265. package/lib/util/make-link.js.map +1 -1
  266. package/lib/util/nice-grpc.d.ts +9 -0
  267. package/lib/util/nice-grpc.d.ts.map +1 -0
  268. package/lib/util/nice-grpc.js +121 -0
  269. package/lib/util/nice-grpc.js.map +1 -0
  270. package/lib/util/parse-workspace-id.d.ts +15 -5
  271. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  272. package/lib/util/parse-workspace-id.js +39 -9
  273. package/lib/util/parse-workspace-id.js.map +1 -1
  274. package/lib/util/parse-workspace-id.spec.d.ts +10 -2
  275. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  276. package/lib/util/parse-workspace-id.spec.js +130 -49
  277. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  278. package/lib/util/queue.d.ts +2 -2
  279. package/lib/util/queue.js +19 -57
  280. package/lib/util/queue.js.map +1 -1
  281. package/lib/util/queue.spec.d.ts +2 -2
  282. package/lib/util/queue.spec.js +149 -288
  283. package/lib/util/queue.spec.js.map +1 -1
  284. package/lib/util/repeat.d.ts +15 -0
  285. package/lib/util/repeat.d.ts.map +1 -0
  286. package/lib/util/repeat.js +55 -0
  287. package/lib/util/repeat.js.map +1 -0
  288. package/lib/util/semaphore.d.ts +2 -2
  289. package/lib/util/semaphore.d.ts.map +1 -1
  290. package/lib/util/semaphore.js +18 -48
  291. package/lib/util/semaphore.js.map +1 -1
  292. package/lib/util/skip-if.d.ts +2 -2
  293. package/lib/util/skip-if.d.ts.map +1 -1
  294. package/lib/util/skip-if.js +9 -8
  295. package/lib/util/skip-if.js.map +1 -1
  296. package/lib/util/timeutil.d.ts +4 -2
  297. package/lib/util/timeutil.d.ts.map +1 -1
  298. package/lib/util/timeutil.js +43 -18
  299. package/lib/util/timeutil.js.map +1 -1
  300. package/lib/util/timeutil.spec.d.ts +4 -2
  301. package/lib/util/timeutil.spec.d.ts.map +1 -1
  302. package/lib/util/timeutil.spec.js +57 -25
  303. package/lib/util/timeutil.spec.js.map +1 -1
  304. package/lib/util/tracing.d.ts +55 -8
  305. package/lib/util/tracing.d.ts.map +1 -1
  306. package/lib/util/tracing.js +210 -66
  307. package/lib/util/tracing.js.map +1 -1
  308. package/lib/util/tracing.spec.d.ts +7 -0
  309. package/lib/util/tracing.spec.d.ts.map +1 -0
  310. package/lib/util/tracing.spec.js +121 -0
  311. package/lib/util/tracing.spec.js.map +1 -0
  312. package/lib/util/workspace-port-authentication.d.ts +9 -9
  313. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  314. package/lib/util/workspace-port-authentication.js +13 -14
  315. package/lib/util/workspace-port-authentication.js.map +1 -1
  316. package/lib/webhook-event.d.ts +44 -0
  317. package/lib/webhook-event.d.ts.map +1 -0
  318. package/lib/webhook-event.js +8 -0
  319. package/lib/webhook-event.js.map +1 -0
  320. package/lib/workspace-class.d.ts +14 -0
  321. package/lib/workspace-class.d.ts.map +1 -0
  322. package/lib/workspace-class.js +8 -0
  323. package/lib/workspace-class.js.map +1 -0
  324. package/lib/workspace-cluster.d.ts +80 -0
  325. package/lib/workspace-cluster.d.ts.map +1 -0
  326. package/lib/workspace-cluster.js +36 -0
  327. package/lib/workspace-cluster.js.map +1 -0
  328. package/lib/workspace-instance.d.ts +51 -8
  329. package/lib/workspace-instance.d.ts.map +1 -1
  330. package/lib/workspace-instance.js +2 -2
  331. package/lib/wsready.d.ts +8 -2
  332. package/lib/wsready.d.ts.map +1 -1
  333. package/lib/wsready.js +4 -3
  334. package/lib/wsready.js.map +1 -1
  335. package/package.json +42 -18
  336. package/pkg-yarn.lock +24 -10
  337. package/provenance-bundle.jsonl +2 -0
  338. package/src/accounting-protocol.ts +253 -0
  339. package/src/admin-protocol.ts +96 -21
  340. package/src/analytics.ts +52 -0
  341. package/src/attribution.ts +67 -0
  342. package/src/auth.ts +27 -0
  343. package/src/billing-mode.ts +84 -0
  344. package/src/blocked-repositories-protocol.ts +13 -0
  345. package/src/context-url.spec.ts +49 -0
  346. package/src/context-url.ts +107 -0
  347. package/src/encryption/container-module.ts +4 -5
  348. package/src/encryption/encryption-engine.spec.ts +11 -10
  349. package/src/encryption/encryption-engine.ts +22 -18
  350. package/src/encryption/encryption-service.ts +6 -7
  351. package/src/encryption/key-provider.ts +18 -21
  352. package/src/env.ts +3 -26
  353. package/src/experiments/always-default.ts +24 -0
  354. package/src/experiments/configcat-server.ts +42 -0
  355. package/src/experiments/configcat.ts +56 -0
  356. package/src/experiments/types.ts +34 -0
  357. package/src/frontend-dashboard-service.ts +148 -0
  358. package/src/gitpod-file-parser.spec.ts +57 -63
  359. package/src/gitpod-file-parser.ts +18 -19
  360. package/src/gitpod-service.ts +602 -99
  361. package/src/headless-workspace-log.ts +14 -16
  362. package/src/ide-frontend-service.ts +28 -0
  363. package/src/ide-protocol.ts +147 -0
  364. package/src/index.ts +18 -12
  365. package/src/installation-admin-protocol.ts +45 -0
  366. package/src/license-protocol.ts +14 -8
  367. package/src/messaging/browser/connection.ts +202 -26
  368. package/src/messaging/browser/window-connection.ts +45 -29
  369. package/src/messaging/client-call-metrics.ts +94 -0
  370. package/src/messaging/error.ts +51 -10
  371. package/src/messaging/handler.ts +13 -1
  372. package/src/messaging/node/connection.ts +23 -70
  373. package/src/messaging/proxy-factory.ts +35 -34
  374. package/src/oss-allowlist.ts +15 -0
  375. package/src/payment-protocol.ts +20 -0
  376. package/src/permission.ts +53 -40
  377. package/src/plans.ts +699 -0
  378. package/src/protocol.spec.ts +97 -0
  379. package/src/protocol.ts +790 -302
  380. package/src/snapshot-url.spec.ts +27 -0
  381. package/src/snapshot-url.ts +27 -0
  382. package/src/team-subscription-protocol.ts +153 -0
  383. package/src/teams-projects-protocol.ts +180 -0
  384. package/src/typings/globals.ts +13 -5
  385. package/src/usage.ts +85 -0
  386. package/src/util/analytics.ts +109 -0
  387. package/src/util/async-iterator.ts +6 -7
  388. package/src/util/cancelable.ts +5 -5
  389. package/src/util/date-time.ts +10 -10
  390. package/src/util/debug-app.ts +81 -0
  391. package/src/util/deep-partial.ts +2 -2
  392. package/src/util/deferred.ts +8 -8
  393. package/src/util/disposable.ts +3 -6
  394. package/src/util/event.ts +9 -11
  395. package/src/util/garbage-collected-cache.ts +18 -10
  396. package/src/util/generate-workspace-id.spec.ts +58 -0
  397. package/src/util/generate-workspace-id.ts +481 -0
  398. package/src/util/gitpod-cookie.ts +38 -0
  399. package/src/util/gitpod-host-url.spec.ts +76 -0
  400. package/src/util/gitpod-host-url.ts +119 -40
  401. package/src/util/grpc.ts +107 -0
  402. package/src/util/jaeger-client-types.ts +102 -0
  403. package/src/util/logging.spec.ts +23 -0
  404. package/src/util/logging.ts +163 -73
  405. package/src/util/make-link.ts +8 -9
  406. package/src/util/nice-grpc.ts +96 -0
  407. package/src/util/parse-workspace-id.spec.ts +62 -12
  408. package/src/util/parse-workspace-id.ts +40 -10
  409. package/src/util/queue.spec.ts +30 -28
  410. package/src/util/queue.ts +2 -2
  411. package/src/util/repeat.ts +45 -0
  412. package/src/util/semaphore.ts +8 -10
  413. package/src/util/skip-if.ts +12 -9
  414. package/src/util/timeutil.spec.ts +42 -16
  415. package/src/util/timeutil.ts +33 -17
  416. package/src/util/tracing.spec.ts +88 -0
  417. package/src/util/tracing.ts +211 -33
  418. package/src/util/workspace-port-authentication.ts +12 -15
  419. package/src/webhook-event.ts +55 -0
  420. package/src/workspace-class.ts +14 -0
  421. package/src/workspace-cluster.ts +121 -0
  422. package/src/workspace-instance.ts +120 -36
  423. package/src/wsready.ts +11 -4
  424. package/data/builtin-theia-plugins.json +0 -362
  425. package/lib/email-protocol.d.ts +0 -49
  426. package/lib/email-protocol.d.ts.map +0 -1
  427. package/lib/email-protocol.js +0 -27
  428. package/lib/email-protocol.js.map +0 -1
  429. package/lib/messaging/connection-error-handler.d.ts +0 -27
  430. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  431. package/lib/messaging/connection-error-handler.js +0 -45
  432. package/lib/messaging/connection-error-handler.js.map +0 -1
  433. package/lib/theia-plugins.d.ts +0 -11
  434. package/lib/theia-plugins.d.ts.map +0 -1
  435. package/lib/theia-plugins.js +0 -8
  436. package/lib/theia-plugins.js.map +0 -1
  437. package/lib/util/repeater.d.ts +0 -22
  438. package/lib/util/repeater.d.ts.map +0 -1
  439. package/lib/util/repeater.js +0 -117
  440. package/lib/util/repeater.js.map +0 -1
  441. package/lib/util/safe-promise.d.ts +0 -11
  442. package/lib/util/safe-promise.d.ts.map +0 -1
  443. package/lib/util/safe-promise.js +0 -33
  444. package/lib/util/safe-promise.js.map +0 -1
  445. package/lib/util/without.d.ts +0 -7
  446. package/lib/util/without.d.ts.map +0 -1
  447. package/lib/util/without.js +0 -8
  448. package/lib/util/without.js.map +0 -1
  449. package/src/email-protocol.ts +0 -67
  450. package/src/messaging/connection-error-handler.ts +0 -62
  451. package/src/theia-plugins.ts +0 -11
  452. package/src/util/jaeger-client.d.ts +0 -105
  453. package/src/util/repeater.ts +0 -49
  454. package/src/util/safe-promise.ts +0 -26
  455. package/src/util/without.ts +0 -8
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License.AGPL.txt in the project root for license information.
6
+ */
7
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
8
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
9
+ var m = o[Symbol.asyncIterator], i;
10
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
11
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
12
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
13
+ };
14
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
15
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
16
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
17
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
18
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
19
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
20
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
21
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
22
+ function fulfill(value) { resume("next", value); }
23
+ function reject(value) { resume("throw", value); }
24
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
25
+ };
26
+ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
27
+ var i, p;
28
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
29
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.prometheusClientMiddleware = void 0;
33
+ const abort_controller_x_1 = require("abort-controller-x");
34
+ const nice_grpc_common_1 = require("nice-grpc-common");
35
+ function getLabels(method) {
36
+ const callType = method.requestStream
37
+ ? method.responseStream
38
+ ? "bidi_stream"
39
+ : "client_stream"
40
+ : method.responseStream
41
+ ? "server_stream"
42
+ : "unary";
43
+ const { path } = method;
44
+ const [serviceName, methodName] = path.split("/").slice(1);
45
+ return {
46
+ type: callType,
47
+ service: serviceName,
48
+ method: methodName,
49
+ };
50
+ }
51
+ function incrementStreamMessagesCounter(iterable, callback) {
52
+ return __asyncGenerator(this, arguments, function* incrementStreamMessagesCounter_1() {
53
+ var e_1, _a;
54
+ try {
55
+ for (var iterable_1 = __asyncValues(iterable), iterable_1_1; iterable_1_1 = yield __await(iterable_1.next()), !iterable_1_1.done;) {
56
+ const item = iterable_1_1.value;
57
+ callback();
58
+ yield yield __await(item);
59
+ }
60
+ }
61
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
62
+ finally {
63
+ try {
64
+ if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) yield __await(_a.call(iterable_1));
65
+ }
66
+ finally { if (e_1) throw e_1.error; }
67
+ }
68
+ });
69
+ }
70
+ function prometheusClientMiddleware(metrics) {
71
+ return function prometheusClientMiddlewareGenerator(call, options) {
72
+ return __asyncGenerator(this, arguments, function* prometheusClientMiddlewareGenerator_1() {
73
+ const labels = getLabels(call.method);
74
+ metrics.started(labels);
75
+ const stopTimer = metrics.startHandleTimer(labels);
76
+ let settled = false;
77
+ let status = nice_grpc_common_1.Status.OK;
78
+ try {
79
+ let request;
80
+ if (!call.requestStream) {
81
+ request = call.request;
82
+ }
83
+ else {
84
+ request = incrementStreamMessagesCounter(call.request, metrics.sent.bind(metrics, labels));
85
+ }
86
+ if (!call.responseStream) {
87
+ const response = yield __await(yield* __asyncDelegator(__asyncValues(call.next(request, options))));
88
+ settled = true;
89
+ return yield __await(response);
90
+ }
91
+ else {
92
+ yield __await(yield* __asyncDelegator(__asyncValues(incrementStreamMessagesCounter(call.next(request, options), metrics.received.bind(metrics, labels)))));
93
+ settled = true;
94
+ return yield __await(void 0);
95
+ }
96
+ }
97
+ catch (err) {
98
+ settled = true;
99
+ if (err instanceof nice_grpc_common_1.ClientError) {
100
+ status = err.code;
101
+ }
102
+ else if ((0, abort_controller_x_1.isAbortError)(err)) {
103
+ status = nice_grpc_common_1.Status.CANCELLED;
104
+ }
105
+ else {
106
+ status = nice_grpc_common_1.Status.UNKNOWN;
107
+ }
108
+ throw err;
109
+ }
110
+ finally {
111
+ if (!settled) {
112
+ status = nice_grpc_common_1.Status.CANCELLED;
113
+ }
114
+ stopTimer({ grpc_code: nice_grpc_common_1.Status[status] });
115
+ metrics.handled(Object.assign(Object.assign({}, labels), { code: nice_grpc_common_1.Status[status] }));
116
+ }
117
+ });
118
+ };
119
+ }
120
+ exports.prometheusClientMiddleware = prometheusClientMiddleware;
121
+ //# sourceMappingURL=nice-grpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nice-grpc.js","sourceRoot":"","sources":["../../src/util/nice-grpc.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2DAAkD;AAClD,uDAO0B;AAG1B,SAAS,SAAS,CAAC,MAAwB;IACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa;QACjC,CAAC,CAAC,MAA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14 +1,24 @@
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
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  /**
7
7
  * Hostname may be of the form:
8
- * - b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io
9
- * - 1234-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io
10
- * - webview-1234-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io (or any other string replacing webview)
8
+ * - moccasin-ferret-155799b3.ws-eu01.gitpod.io
9
+ * - 1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io
10
+ * - webview-1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io (or any other string replacing webview)
11
11
  * @param hostname The hostname the request is headed to
12
12
  */
13
13
  export declare const parseWorkspaceIdFromHostname: (hostname: string) => string | undefined;
14
+ /**
15
+ * @param maybeId
16
+ * @returns
17
+ */
18
+ export declare const matchesInstanceIdOrLegacyWorkspaceIdExactly: (maybeId: string) => boolean;
19
+ /**
20
+ * @param maybeWorkspaceId
21
+ * @returns
22
+ */
23
+ export declare const matchesNewWorkspaceIdExactly: (maybeWorkspaceId: string) => boolean;
14
24
  //# sourceMappingURL=parse-workspace-id.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-workspace-id.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,0CASxC,CAAA"}
1
+ {"version":3,"file":"parse-workspace-id.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,aAAuB,MAAM,uBAWrE,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,2CAA2C,YAAsB,MAAM,KAAG,OAEtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qBAA+B,MAAM,KAAG,OAEhF,CAAC"}
@@ -1,26 +1,56 @@
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
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.matchesNewWorkspaceIdExactly = exports.matchesInstanceIdOrLegacyWorkspaceIdExactly = exports.parseWorkspaceIdFromHostname = void 0;
9
+ const REGEX_WORKSPACE_ID = /[0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}/;
10
+ const REGEX_WORKSPACE_ID_EXACT = new RegExp(`^${REGEX_WORKSPACE_ID.source}$`);
11
+ // We need to parse the workspace id precisely here to get the case '<some-str>-<port>-<wsid>.ws.' right
12
+ const REGEX_WORKSPACE_ID_FROM_HOSTNAME = new RegExp(`(${REGEX_WORKSPACE_ID.source})\.ws`);
13
+ const REGEX_WORKSPACE_ID_LEGACY = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
14
+ const REGEX_WORKSPACE_ID_LEGACY_EXACT = new RegExp(`^${REGEX_WORKSPACE_ID_LEGACY.source}$`);
15
+ const REGEX_WORKSPACE_ID_LEGACY_FROM_HOSTNAME = new RegExp(`(${REGEX_WORKSPACE_ID_LEGACY.source})\.ws`);
8
16
  /**
9
17
  * Hostname may be of the form:
10
- * - b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io
11
- * - 1234-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io
12
- * - webview-1234-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io (or any other string replacing webview)
18
+ * - moccasin-ferret-155799b3.ws-eu01.gitpod.io
19
+ * - 1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io
20
+ * - webview-1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io (or any other string replacing webview)
13
21
  * @param hostname The hostname the request is headed to
14
22
  */
15
- exports.parseWorkspaceIdFromHostname = function (hostname) {
16
- // We need to parse the workspace id precisely here to get the case '<some-str>-<port>-<wsid>.ws.' right
17
- var wsIdExpression = /([a-z][0-9a-z]+\-([0-9a-z]+\-){3}[0-9a-z]+)\.ws/g;
18
- var match = wsIdExpression.exec(hostname);
23
+ const parseWorkspaceIdFromHostname = function (hostname) {
24
+ const match = REGEX_WORKSPACE_ID_FROM_HOSTNAME.exec(hostname);
19
25
  if (match && match.length >= 2) {
20
26
  return match[1];
21
27
  }
22
28
  else {
29
+ const legacyMatch = REGEX_WORKSPACE_ID_LEGACY_FROM_HOSTNAME.exec(hostname);
30
+ if (legacyMatch && legacyMatch.length >= 2) {
31
+ return legacyMatch[1];
32
+ }
23
33
  return undefined;
24
34
  }
25
35
  };
36
+ exports.parseWorkspaceIdFromHostname = parseWorkspaceIdFromHostname;
37
+ /** Equalls UUIDv4 (and REGEX_WORKSPACE_ID_LEGACY!) */
38
+ const REGEX_INSTANCE_ID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
39
+ const REGEX_INSTANCE_ID_EXACT = new RegExp(`^${REGEX_INSTANCE_ID.source}$`);
40
+ /**
41
+ * @param maybeId
42
+ * @returns
43
+ */
44
+ const matchesInstanceIdOrLegacyWorkspaceIdExactly = function (maybeId) {
45
+ return REGEX_INSTANCE_ID_EXACT.test(maybeId) || REGEX_WORKSPACE_ID_LEGACY_EXACT.test(maybeId);
46
+ };
47
+ exports.matchesInstanceIdOrLegacyWorkspaceIdExactly = matchesInstanceIdOrLegacyWorkspaceIdExactly;
48
+ /**
49
+ * @param maybeWorkspaceId
50
+ * @returns
51
+ */
52
+ const matchesNewWorkspaceIdExactly = function (maybeWorkspaceId) {
53
+ return REGEX_WORKSPACE_ID_EXACT.test(maybeWorkspaceId);
54
+ };
55
+ exports.matchesNewWorkspaceIdExactly = matchesNewWorkspaceIdExactly;
26
56
  //# sourceMappingURL=parse-workspace-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-workspace-id.js","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAGH;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,UAAS,QAAgB;IACjE,wGAAwG;IACxG,IAAM,cAAc,GAAG,kDAAkD,CAAC;IAC1E,IAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;QAC5B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;KACnB;SAAM;QACH,OAAO,SAAS,CAAC;KACpB;AACL,CAAC,CAAA"}
1
+ {"version":3,"file":"parse-workspace-id.js","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,MAAM,kBAAkB,GAAG,8CAA8C,CAAC;AAC1E,MAAM,wBAAwB,GAAG,IAAI,MAAM,CAAC,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9E,wGAAwG;AACxG,MAAM,gCAAgC,GAAG,IAAI,MAAM,CAAC,IAAI,kBAAkB,CAAC,MAAM,OAAO,CAAC,CAAC;AAE1F,MAAM,yBAAyB,GAAG,8DAA8D,CAAC;AACjG,MAAM,+BAA+B,GAAG,IAAI,MAAM,CAAC,IAAI,yBAAyB,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5F,MAAM,uCAAuC,GAAG,IAAI,MAAM,CAAC,IAAI,yBAAyB,CAAC,MAAM,OAAO,CAAC,CAAC;AAExG;;;;;;GAMG;AACI,MAAM,4BAA4B,GAAG,UAAU,QAAgB;IAClE,MAAM,KAAK,GAAG,gCAAgC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9D,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;QAC5B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;KACnB;SAAM;QACH,MAAM,WAAW,GAAG,uCAAuC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3E,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,EAAE;YACxC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,OAAO,SAAS,CAAC;KACpB;AACL,CAAC,CAAC;AAXW,QAAA,4BAA4B,gCAWvC;AAEF,sDAAsD;AACtD,MAAM,iBAAiB,GAAG,8DAA8D,CAAC;AACzF,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;AAE5E;;;GAGG;AACI,MAAM,2CAA2C,GAAG,UAAU,OAAe;IAChF,OAAO,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClG,CAAC,CAAC;AAFW,QAAA,2CAA2C,+CAEtD;AAEF;;;GAGG;AACI,MAAM,4BAA4B,GAAG,UAAU,gBAAwB;IAC1E,OAAO,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC,CAAC;AAFW,QAAA,4BAA4B,gCAEvC"}
@@ -1,12 +1,20 @@
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
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  export declare class ParseWorkspaceIdTest {
7
7
  parseWorkspaceIdFromHostname_fromWorkspaceLocation(): void;
8
8
  parseWorkspaceIdFromHostname_fromWorkspacePortLocation(): void;
9
9
  parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix(): void;
10
10
  parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost(): void;
11
+ parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation(): void;
12
+ parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation(): void;
13
+ parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix(): void;
14
+ parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost(): void;
15
+ matchesInstanceIdOrLegacyWorkspaceIdExactly_positive(): void;
16
+ matchesInstanceIdOrLegacyWorkspaceIdExactly_negative(): void;
17
+ matchesWorkspaceIdExactly_new_positive(): void;
18
+ matchesWorkspaceIdExactly_new_negative(): void;
11
19
  }
12
20
  //# sourceMappingURL=parse-workspace-id.spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-workspace-id.spec.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,qBACa,oBAAoB;IAEhB,kDAAkD;IAKlD,sDAAsD;IAKtD,uEAAuE;IAKvE,iFAAiF;CAIjG"}
1
+ {"version":3,"file":"parse-workspace-id.spec.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,qBACa,oBAAoB;IAChB,kDAAkD;IAKlD,sDAAsD;IAKtD,uEAAuE;IAKvE,iFAAiF;IAQjF,wDAAwD;IAKxD,4DAA4D;IAK5D,6EAA6E;IAO7E,uFAAuF;IAQvF,oDAAoD;IAIpD,oDAAoD;IAMpD,sCAAsC;IAItC,sCAAsC;CAItD"}
@@ -1,8 +1,8 @@
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
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -14,58 +14,139 @@ var __metadata = (this && this.__metadata) || function (k, v) {
14
14
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var chai = require("chai");
18
- var mocha_typescript_1 = require("mocha-typescript");
19
- var parse_workspace_id_1 = require("./parse-workspace-id");
20
- var expect = chai.expect;
21
- var ParseWorkspaceIdTest = /** @class */ (function () {
22
- function ParseWorkspaceIdTest() {
17
+ exports.ParseWorkspaceIdTest = void 0;
18
+ const chai = require("chai");
19
+ const mocha_typescript_1 = require("mocha-typescript");
20
+ const parse_workspace_id_1 = require("./parse-workspace-id");
21
+ const expect = chai.expect;
22
+ let ParseWorkspaceIdTest = class ParseWorkspaceIdTest {
23
+ parseWorkspaceIdFromHostname_fromWorkspaceLocation() {
24
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("moccasin-ferret-155799b3.ws-eu01.gitpod.io");
25
+ expect(actual).to.equal("moccasin-ferret-155799b3");
23
26
  }
24
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspaceLocation = function () {
25
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
27
+ parseWorkspaceIdFromHostname_fromWorkspacePortLocation() {
28
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
29
+ expect(actual).to.equal("moccasin-ferret-155799b3");
30
+ }
31
+ parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix() {
32
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
33
+ expect(actual).to.equal("moccasin-ferret-155799b3");
34
+ }
35
+ parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost() {
36
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-moccasin-ferret-155799b3.ws-eu01.some.subdomain.somehost.com");
37
+ expect(actual).to.equal("moccasin-ferret-155799b3");
38
+ }
39
+ // legacy mode
40
+ parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation() {
41
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
26
42
  expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
27
- };
28
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspacePortLocation = function () {
29
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
43
+ }
44
+ parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation() {
45
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
30
46
  expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
31
- };
32
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix = function () {
33
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("webview-3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
47
+ }
48
+ parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix() {
49
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
34
50
  expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
35
- };
36
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost = function () {
37
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("webview-3000-ca81a50f-09d7-465c-acd9-264a747d5351.ws-eu01.some.subdomain.somehost.com");
51
+ }
52
+ parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost() {
53
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-ca81a50f-09d7-465c-acd9-264a747d5351.ws-eu01.some.subdomain.somehost.com");
38
54
  expect(actual).to.equal("ca81a50f-09d7-465c-acd9-264a747d5351");
39
- };
40
- __decorate([
41
- mocha_typescript_1.test,
42
- __metadata("design:type", Function),
43
- __metadata("design:paramtypes", []),
44
- __metadata("design:returntype", void 0)
45
- ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspaceLocation", null);
46
- __decorate([
47
- mocha_typescript_1.test,
48
- __metadata("design:type", Function),
49
- __metadata("design:paramtypes", []),
50
- __metadata("design:returntype", void 0)
51
- ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocation", null);
52
- __decorate([
53
- mocha_typescript_1.test,
54
- __metadata("design:type", Function),
55
- __metadata("design:paramtypes", []),
56
- __metadata("design:returntype", void 0)
57
- ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix", null);
58
- __decorate([
59
- mocha_typescript_1.test,
60
- __metadata("design:type", Function),
61
- __metadata("design:paramtypes", []),
62
- __metadata("design:returntype", void 0)
63
- ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost", null);
64
- ParseWorkspaceIdTest = __decorate([
65
- mocha_typescript_1.suite
66
- ], ParseWorkspaceIdTest);
67
- return ParseWorkspaceIdTest;
68
- }());
55
+ }
56
+ // match - instance ID
57
+ matchesInstanceIdOrLegacyWorkspaceIdExactly_positive() {
58
+ const actual = (0, parse_workspace_id_1.matchesInstanceIdOrLegacyWorkspaceIdExactly)("b7e0eaf8-ec73-44ec-81ea-04859263b656");
59
+ expect(actual).to.be.true;
60
+ }
61
+ matchesInstanceIdOrLegacyWorkspaceIdExactly_negative() {
62
+ const actual = (0, parse_workspace_id_1.matchesInstanceIdOrLegacyWorkspaceIdExactly)("b7e0eaf8-ec73-44ec-81a-04859263b656");
63
+ expect(actual).to.be.false;
64
+ }
65
+ // match - new workspace ID
66
+ matchesWorkspaceIdExactly_new_positive() {
67
+ const actual = (0, parse_workspace_id_1.matchesNewWorkspaceIdExactly)("moccasin-ferret-155799b3");
68
+ expect(actual).to.be.true;
69
+ }
70
+ matchesWorkspaceIdExactly_new_negative() {
71
+ const actual = (0, parse_workspace_id_1.matchesNewWorkspaceIdExactly)("moccasin-ferret-15599b3");
72
+ expect(actual).to.be.false;
73
+ }
74
+ };
75
+ __decorate([
76
+ mocha_typescript_1.test,
77
+ __metadata("design:type", Function),
78
+ __metadata("design:paramtypes", []),
79
+ __metadata("design:returntype", void 0)
80
+ ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspaceLocation", null);
81
+ __decorate([
82
+ mocha_typescript_1.test,
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", []),
85
+ __metadata("design:returntype", void 0)
86
+ ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocation", null);
87
+ __decorate([
88
+ mocha_typescript_1.test,
89
+ __metadata("design:type", Function),
90
+ __metadata("design:paramtypes", []),
91
+ __metadata("design:returntype", void 0)
92
+ ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix", null);
93
+ __decorate([
94
+ mocha_typescript_1.test,
95
+ __metadata("design:type", Function),
96
+ __metadata("design:paramtypes", []),
97
+ __metadata("design:returntype", void 0)
98
+ ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost", null);
99
+ __decorate([
100
+ mocha_typescript_1.test,
101
+ __metadata("design:type", Function),
102
+ __metadata("design:paramtypes", []),
103
+ __metadata("design:returntype", void 0)
104
+ ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation", null);
105
+ __decorate([
106
+ mocha_typescript_1.test,
107
+ __metadata("design:type", Function),
108
+ __metadata("design:paramtypes", []),
109
+ __metadata("design:returntype", void 0)
110
+ ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation", null);
111
+ __decorate([
112
+ mocha_typescript_1.test,
113
+ __metadata("design:type", Function),
114
+ __metadata("design:paramtypes", []),
115
+ __metadata("design:returntype", void 0)
116
+ ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix", null);
117
+ __decorate([
118
+ mocha_typescript_1.test,
119
+ __metadata("design:type", Function),
120
+ __metadata("design:paramtypes", []),
121
+ __metadata("design:returntype", void 0)
122
+ ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost", null);
123
+ __decorate([
124
+ mocha_typescript_1.test,
125
+ __metadata("design:type", Function),
126
+ __metadata("design:paramtypes", []),
127
+ __metadata("design:returntype", void 0)
128
+ ], ParseWorkspaceIdTest.prototype, "matchesInstanceIdOrLegacyWorkspaceIdExactly_positive", null);
129
+ __decorate([
130
+ mocha_typescript_1.test,
131
+ __metadata("design:type", Function),
132
+ __metadata("design:paramtypes", []),
133
+ __metadata("design:returntype", void 0)
134
+ ], ParseWorkspaceIdTest.prototype, "matchesInstanceIdOrLegacyWorkspaceIdExactly_negative", null);
135
+ __decorate([
136
+ mocha_typescript_1.test,
137
+ __metadata("design:type", Function),
138
+ __metadata("design:paramtypes", []),
139
+ __metadata("design:returntype", void 0)
140
+ ], ParseWorkspaceIdTest.prototype, "matchesWorkspaceIdExactly_new_positive", null);
141
+ __decorate([
142
+ mocha_typescript_1.test,
143
+ __metadata("design:type", Function),
144
+ __metadata("design:paramtypes", []),
145
+ __metadata("design:returntype", void 0)
146
+ ], ParseWorkspaceIdTest.prototype, "matchesWorkspaceIdExactly_new_negative", null);
147
+ ParseWorkspaceIdTest = __decorate([
148
+ mocha_typescript_1.suite
149
+ ], ParseWorkspaceIdTest);
69
150
  exports.ParseWorkspaceIdTest = ParseWorkspaceIdTest;
70
151
  module.exports = new ParseWorkspaceIdTest();
71
152
  //# sourceMappingURL=parse-workspace-id.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-workspace-id.spec.js","sourceRoot":"","sources":["../../src/util/parse-workspace-id.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AAEH,2BAA6B;AAC7B,qDAA+C;AAC/C,2DAAoE;AACpE,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B;IAAA;IAqBA,CAAC;IAnBgB,iFAAkD,GAAzD;QACF,IAAM,MAAM,GAAG,iDAA4B,CAAC,wDAAwD,CAAC,CAAC;QACtG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACpE,CAAC;IAEY,qFAAsD,GAA7D;QACF,IAAM,MAAM,GAAG,iDAA4B,CAAC,6DAA6D,CAAC,CAAC;QAC3G,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sCAAsC,CAAC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C9B,CAAC;IACY,oDAAoD;QAC7D,MAAM,MAAM,GAAG,IAAA,gEAA2C,EAAC,qCAAqC,CAAC,CAAC;QAClG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAC/B,CAAC;IAED,2BAA2B;IACd,sCAAsC;QAC/C,MAAM,MAAM,GAAG,IAAA,iDAA4B,EAAC,0BAA0B,CAAC,CAAC;QACxE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAC9B,CAAC;IACY,sCAAsC;QAC/C,MAAM,MAAM,GAAG,IAAA,iDAA4B,EAAC,yBAAyB,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAC/B,CAAC;CACJ,CAAA;AAlES;IAAL,uBAAI;;;;8FAGJ;AAEK;IAAL,uBAAI;;;;kGAGJ;AAEK;IAAL,uBAAI;;;;mHAGJ;AAEK;IAAL,uBAAI;;;;6HAKJ;AAGK;IAAL,uBAAI;;;;oGAGJ;AAEK;IAAL,uBAAI;;;;wGAGJ;AAEK;IAAL,uBAAI;;;;yHAKJ;AAEK;IAAL,uBAAI;;;;mIAKJ;AAGK;IAAL,uBAAI;;;;gGAGJ;AACK;IAAL,uBAAI;;;;gGAGJ;AAGK;IAAL,uBAAI;;;;kFAGJ;AACK;IAAL,uBAAI;;;;kFAGJ;AAlEQ,oBAAoB;IADhC,wBAAK;GACO,oBAAoB,CAmEhC;AAnEY,oDAAoB;AAoEjC,MAAM,CAAC,OAAO,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
@@ -1,7 +1,7 @@
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
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  /**
7
7
  * Queues asynchronous operations in a synchronous context
package/lib/util/queue.js CHANGED
@@ -1,8 +1,8 @@
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
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
8
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -13,67 +13,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  step((generator = generator.apply(thisArg, _arguments || [])).next());
14
14
  });
15
15
  };
16
- var __generator = (this && this.__generator) || function (thisArg, body) {
17
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
18
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
19
- function verb(n) { return function (v) { return step([n, v]); }; }
20
- function step(op) {
21
- if (f) throw new TypeError("Generator is already executing.");
22
- while (_) try {
23
- 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;
24
- if (y = 0, t) op = [op[0] & 2, t.value];
25
- switch (op[0]) {
26
- case 0: case 1: t = op; break;
27
- case 4: _.label++; return { value: op[1], done: false };
28
- case 5: _.label++; y = op[1]; op = [0]; continue;
29
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
30
- default:
31
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
32
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
33
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
34
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
35
- if (t[2]) _.ops.pop();
36
- _.trys.pop(); continue;
37
- }
38
- op = body.call(thisArg, _);
39
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
40
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
41
- }
42
- };
43
16
  Object.defineProperty(exports, "__esModule", { value: true });
44
- var deferred_1 = require("./deferred");
17
+ exports.Queue = void 0;
18
+ const deferred_1 = require("./deferred");
45
19
  /**
46
20
  * Queues asynchronous operations in a synchronous context
47
21
  */
48
- var Queue = /** @class */ (function () {
49
- function Queue() {
22
+ class Queue {
23
+ constructor() {
50
24
  this.queue = Promise.resolve();
51
25
  }
52
- Queue.prototype.enqueue = function (operation) {
53
- var _this = this;
54
- var enqueue = new deferred_1.Deferred();
55
- this.queue = this.queue.then(function () { return __awaiter(_this, void 0, void 0, function () {
56
- var result, err_1;
57
- return __generator(this, function (_a) {
58
- switch (_a.label) {
59
- case 0:
60
- _a.trys.push([0, 2, , 3]);
61
- return [4 /*yield*/, operation()];
62
- case 1:
63
- result = _a.sent();
64
- enqueue.resolve(result);
65
- return [3 /*break*/, 3];
66
- case 2:
67
- err_1 = _a.sent();
68
- enqueue.reject(err_1);
69
- return [3 /*break*/, 3];
70
- case 3: return [2 /*return*/];
71
- }
72
- });
73
- }); });
26
+ enqueue(operation) {
27
+ const enqueue = new deferred_1.Deferred();
28
+ this.queue = this.queue.then(() => __awaiter(this, void 0, void 0, function* () {
29
+ try {
30
+ const result = yield operation();
31
+ enqueue.resolve(result);
32
+ }
33
+ catch (err) {
34
+ enqueue.reject(err);
35
+ }
36
+ }));
74
37
  return enqueue.promise;
75
- };
76
- return Queue;
77
- }());
38
+ }
39
+ }
78
40
  exports.Queue = Queue;
79
41
  //# sourceMappingURL=queue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/util/queue.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAsC;AAEtC;;GAEG;AACH;IAAA;QACc,UAAK,GAAiB,OAAO,CAAC,OAAO,EAAE,CAAC;IActD,CAAC;IAZG,uBAAO,GAAP,UAAW,SAA2B;QAAtC,iBAWC;QAVG,IAAM,OAAO,GAAG,IAAI,mBAAQ,EAAK,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;;;;;;wBAEN,qBAAM,SAAS,EAAE,EAAA;;wBAA1B,MAAM,GAAG,SAAiB;wBAChC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;;;;wBAExB,OAAO,CAAC,MAAM,CAAC,KAAG,CAAC,CAAC;;;;;aAE3B,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC;IAC3B,CAAC;IACL,YAAC;AAAD,CAAC,AAfD,IAeC;AAfY,sBAAK"}
1
+ {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/util/queue.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,yCAAsC;AAEtC;;GAEG;AACH,MAAa,KAAK;IAAlB;QACc,UAAK,GAAiB,OAAO,CAAC,OAAO,EAAE,CAAC;IActD,CAAC;IAZG,OAAO,CAAI,SAA2B;QAClC,MAAM,OAAO,GAAG,IAAI,mBAAQ,EAAK,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAS,EAAE;YACpC,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;gBACjC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aAC3B;YAAC,OAAO,GAAG,EAAE;gBACV,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aACvB;QACL,CAAC,CAAA,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC;IAC3B,CAAC;CACJ;AAfD,sBAeC"}
@@ -1,7 +1,7 @@
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
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  export {};
7
7
  //# sourceMappingURL=queue.spec.d.ts.map