@gitpod/gitpod-protocol 0.1.5-main.648 → 0.1.5-main.6480

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 +157 -29
  2. package/lib/accounting-protocol.d.ts +19 -14
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +44 -48
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +44 -5
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +16 -1
  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 +24 -0
  15. package/lib/attribution.d.ts.map +1 -0
  16. package/lib/attribution.js +54 -0
  17. package/lib/attribution.js.map +1 -0
  18. package/lib/auth.d.ts +1 -1
  19. package/lib/auth.d.ts.map +1 -1
  20. package/lib/auth.js +1 -1
  21. package/lib/billing-mode.d.ts +45 -0
  22. package/lib/billing-mode.d.ts.map +1 -0
  23. package/lib/billing-mode.js +44 -0
  24. package/lib/billing-mode.js.map +1 -0
  25. package/lib/blocked-repositories-protocol.d.ts +13 -0
  26. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  27. package/lib/blocked-repositories-protocol.js +8 -0
  28. package/lib/blocked-repositories-protocol.js.map +1 -0
  29. package/lib/context-url.d.ts +30 -0
  30. package/lib/context-url.d.ts.map +1 -0
  31. package/lib/context-url.js +100 -0
  32. package/lib/context-url.js.map +1 -0
  33. package/lib/context-url.spec.d.ts +12 -0
  34. package/lib/context-url.spec.d.ts.map +1 -0
  35. package/lib/context-url.spec.js +81 -0
  36. package/lib/context-url.spec.js.map +1 -0
  37. package/lib/encryption/container-module.d.ts +1 -1
  38. package/lib/encryption/container-module.d.ts.map +1 -1
  39. package/lib/encryption/container-module.js +5 -5
  40. package/lib/encryption/container-module.js.map +1 -1
  41. package/lib/encryption/encryption-engine.d.ts +1 -1
  42. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  43. package/lib/encryption/encryption-engine.js +26 -27
  44. package/lib/encryption/encryption-engine.js.map +1 -1
  45. package/lib/encryption/encryption-engine.spec.d.ts +1 -1
  46. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  47. package/lib/encryption/encryption-engine.spec.js +30 -38
  48. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  49. package/lib/encryption/encryption-service.d.ts +1 -1
  50. package/lib/encryption/encryption-service.d.ts.map +1 -1
  51. package/lib/encryption/encryption-service.js +31 -45
  52. package/lib/encryption/encryption-service.js.map +1 -1
  53. package/lib/encryption/key-provider.d.ts +1 -1
  54. package/lib/encryption/key-provider.d.ts.map +1 -1
  55. package/lib/encryption/key-provider.js +32 -39
  56. package/lib/encryption/key-provider.js.map +1 -1
  57. package/lib/env.d.ts +1 -7
  58. package/lib/env.d.ts.map +1 -1
  59. package/lib/env.js +8 -28
  60. package/lib/env.js.map +1 -1
  61. package/lib/experiments/always-default.d.ts +8 -0
  62. package/lib/experiments/always-default.d.ts.map +1 -0
  63. package/lib/experiments/always-default.js +20 -0
  64. package/lib/experiments/always-default.js.map +1 -0
  65. package/lib/experiments/configcat-server.d.ts +10 -0
  66. package/lib/experiments/configcat-server.d.ts.map +1 -0
  67. package/lib/experiments/configcat-server.js +37 -0
  68. package/lib/experiments/configcat-server.js.map +1 -0
  69. package/lib/experiments/configcat.d.ts +21 -0
  70. package/lib/experiments/configcat.d.ts.map +1 -0
  71. package/lib/experiments/configcat.js +51 -0
  72. package/lib/experiments/configcat.js.map +1 -0
  73. package/lib/experiments/types.d.ts +22 -0
  74. package/lib/experiments/types.d.ts.map +1 -0
  75. package/lib/experiments/types.js +10 -0
  76. package/lib/experiments/types.js.map +1 -0
  77. package/lib/frontend-dashboard-service.d.ts +90 -0
  78. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  79. package/lib/frontend-dashboard-service.js +49 -0
  80. package/lib/frontend-dashboard-service.js.map +1 -0
  81. package/lib/gitpod-file-parser.d.ts +1 -1
  82. package/lib/gitpod-file-parser.d.ts.map +1 -1
  83. package/lib/gitpod-file-parser.js +27 -43
  84. package/lib/gitpod-file-parser.js.map +1 -1
  85. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  86. package/lib/gitpod-file-parser.spec.js +146 -143
  87. package/lib/gitpod-file-parser.spec.js.map +1 -1
  88. package/lib/gitpod-service.d.ts +191 -55
  89. package/lib/gitpod-service.d.ts.map +1 -1
  90. package/lib/gitpod-service.js +204 -298
  91. package/lib/gitpod-service.js.map +1 -1
  92. package/lib/headless-workspace-log.d.ts +10 -12
  93. package/lib/headless-workspace-log.d.ts.map +1 -1
  94. package/lib/headless-workspace-log.js +7 -9
  95. package/lib/headless-workspace-log.js.map +1 -1
  96. package/lib/ide-frontend-service.d.ts +2 -2
  97. package/lib/ide-frontend-service.js +1 -1
  98. package/lib/ide-protocol.d.ts +126 -0
  99. package/lib/ide-protocol.d.ts.map +1 -0
  100. package/lib/ide-protocol.js +18 -0
  101. package/lib/ide-protocol.js.map +1 -0
  102. package/lib/index.d.ts +17 -11
  103. package/lib/index.d.ts.map +1 -1
  104. package/lib/index.js +8 -2
  105. package/lib/index.js.map +1 -1
  106. package/lib/installation-admin-protocol.d.ts +30 -0
  107. package/lib/installation-admin-protocol.d.ts.map +1 -0
  108. package/lib/installation-admin-protocol.js +31 -0
  109. package/lib/installation-admin-protocol.js.map +1 -0
  110. package/lib/license-protocol.d.ts +8 -1
  111. package/lib/license-protocol.d.ts.map +1 -1
  112. package/lib/license-protocol.js +1 -1
  113. package/lib/license-protocol.js.map +1 -1
  114. package/lib/messaging/browser/connection.d.ts +4 -6
  115. package/lib/messaging/browser/connection.d.ts.map +1 -1
  116. package/lib/messaging/browser/connection.js +176 -45
  117. package/lib/messaging/browser/connection.js.map +1 -1
  118. package/lib/messaging/browser/window-connection.d.ts +5 -5
  119. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  120. package/lib/messaging/browser/window-connection.js +43 -60
  121. package/lib/messaging/browser/window-connection.js.map +1 -1
  122. package/lib/messaging/client-call-metrics.d.ts +21 -0
  123. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  124. package/lib/messaging/client-call-metrics.js +95 -0
  125. package/lib/messaging/client-call-metrics.js.map +1 -0
  126. package/lib/messaging/error.d.ts +13 -3
  127. package/lib/messaging/error.d.ts.map +1 -1
  128. package/lib/messaging/error.js +25 -5
  129. package/lib/messaging/error.js.map +1 -1
  130. package/lib/messaging/handler.d.ts +10 -0
  131. package/lib/messaging/handler.d.ts.map +1 -1
  132. package/lib/messaging/handler.js +1 -1
  133. package/lib/messaging/node/connection.d.ts +1 -17
  134. package/lib/messaging/node/connection.d.ts.map +1 -1
  135. package/lib/messaging/node/connection.js +24 -60
  136. package/lib/messaging/node/connection.js.map +1 -1
  137. package/lib/messaging/proxy-factory.d.ts +3 -1
  138. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  139. package/lib/messaging/proxy-factory.js +75 -162
  140. package/lib/messaging/proxy-factory.js.map +1 -1
  141. package/lib/oss-allowlist.d.ts +14 -0
  142. package/lib/oss-allowlist.d.ts.map +1 -0
  143. package/lib/oss-allowlist.js +8 -0
  144. package/lib/oss-allowlist.js.map +1 -0
  145. package/lib/payment-protocol.d.ts +1 -1
  146. package/lib/payment-protocol.d.ts.map +1 -1
  147. package/lib/payment-protocol.js +2 -2
  148. package/lib/payment-protocol.js.map +1 -1
  149. package/lib/permission.d.ts +14 -4
  150. package/lib/permission.d.ts.map +1 -1
  151. package/lib/permission.js +45 -32
  152. package/lib/permission.js.map +1 -1
  153. package/lib/plans.d.ts +6 -5
  154. package/lib/plans.d.ts.map +1 -1
  155. package/lib/plans.js +230 -210
  156. package/lib/plans.js.map +1 -1
  157. package/lib/protocol.d.ts +261 -105
  158. package/lib/protocol.d.ts.map +1 -1
  159. package/lib/protocol.js +346 -205
  160. package/lib/protocol.js.map +1 -1
  161. package/{src/util/without.ts → lib/protocol.spec.d.ts} +3 -4
  162. package/lib/protocol.spec.d.ts.map +1 -0
  163. package/lib/protocol.spec.js +127 -0
  164. package/lib/protocol.spec.js.map +1 -0
  165. package/lib/snapshot-url.d.ts +14 -0
  166. package/lib/snapshot-url.d.ts.map +1 -0
  167. package/lib/snapshot-url.js +26 -0
  168. package/lib/snapshot-url.js.map +1 -0
  169. package/lib/snapshot-url.spec.d.ts +7 -0
  170. package/lib/snapshot-url.spec.d.ts.map +1 -0
  171. package/lib/snapshot-url.spec.js +41 -0
  172. package/lib/snapshot-url.spec.js.map +1 -0
  173. package/lib/team-subscription-protocol.d.ts +24 -5
  174. package/lib/team-subscription-protocol.d.ts.map +1 -1
  175. package/lib/team-subscription-protocol.js +36 -18
  176. package/lib/team-subscription-protocol.js.map +1 -1
  177. package/lib/teams-projects-protocol.d.ts +137 -0
  178. package/lib/teams-projects-protocol.d.ts.map +1 -0
  179. package/lib/teams-projects-protocol.js +41 -0
  180. package/lib/teams-projects-protocol.js.map +1 -0
  181. package/lib/typings/globals.d.ts +3 -3
  182. package/lib/typings/globals.d.ts.map +1 -1
  183. package/lib/typings/globals.js +1 -1
  184. package/lib/usage.d.ts +73 -0
  185. package/lib/usage.d.ts.map +1 -0
  186. package/lib/usage.js +20 -0
  187. package/lib/usage.js.map +1 -0
  188. package/lib/util/analytics.d.ts +8 -0
  189. package/lib/util/analytics.d.ts.map +1 -0
  190. package/lib/util/analytics.js +88 -0
  191. package/lib/util/analytics.js.map +1 -0
  192. package/lib/util/async-iterator.d.ts +1 -1
  193. package/lib/util/async-iterator.d.ts.map +1 -1
  194. package/lib/util/async-iterator.js +58 -136
  195. package/lib/util/async-iterator.js.map +1 -1
  196. package/lib/util/cancelable.d.ts +1 -1
  197. package/lib/util/cancelable.js +18 -60
  198. package/lib/util/cancelable.js.map +1 -1
  199. package/lib/util/date-time.d.ts +1 -1
  200. package/lib/util/date-time.js +12 -12
  201. package/lib/util/date-time.js.map +1 -1
  202. package/lib/util/debug-app.d.ts +25 -0
  203. package/lib/util/debug-app.d.ts.map +1 -0
  204. package/lib/util/debug-app.js +100 -0
  205. package/lib/util/debug-app.js.map +1 -0
  206. package/lib/util/deep-partial.d.ts +1 -1
  207. package/lib/util/deep-partial.js +1 -1
  208. package/lib/util/deferred.d.ts +1 -1
  209. package/lib/util/deferred.js +11 -13
  210. package/lib/util/deferred.js.map +1 -1
  211. package/lib/util/disposable.d.ts.map +1 -1
  212. package/lib/util/disposable.js +27 -40
  213. package/lib/util/disposable.js.map +1 -1
  214. package/lib/util/event.d.ts.map +1 -1
  215. package/lib/util/event.js +63 -77
  216. package/lib/util/event.js.map +1 -1
  217. package/lib/util/garbage-collected-cache.d.ts +2 -1
  218. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  219. package/lib/util/garbage-collected-cache.js +33 -48
  220. package/lib/util/garbage-collected-cache.js.map +1 -1
  221. package/lib/util/generate-workspace-id.d.ts +6 -1
  222. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  223. package/lib/util/generate-workspace-id.js +469 -502
  224. package/lib/util/generate-workspace-id.js.map +1 -1
  225. package/lib/util/generate-workspace-id.spec.d.ts +1 -1
  226. package/lib/util/generate-workspace-id.spec.js +69 -79
  227. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  228. package/lib/util/gitpod-cookie.d.ts +20 -0
  229. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  230. package/lib/util/gitpod-cookie.js +41 -0
  231. package/lib/util/gitpod-cookie.js.map +1 -0
  232. package/lib/util/gitpod-host-url.d.ts +12 -7
  233. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  234. package/lib/util/gitpod-host-url.js +132 -110
  235. package/lib/util/gitpod-host-url.js.map +1 -1
  236. package/lib/util/gitpod-host-url.spec.d.ts +7 -1
  237. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  238. package/lib/util/gitpod-host-url.spec.js +113 -31
  239. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  240. package/lib/util/grpc.d.ts +35 -0
  241. package/lib/util/grpc.d.ts.map +1 -0
  242. package/lib/util/grpc.js +90 -0
  243. package/lib/util/grpc.js.map +1 -0
  244. package/lib/util/jaeger-client-types.d.ts +68 -0
  245. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  246. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +2 -2
  247. package/lib/util/jaeger-client-types.js.map +1 -0
  248. package/lib/util/logging.d.ts +50 -34
  249. package/lib/util/logging.d.ts.map +1 -1
  250. package/lib/util/logging.js +133 -130
  251. package/lib/util/logging.js.map +1 -1
  252. package/lib/util/logging.spec.d.ts +7 -0
  253. package/lib/util/logging.spec.d.ts.map +1 -0
  254. package/lib/util/logging.spec.js +52 -0
  255. package/lib/util/logging.spec.js.map +1 -0
  256. package/lib/util/make-link.d.ts +1 -1
  257. package/lib/util/make-link.js +6 -6
  258. package/lib/util/make-link.js.map +1 -1
  259. package/lib/util/nice-grpc.d.ts +9 -0
  260. package/lib/util/nice-grpc.d.ts.map +1 -0
  261. package/lib/util/nice-grpc.js +121 -0
  262. package/lib/util/nice-grpc.js.map +1 -0
  263. package/lib/util/parse-workspace-id.d.ts +11 -1
  264. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  265. package/lib/util/parse-workspace-id.js +31 -8
  266. package/lib/util/parse-workspace-id.js.map +1 -1
  267. package/lib/util/parse-workspace-id.spec.d.ts +5 -1
  268. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  269. package/lib/util/parse-workspace-id.spec.js +124 -85
  270. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  271. package/lib/util/queue.d.ts +1 -1
  272. package/lib/util/queue.js +17 -56
  273. package/lib/util/queue.js.map +1 -1
  274. package/lib/util/queue.spec.d.ts +1 -1
  275. package/lib/util/queue.spec.js +148 -289
  276. package/lib/util/queue.spec.js.map +1 -1
  277. package/lib/util/repeat.d.ts +15 -0
  278. package/lib/util/repeat.d.ts.map +1 -0
  279. package/lib/util/repeat.js +55 -0
  280. package/lib/util/repeat.js.map +1 -0
  281. package/lib/util/semaphore.d.ts +1 -1
  282. package/lib/util/semaphore.d.ts.map +1 -1
  283. package/lib/util/semaphore.js +16 -47
  284. package/lib/util/semaphore.js.map +1 -1
  285. package/lib/util/skip-if.d.ts +1 -1
  286. package/lib/util/skip-if.d.ts.map +1 -1
  287. package/lib/util/skip-if.js +7 -7
  288. package/lib/util/skip-if.js.map +1 -1
  289. package/lib/util/timeutil.d.ts +3 -1
  290. package/lib/util/timeutil.d.ts.map +1 -1
  291. package/lib/util/timeutil.js +30 -18
  292. package/lib/util/timeutil.js.map +1 -1
  293. package/lib/util/timeutil.spec.d.ts +3 -1
  294. package/lib/util/timeutil.spec.d.ts.map +1 -1
  295. package/lib/util/timeutil.spec.js +55 -24
  296. package/lib/util/timeutil.spec.js.map +1 -1
  297. package/lib/util/tracing.d.ts +53 -7
  298. package/lib/util/tracing.d.ts.map +1 -1
  299. package/lib/util/tracing.js +198 -65
  300. package/lib/util/tracing.js.map +1 -1
  301. package/lib/util/tracing.spec.d.ts +7 -0
  302. package/lib/util/tracing.spec.d.ts.map +1 -0
  303. package/lib/util/tracing.spec.js +121 -0
  304. package/lib/util/tracing.spec.js.map +1 -0
  305. package/lib/util/workspace-port-authentication.d.ts +8 -8
  306. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  307. package/lib/util/workspace-port-authentication.js +10 -13
  308. package/lib/util/workspace-port-authentication.js.map +1 -1
  309. package/lib/webhook-event.d.ts +44 -0
  310. package/lib/webhook-event.d.ts.map +1 -0
  311. package/lib/webhook-event.js +8 -0
  312. package/lib/webhook-event.js.map +1 -0
  313. package/lib/workspace-class.d.ts +14 -0
  314. package/lib/workspace-class.d.ts.map +1 -0
  315. package/lib/workspace-class.js +8 -0
  316. package/lib/workspace-class.js.map +1 -0
  317. package/lib/workspace-cluster.d.ts +28 -8
  318. package/lib/workspace-cluster.d.ts.map +1 -1
  319. package/lib/workspace-cluster.js +20 -5
  320. package/lib/workspace-cluster.js.map +1 -1
  321. package/lib/workspace-instance.d.ts +46 -6
  322. package/lib/workspace-instance.d.ts.map +1 -1
  323. package/lib/workspace-instance.js +1 -1
  324. package/lib/wsready.d.ts +8 -2
  325. package/lib/wsready.d.ts.map +1 -1
  326. package/lib/wsready.js +3 -3
  327. package/package.json +40 -18
  328. package/pkg-yarn.lock +23 -10
  329. package/provenance-bundle.jsonl +2 -0
  330. package/src/accounting-protocol.ts +67 -58
  331. package/src/admin-protocol.ts +88 -20
  332. package/src/analytics.ts +52 -0
  333. package/src/attribution.ts +63 -0
  334. package/src/auth.ts +3 -3
  335. package/src/billing-mode.ts +84 -0
  336. package/src/blocked-repositories-protocol.ts +13 -0
  337. package/src/context-url.spec.ts +49 -0
  338. package/src/context-url.ts +107 -0
  339. package/src/encryption/container-module.ts +3 -4
  340. package/src/encryption/encryption-engine.spec.ts +10 -9
  341. package/src/encryption/encryption-engine.ts +21 -17
  342. package/src/encryption/encryption-service.ts +5 -6
  343. package/src/encryption/key-provider.ts +17 -20
  344. package/src/env.ts +2 -25
  345. package/src/experiments/always-default.ts +24 -0
  346. package/src/experiments/configcat-server.ts +42 -0
  347. package/src/experiments/configcat.ts +56 -0
  348. package/src/experiments/types.ts +34 -0
  349. package/src/frontend-dashboard-service.ts +125 -0
  350. package/src/gitpod-file-parser.spec.ts +56 -62
  351. package/src/gitpod-file-parser.ts +17 -18
  352. package/src/gitpod-service.ts +369 -146
  353. package/src/headless-workspace-log.ts +13 -15
  354. package/src/ide-frontend-service.ts +3 -3
  355. package/src/ide-protocol.ts +147 -0
  356. package/src/index.ts +17 -11
  357. package/src/installation-admin-protocol.ts +45 -0
  358. package/src/license-protocol.ts +13 -7
  359. package/src/messaging/browser/connection.ts +187 -28
  360. package/src/messaging/browser/window-connection.ts +40 -30
  361. package/src/messaging/client-call-metrics.ts +94 -0
  362. package/src/messaging/error.ts +36 -8
  363. package/src/messaging/handler.ts +13 -1
  364. package/src/messaging/node/connection.ts +23 -70
  365. package/src/messaging/proxy-factory.ts +35 -34
  366. package/src/oss-allowlist.ts +15 -0
  367. package/src/payment-protocol.ts +3 -3
  368. package/src/permission.ts +47 -34
  369. package/src/plans.ts +250 -199
  370. package/src/protocol.spec.ts +97 -0
  371. package/src/protocol.ts +636 -293
  372. package/src/snapshot-url.spec.ts +27 -0
  373. package/src/snapshot-url.ts +27 -0
  374. package/src/team-subscription-protocol.ts +62 -23
  375. package/src/teams-projects-protocol.ts +181 -0
  376. package/src/typings/globals.ts +6 -5
  377. package/src/usage.ts +85 -0
  378. package/src/util/analytics.ts +109 -0
  379. package/src/util/async-iterator.ts +5 -6
  380. package/src/util/cancelable.ts +4 -4
  381. package/src/util/date-time.ts +9 -9
  382. package/src/util/debug-app.ts +81 -0
  383. package/src/util/deep-partial.ts +1 -1
  384. package/src/util/deferred.ts +7 -7
  385. package/src/util/disposable.ts +3 -6
  386. package/src/util/event.ts +9 -11
  387. package/src/util/garbage-collected-cache.ts +17 -9
  388. package/src/util/generate-workspace-id.spec.ts +38 -11
  389. package/src/util/generate-workspace-id.ts +465 -439
  390. package/src/util/gitpod-cookie.ts +38 -0
  391. package/src/util/gitpod-host-url.spec.ts +59 -8
  392. package/src/util/gitpod-host-url.ts +88 -48
  393. package/src/util/grpc.ts +107 -0
  394. package/src/util/jaeger-client-types.ts +102 -0
  395. package/src/util/logging.spec.ts +23 -0
  396. package/src/util/logging.ts +157 -75
  397. package/src/util/make-link.ts +7 -8
  398. package/src/util/nice-grpc.ts +96 -0
  399. package/src/util/parse-workspace-id.spec.ts +38 -9
  400. package/src/util/parse-workspace-id.ts +33 -8
  401. package/src/util/queue.spec.ts +28 -26
  402. package/src/util/queue.ts +1 -1
  403. package/src/util/repeat.ts +45 -0
  404. package/src/util/semaphore.ts +7 -9
  405. package/src/util/skip-if.ts +11 -8
  406. package/src/util/timeutil.spec.ts +41 -15
  407. package/src/util/timeutil.ts +32 -16
  408. package/src/util/tracing.spec.ts +88 -0
  409. package/src/util/tracing.ts +201 -32
  410. package/src/util/workspace-port-authentication.ts +11 -14
  411. package/src/webhook-event.ts +55 -0
  412. package/src/workspace-class.ts +14 -0
  413. package/src/workspace-cluster.ts +47 -17
  414. package/src/workspace-instance.ts +106 -32
  415. package/src/wsready.ts +11 -4
  416. package/data/builtin-theia-plugins.json +0 -372
  417. package/lib/email-protocol.d.ts +0 -50
  418. package/lib/email-protocol.d.ts.map +0 -1
  419. package/lib/email-protocol.js +0 -28
  420. package/lib/email-protocol.js.map +0 -1
  421. package/lib/messaging/connection-error-handler.d.ts +0 -27
  422. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  423. package/lib/messaging/connection-error-handler.js +0 -46
  424. package/lib/messaging/connection-error-handler.js.map +0 -1
  425. package/lib/theia-plugins.d.ts +0 -11
  426. package/lib/theia-plugins.d.ts.map +0 -1
  427. package/lib/theia-plugins.js.map +0 -1
  428. package/lib/util/context-url.d.ts +0 -13
  429. package/lib/util/context-url.d.ts.map +0 -1
  430. package/lib/util/context-url.js +0 -26
  431. package/lib/util/context-url.js.map +0 -1
  432. package/lib/util/context-url.spec.d.ts +0 -10
  433. package/lib/util/context-url.spec.d.ts.map +0 -1
  434. package/lib/util/context-url.spec.js +0 -52
  435. package/lib/util/context-url.spec.js.map +0 -1
  436. package/lib/util/repeater.d.ts +0 -22
  437. package/lib/util/repeater.d.ts.map +0 -1
  438. package/lib/util/repeater.js +0 -118
  439. package/lib/util/repeater.js.map +0 -1
  440. package/lib/util/safe-promise.d.ts +0 -11
  441. package/lib/util/safe-promise.d.ts.map +0 -1
  442. package/lib/util/safe-promise.js +0 -34
  443. package/lib/util/safe-promise.js.map +0 -1
  444. package/lib/util/without.d.ts +0 -7
  445. package/lib/util/without.d.ts.map +0 -1
  446. package/lib/util/without.js +0 -8
  447. package/lib/util/without.js.map +0 -1
  448. package/src/email-protocol.ts +0 -67
  449. package/src/messaging/connection-error-handler.ts +0 -62
  450. package/src/theia-plugins.ts +0 -11
  451. package/src/util/context-url.spec.ts +0 -25
  452. package/src/util/context-url.ts +0 -23
  453. package/src/util/jaeger-client.d.ts +0 -105
  454. package/src/util/repeater.ts +0 -49
  455. package/src/util/safe-promise.ts +0 -26
@@ -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;QAC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,gEAqDC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
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:
@@ -11,4 +11,14 @@
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,aAAsB,MAAM,uBAcpE,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"}
@@ -2,10 +2,17 @@
2
2
  /**
3
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.parseWorkspaceIdFromHostname = void 0;
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`);
9
16
  /**
10
17
  * Hostname may be of the form:
11
18
  * - moccasin-ferret-155799b3.ws-eu01.gitpod.io
@@ -13,16 +20,13 @@ exports.parseWorkspaceIdFromHostname = void 0;
13
20
  * - webview-1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io (or any other string replacing webview)
14
21
  * @param hostname The hostname the request is headed to
15
22
  */
16
- var parseWorkspaceIdFromHostname = function (hostname) {
17
- // We need to parse the workspace id precisely here to get the case '<some-str>-<port>-<wsid>.ws.' right
18
- var wsIdExpression = /([0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8})\.ws/g;
19
- var match = wsIdExpression.exec(hostname);
23
+ const parseWorkspaceIdFromHostname = function (hostname) {
24
+ const match = REGEX_WORKSPACE_ID_FROM_HOSTNAME.exec(hostname);
20
25
  if (match && match.length >= 2) {
21
26
  return match[1];
22
27
  }
23
28
  else {
24
- var legacyUrlFormat = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.ws/g;
25
- var legacyMatch = legacyUrlFormat.exec(hostname);
29
+ const legacyMatch = REGEX_WORKSPACE_ID_LEGACY_FROM_HOSTNAME.exec(hostname);
26
30
  if (legacyMatch && legacyMatch.length >= 2) {
27
31
  return legacyMatch[1];
28
32
  }
@@ -30,4 +34,23 @@ var parseWorkspaceIdFromHostname = function (hostname) {
30
34
  }
31
35
  };
32
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;
33
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;;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G,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,7 +1,7 @@
1
1
  /**
2
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;
@@ -12,5 +12,9 @@ export declare class ParseWorkspaceIdTest {
12
12
  parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation(): void;
13
13
  parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix(): void;
14
14
  parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost(): void;
15
+ matchesInstanceIdOrLegacyWorkspaceIdExactly_positive(): void;
16
+ matchesInstanceIdOrLegacyWorkspaceIdExactly_negative(): void;
17
+ matchesWorkspaceIdExactly_new_positive(): void;
18
+ matchesWorkspaceIdExactly_new_negative(): void;
15
19
  }
16
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;IAMjF,wDAAwD;IAKxD,4DAA4D;IAK5D,6EAA6E;IAK7E,uFAAuF;CAIvG"}
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"}
@@ -2,7 +2,7 @@
2
2
  /**
3
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;
@@ -15,99 +15,138 @@ var __metadata = (this && this.__metadata) || function (k, v) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.ParseWorkspaceIdTest = void 0;
18
- var chai = require("chai");
19
- var mocha_typescript_1 = require("mocha-typescript");
20
- var parse_workspace_id_1 = require("./parse-workspace-id");
21
- var expect = chai.expect;
22
- var ParseWorkspaceIdTest = /** @class */ (function () {
23
- function ParseWorkspaceIdTest() {
24
- }
25
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspaceLocation = function () {
26
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("moccasin-ferret-155799b3.ws-eu01.gitpod.io");
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");
27
25
  expect(actual).to.equal("moccasin-ferret-155799b3");
28
- };
29
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspacePortLocation = function () {
30
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
26
+ }
27
+ parseWorkspaceIdFromHostname_fromWorkspacePortLocation() {
28
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
31
29
  expect(actual).to.equal("moccasin-ferret-155799b3");
32
- };
33
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix = function () {
34
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("webview-3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
30
+ }
31
+ parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix() {
32
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
35
33
  expect(actual).to.equal("moccasin-ferret-155799b3");
36
- };
37
- ParseWorkspaceIdTest.prototype.parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost = function () {
38
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("webview-3000-moccasin-ferret-155799b3.ws-eu01.some.subdomain.somehost.com");
34
+ }
35
+ parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost() {
36
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-moccasin-ferret-155799b3.ws-eu01.some.subdomain.somehost.com");
39
37
  expect(actual).to.equal("moccasin-ferret-155799b3");
40
- };
38
+ }
41
39
  // legacy mode
42
- ParseWorkspaceIdTest.prototype.parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation = function () {
43
- var actual = parse_workspace_id_1.parseWorkspaceIdFromHostname("b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
40
+ parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation() {
41
+ const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
44
42
  expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
45
- };
46
- ParseWorkspaceIdTest.prototype.parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation = function () {
47
- 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");
48
46
  expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
49
- };
50
- ParseWorkspaceIdTest.prototype.parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix = function () {
51
- 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");
52
50
  expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
53
- };
54
- ParseWorkspaceIdTest.prototype.parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost = function () {
55
- 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");
56
54
  expect(actual).to.equal("ca81a50f-09d7-465c-acd9-264a747d5351");
57
- };
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_fromWorkspaceLocation", null);
64
- __decorate([
65
- mocha_typescript_1.test,
66
- __metadata("design:type", Function),
67
- __metadata("design:paramtypes", []),
68
- __metadata("design:returntype", void 0)
69
- ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocation", null);
70
- __decorate([
71
- mocha_typescript_1.test,
72
- __metadata("design:type", Function),
73
- __metadata("design:paramtypes", []),
74
- __metadata("design:returntype", void 0)
75
- ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix", null);
76
- __decorate([
77
- mocha_typescript_1.test,
78
- __metadata("design:type", Function),
79
- __metadata("design:paramtypes", []),
80
- __metadata("design:returntype", void 0)
81
- ], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost", null);
82
- __decorate([
83
- mocha_typescript_1.test,
84
- __metadata("design:type", Function),
85
- __metadata("design:paramtypes", []),
86
- __metadata("design:returntype", void 0)
87
- ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation", null);
88
- __decorate([
89
- mocha_typescript_1.test,
90
- __metadata("design:type", Function),
91
- __metadata("design:paramtypes", []),
92
- __metadata("design:returntype", void 0)
93
- ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation", null);
94
- __decorate([
95
- mocha_typescript_1.test,
96
- __metadata("design:type", Function),
97
- __metadata("design:paramtypes", []),
98
- __metadata("design:returntype", void 0)
99
- ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix", null);
100
- __decorate([
101
- mocha_typescript_1.test,
102
- __metadata("design:type", Function),
103
- __metadata("design:paramtypes", []),
104
- __metadata("design:returntype", void 0)
105
- ], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost", null);
106
- ParseWorkspaceIdTest = __decorate([
107
- mocha_typescript_1.suite
108
- ], ParseWorkspaceIdTest);
109
- return ParseWorkspaceIdTest;
110
- }());
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);
111
150
  exports.ParseWorkspaceIdTest = ParseWorkspaceIdTest;
112
151
  module.exports = new ParseWorkspaceIdTest();
113
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;IA0CA,CAAC;IAxCgB,iFAAkD,GAAzD;QACF,IAAM,MAAM,GAAG,iDAA4B,CAAC,4CAA4C,CAAC,CAAC;QAC1F,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACxD,CAAC;IAEY,qFAAsD,GAA7D;QACF,IAAM,MAAM,GAAG,iDAA4B,CAAC,iDAAiD,CAAC,CAAC;QAC/F,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACxD,CAAC;IAEY,sGAAuE,GAA9E;QACF,IAAM,MAAM,GAAG,iDAA4B,CAAC,yDAAyD,CAAC,CAAC;QACvG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACxD,CAAC;IAEY,gHAAiF,GAAxF;QACF,IAAM,MAAM,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,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
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
@@ -2,7 +2,7 @@
2
2
  /**
3
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,68 +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
17
  exports.Queue = void 0;
45
- var deferred_1 = require("./deferred");
18
+ const deferred_1 = require("./deferred");
46
19
  /**
47
20
  * Queues asynchronous operations in a synchronous context
48
21
  */
49
- var Queue = /** @class */ (function () {
50
- function Queue() {
22
+ class Queue {
23
+ constructor() {
51
24
  this.queue = Promise.resolve();
52
25
  }
53
- Queue.prototype.enqueue = function (operation) {
54
- var _this = this;
55
- var enqueue = new deferred_1.Deferred();
56
- this.queue = this.queue.then(function () { return __awaiter(_this, void 0, void 0, function () {
57
- var result, err_1;
58
- return __generator(this, function (_a) {
59
- switch (_a.label) {
60
- case 0:
61
- _a.trys.push([0, 2, , 3]);
62
- return [4 /*yield*/, operation()];
63
- case 1:
64
- result = _a.sent();
65
- enqueue.resolve(result);
66
- return [3 /*break*/, 3];
67
- case 2:
68
- err_1 = _a.sent();
69
- enqueue.reject(err_1);
70
- return [3 /*break*/, 3];
71
- case 3: return [2 /*return*/];
72
- }
73
- });
74
- }); });
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
+ }));
75
37
  return enqueue.promise;
76
- };
77
- return Queue;
78
- }());
38
+ }
39
+ }
79
40
  exports.Queue = Queue;
80
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
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