@gitpod/gitpod-protocol 0.1.5-tweak-workspaceconfig-origin-docs-fork.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 (436) hide show
  1. package/data/gitpod-schema.json +150 -8
  2. package/lib/accounting-protocol.d.ts +21 -11
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +44 -33
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +29 -1
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +1 -1
  9. package/lib/admin-protocol.js.map +1 -1
  10. package/lib/analytics.d.ts +5 -6
  11. package/lib/analytics.d.ts.map +1 -1
  12. package/lib/analytics.js +1 -1
  13. package/lib/analytics.js.map +1 -1
  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 +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 +19 -7
  30. package/lib/context-url.d.ts.map +1 -1
  31. package/lib/context-url.js +60 -9
  32. package/lib/context-url.js.map +1 -1
  33. package/lib/context-url.spec.d.ts +3 -3
  34. package/lib/context-url.spec.d.ts.map +1 -1
  35. package/lib/context-url.spec.js +20 -12
  36. package/lib/context-url.spec.js.map +1 -1
  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 +2 -2
  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 +10 -10
  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 +3 -4
  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 +2 -2
  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 +8 -10
  56. package/lib/encryption/key-provider.js.map +1 -1
  57. package/lib/env.d.ts +1 -6
  58. package/lib/env.d.ts.map +1 -1
  59. package/lib/env.js +2 -21
  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 +99 -0
  78. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  79. package/lib/frontend-dashboard-service.js +55 -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 +7 -7
  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 +43 -40
  87. package/lib/gitpod-file-parser.spec.js.map +1 -1
  88. package/lib/gitpod-service.d.ts +143 -51
  89. package/lib/gitpod-service.d.ts.map +1 -1
  90. package/lib/gitpod-service.js +78 -36
  91. package/lib/gitpod-service.js.map +1 -1
  92. package/lib/headless-workspace-log.d.ts +2 -1
  93. package/lib/headless-workspace-log.d.ts.map +1 -1
  94. package/lib/headless-workspace-log.js +3 -2
  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 +53 -8
  99. package/lib/ide-protocol.d.ts.map +1 -1
  100. package/lib/ide-protocol.js +11 -1
  101. package/lib/ide-protocol.js.map +1 -1
  102. package/lib/index.d.ts +17 -15
  103. package/lib/index.d.ts.map +1 -1
  104. package/lib/index.js +4 -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 +1 -1
  115. package/lib/messaging/browser/connection.d.ts.map +1 -1
  116. package/lib/messaging/browser/connection.js +19 -19
  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 +10 -7
  121. package/lib/messaging/browser/window-connection.js.map +1 -1
  122. package/lib/messaging/client-call-metrics.d.ts +5 -19
  123. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  124. package/lib/messaging/client-call-metrics.js +35 -23
  125. package/lib/messaging/client-call-metrics.js.map +1 -1
  126. package/lib/messaging/error.d.ts +12 -2
  127. package/lib/messaging/error.d.ts.map +1 -1
  128. package/lib/messaging/error.js +26 -4
  129. package/lib/messaging/error.js.map +1 -1
  130. package/lib/messaging/handler.d.ts.map +1 -1
  131. package/lib/messaging/handler.js +1 -1
  132. package/lib/messaging/node/connection.d.ts +1 -17
  133. package/lib/messaging/node/connection.d.ts.map +1 -1
  134. package/lib/messaging/node/connection.js +23 -59
  135. package/lib/messaging/node/connection.js.map +1 -1
  136. package/lib/messaging/proxy-factory.d.ts +1 -1
  137. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  138. package/lib/messaging/proxy-factory.js +7 -9
  139. package/lib/messaging/proxy-factory.js.map +1 -1
  140. package/lib/oss-allowlist.d.ts +14 -0
  141. package/lib/oss-allowlist.d.ts.map +1 -0
  142. package/lib/oss-allowlist.js +8 -0
  143. package/lib/oss-allowlist.js.map +1 -0
  144. package/lib/payment-protocol.d.ts +1 -1
  145. package/lib/payment-protocol.d.ts.map +1 -1
  146. package/lib/payment-protocol.js +2 -2
  147. package/lib/payment-protocol.js.map +1 -1
  148. package/lib/permission.d.ts +13 -4
  149. package/lib/permission.d.ts.map +1 -1
  150. package/lib/permission.js +38 -26
  151. package/lib/permission.js.map +1 -1
  152. package/lib/plans.d.ts +8 -5
  153. package/lib/plans.d.ts.map +1 -1
  154. package/lib/plans.js +227 -172
  155. package/lib/plans.js.map +1 -1
  156. package/lib/protocol.d.ts +238 -104
  157. package/lib/protocol.d.ts.map +1 -1
  158. package/lib/protocol.js +322 -105
  159. package/lib/protocol.js.map +1 -1
  160. package/lib/protocol.spec.d.ts +7 -0
  161. package/lib/protocol.spec.d.ts.map +1 -0
  162. package/lib/protocol.spec.js +127 -0
  163. package/lib/protocol.spec.js.map +1 -0
  164. package/lib/snapshot-url.d.ts +1 -1
  165. package/lib/snapshot-url.js +1 -1
  166. package/lib/snapshot-url.spec.d.ts +1 -1
  167. package/lib/snapshot-url.spec.js +1 -1
  168. package/lib/snapshot-url.spec.js.map +1 -1
  169. package/lib/team-subscription-protocol.d.ts +24 -4
  170. package/lib/team-subscription-protocol.d.ts.map +1 -1
  171. package/lib/team-subscription-protocol.js +25 -6
  172. package/lib/team-subscription-protocol.js.map +1 -1
  173. package/lib/teams-projects-protocol.d.ts +39 -6
  174. package/lib/teams-projects-protocol.d.ts.map +1 -1
  175. package/lib/teams-projects-protocol.js +21 -3
  176. package/lib/teams-projects-protocol.js.map +1 -1
  177. package/lib/typings/globals.d.ts +7 -3
  178. package/lib/typings/globals.d.ts.map +1 -1
  179. package/lib/typings/globals.js +1 -1
  180. package/lib/usage.d.ts +73 -0
  181. package/lib/usage.d.ts.map +1 -0
  182. package/lib/usage.js +20 -0
  183. package/lib/usage.js.map +1 -0
  184. package/lib/util/analytics.d.ts +1 -1
  185. package/lib/util/analytics.d.ts.map +1 -1
  186. package/lib/util/analytics.js +13 -4
  187. package/lib/util/analytics.js.map +1 -1
  188. package/lib/util/async-iterator.d.ts +1 -1
  189. package/lib/util/async-iterator.d.ts.map +1 -1
  190. package/lib/util/async-iterator.js +4 -4
  191. package/lib/util/async-iterator.js.map +1 -1
  192. package/lib/util/cancelable.d.ts +1 -1
  193. package/lib/util/cancelable.js +1 -1
  194. package/lib/util/cancelable.js.map +1 -1
  195. package/lib/util/date-time.d.ts +1 -1
  196. package/lib/util/date-time.js +7 -7
  197. package/lib/util/date-time.js.map +1 -1
  198. package/lib/util/debug-app.d.ts +25 -0
  199. package/lib/util/debug-app.d.ts.map +1 -0
  200. package/lib/util/debug-app.js +100 -0
  201. package/lib/util/debug-app.js.map +1 -0
  202. package/lib/util/deep-partial.d.ts +1 -1
  203. package/lib/util/deep-partial.js +1 -1
  204. package/lib/util/deferred.d.ts +1 -1
  205. package/lib/util/deferred.js +1 -1
  206. package/lib/util/deferred.js.map +1 -1
  207. package/lib/util/disposable.d.ts.map +1 -1
  208. package/lib/util/disposable.js +2 -2
  209. package/lib/util/disposable.js.map +1 -1
  210. package/lib/util/event.d.ts.map +1 -1
  211. package/lib/util/event.js +5 -3
  212. package/lib/util/event.js.map +1 -1
  213. package/lib/util/garbage-collected-cache.d.ts +2 -1
  214. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  215. package/lib/util/garbage-collected-cache.js +12 -3
  216. package/lib/util/garbage-collected-cache.js.map +1 -1
  217. package/lib/util/generate-workspace-id.d.ts +6 -1
  218. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  219. package/lib/util/generate-workspace-id.js +461 -440
  220. package/lib/util/generate-workspace-id.js.map +1 -1
  221. package/lib/util/generate-workspace-id.spec.d.ts +1 -1
  222. package/lib/util/generate-workspace-id.spec.js +37 -2
  223. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  224. package/lib/util/gitpod-cookie.d.ts +2 -2
  225. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  226. package/lib/util/gitpod-cookie.js +1 -4
  227. package/lib/util/gitpod-cookie.js.map +1 -1
  228. package/lib/util/gitpod-host-url.d.ts +12 -5
  229. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  230. package/lib/util/gitpod-host-url.js +69 -41
  231. package/lib/util/gitpod-host-url.js.map +1 -1
  232. package/lib/util/gitpod-host-url.spec.d.ts +1 -1
  233. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  234. package/lib/util/gitpod-host-url.spec.js +16 -6
  235. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  236. package/lib/util/grpc.d.ts +21 -1
  237. package/lib/util/grpc.d.ts.map +1 -1
  238. package/lib/util/grpc.js +74 -2
  239. package/lib/util/grpc.js.map +1 -1
  240. package/lib/util/jaeger-client-types.d.ts +68 -0
  241. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  242. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +2 -2
  243. package/lib/util/jaeger-client-types.js.map +1 -0
  244. package/lib/util/logging.d.ts +2 -2
  245. package/lib/util/logging.d.ts.map +1 -1
  246. package/lib/util/logging.js +32 -26
  247. package/lib/util/logging.js.map +1 -1
  248. package/lib/util/logging.spec.d.ts +7 -0
  249. package/lib/util/logging.spec.d.ts.map +1 -0
  250. package/lib/util/logging.spec.js +52 -0
  251. package/lib/util/logging.spec.js.map +1 -0
  252. package/lib/util/make-link.d.ts +1 -1
  253. package/lib/util/make-link.js +6 -6
  254. package/lib/util/make-link.js.map +1 -1
  255. package/lib/util/nice-grpc.d.ts +9 -0
  256. package/lib/util/nice-grpc.d.ts.map +1 -0
  257. package/lib/util/nice-grpc.js +121 -0
  258. package/lib/util/nice-grpc.js.map +1 -0
  259. package/lib/util/parse-workspace-id.d.ts +1 -1
  260. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  261. package/lib/util/parse-workspace-id.js +3 -4
  262. package/lib/util/parse-workspace-id.js.map +1 -1
  263. package/lib/util/parse-workspace-id.spec.d.ts +1 -1
  264. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  265. package/lib/util/parse-workspace-id.spec.js +1 -1
  266. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  267. package/lib/util/queue.d.ts +1 -1
  268. package/lib/util/queue.js +1 -1
  269. package/lib/util/queue.spec.d.ts +1 -1
  270. package/lib/util/queue.spec.js +10 -7
  271. package/lib/util/queue.spec.js.map +1 -1
  272. package/lib/util/repeat.d.ts +15 -0
  273. package/lib/util/repeat.d.ts.map +1 -0
  274. package/lib/util/repeat.js +55 -0
  275. package/lib/util/repeat.js.map +1 -0
  276. package/lib/util/semaphore.d.ts +1 -1
  277. package/lib/util/semaphore.d.ts.map +1 -1
  278. package/lib/util/semaphore.js +1 -1
  279. package/lib/util/semaphore.js.map +1 -1
  280. package/lib/util/skip-if.d.ts +1 -1
  281. package/lib/util/skip-if.d.ts.map +1 -1
  282. package/lib/util/skip-if.js +1 -1
  283. package/lib/util/skip-if.js.map +1 -1
  284. package/lib/util/timeutil.d.ts +3 -1
  285. package/lib/util/timeutil.d.ts.map +1 -1
  286. package/lib/util/timeutil.js +16 -4
  287. package/lib/util/timeutil.js.map +1 -1
  288. package/lib/util/timeutil.spec.d.ts +3 -1
  289. package/lib/util/timeutil.spec.d.ts.map +1 -1
  290. package/lib/util/timeutil.spec.js +35 -1
  291. package/lib/util/timeutil.spec.js.map +1 -1
  292. package/lib/util/tracing.d.ts +47 -13
  293. package/lib/util/tracing.d.ts.map +1 -1
  294. package/lib/util/tracing.js +141 -32
  295. package/lib/util/tracing.js.map +1 -1
  296. package/lib/util/tracing.spec.d.ts +7 -0
  297. package/lib/util/tracing.spec.d.ts.map +1 -0
  298. package/lib/util/tracing.spec.js +121 -0
  299. package/lib/util/tracing.spec.js.map +1 -0
  300. package/lib/util/workspace-port-authentication.d.ts +8 -8
  301. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  302. package/lib/util/workspace-port-authentication.js +9 -12
  303. package/lib/util/workspace-port-authentication.js.map +1 -1
  304. package/lib/webhook-event.d.ts +44 -0
  305. package/lib/webhook-event.d.ts.map +1 -0
  306. package/lib/webhook-event.js +8 -0
  307. package/lib/webhook-event.js.map +1 -0
  308. package/lib/workspace-class.d.ts +14 -0
  309. package/lib/workspace-class.d.ts.map +1 -0
  310. package/lib/workspace-class.js +8 -0
  311. package/lib/workspace-class.js.map +1 -0
  312. package/lib/workspace-cluster.d.ts +24 -18
  313. package/lib/workspace-cluster.d.ts.map +1 -1
  314. package/lib/workspace-cluster.js +22 -2
  315. package/lib/workspace-cluster.js.map +1 -1
  316. package/lib/workspace-instance.d.ts +41 -4
  317. package/lib/workspace-instance.d.ts.map +1 -1
  318. package/lib/workspace-instance.js +1 -1
  319. package/lib/wsready.d.ts +8 -2
  320. package/lib/wsready.d.ts.map +1 -1
  321. package/lib/wsready.js +3 -3
  322. package/package.json +18 -8
  323. package/pkg-yarn.lock +11 -6
  324. package/provenance-bundle.jsonl +2 -0
  325. package/src/accounting-protocol.ts +76 -52
  326. package/src/admin-protocol.ts +59 -19
  327. package/src/analytics.ts +27 -29
  328. package/src/attribution.ts +67 -0
  329. package/src/auth.ts +3 -3
  330. package/src/billing-mode.ts +84 -0
  331. package/src/blocked-repositories-protocol.ts +13 -0
  332. package/src/context-url.spec.ts +25 -15
  333. package/src/context-url.ts +93 -37
  334. package/src/encryption/container-module.ts +3 -4
  335. package/src/encryption/encryption-engine.spec.ts +10 -9
  336. package/src/encryption/encryption-engine.ts +21 -17
  337. package/src/encryption/encryption-service.ts +5 -6
  338. package/src/encryption/key-provider.ts +17 -20
  339. package/src/env.ts +2 -25
  340. package/src/experiments/always-default.ts +24 -0
  341. package/src/experiments/configcat-server.ts +42 -0
  342. package/src/experiments/configcat.ts +56 -0
  343. package/src/experiments/types.ts +34 -0
  344. package/src/frontend-dashboard-service.ts +148 -0
  345. package/src/gitpod-file-parser.spec.ts +56 -62
  346. package/src/gitpod-file-parser.ts +17 -18
  347. package/src/gitpod-service.ts +315 -136
  348. package/src/headless-workspace-log.ts +7 -5
  349. package/src/ide-frontend-service.ts +3 -3
  350. package/src/ide-protocol.ts +63 -8
  351. package/src/index.ts +17 -15
  352. package/src/installation-admin-protocol.ts +45 -0
  353. package/src/license-protocol.ts +13 -7
  354. package/src/messaging/browser/connection.ts +45 -47
  355. package/src/messaging/browser/window-connection.ts +40 -30
  356. package/src/messaging/client-call-metrics.ts +79 -82
  357. package/src/messaging/error.ts +37 -8
  358. package/src/messaging/handler.ts +6 -6
  359. package/src/messaging/node/connection.ts +23 -70
  360. package/src/messaging/proxy-factory.ts +23 -30
  361. package/src/oss-allowlist.ts +15 -0
  362. package/src/payment-protocol.ts +3 -3
  363. package/src/permission.ts +45 -33
  364. package/src/plans.ts +257 -190
  365. package/src/protocol.spec.ts +97 -0
  366. package/src/protocol.ts +650 -305
  367. package/src/snapshot-url.spec.ts +10 -8
  368. package/src/snapshot-url.ts +1 -1
  369. package/src/team-subscription-protocol.ts +63 -23
  370. package/src/teams-projects-protocol.ts +60 -12
  371. package/src/typings/globals.ts +12 -5
  372. package/src/usage.ts +85 -0
  373. package/src/util/analytics.ts +47 -25
  374. package/src/util/async-iterator.ts +5 -6
  375. package/src/util/cancelable.ts +4 -4
  376. package/src/util/date-time.ts +9 -9
  377. package/src/util/debug-app.ts +81 -0
  378. package/src/util/deep-partial.ts +1 -1
  379. package/src/util/deferred.ts +7 -7
  380. package/src/util/disposable.ts +3 -6
  381. package/src/util/event.ts +9 -11
  382. package/src/util/garbage-collected-cache.ts +15 -7
  383. package/src/util/generate-workspace-id.spec.ts +35 -8
  384. package/src/util/generate-workspace-id.ts +465 -441
  385. package/src/util/gitpod-cookie.ts +9 -10
  386. package/src/util/gitpod-host-url.spec.ts +41 -14
  387. package/src/util/gitpod-host-url.ts +81 -46
  388. package/src/util/grpc.ts +94 -2
  389. package/src/util/jaeger-client-types.ts +102 -0
  390. package/src/util/logging.spec.ts +23 -0
  391. package/src/util/logging.ts +61 -43
  392. package/src/util/make-link.ts +7 -8
  393. package/src/util/nice-grpc.ts +96 -0
  394. package/src/util/parse-workspace-id.spec.ts +18 -9
  395. package/src/util/parse-workspace-id.ts +7 -8
  396. package/src/util/queue.spec.ts +28 -26
  397. package/src/util/queue.ts +1 -1
  398. package/src/util/repeat.ts +45 -0
  399. package/src/util/semaphore.ts +5 -7
  400. package/src/util/skip-if.ts +10 -7
  401. package/src/util/timeutil.spec.ts +41 -15
  402. package/src/util/timeutil.ts +28 -12
  403. package/src/util/tracing.spec.ts +88 -0
  404. package/src/util/tracing.ts +175 -59
  405. package/src/util/workspace-port-authentication.ts +11 -14
  406. package/src/webhook-event.ts +55 -0
  407. package/src/workspace-class.ts +14 -0
  408. package/src/workspace-cluster.ts +46 -21
  409. package/src/workspace-instance.ts +84 -22
  410. package/src/wsready.ts +11 -4
  411. package/data/builtin-theia-plugins.json +0 -372
  412. package/lib/email-protocol.d.ts +0 -49
  413. package/lib/email-protocol.d.ts.map +0 -1
  414. package/lib/email-protocol.js +0 -28
  415. package/lib/email-protocol.js.map +0 -1
  416. package/lib/messaging/connection-error-handler.d.ts +0 -27
  417. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  418. package/lib/messaging/connection-error-handler.js +0 -34
  419. package/lib/messaging/connection-error-handler.js.map +0 -1
  420. package/lib/theia-plugins.d.ts +0 -11
  421. package/lib/theia-plugins.d.ts.map +0 -1
  422. package/lib/theia-plugins.js.map +0 -1
  423. package/lib/util/repeater.d.ts +0 -22
  424. package/lib/util/repeater.d.ts.map +0 -1
  425. package/lib/util/repeater.js +0 -65
  426. package/lib/util/repeater.js.map +0 -1
  427. package/lib/util/safe-promise.d.ts +0 -11
  428. package/lib/util/safe-promise.d.ts.map +0 -1
  429. package/lib/util/safe-promise.js +0 -31
  430. package/lib/util/safe-promise.js.map +0 -1
  431. package/src/email-protocol.ts +0 -66
  432. package/src/messaging/connection-error-handler.ts +0 -62
  433. package/src/theia-plugins.ts +0 -11
  434. package/src/util/jaeger-client.d.ts +0 -105
  435. package/src/util/repeater.ts +0 -49
  436. package/src/util/safe-promise.ts +0 -26
@@ -1,19 +1,21 @@
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
- import { suite, test } from "mocha-typescript"
8
- import * as chai from "chai"
7
+ import { suite, test } from "mocha-typescript";
8
+ import * as chai from "chai";
9
9
  import { SnapshotUrl } from ".";
10
10
 
11
- const expect = chai.expect
12
-
13
- @suite class TestSnapshotUrlParser {
11
+ const expect = chai.expect;
14
12
 
13
+ @suite
14
+ class TestSnapshotUrlParser {
15
15
  @test public testPositive() {
16
- const actual = SnapshotUrl.parse("workspaces/c362d434-6faa-4ce0-9ad4-91b4a87c4abe/3f0556f7-4afa-11e9-98d5-52f8983b9279.tar@gitpod-prodcopy-user-e1e28f18-0354-4a5d-b6b4-8879a2ff73fd");
16
+ const actual = SnapshotUrl.parse(
17
+ "workspaces/c362d434-6faa-4ce0-9ad4-91b4a87c4abe/3f0556f7-4afa-11e9-98d5-52f8983b9279.tar@gitpod-prodcopy-user-e1e28f18-0354-4a5d-b6b4-8879a2ff73fd",
18
+ );
17
19
 
18
20
  expect(actual).to.deep.equal(<SnapshotUrl>{
19
21
  bucketId: "gitpod-prodcopy-user-e1e28f18-0354-4a5d-b6b4-8879a2ff73fd",
@@ -22,4 +24,4 @@ const expect = chai.expect
22
24
  });
23
25
  }
24
26
  }
25
- module.exports = new TestSnapshotUrlParser() // Only to circumvent no usage warning :-/
27
+ module.exports = new TestSnapshotUrlParser(); // Only to circumvent no usage warning :-/
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 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
  export interface SnapshotUrl {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Copyright (c) 2021 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
- import { v4 as uuidv4 } from 'uuid';
7
+ import { v4 as uuidv4 } from "uuid";
8
8
  import { Subscription } from "./accounting-protocol";
9
9
 
10
10
  export interface TeamSubscription {
@@ -18,16 +18,48 @@ export interface TeamSubscription {
18
18
  paymentReference: string;
19
19
  cancellationDate?: string;
20
20
  deleted?: boolean;
21
+ /** If this flag is set slots are not eligibile for clusters with "more-resources" - even if their plan might be */
22
+ excludeFromMoreResources: boolean;
21
23
  }
22
24
 
23
25
  export namespace TeamSubscription {
24
- export const create = (ts: Omit<TeamSubscription, 'id'>): TeamSubscription => {
26
+ export const create = (ts: Omit<TeamSubscription, "id">): TeamSubscription => {
25
27
  const withId = ts as TeamSubscription;
26
28
  withId.id = uuidv4();
27
29
  return withId;
28
- }
30
+ };
29
31
  export const isActive = (ts: TeamSubscription, date: string): boolean => {
30
32
  return ts.startDate <= date && (ts.endDate === undefined || date < ts.endDate);
33
+ };
34
+ export function isCancelled(s: TeamSubscription, date: string): boolean {
35
+ return (!!s.cancellationDate && s.cancellationDate < date) || (!!s.endDate && s.endDate < date); // This edge case is meant to handle bad data: If for whatever reason cancellationDate has not been set: treat endDate as such
36
+ }
37
+ }
38
+
39
+ export interface TeamSubscription2 {
40
+ id: string;
41
+ teamId: string;
42
+ planId: string;
43
+ startDate: string;
44
+ endDate?: string;
45
+ quantity: number;
46
+ /** The Chargebee subscription id */
47
+ paymentReference: string;
48
+ cancellationDate?: string;
49
+ excludeFromMoreResources: boolean;
50
+ }
51
+
52
+ export namespace TeamSubscription2 {
53
+ export const create = (ts2: Omit<TeamSubscription2, "id">): TeamSubscription2 => {
54
+ const withId = ts2 as TeamSubscription2;
55
+ withId.id = uuidv4();
56
+ return withId;
57
+ };
58
+ export const isActive = (ts2: TeamSubscription2, date: string): boolean => {
59
+ return ts2.startDate <= date && (ts2.endDate === undefined || date < ts2.endDate);
60
+ };
61
+ export function isCancelled(s: TeamSubscription2, date: string): boolean {
62
+ return (!!s.cancellationDate && s.cancellationDate < date) || (!!s.endDate && s.endDate < date); // This edge case is meant to handle bad data: If for whatever reason cancellationDate has not been set: treat endDate as such
31
63
  }
32
64
  }
33
65
 
@@ -42,49 +74,57 @@ export interface TeamSubscriptionSlot {
42
74
  subscriptionId?: string;
43
75
  cancellationDate?: string;
44
76
  }
45
- export type TeamSubscriptionSlotDeactivated = TeamSubscriptionSlot & { assigneeId: string, assigneeIdentifier: AssigneeIdentifier };
46
- export type TeamSubscriptionSlotAssigned = TeamSubscriptionSlot & TeamSubscriptionSlotDeactivated & { subscriptionId: string };
77
+ export type TeamSubscriptionSlotDeactivated = TeamSubscriptionSlot & {
78
+ assigneeId: string;
79
+ assigneeIdentifier: AssigneeIdentifier;
80
+ };
81
+ export type TeamSubscriptionSlotAssigned = TeamSubscriptionSlot &
82
+ TeamSubscriptionSlotDeactivated & { subscriptionId: string };
47
83
 
48
- export type TeamSubscriptionSlotState = 'unassigned' | 'assigned' | 'deactivated' | 'cancelled';
84
+ export type TeamSubscriptionSlotState = "unassigned" | "assigned" | "deactivated" | "cancelled";
49
85
 
50
86
  export namespace TeamSubscriptionSlot {
51
- export const create = (ts: Omit<TeamSubscriptionSlot, 'id'>): TeamSubscriptionSlot => {
87
+ export const create = (ts: Omit<TeamSubscriptionSlot, "id">): TeamSubscriptionSlot => {
52
88
  const withId = ts as TeamSubscriptionSlot;
53
89
  withId.id = uuidv4();
54
90
  return withId;
55
- }
56
- export const assign = (slot: TeamSubscriptionSlot, assigneeId: string, subscriptionId: string, assigneeIdentifier: AssigneeIdentifier) => {
91
+ };
92
+ export const assign = (
93
+ slot: TeamSubscriptionSlot,
94
+ assigneeId: string,
95
+ subscriptionId: string,
96
+ assigneeIdentifier: AssigneeIdentifier,
97
+ ) => {
57
98
  slot.assigneeId = assigneeId;
58
99
  slot.subscriptionId = subscriptionId;
59
100
  slot.assigneeIdentifier = assigneeIdentifier;
60
- }
101
+ };
61
102
  export const deactivate = (slot: TeamSubscriptionSlot, cancellationDate: string) => {
62
103
  slot.subscriptionId = undefined;
63
104
  slot.cancellationDate = cancellationDate;
64
- }
105
+ };
65
106
  export const reactivate = (slot: TeamSubscriptionSlot, subscriptionId?: string) => {
66
107
  slot.subscriptionId = subscriptionId;
67
108
  slot.cancellationDate = undefined;
68
- }
109
+ };
69
110
  export const status = (slot: TeamSubscriptionSlot, now: string): TeamSubscriptionSlotState => {
70
111
  if (slot.cancellationDate) {
71
112
  if (slot.cancellationDate < now) {
72
- return 'cancelled';
113
+ return "cancelled";
73
114
  } else {
74
- return 'deactivated';
115
+ return "deactivated";
75
116
  }
76
117
  } else {
77
118
  if (slot.subscriptionId) {
78
- return 'assigned';
119
+ return "assigned";
79
120
  } else {
80
- return 'unassigned';
121
+ return "unassigned";
81
122
  }
82
123
  }
83
-
84
- }
124
+ };
85
125
  export const isActive = (slot: TeamSubscriptionSlot): boolean => {
86
126
  return !slot.cancellationDate;
87
- }
127
+ };
88
128
  }
89
129
 
90
130
  /**
@@ -107,7 +147,7 @@ export interface TeamSubscriptionSlotResolved {
107
147
  export type AssigneeIdentifier = AssigneeIdentityIdentifier;
108
148
  export interface AssigneeIdentityIdentifier {
109
149
  identity: {
110
- authHost: string,
111
- authName: string
112
- }
150
+ authHost: string;
151
+ authName: string;
152
+ };
113
153
  }
@@ -1,14 +1,27 @@
1
1
  /**
2
2
  * Copyright (c) 2021 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
- import { PrebuiltWorkspaceState } from "./protocol";
8
- import { v4 as uuidv4 } from 'uuid';
7
+ import { PrebuiltWorkspaceState, WorkspaceClasses } from "./protocol";
8
+ import { v4 as uuidv4 } from "uuid";
9
+ import { DeepPartial } from "./util/deep-partial";
10
+ import { WebhookEvent } from "./webhook-event";
9
11
 
10
12
  export interface ProjectConfig {
11
- '.gitpod.yml': string;
13
+ ".gitpod.yml": string;
14
+ }
15
+
16
+ export interface ProjectSettings {
17
+ useIncrementalPrebuilds?: boolean;
18
+ keepOutdatedPrebuildsRunning?: boolean;
19
+ // whether new workspaces can start on older prebuilds and incrementally update
20
+ allowUsingPreviousPrebuilds?: boolean;
21
+ // how many commits in the commit history a prebuild is good (undefined and 0 means every commit is prebuilt)
22
+ prebuildEveryNthCommit?: number;
23
+ // preferred workspace classes
24
+ workspaceClasses?: WorkspaceClasses;
12
25
  }
13
26
 
14
27
  export interface Project {
@@ -19,7 +32,7 @@ export interface Project {
19
32
  teamId?: string;
20
33
  userId?: string;
21
34
  appInstallationId: string;
22
- config?: ProjectConfig;
35
+ settings?: ProjectSettings;
23
36
  creationTime: string;
24
37
  /** This is a flag that triggers the HARD DELETION of this entity */
25
38
  deleted?: boolean;
@@ -27,16 +40,27 @@ export interface Project {
27
40
  }
28
41
 
29
42
  export namespace Project {
30
- export const create = (project: Omit<Project, 'id' | 'creationTime'>): Project => {
43
+ export const create = (project: Omit<Project, "id" | "creationTime">): Project => {
31
44
  return {
32
45
  ...project,
33
46
  id: uuidv4(),
34
- creationTime: new Date().toISOString()
47
+ creationTime: new Date().toISOString(),
35
48
  };
49
+ };
50
+
51
+ export function slug(p: Project): string {
52
+ return p.slug || p.name || p.id;
36
53
  }
37
54
 
38
55
  export interface Overview {
39
- branches: BranchDetails[]
56
+ branches: BranchDetails[];
57
+ isConsideredInactive?: boolean;
58
+ }
59
+
60
+ export namespace Overview {
61
+ export function is(data?: any): data is Project.Overview {
62
+ return Array.isArray(data?.branches);
63
+ }
40
64
  }
41
65
 
42
66
  export interface BranchDetails {
@@ -55,6 +79,13 @@ export namespace Project {
55
79
  }
56
80
  }
57
81
 
82
+ export type PartialProject = DeepPartial<Project> & Pick<Project, "id">;
83
+
84
+ export interface ProjectUsage {
85
+ lastWebhookReceived: string;
86
+ lastWorkspaceStart: string;
87
+ }
88
+
58
89
  export interface PrebuildWithStatus {
59
90
  info: PrebuildInfo;
60
91
  status: PrebuiltWorkspaceState;
@@ -64,6 +95,7 @@ export interface PrebuildWithStatus {
64
95
  export interface PrebuildInfo {
65
96
  id: string;
66
97
  buildWorkspaceId: string;
98
+ basedOnPrebuildId?: string;
67
99
 
68
100
  teamId?: string;
69
101
  userId?: string;
@@ -88,7 +120,7 @@ export interface PrebuildInfo {
88
120
  }
89
121
  export namespace PrebuildInfo {
90
122
  export function is(data?: any): data is PrebuildInfo {
91
- return typeof data === "object" && ["id", "buildWorkspaceId", "projectId", "branch"].every(p => p in data);
123
+ return typeof data === "object" && ["id", "buildWorkspaceId", "projectId", "branch"].every((p) => p in data);
92
124
  }
93
125
  }
94
126
 
@@ -97,11 +129,9 @@ export interface StartPrebuildResult {
97
129
  wsid: string;
98
130
  done: boolean;
99
131
  }
100
-
101
132
  export interface Team {
102
133
  id: string;
103
134
  name: string;
104
- slug: string;
105
135
  creationTime: string;
106
136
  markedDeleted?: boolean;
107
137
  /** This is a flag that triggers the HARD DELETION of this entity */
@@ -110,6 +140,12 @@ export interface Team {
110
140
 
111
141
  export type TeamMemberRole = "owner" | "member";
112
142
 
143
+ export namespace TeamMemberRole {
144
+ export function isValid(role: any): role is TeamMemberRole {
145
+ return role === "owner" || role === "member";
146
+ }
147
+ }
148
+
113
149
  export interface TeamMemberInfo {
114
150
  userId: string;
115
151
  fullName?: string;
@@ -129,4 +165,16 @@ export interface TeamMembershipInvite {
129
165
 
130
166
  /** This is a flag that triggers the HARD DELETION of this entity */
131
167
  deleted?: boolean;
132
- }
168
+ }
169
+
170
+ export interface PrebuildEvent {
171
+ id: string;
172
+ creationTime: string;
173
+ status: WebhookEvent.Status | WebhookEvent.PrebuildStatus;
174
+ message?: string;
175
+ prebuildId?: string;
176
+ projectId?: string;
177
+ cloneUrl?: string;
178
+ branch?: string;
179
+ commit?: string;
180
+ }
@@ -1,12 +1,19 @@
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
  interface Window {
8
+ // gitpod is used by supervisor/frontend and vscode browser https://github.com/gitpod-io/openvscode-server/blob/dadd40deda5959c0efdaa0c7d02ab64b6f8b5ad0/src/vs/gitpod/browser/workbench/workbench.ts#L7
8
9
  gitpod: {
9
- service: import('../gitpod-service').GitpodService
10
- ideService?: import('../ide-frontend-service').IDEFrontendService
11
- }
12
- }
10
+ ideService?: import("../ide-frontend-service").IDEFrontendService;
11
+ loggedUserID?: string;
12
+
13
+ openDesktopIDE(url: string): void;
14
+
15
+ encrypt(content: string): string;
16
+ decrypt(content: string): string;
17
+ isEncryptedData(content: string): boolean;
18
+ };
19
+ }
package/src/usage.ts ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License.AGPL.txt in the project root for license information.
5
+ */
6
+
7
+ import { WorkspaceType } from "./protocol";
8
+
9
+ // types below are copied over from components/usage-api/typescript/src/usage/v1/usage_pb.d.ts
10
+ export interface ListUsageRequest {
11
+ attributionId: string;
12
+ from?: number;
13
+ to?: number;
14
+ order: Ordering;
15
+ pagination?: PaginationRequest;
16
+ }
17
+
18
+ export enum Ordering {
19
+ ORDERING_DESCENDING = 0,
20
+ ORDERING_ASCENDING = 1,
21
+ }
22
+
23
+ export interface PaginationRequest {
24
+ perPage: number;
25
+ page: number;
26
+ }
27
+
28
+ export interface ListUsageResponse {
29
+ usageEntriesList: Usage[];
30
+ pagination?: PaginationResponse;
31
+ creditsUsed: number;
32
+ }
33
+
34
+ export interface PaginationResponse {
35
+ perPage: number;
36
+ totalPages: number;
37
+ total: number;
38
+ page: number;
39
+ }
40
+
41
+ export type UsageKind = "workspaceinstance" | "invoice";
42
+ export interface Usage {
43
+ id: string;
44
+ attributionId: string;
45
+ description: string;
46
+ credits: number;
47
+ effectiveTime?: number;
48
+ kind: UsageKind;
49
+ workspaceInstanceId: string;
50
+ draft: boolean;
51
+ metadata: WorkspaceInstanceUsageData | InvoiceUsageData;
52
+ }
53
+
54
+ // the equivalent golang shape is maintained in `/workspace/gitpod/`components/usage/pkg/db/usage.go`
55
+ export interface WorkspaceInstanceUsageData {
56
+ workspaceId: string;
57
+ workspaceType: WorkspaceType;
58
+ workspaceClass: string;
59
+ contextURL: string;
60
+ startTime: string;
61
+ endTime?: string;
62
+ userId: string;
63
+ userName: string;
64
+ userAvatarURL: string;
65
+ }
66
+
67
+ export interface InvoiceUsageData {
68
+ invoiceId: string;
69
+ startDate: string;
70
+ endDate: string;
71
+ }
72
+
73
+ export interface CostCenterJSON {
74
+ attributionId: string;
75
+ spendingLimit: number;
76
+ billingStrategy: CostCenter_BillingStrategy;
77
+ nextBillingTime?: string;
78
+ billingCycleStart?: string;
79
+ }
80
+
81
+ export enum CostCenter_BillingStrategy {
82
+ BILLING_STRATEGY_STRIPE = "BILLING_STRATEGY_STRIPE",
83
+ BILLING_STRATEGY_OTHER = "BILLING_STRATEGY_OTHER",
84
+ UNRECOGNIZED = "UNRECOGNIZED",
85
+ }
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * Copyright (c) 2021 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
  import Analytics = require("analytics-node");
8
8
  import { IAnalyticsWriter, IdentifyMessage, TrackMessage, PageMessage } from "../analytics";
9
- import { log } from './logging';
10
-
9
+ import { log } from "./logging";
11
10
 
12
11
  export function newAnalyticsWriterFromEnv(): IAnalyticsWriter {
13
12
  switch (process.env.GITPOD_ANALYTICS_WRITER) {
@@ -21,20 +20,28 @@ export function newAnalyticsWriterFromEnv(): IAnalyticsWriter {
21
20
  }
22
21
 
23
22
  class SegmentAnalyticsWriter implements IAnalyticsWriter {
24
-
25
23
  protected readonly analytics: Analytics;
26
24
 
27
25
  constructor(writeKey: string) {
28
26
  this.analytics = new Analytics(writeKey);
29
27
  }
30
28
 
31
- identify(msg: IdentifyMessage) {
29
+ identify(msg: IdentifyMessage) {
32
30
  try {
33
- this.analytics.identify(msg, (err: Error) => {
34
- if (err) {
35
- log.warn("analytics.identify failed", err);
36
- }
37
- });
31
+ this.analytics.identify(
32
+ {
33
+ ...msg,
34
+ integrations: {
35
+ All: true,
36
+ Mixpanel: !!msg.userId,
37
+ },
38
+ },
39
+ (err: Error) => {
40
+ if (err) {
41
+ log.warn("analytics.identify failed", err);
42
+ }
43
+ },
44
+ );
38
45
  } catch (err) {
39
46
  log.warn("analytics.identify failed", err);
40
47
  }
@@ -42,32 +49,48 @@ class SegmentAnalyticsWriter implements IAnalyticsWriter {
42
49
 
43
50
  track(msg: TrackMessage) {
44
51
  try {
45
- this.analytics.track(msg, (err: Error) => {
46
- if (err) {
47
- log.warn("analytics.track failed", err);
48
- }
49
- });
52
+ this.analytics.track(
53
+ {
54
+ ...msg,
55
+ integrations: {
56
+ All: true,
57
+ Mixpanel: !!msg.userId,
58
+ },
59
+ },
60
+ (err: Error) => {
61
+ if (err) {
62
+ log.warn("analytics.track failed", err);
63
+ }
64
+ },
65
+ );
50
66
  } catch (err) {
51
67
  log.warn("analytics.track failed", err);
52
68
  }
53
69
  }
54
70
 
55
71
  page(msg: PageMessage) {
56
- try{
57
- this.analytics.page(msg, (err: Error) => {
58
- if (err) {
59
- log.warn("analytics.page failed", err);
60
- }
61
- });
72
+ try {
73
+ this.analytics.page(
74
+ {
75
+ ...msg,
76
+ integrations: {
77
+ All: true,
78
+ Mixpanel: !!msg.userId,
79
+ },
80
+ },
81
+ (err: Error) => {
82
+ if (err) {
83
+ log.warn("analytics.page failed", err);
84
+ }
85
+ },
86
+ );
62
87
  } catch (err) {
63
88
  log.warn("analytics.page failed", err);
64
89
  }
65
90
  }
66
-
67
91
  }
68
92
 
69
93
  class LogAnalyticsWriter implements IAnalyticsWriter {
70
-
71
94
  identify(msg: IdentifyMessage): void {
72
95
  log.debug("analytics identify", msg);
73
96
  }
@@ -77,11 +100,10 @@ class LogAnalyticsWriter implements IAnalyticsWriter {
77
100
  page(msg: PageMessage): void {
78
101
  log.debug("analytics page", msg);
79
102
  }
80
-
81
103
  }
82
104
 
83
105
  class NoAnalyticsWriter implements IAnalyticsWriter {
84
106
  identify(msg: IdentifyMessage): void {}
85
107
  track(msg: TrackMessage): void {}
86
108
  page(msg: PageMessage): void {}
87
- }
109
+ }
@@ -1,12 +1,12 @@
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
  // Use asyncIterators with es2015
8
- if (typeof (Symbol as any).asyncIterator === 'undefined') {
9
- (Symbol as any).asyncIterator = Symbol.asyncIterator || Symbol('asyncIterator');
8
+ if (typeof (Symbol as any).asyncIterator === "undefined") {
9
+ (Symbol as any).asyncIterator = Symbol.asyncIterator || Symbol("asyncIterator");
10
10
  }
11
11
 
12
12
  export async function find<T>(it: AsyncIterableIterator<T>, predicate: (value: T) => boolean): Promise<T | undefined> {
@@ -31,12 +31,11 @@ export interface AsyncCachingIterator<T> extends AsyncIterableIterator<T> {
31
31
  resetCursor(): void;
32
32
  }
33
33
  export class AsyncCachingIteratorImpl<T> implements AsyncIterableIterator<T>, AsyncCachingIterator<T> {
34
-
35
34
  protected cache: T[] = [];
36
35
  protected cursor = 0;
37
36
  protected cacheRead = false;
38
37
 
39
- constructor(protected readonly iterable: AsyncIterableIterator<T>) { }
38
+ constructor(protected readonly iterable: AsyncIterableIterator<T>) {}
40
39
 
41
40
  public resetCursor() {
42
41
  this.cursor = 0;
@@ -47,7 +46,7 @@ export class AsyncCachingIteratorImpl<T> implements AsyncIterableIterator<T>, As
47
46
  if (!this.cacheRead && this.cursor < this.cache.length) {
48
47
  return {
49
48
  done: false,
50
- value: this.cache[this.cursor++]
49
+ value: this.cache[this.cursor++],
51
50
  };
52
51
  }
53
52
  this.cacheRead = true;
@@ -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
  import { Disposable } from "./disposable";
@@ -9,10 +9,10 @@ import { Disposable } from "./disposable";
9
9
  export class Cancelable<T> implements Disposable {
10
10
  protected canceled: boolean;
11
11
 
12
- constructor(protected readonly activity: (cancel: boolean) => Promise<T> | undefined) { }
12
+ constructor(protected readonly activity: (cancel: boolean) => Promise<T> | undefined) {}
13
13
 
14
14
  public async run(): Promise<T | undefined> {
15
- for(let r = await this.activity(this.canceled); ; r = await this.activity(this.canceled)) {
15
+ for (let r = await this.activity(this.canceled); ; r = await this.activity(this.canceled)) {
16
16
  if (this.canceled) {
17
17
  return;
18
18
  } else if (r !== undefined) {
@@ -28,4 +28,4 @@ export class Cancelable<T> implements Disposable {
28
28
  dispose(): void {
29
29
  this.cancel();
30
30
  }
31
- }
31
+ }
@@ -1,30 +1,30 @@
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
  export function formatDate(date?: string) {
8
- return date ? new Date(date).toLocaleString() : '';
8
+ return date ? new Date(date).toLocaleString() : "";
9
9
  }
10
10
 
11
11
  export function formatHours(hours?: number) {
12
12
  if (hours === undefined) {
13
- return '';
13
+ return "";
14
14
  }
15
15
  const h = Math.floor(Math.abs(hours));
16
- const rm = (Math.abs(hours) - h) * 60.;
16
+ const rm = (Math.abs(hours) - h) * 60;
17
17
  const m = Math.floor(rm);
18
- const rs = (rm - m) * 60.;
18
+ const rs = (rm - m) * 60;
19
19
  const s = Math.floor(rs);
20
- const result = h + ':' + pad2(m) + ':' + pad2(s);
20
+ const result = h + ":" + pad2(m) + ":" + pad2(s);
21
21
  if (hours < 0) {
22
- return `-${result}`
22
+ return `-${result}`;
23
23
  } else {
24
- return `${result}`
24
+ return `${result}`;
25
25
  }
26
26
  }
27
27
 
28
28
  function pad2(n: number) {
29
- return n < 10 ? '0' + n : '' + n;
29
+ return n < 10 ? "0" + n : "" + n;
30
30
  }